9 integer :: gsw_error_flag = 0
13 real (r8) :: saturation_fraction
15 real (r8),
dimension(:,:),
allocatable :: lat,
long 17 real (r8),
dimension(:,:),
allocatable :: val1, val2, val3, val4, val5, val6
19 real (r8),
dimension(:,:),
allocatable :: c, sr, sstar, pt, entropy
20 real (r8),
dimension(:,:),
allocatable :: h, ctf, tf, diff
21 real (r8),
dimension(:,:),
allocatable :: ctf_poly, tf_poly, pt0
54 saturation_fraction = 0.5_r8
78 call check_accuracy(
'CT_freezing_first_derivatives (ctf_sa)',val1,val3)
79 call check_accuracy(
'CT_freezing_first_derivatives (ctf_p)',val2,val4)
83 call check_accuracy(
't_freezing_first_derivatives (tf_sa)',val1,val3)
84 call check_accuracy(
't_freezing_first_derivatives (tf_p)',val2,val4)
88 call check_accuracy(
'pot_enthalpy_ice_freezing_first_derivatives (sa)',val1,val3)
89 call check_accuracy(
'pot_enthalpy_ice_freezing_first_derivatives (p)',val2,val4)
94 deallocate(h,val1,val2,val3,val4,val5,val6)
115 call section_title(
'Thermodynamic interaction between ice and seawater')
117 saturation_fraction = 0.0_r8
125 call check_accuracy(
'melting_ice_equilibrium_SA_CT_ratio',val1,val2)
129 call check_accuracy(
'frazil_ratios_adiabatic (dsa_dct)',val1,val4)
136 call check_accuracy(
'frazil_properties_potential (sa_final)',val1,val4)
137 call check_accuracy(
'frazil_properties_potential (ct_final)',val2,val5)
138 call check_accuracy(
'frazil_properties_potential (w_ih_final)',val3,val6)
141 call section_title(
'Thermodynamic interaction between seaice and seawater')
151 call check_accuracy(
'melting_seaice_equilibrium_SA_CT_ratio',val1,val2)
170 if (gsw_error_flag.eq.1)
then 172 print*; print*,
'Your installation of the Gibbs SeaWater (GSW) Oceanographic Toolbox has errors!' 175 print*; print*,
'Well done! The gsw_check_fuctions confirms that the Gibbs' 176 print*; print*,
'SeaWater (GSW) Oceanographic Toolbox is installed correctly.' 186 character (*),
intent(in) :: title
189 print *,
"----------------------------------------------------------------------------" 204 character (*),
intent(in) :: func_name
205 real (r8),
intent(in) :: fvalue1(:,:), fvalue2(:,:)
206 logical,
intent(in),
optional :: vprint
208 integer :: ndots, i, j
209 real (r8) :: diff(size(fvalue1,1),size(fvalue1,2))
210 character (len(func_name)+3) :: message
211 character (4) :: errflg
213 character (*),
parameter :: att_name =
'computation_accuracy' 214 character (*),
parameter :: &
215 dots =
' .............................................................' 219 diff = fvalue1 - fvalue2
221 if (
present(vprint))
then 223 print
'(i3,3ES24.15)', ((i,fvalue1(i,j),fvalue2(i,j),diff(i,j),&
224 i=1,
size(fvalue1,1)), j=1,
size(fvalue1,2))
235 ndots = 52 - len(trim(message))
237 print
'(1x,2a,2es12.3)', trim(message), dots(:ndots), minval(diff), &
real(r8), dimension(cast_n) lat_cast
integer, parameter cast_m
integer, parameter, public long
subroutine section_title(title)
subroutine check_accuracy(func_name, fvalue, result, result_ice, result_mpres, result_cast, vprint)
real(r8), dimension(cast_n) long_cast
real(r8), dimension(cast_m, cast_n) p
real(r8), parameter, public gsw_error_limit
real(r8), dimension(cast_ice_m, cast_ice_n) sa_arctic
real(r8), dimension(cast_ice_m, cast_ice_n) w_seaice
integer, parameter cast_n
real(r8), dimension(cast_ice_m, cast_ice_n) p_arctic
real(r8), dimension(cast_ice_m, cast_ice_n) t_seaice
real(r8), dimension(cast_ice_m, cast_ice_n) h_pot_bulk
real(r8), dimension(cast_ice_m, cast_ice_n) w_ice
real(r8), dimension(cast_ice_m, cast_ice_n) sa_seaice
real(r8), dimension(cast_ice_m, cast_ice_n) sa_bulk
integer, parameter cast_ice_m
integer, parameter cast_ice_n
real(r8), dimension(cast_m, cast_n) sa
real(r8), dimension(cast_ice_m, cast_ice_n) ct_arctic
real(r8), dimension(cast_ice_m, cast_ice_n) t_ice