FV3 Bundle
gsw_check_functions.f90
Go to the documentation of this file.
2 
5 
8 
9 implicit none
10 
11 integer :: gsw_error_flag = 0
12 
13 integer :: i, n
14 
15 real (r8) :: saturation_fraction
16 
17 real (r8), dimension(:,:), allocatable :: lat, long
18 
19 
20 real (r8), dimension(:,:), allocatable :: value
21 real (r8), dimension(:,:), allocatable :: val1, val2, val3, val4, val5
22 real (r8), dimension(:,:), allocatable :: val6, val7, val8
23 
24 
25 real (r8), dimension(:,:), allocatable :: c, r, sr, sstar, pt, entropy
26 real (r8), dimension(:,:), allocatable :: h, ctf, tf, diff, z
27 real (r8), dimension(:,:), allocatable :: ctf_poly, tf_poly, pt0
28 
29 
30 allocate(lat(cast_m,cast_n))
31 allocate(long(cast_m,cast_n))
32 allocate(pt0(cast_ice_m,cast_ice_n))
33 
34 allocate(value(cast_m,cast_n))
35 allocate(val1(cast_m,cast_n))
36 allocate(val2(cast_m,cast_n))
37 allocate(val3(cast_m,cast_n))
38 allocate(val4(cast_m,cast_n))
39 allocate(val5(cast_m,cast_n))
40 
41 allocate(c(cast_m,cast_n))
42 allocate(r(cast_m,cast_n))
43 allocate(sr(cast_m,cast_n))
44 allocate(sstar(cast_m,cast_n))
45 allocate(pt(cast_m,cast_n))
46 allocate(entropy(cast_m,cast_n))
47 allocate(ctf(cast_m,cast_n))
48 allocate(tf(cast_m,cast_n))
49 allocate(ctf_poly(cast_m,cast_n))
50 allocate(tf_poly(cast_m,cast_n))
51 allocate(h(cast_m,cast_n))
52 allocate(diff(cast_m,cast_n))
53 allocate(z(cast_m,cast_n))
54 
55 do i = 1, cast_n
56  lat(:,i) = lat_cast(i)
57  long(:,i) = long_cast(i)
58 end do
59 
60 
61 print*
62 print*,'============================================================================'
63 print*
64 print*,' Gibbs SeaWater (GSW) Oceanographic Toolbox of TEOS-10 (Fortran)'
65 print*
66 print*,'============================================================================'
67 print*
68 print*,' These are the check values for the subset of functions that have been '
69 print*
70 print*,' converted into FORTRAN 95 from the Gibbs SeaWater (GSW) Oceanographic '
71 print*
72 print*,' Toolbox of TEOS-10.'
73 print*
74 
75 !------------------------------------------------------------------------------
76 call section_title('Practical Salinity, PSS-78')
77 
78 c = gsw_c_from_sp(sp,t,p)
79 call check_accuracy('C_from_SP',c,c_from_sp)
80 
81 value = gsw_sp_from_c(c,t,p)
82 call check_accuracy('SP_from_C',value,sp_from_c)
83 
84 value = gsw_sp_from_sk(sk)
85 call check_accuracy('SP_from_SK',value,sp_from_sk)
86 
87 !------------------------------------------------------------------------------
88 call section_title('Absolute Salinity, Preformed Salinity and Conservative Temperature')
89 
90 value = gsw_sa_from_sp(sp,p,long,lat)
91 call check_accuracy('SA_from_SP',value,sa_from_sp)
92 
93 value = gsw_sstar_from_sp(sp,p,long,lat)
94 call check_accuracy('Sstar_from_SP',value,sstar_from_sp)
95 
96 value = gsw_ct_from_t(sa,t,p)
97 call check_accuracy('CT_from_t',value,ct_from_t)
98 
99 !------------------------------------------------------------------------------
100 call section_title('Other conversions between Temperatures, Salinities, Entropy, Pressure and Height')
101 
102 value = gsw_deltasa_from_sp(sp,p,long,lat)
103 call check_accuracy('deltaSA_from_SP',value,deltasa_from_sp)
104 
105 sr = gsw_sr_from_sp(sp)
106 call check_accuracy('SR_from_SP',sr,sr_from_sp)
107 
108 value = gsw_sp_from_sr(sr)
109 call check_accuracy('SP_from_SR',value,sp_from_sr)
110 
111 value = gsw_sp_from_sa(sa,p,long,lat)
112 call check_accuracy('SP_from_SA',value,sp_from_sa)
113 
114 sstar = gsw_sstar_from_sa(sa,p,long,lat)
115 call check_accuracy('Sstar_from_SA',sstar,sstar_from_sa)
116 
117 value = gsw_sa_from_sstar(sstar,p,long,lat)
118 call check_accuracy('SA_from_Sstar',value,sa_from_sstar)
119 
120 value = gsw_sp_from_sstar(sstar,p,long,lat)
121 call check_accuracy('SP_from_Sstar',value,sp_from_sstar)
122 
123 pt = gsw_pt_from_ct(sa,ct)
124 call check_accuracy('pt_from_CT',pt,pt_from_ct)
125 
126 value = gsw_t_from_ct(sa,ct,p)
127 call check_accuracy('t_from_CT',value,t_from_ct)
128 
129 value = gsw_ct_from_pt(sa,pt)
130 call check_accuracy('CT_from_pt',value,ct_from_pt)
131 
132 value = gsw_pt0_from_t(sa,t,p)
133 call check_accuracy('pt0_from_t',value,pt0_from_t)
134 
135 value = gsw_pt_from_t(sa,t,p,pref)
136 call check_accuracy('pt_from_t',value,pt_from_t)
137 
138 z = gsw_z_from_p(p,lat)
139 call check_accuracy('z_from_p',z,z_from_p)
140 
141 value = gsw_p_from_z(z,lat)
142 call check_accuracy('p_from_z',value,p_from_z)
143 
144 entropy = gsw_entropy_from_pt(sa,pt)
145 call check_accuracy('entropy_from_pt',entropy,entropy_from_pt)
146 
147 value = gsw_pt_from_entropy(sa,entropy)
148 call check_accuracy('pt_from_entropy',value,pt_from_entropy)
149 
150 value = gsw_ct_from_entropy(sa,entropy)
151 call check_accuracy('CT_from_entropy',value,ct_from_entropy)
152 
153 value = gsw_entropy_from_t(sa,t,p)
154 call check_accuracy('entropy_from_t',value,entropy_from_t)
155 
157 call check_accuracy('adiabatic_lapse_rate_from_CT',value, &
159 
160 !------------------------------------------------------------------------------
161 call section_title('Specific Volume, Density and Enthalpy')
162 
163 value = gsw_specvol(sa,ct,p)
164 call check_accuracy('specvol',value,specvol)
165 
166 value = gsw_alpha(sa,ct,p)
167 call check_accuracy('alpha',value,alpha)
168 
169 value = gsw_beta(sa,ct,p)
170 call check_accuracy('beta',value,beta)
171 
172 value = gsw_alpha_on_beta(sa,ct,p)
173 call check_accuracy('alpha_on_beta',value,alpha_on_beta)
174 
175 call gsw_specvol_alpha_beta(sa,ct,p,val1,val2,val3)
176 call check_accuracy('specvol_alpha_beta',val1,v_vab)
177 call check_accuracy('specvol_alpha_beta',val2,alpha_vab)
178 call check_accuracy('specvol_alpha_beta',val3,beta_vab)
179 
180 call gsw_specvol_first_derivatives(sa,ct,p,val1,val2,val3)
181 call check_accuracy('specvol_first_derivatives',val1,v_sa)
182 call check_accuracy('specvol_first_derivatives',val2,v_ct)
183 call check_accuracy('specvol_first_derivatives',val3,v_p)
184 
185 call gsw_specvol_second_derivatives(sa,ct,p,val1,val2,val3,val4,val5)
186 call check_accuracy('specvol_second_derivatives',val1,v_sa_sa)
187 call check_accuracy('specvol_second_derivatives',val2,v_sa_ct)
188 call check_accuracy('specvol_second_derivatives',val3,v_ct_ct)
189 call check_accuracy('specvol_second_derivatives',val4,v_sa_p)
190 call check_accuracy('specvol_second_derivatives',val5,v_ct_p)
191 
193 call check_accuracy('specvol_first_derivatives_wrt_enthalpy',val1,v_sa_wrt_h)
194 call check_accuracy('specvol_first_derivatives_wrt_enthalpy',val2,v_h)
195 
197 call check_accuracy('specvol_second_derivatives_wrt_enthalpy',val1,v_sa_sa_wrt_h)
198 call check_accuracy('specvol_second_derivatives_wrt_enthalpy',val2,v_sa_h)
199 call check_accuracy('specvol_second_derivatives_wrt_enthalpy',val3,v_h_h)
200 
202 call check_accuracy('specvol_anom_standard',value,specvol_anom_standard)
203 
204 r = gsw_rho(sa,ct,p)
205 call check_accuracy('rho',r,rho)
206 
207 call gsw_rho_alpha_beta(sa,ct,p,val1,val2,val3)
208 call check_accuracy('rho_alpha_beta',val1,rho_rab)
209 call check_accuracy('rho_alpha_beta',val2,alpha_rab)
210 call check_accuracy('rho_alpha_beta',val3,beta_rab)
211 
212 call gsw_rho_first_derivatives(sa,ct,p,val1,val2,val3)
213 call check_accuracy('rho_first_derivatives',val1,rho_sa)
214 call check_accuracy('rho_first_derivatives',val2,rho_ct)
215 call check_accuracy('rho_first_derivatives',val3,rho_p)
216 
217 call gsw_rho_second_derivatives(sa,ct,p,val1,val2,val3,val4,val5)
218 call check_accuracy('rho_second_derivatives',val1,rho_sa_sa)
219 call check_accuracy('rho_second_derivatives',val2,rho_sa_ct)
220 call check_accuracy('rho_second_derivatives',val3,rho_ct_ct)
221 call check_accuracy('rho_second_derivatives',val4,rho_sa_p)
222 call check_accuracy('rho_second_derivatives',val5,rho_ct_p)
223 
225 call check_accuracy('rho_first_derivatives_wrt_enthalpy',val1,rho_sa_wrt_h)
226 call check_accuracy('rho_first_derivatives_wrt_enthalpy',val2,rho_h)
227 
228 call gsw_rho_second_derivatives_wrt_enthalpy(sa,ct,p,val1,val2,val3)
229 call check_accuracy('rho_second_derivatives_wrt_enthalpy',val1,rho_sa_sa_wrt_h)
230 call check_accuracy('rho_second_derivatives_wrt_enthalpy',val2,rho_sa_h)
231 call check_accuracy('rho_second_derivatives_wrt_enthalpy',val3,rho_h_h)
232 
233 value = gsw_sigma0(sa,ct)
234 call check_accuracy('sigma0',value,sigma0)
235 
236 value = gsw_sigma1(sa,ct)
237 call check_accuracy('sigma1',value,sigma1)
238 
239 value = gsw_sigma2(sa,ct)
240 call check_accuracy('sigma2',value,sigma2)
241 
242 value = gsw_sigma3(sa,ct)
243 call check_accuracy('sigma3',value,sigma3)
244 
245 value = gsw_sigma4(sa,ct)
246 call check_accuracy('sigma4',value,sigma4)
247 
248 value = gsw_sound_speed(sa,ct,p)
249 call check_accuracy('sound_speed',value,sound_speed)
250 
251 value = gsw_kappa(sa,ct,p)
252 call check_accuracy('kappa',value,kappa)
253 
254 value = gsw_cabbeling(sa,ct,p)
255 call check_accuracy('cabbeling',value,cabbeling)
256 
257 value = gsw_thermobaric(sa,ct,p)
258 call check_accuracy('thermobaric',value,thermobaric)
259 
260 value = gsw_sa_from_rho(r,ct,p)
261 call check_accuracy('SA_from_rho',value,sa_from_rho)
262 
263 call gsw_ct_from_rho(r,sa,p,value)
264 call check_accuracy('CT_from_rho',value,ct_from_rho)
265 
266 value = gsw_ct_maxdensity(sa,p)
267 call check_accuracy('CT_maxdensity',value,ct_maxdensity)
268 
269 value = gsw_internal_energy(sa,ct,p)
270 call check_accuracy('internal_energy',value,internal_energy)
271 
272 h = gsw_enthalpy(sa,ct,p)
273 call check_accuracy('enthalpy',h,enthalpy)
274 
276 call check_accuracy('enthalpy_diff',value,enthalpy_diff)
277 
278 value = gsw_ct_from_enthalpy(sa,h,p)
279 call check_accuracy('CT_from_enthalpy',value,ct_from_enthalpy)
280 
281 value = gsw_dynamic_enthalpy(sa,ct,p)
282 call check_accuracy('dynamic_enthalpy',value,dynamic_enthalpy)
283 
284 call gsw_enthalpy_first_derivatives(sa,ct,p,val1,val2)
285 call check_accuracy('enthalpy_first_derivatives',val1,h_sa)
286 call check_accuracy('enthalpy_first_derivatives',val2,h_ct)
287 
288 call gsw_enthalpy_second_derivatives(sa,ct,p,val1,val2,val3)
289 call check_accuracy('enthalpy_second_derivatives',val1,h_sa_sa)
290 call check_accuracy('enthalpy_second_derivatives',val2,h_sa_ct)
291 call check_accuracy('enthalpy_second_derivatives',val3,h_ct_ct)
292 
293 !------------------------------------------------------------------------------
294 call section_title('Derivatives of entropy, CT and pt')
295 
296 call gsw_ct_first_derivatives(sa,pt,val1,val2)
297 call check_accuracy('CT_first_derivatives',val1,ct_sa)
298 call check_accuracy('CT_first_derivatives',val2,ct_pt)
299 
300 call gsw_ct_second_derivatives(sa,pt,val1,val2,val3)
301 call check_accuracy('CT_second_derivatives',val1,ct_sa_sa)
302 call check_accuracy('CT_second_derivatives',val2,ct_sa_pt)
303 call check_accuracy('CT_second_derivatives',val3,ct_pt_pt)
304 
305 call gsw_entropy_first_derivatives(sa,ct,val1,val2)
306 call check_accuracy('entropy_first_derivatives',val1,eta_sa)
307 call check_accuracy('entropy_first_derivatives',val2,eta_ct)
308 
309 call gsw_entropy_second_derivatives(sa,ct,val1,val2,val3)
310 call check_accuracy('entropy_second_derivatives',val1,eta_sa_sa)
311 call check_accuracy('entropy_second_derivatives',val2,eta_sa_ct)
312 call check_accuracy('entropy_second_derivatives',val3,eta_ct_ct)
313 
314 call gsw_pt_first_derivatives(sa,ct,val1,val2)
315 call check_accuracy('pt_first_derivatives',val1,pt_sa)
316 call check_accuracy('pt_first_derivatives',val2,pt_ct)
317 
318 call gsw_pt_second_derivatives(sa,ct,val1,val2,val3)
319 call check_accuracy('pt_second_derivatives',val1,pt_sa_sa)
320 call check_accuracy('pt_second_derivatives',val2,pt_sa_ct)
321 call check_accuracy('pt_second_derivatives',val3,pt_ct_ct)
322 
323 !------------------------------------------------------------------------------
324 call section_title('Freezing temperatures')
325 
326 saturation_fraction = 0.5_r8
327 
328 ctf = gsw_ct_freezing(sa,p,saturation_fraction)
329 call check_accuracy('CT_freezing',ctf,ct_freezing)
330 
331 ctf_poly = gsw_ct_freezing_poly(sa,p,saturation_fraction)
332 call check_accuracy('CT_freezing_poly',ctf_poly,ct_freezing_poly)
333 
334 tf = gsw_t_freezing(sa,p,saturation_fraction)
335 call check_accuracy('t_freezing',tf,t_freezing)
336 
337 tf_poly = gsw_t_freezing_poly(sa,p,saturation_fraction)
338 call check_accuracy('t_freezing_poly',tf_poly,t_freezing_poly)
339 
341 call check_accuracy('pot_enthalpy_ice_freezing',value,pot_enthalpy_ice_freezing)
342 
344 call check_accuracy('pot_enthalpy_ice_freezing_poly',value, &
346 
347 value = gsw_sa_freezing_from_ct(ctf,p,saturation_fraction)
348 call check_accuracy('SA_freezing_from_CT',value,sa_freezing_from_ct)
349 
350 value = gsw_sa_freezing_from_ct_poly(ctf_poly,p,saturation_fraction)
351 call check_accuracy('SA_freezing_from_CT_poly',value,sa_freezing_from_ct_poly)
352 
353 value = gsw_sa_freezing_from_t(tf,p,saturation_fraction)
354 call check_accuracy('SA_freezing_from_t',value,sa_freezing_from_t)
355 
356 value = gsw_sa_freezing_from_t_poly(tf_poly,p,saturation_fraction)
357 call check_accuracy('SA_freezing_from_t_poly',value,sa_freezing_from_t_poly)
358 
359 call gsw_ct_freezing_first_derivatives(sa,p,saturation_fraction,val1,val2)
360 call check_accuracy('CT_freezing_first_derivatives',val1,ctfreezing_sa)
361 call check_accuracy('CT_freezing_first_derivatives',val2,ctfreezing_p)
362 
363 call gsw_ct_freezing_first_derivatives_poly(sa,p,saturation_fraction,val4,val5)
364 call check_accuracy('CT_freezing_first_derivatives_poly',val4,ctfreezing_sa_poly)
365 call check_accuracy('CT_freezing_first_derivatives_poly',val5,ctfreezing_p_poly)
366 
367 call gsw_t_freezing_first_derivatives(sa,p,saturation_fraction,val1,val2)
368 call check_accuracy('t_freezing_first_derivatives',val1,tfreezing_sa)
369 call check_accuracy('t_freezing_first_derivatives',val2,tfreezing_p)
370 
371 call gsw_t_freezing_first_derivatives_poly(sa,p,saturation_fraction,val4,val5)
372 call check_accuracy('t_freezing_first_derivatives_poly',val4,tfreezing_sa_poly)
373 call check_accuracy('t_freezing_first_derivatives_poly',val5,tfreezing_p_poly)
374 
376 call check_accuracy('pot_enthalpy_ice_freezing_first_derivatives',val1, &
378 call check_accuracy('pot_enthalpy_ice_freezing_first_derivatives',val2, &
380 
382 call check_accuracy('pot_enthalpy_ice_freezing_first_derivatives_poly',val1, &
384 call check_accuracy('pot_enthalpy_ice_freezing_first_derivatives_poly',val2, &
386 
387 !------------------------------------------------------------------------------
388 call section_title('Isobaric Melting Enthalpy and Isobaric Evaporation Enthalpy')
389 
390 value = gsw_latentheat_melting(sa,p)
391 call check_accuracy('latentheat_melting',value,latentheat_melting)
392 
394 call check_accuracy('latentheat_evap_CT',value,latentheat_evap_ct)
395 
396 value = gsw_latentheat_evap_t(sa,t)
397 call check_accuracy('latentheat_evap_t',value,latentheat_evap_t)
398 
399 !------------------------------------------------------------------------------
400 call section_title('Planet Earth properties')
401 
402 value = gsw_grav(lat,p)
403 call check_accuracy('grav',value,grav)
404 
405 !------------------------------------------------------------------------------
406 call section_title('Density and enthalpy in terms of CT, derived from the exact Gibbs function')
407 
408 value = gsw_enthalpy_ct_exact(sa,ct,p)
409 call check_accuracy('enthalpy_CT_exact',value,enthalpy_ct_exact)
410 
412 call check_accuracy('enthalpy_first_derivatives_CT_exact',val1,h_sa_ct_exact)
413 call check_accuracy('enthalpy_first_derivatives_CT_exact',val2,h_ct_ct_exact)
414 
415 call gsw_enthalpy_second_derivatives_ct_exact(sa,ct,p,val1,val2,val3)
416 call check_accuracy('enthalpy_second_derivatives_CT_exact',val1, &
418 call check_accuracy('enthalpy_second_derivatives_CT_exact',val2, &
420 call check_accuracy('enthalpy_second_derivatives_CT_exact',val3, &
422 
423 !------------------------------------------------------------------------------
424 call section_title('Basic thermodynamic properties in terms of in-situ t, based on the exact Gibbs function')
425 
426 value = gsw_rho_t_exact(sa,t,p)
427 call check_accuracy('rho_t_exact',value,rho_t_exact)
428 
429 value = gsw_pot_rho_t_exact(sa,t,p,pref)
430 call check_accuracy('pot_rho_t_exact',value,pot_rho_t_exact)
431 
432 value = gsw_alpha_wrt_t_exact(sa,t,p)
433 call check_accuracy('alpha_wrt_t_exact',value,alpha_wrt_t_exact)
434 
435 value = gsw_beta_const_t_exact(sa,t,p)
436 call check_accuracy('beta_const_t_exact',value,beta_const_t_exact)
437 
438 value = gsw_specvol_t_exact(sa,t,p)
439 call check_accuracy('specvol_t_exact',value,specvol_t_exact)
440 
441 value = gsw_sound_speed_t_exact(sa,t,p)
442 call check_accuracy('sound_speed_t_exact',value,sound_speed_t_exact)
443 
444 value = gsw_kappa_t_exact(sa,t,p)
445 call check_accuracy('kappa_t_exact',value,kappa_t_exact)
446 
447 value = gsw_enthalpy_t_exact(sa,t,p)
448 call check_accuracy('enthalpy_t_exact',value,enthalpy_t_exact)
449 
450 call gsw_ct_first_derivatives_wrt_t_exact(sa,t,p,val1,val2,val3)
451 call check_accuracy('CT_first_derivatives_wrt_t_exact',val1,ct_sa_wrt_t)
452 call check_accuracy('CT_first_derivatives_wrt_t_exact',val2,ct_t_wrt_t)
453 call check_accuracy('CT_first_derivatives_wrt_t_exact',val3,ct_p_wrt_t)
454 
456 call check_accuracy('chem_potential_water_t_exact',value, &
458 
460 call check_accuracy('t_deriv_chem_potential_water_t_exact',value, &
462 
464 call check_accuracy('dilution_coefficient_t_exact',value, &
466 
467 !------------------------------------------------------------------------------
468 call section_title('Library functions of the GSW Toolbox')
469 
470 value = gsw_deltasa_atlas(p,long,lat)
471 call check_accuracy('deltaSA_atlas',value,deltasa_atlas)
472 
473 value = gsw_fdelta(p,long,lat)
474 call check_accuracy('Fdelta',value,fdelta)
475 
476 !------------------------------------------------------------------------------
477 call section_title('Vertical stability')
478 
479 deallocate(val1,val2,val3,val4,val5)
480 allocate(val1(cast_mpres_m,cast_mpres_n))
481 allocate(val2(cast_mpres_m,cast_mpres_n))
482 allocate(val3(cast_mpres_m,cast_mpres_n))
483 allocate(val4(cast_mpres_m,cast_mpres_n))
484 allocate(val5(cast_mpres_m,cast_mpres_n))
485 allocate(val6(cast_mpres_m,cast_mpres_n))
486 allocate(val7(cast_mpres_m,cast_mpres_n))
487 allocate(val8(cast_mpres_m,cast_mpres_n))
488 
489 do i = 1, cast_mpres_n
490  call gsw_turner_rsubrho(sa(:,i),ct(:,i),p(:,i),val1(:,i),val2(:,i), &
491  val3(:,i))
492 end do
493 call check_accuracy('Turner_Rsubrho',val1,result_mpres=tu)
494 call check_accuracy('Turner_Rsubrho',val2,result_mpres=rsubrho)
495 call check_accuracy('Turner_Rsubrho',val3,result_mpres=p_mid_tursr)
496 
497 do i = 1, cast_mpres_n
498  call gsw_nsquared(sa(:,i),ct(:,i),p(:,i),lat(:,i),val1(:,i),val2(:,i))
499 end do
500 call check_accuracy('Nsquared',val1,result_mpres=n2)
501 call check_accuracy('Nsquared',val2,result_mpres=p_mid_n2)
502 
503 do i = 1, cast_mpres_n
504  call gsw_nsquared_min(sa(:,i),ct(:,i),p(:,i),lat(:,i),val1(:,i),val2(:,i), &
505  val3(:,i),val4(:,i),val5(:,i),val6(:,i),val7(:,i),val8(:,i))
506 end do
507 call check_accuracy('Nsquared_min',val1,result_mpres=n2min)
508 call check_accuracy('Nsquared_min',val2,result_mpres=n2min_pmid)
509 call check_accuracy('Nsquared_min',val3,result_mpres=n2min_specvol)
510 call check_accuracy('Nsquared_min',val4,result_mpres=n2min_alpha)
511 call check_accuracy('Nsquared_min',val5,result_mpres=n2min_beta)
512 call check_accuracy('Nsquared_min',val6,result_mpres=n2min_dsa)
513 call check_accuracy('Nsquared_min',val7,result_mpres=n2min_dct)
514 call check_accuracy('Nsquared_min',val8,result_mpres=n2min_dp)
515 
516 do i = 1, cast_mpres_n
517  call gsw_ipv_vs_fnsquared_ratio(sa(:,i),ct(:,i),p(:,i),pref,val1(:,i), &
518  val2(:,i))
519 end do
520 call check_accuracy('IPV_vs_fNsquared_ratio',val1,result_mpres=ipvfn2)
521 call check_accuracy('IPV_vs_fNsquared_ratio',val2,result_mpres=p_mid_ipvfn2)
522 
523 value = gsw_nsquared_lowerlimit(p,long,lat)
524 call check_accuracy('n2_lowerlimit',value,n2_lowerlimit)
525 
526 deallocate(value)
527 allocate(value(cast_mpres_n,1))
528 do i = 1, cast_mpres_n
529  value(i,1) = gsw_mlp(sa(:,i),ct(:,i),p(:,i))
530 end do
531 call check_accuracy('mlp',value,result_cast=mlp)
532 
533 !------------------------------------------------------------------------------
534 call section_title('Geostrophic streamfunctions and acoustic travel time')
535 
536 deallocate(val1,val2)
537 allocate(val1(cast_m,cast_n))
538 allocate(val2(cast_m,cast_n))
539 
540 do i = 1, cast_n
541  n = count(sa(:,i) .lt. 1e90_r8) ! Only analyse valid section of the cast
542  val1(:n,i) = gsw_geo_strf_dyn_height(sa(:n,i),ct(:n,i),p(:n,i),pref)
543  if (n .lt. cast_m) val1(n+1:,i) = sa(n+1:cast_m,i)
544 end do
545 call check_accuracy('geo_strf_dyn_height',val1,geo_strf_dyn_height)
546 
547 do i = 1, cast_n
548  call gsw_geo_strf_dyn_height_pc(sa(:,i),ct(:,i),delta_p(:,i), &
549  val1(:,i),val2(:,i))
550 end do
551 call check_accuracy('geo_strf_dyn_height_pc',val1,geo_strf_dyn_height_pc)
552 call check_accuracy('geo_strf_dyn_height_pc',val2,geo_strf_dyn_height_pc_p_mid)
553 
554 !------------------------------------------------------------------------------
555 call section_title('Thermodynamic properties of ice Ih')
556 
557 deallocate(value)
558 allocate(value(cast_ice_m,cast_ice_n))
559 
561 call check_accuracy('rho_ice',value,result_ice=rho_ice)
562 
564 call check_accuracy('alpha_wrt_t_ice',value,result_ice=alpha_wrt_t_ice)
565 
567 call check_accuracy('specvol_ice',value,result_ice=specvol_ice)
568 
570 call check_accuracy('pressure_coefficient_ice',value, &
571  result_ice=pressure_coefficient_ice)
572 
574 call check_accuracy('sound_speed_ice',value,result_ice=sound_speed_ice)
575 
577 call check_accuracy('kappa_ice',value,result_ice=kappa_ice)
578 
580 call check_accuracy('kappa_const_t_ice',value,result_ice=kappa_const_t_ice)
581 
583 call check_accuracy('internal_energy_ice',value,result_ice=internal_energy_ice)
584 
586 call check_accuracy('enthalpy_ice',value,result_ice=enthalpy_ice)
587 
589 call check_accuracy('entropy_ice',value,result_ice=entropy_ice)
590 
592 call check_accuracy('cp_ice',value,result_ice=cp_ice)
593 
595 call check_accuracy('chem_potential_water_ice',value, &
596  result_ice=chem_potential_water_ice)
597 
599 call check_accuracy('Helmholtz_energy_ice',value, &
600  result_ice=helmholtz_energy_ice)
601 
603 call check_accuracy('adiabatic_lapse_rate_ice',value, &
604  result_ice=adiabatic_lapse_rate_ice)
605 
607 call check_accuracy('pt0_from_t_ice',pt0,result_ice=pt0_from_t_ice)
608 
610 call check_accuracy('pt_from_t_ice',value,result_ice=pt_from_t_ice)
611 
612 value = gsw_t_from_pt0_ice(pt0,p_arctic)
613 call check_accuracy('t_from_pt0_ice',value,result_ice=t_from_pt0_ice)
614 
616 call check_accuracy('pot_enthalpy_from_pt_ice',h, &
617  result_ice=pot_enthalpy_from_pt_ice)
618 
620 call check_accuracy('pt_from_pot_enthalpy_ice',value, &
621  result_ice=pt_from_pot_enthalpy_ice)
622 
624 call check_accuracy('pot_enthalpy_from_pt_ice_poly',h, &
626 
628 call check_accuracy('pt_from_pot_enthalpy_ice_poly',value, &
630 
631 saturation_fraction = 0.5_r8
632 
633 value = gsw_pressure_freezing_ct(sa_arctic,ct_arctic-1.0_r8,saturation_fraction)
634 call check_accuracy('pressure_freezing_CT',value, &
635  result_ice=pressure_freezing_ct)
636 
637 !------------------------------------------------------------------------------
638 call section_title('Thermodynamic interaction between ice and seawater')
639 
640 deallocate(val1,val2,val3)
641 allocate(val1(cast_ice_m,cast_ice_n))
642 allocate(val2(cast_ice_m,cast_ice_n))
643 allocate(val3(cast_ice_m,cast_ice_n))
644 
646 call check_accuracy('melting_ice_sa_ct_ratio',value, &
647  result_ice=melting_ice_sa_ct_ratio)
648 
650 call check_accuracy('melting_ice_sa_ct_ratio_poly',value, &
651  result_ice=melting_ice_sa_ct_ratio_poly)
652 
654 call check_accuracy('melting_ice_equilibrium_sa_ct_ratio',value, &
656 
658 call check_accuracy('melting_ice_equilibrium_sa_ct_ratio_poly',value, &
660 
662  t_ice,val1,val2,val3)
663 call check_accuracy('melting_ice_into_seawater',val1, &
665 call check_accuracy('melting_ice_into_seawater',val2, &
667 !call check_accuracy('melting_ice_into_seawater',val3, &
668 ! 'melting_ice_into_seawater_w_Ih')
669 
671  val1,val2,val3)
672 call check_accuracy('ice_fraction_to_freeze_seawater',val1, &
674 call check_accuracy('ice_fraction_to_freeze_seawater',val2, &
676 call check_accuracy('ice_fraction_to_freeze_seawater',val3, &
678 
680 call check_accuracy('frazil_ratios_adiabatic',val1,result_ice=dsa_dct_frazil)
681 call check_accuracy('frazil_ratios_adiabatic',val2,result_ice=dsa_dp_frazil)
682 call check_accuracy('frazil_ratios_adiabatic',val3,result_ice=dct_dp_frazil)
683 
685 call check_accuracy('frazil_ratios_adiabatic_poly',val1, &
686  result_ice=dsa_dct_frazil_poly)
687 call check_accuracy('frazil_ratios_adiabatic_poly',val2, &
688  result_ice=dsa_dp_frazil_poly)
689 call check_accuracy('frazil_ratios_adiabatic_poly',val3, &
690  result_ice=dct_dp_frazil_poly)
691 
693 call check_accuracy('frazil_properties_potential',val1, &
695 call check_accuracy('frazil_properties_potential',val2, &
697 call check_accuracy('frazil_properties_potential',val3, &
699 
701  val2,val3)
702 call check_accuracy('frazil_properties_potential_poly',val1, &
704 call check_accuracy('frazil_properties_potential_poly',val2, &
706 call check_accuracy('frazil_properties_potential_poly',val3, &
708 
709 call gsw_frazil_properties(sa_bulk,h_bulk,p_arctic,val1,val2,val3)
710 call check_accuracy('frazil_properties',val1, &
711  result_ice=frazil_properties_sa_final)
712 call check_accuracy('frazil_properties',val2, &
713  result_ice=frazil_properties_ct_final)
714 call check_accuracy('frazil_properties',val3, &
715  result_ice=frazil_properties_w_ih_final)
716 
717 !------------------------------------------------------------------------------
718 call section_title('Thermodynamic interaction between seaice and seawater')
719 
722 call check_accuracy('melting_seaice_sa_ct_ratio',value, &
723  result_ice=melting_seaice_sa_ct_ratio)
724 
727 call check_accuracy('melting_seaice_sa_ct_ratio_poly',value, &
729 
731 call check_accuracy('melting_seaice_equilibrium_sa_ct_ratio',value, &
733 
735 call check_accuracy('melting_seaice_equilibrium_sa_ct_ratio_poly',value, &
737 
739  w_seaice,sa_seaice,t_seaice,val1,val2)
740 call check_accuracy('melting_seaice_into_seawater',val1, &
742 call check_accuracy('melting_seaice_into_seawater',val2, &
744 
746  sa_seaice,t_seaice,val1,val2,val3)
747 call check_accuracy('seaice_fraction_to_freeze_seawater',val1, &
749 call check_accuracy('seaice_fraction_to_freeze_seawater',val2, &
751 call check_accuracy('seaice_fraction_to_freeze_seawater',val3, &
753 
754 !------------------------------------------------------------------------------
755 if (gsw_error_flag.eq.1) then
756  print*
757  print*
758  print*, 'Your installation of the Gibbs SeaWater (GSW) Oceanographic Toolbox has errors!'
759 else
760  print*
761  print*
762  print*, 'Well done! The gsw_check_fuctions confirms that the'
763  print*, 'Gibbs SeaWater (GSW) Oceanographic Toolbox is installed correctly.'
764  print*
765 endif
766 
767 contains
768 
769  !--------------------------------------------------------------------------
770 
771  subroutine section_title (title)
773  character (*), intent(in) :: title
774 
775  print *
776  print *, "----------------------------------------------------------------------------"
777  print *, title
778  print *
779 
780  return
781  end subroutine section_title
782 
783  !--------------------------------------------------------------------------
784 
785  subroutine check_accuracy (func_name, fvalue, result, result_ice, &
786  result_mpres, result_cast, vprint)
789 
790  implicit none
791 
792  character (*), intent(in) :: func_name
793  real (r8), intent(in) :: fvalue(:,:)
794  type(gsw_result), intent(in), optional :: result
795  type(gsw_result_ice), intent(in), optional :: result_ice
796  type(gsw_result_mpres), intent(in), optional :: result_mpres
797  type(gsw_result_cast), intent(in), optional :: result_cast
798  logical, intent(in), optional :: vprint
799 
800  integer :: ndots, i, j, k, ik=1, jk=1
801  real (r8) :: dmax, drel, comp_accuracy
802  real (r8) :: diff(size(fvalue,1),size(fvalue,2))
803  real (r8) :: rvalue(size(fvalue,1),size(fvalue,2))
804  character (80) :: message
805  character (50) :: var_name
806  character (4) :: errflg
807 
808  character (*), parameter :: att_name = 'computation_accuracy'
809  character (*), parameter :: &
810  dots = ' .............................................................'
811 
812  if (present(result)) then
813  rvalue = result%values
814  var_name = result%variable_name
815  comp_accuracy = result%computation_accuracy
816  else if (present(result_ice)) then
817  rvalue = result_ice%values
818  var_name = result_ice%variable_name
819  comp_accuracy = result_ice%computation_accuracy
820  else if (present(result_mpres)) then
821  rvalue = result_mpres%values
822  var_name = result_mpres%variable_name
823  comp_accuracy = result_mpres%computation_accuracy
824  else if (present(result_cast)) then
825  rvalue(:,1) = result_cast%values
826  var_name = result_cast%variable_name
827  comp_accuracy = result_cast%computation_accuracy
828  end if
829 
830  if (trim(var_name).ne.func_name) then
831  if (len(func_name)+len_trim(var_name).gt.55) then
832  k = len(func_name) + len_trim(var_name) - 55
833  message = func_name // ' (..' // trim(var_name(k:)) // ')'
834  else
835  message = func_name // ' (' // trim(var_name) // ')'
836  end if
837  else
838  message = func_name
839  end if
840 
841  diff = abs(fvalue - rvalue)
842  where (rvalue .eq. 9e90_r8) diff = 0.0_r8
843 
844  if (present(vprint)) then
845  if (vprint) then
846  print *, "Limit =", comp_accuracy
847  print '(i3,3ES24.15)', ((i,fvalue(i,j),rvalue(i,j),diff(i,j), &
848  i=1,size(fvalue,1)), j=1,size(fvalue,2))
849  print *
850  end if
851  end if
852 
853  if (any(fvalue .gt. gsw_error_limit .and. fvalue .lt. 1e90_r8 .and. &
854  rvalue .lt. 1e90_r8)) then
855  where (fvalue .gt. gsw_error_limit) diff = 0.0_r8
856  errflg = ' (*)'
857  else
858  errflg = ' '
859  end if
860  ndots = 65 - len_trim(message)
861 
862  if (any(diff .gt. comp_accuracy)) then
863  gsw_error_flag = 1
864  dmax = 0.0_r8
865  do i = 1, size(fvalue,1)
866  do j = 1, size(fvalue,2)
867  if (diff(i,j) .gt. dmax) then
868  dmax = diff(i,j)
869  ik = i
870  jk = j
871  end if
872  end do
873  end do
874  drel = dmax*100.0_r8/abs(fvalue(ik,jk))
875  print *, trim(message), dots(:ndots-3), ' << failed >>'
876  print *
877  print *, " Max. difference =", dmax, ", limit =", comp_accuracy
878  print *, " Max. diff (rel) =", drel, ", limit =", &
879  comp_accuracy*100.0_r8/abs(fvalue(ik,jk))
880  print *
881  else
882  print *, trim(message), dots(:ndots), ' passed', errflg
883  endif
884 
885  return
886  end subroutine check_accuracy
887 
888 end
889 
890 !--------------------------------------------------------------------------
type(gsw_result) beta_const_t_exact
real(r8), dimension(cast_n) lat_cast
integer, parameter cast_m
real(r8), dimension(cast_m, cast_n) sk
program gsw_check_functions
type(gsw_result_ice) frazil_properties_potential_poly_sa_final
type(gsw_result) eta_ct_ct
real(r8), dimension(cast_m, cast_n) p_deep
type(gsw_result_mpres) n2min_dct
type(gsw_result_mpres) p_mid_n2
type(gsw_result_ice) melting_seaice_equilibrium_sa_ct_ratio_poly
type(gsw_result) pot_enthalpy_ice_freezing_sa_poly
real(r8), dimension(cast_m, cast_n) sp
type(gsw_result_ice) kappa_ice
type(gsw_result_mpres) p_mid_tursr
type(gsw_result) pot_enthalpy_ice_freezing
type(gsw_result) z_from_p
type(gsw_result) h_sa_ct_exact
type(gsw_result_mpres) p_mid_ipvfn2
type(gsw_result_ice) seaice_fraction_to_freeze_seawater_ct_freeze
type(gsw_result) ctfreezing_sa
type(gsw_result_ice) pt_from_t_ice
type(gsw_result) h_sa_ct
type(gsw_result_ice) melting_ice_equilibrium_sa_ct_ratio
type(gsw_result) ct_from_enthalpy
type(gsw_result_ice) specvol_ice
type(gsw_result) geo_strf_dyn_height
type(gsw_result_ice) dsa_dct_frazil_poly
type(gsw_result) t_deriv_chem_potential_water_t_exact
type(gsw_result_ice) seaice_fraction_to_freeze_seawater_w_ih
integer, parameter cast_mpres_m
type(gsw_result) rho_ct_ct
integer, parameter, public long
Definition: Type_Kinds.f90:76
type(gsw_result_ice) frazil_properties_potential_poly_w_ih_final
type(gsw_result) entropy_from_t
type(gsw_result) tfreezing_sa_poly
type(gsw_result) geo_strf_dyn_height_pc
type(gsw_result) cabbeling
type(gsw_result_ice) seaice_fraction_to_freeze_seawater_sa_freeze
integer, parameter cast_mpres_n
type(gsw_result) beta_vab
type(gsw_result_ice) ice_fraction_to_freeze_seawater_sa_freeze
type(gsw_result) rho_ct_p
type(gsw_result_ice) pot_enthalpy_from_pt_ice
subroutine section_title(title)
type(gsw_result_ice) frazil_properties_sa_final
subroutine check_accuracy(func_name, fvalue, result, result_ice, result_mpres, result_cast, vprint)
type(gsw_result_ice) pressure_freezing_ct
type(gsw_result_ice) melting_ice_sa_ct_ratio_poly
real(r8), dimension(cast_n) long_cast
type(gsw_result) rho_t_exact
type(gsw_result_ice) ice_fraction_to_freeze_seawater_ct_freeze
type(gsw_result) h_sa_ct_ct_exact
type(gsw_result) sa_freezing_from_ct_poly
type(gsw_result) sound_speed_t_exact
type(gsw_result) pt_from_ct
type(gsw_result_ice) frazil_properties_potential_poly_ct_final
type(gsw_result) ct_freezing_poly
type(gsw_result) ct_from_pt
type(gsw_result_ice) pt_from_pot_enthalpy_ice
type(gsw_result) sp_from_c
type(gsw_result_ice) enthalpy_ice
type(gsw_result) deltasa_atlas
type(gsw_result_ice) alpha_wrt_t_ice
type(gsw_result) ct_sa_pt
type(gsw_result) tfreezing_p_poly
type(gsw_result) pot_enthalpy_ice_freezing_p_poly
type(gsw_result) enthalpy_ct_exact
type(gsw_result_ice) melting_seaice_sa_ct_ratio
type(gsw_result) rho_sa_wrt_h
type(gsw_result_ice) frazil_properties_potential_w_ih_final
type(gsw_result_ice) melting_seaice_sa_ct_ratio_poly
type(gsw_result) sa_from_rho
type(gsw_result_ice) dsa_dp_frazil_poly
type(gsw_result_mpres) n2min_pmid
type(gsw_result) pt_sa_sa
type(gsw_result) v_sa_sa_wrt_h
type(gsw_result_ice) frazil_properties_w_ih_final
type(gsw_result_ice) dct_dp_frazil_poly
real(r8), dimension(cast_m, cast_n) p
type(gsw_result) p_from_z
type(gsw_result_ice) entropy_ice
type(gsw_result) entropy_from_pt
type(gsw_result) deltasa_from_sp
type(gsw_result_ice) pressure_coefficient_ice
type(gsw_result) h_sa_sa
type(gsw_result) chem_potential_water_t_exact
real(r8), parameter, public gsw_error_limit
type(gsw_result) pt_from_entropy
type(gsw_result) v_sa_ct
real(r8), dimension(cast_ice_m, cast_ice_n) sa_arctic
type(gsw_result_ice) melting_ice_equilibrium_sa_ct_ratio_poly
type(gsw_result) eta_sa_ct
type(gsw_result_ice) melting_seaice_into_seawater_sa_final
type(gsw_result) dilution_coefficient_t_exact
type(gsw_result) geo_strf_dyn_height_pc_p_mid
real(r8), dimension(cast_ice_m, cast_ice_n) h_bulk
type(gsw_result) tfreezing_sa
type(gsw_result) ctfreezing_sa_poly
type(gsw_result) ct_from_t
type(gsw_result) alpha_vab
type(gsw_result_ice) rho_ice
real(r8), dimension(cast_ice_m, cast_ice_n) w_seaice
type(gsw_result_ice) pot_enthalpy_from_pt_ice_poly
integer, parameter cast_n
type(gsw_result_ice) sound_speed_ice
type(gsw_result_ice) frazil_properties_potential_sa_final
type(gsw_result) t_from_ct
type(gsw_result) t_freezing
type(gsw_result_ice) adiabatic_lapse_rate_ice
type(gsw_result) ct_p_wrt_t
type(gsw_result) latentheat_melting
type(gsw_result) sstar_from_sa
type(gsw_result) alpha_rab
type(gsw_result) dynamic_enthalpy
type(gsw_result) rho_rab
type(gsw_result) sr_from_sp
type(gsw_result) rho_sa_ct
type(gsw_result_ice) helmholtz_energy_ice
type(gsw_result_ice) melting_seaice_equilibrium_sa_ct_ratio
type(gsw_result) sp_from_sstar
type(gsw_result) ct_pt_pt
type(gsw_result_ice) pt0_from_t_ice
type(gsw_result_ice) internal_energy_ice
type(gsw_result) v_sa_wrt_h
type(gsw_result) pt_from_t
type(gsw_result) rho_sa_h
real(r8), dimension(cast_ice_m, cast_ice_n) p_arctic
type(gsw_result) ctfreezing_p_poly
type(gsw_result) latentheat_evap_t
type(gsw_result) sp_from_sk
type(gsw_result) sp_from_sa
type(gsw_result) enthalpy
type(gsw_result) pot_enthalpy_ice_freezing_poly
real(r8), dimension(cast_m, cast_n) p_shallow
real(r8), dimension(cast_ice_m, cast_ice_n) t_seaice
type(gsw_result_ice) melting_seaice_into_seawater_ct_final
type(gsw_result) rho_sa_p
real(r8), dimension(cast_m, cast_n) ct
real(r8), dimension(cast_ice_m, cast_ice_n) h_pot_bulk
type(gsw_result) sa_from_sstar
type(gsw_result) enthalpy_t_exact
type(gsw_result_ice) frazil_properties_ct_final
type(gsw_result) sa_freezing_from_t_poly
type(gsw_result_mpres) n2
type(gsw_result) specvol_t_exact
real(r8), dimension(cast_ice_m, cast_ice_n) w_ice
type(gsw_result) eta_sa_sa
type(gsw_result) tfreezing_p
type(gsw_result_ice) chem_potential_water_ice
type(gsw_result_mpres) n2min_dsa
real, parameter, public grav
Acceleration due to gravity [m/s^2].
Definition: constants.F90:76
type(gsw_result_ice) dct_dp_frazil
type(gsw_result_ice) pt_from_pot_enthalpy_ice_poly
type(gsw_result) pt_ct_ct
type(gsw_result_mpres) ipvfn2
real(r8), dimension(cast_m, cast_n) delta_p
type(gsw_result) sa_freezing_from_t
type(gsw_result_ice) ice_fraction_to_freeze_seawater_w_ih
type(gsw_result) ct_maxdensity
type(gsw_result_mpres) n2min_dp
type(gsw_result) t_freezing_poly
type(gsw_result) h_ct_ct_ct_exact
type(gsw_result) specvol_anom_standard
type(gsw_result) latentheat_evap_ct
type(gsw_result) kappa_t_exact
type(gsw_result) rho_sa_sa
type(gsw_result) sound_speed
type(gsw_result_ice) cp_ice
real(r8), dimension(cast_ice_m, cast_ice_n) sa_seaice
type(gsw_result) pot_rho_t_exact
type(gsw_result) n2_lowerlimit
type(gsw_result) alpha_wrt_t_exact
type(gsw_result_mpres) rsubrho
type(gsw_result) sp_from_sr
type(gsw_result) pot_enthalpy_ice_freezing_p
real(r8), dimension(cast_m, cast_n) t
type(gsw_result_ice) melting_ice_into_seawater_sa_final
type(gsw_result) ct_sa_sa
type(gsw_result) thermobaric
type(gsw_result) enthalpy_diff
type(gsw_result_ice) melting_ice_into_seawater_ct_final
type(gsw_result) pt_sa_ct
type(gsw_result) internal_energy
real(r8), dimension(cast_ice_m, cast_ice_n) sa_bulk
type(gsw_result_cast) mlp
type(gsw_result) c_from_sp
type(gsw_result_mpres) tu
type(gsw_result) alpha_on_beta
type(gsw_result) ct_from_entropy
type(gsw_result_mpres) n2min_beta
type(gsw_result) ctfreezing_p
type(gsw_result) adiabatic_lapse_rate_from_ct
type(gsw_result_ice) kappa_const_t_ice
type(gsw_result_ice) t_from_pt0_ice
type(gsw_result) h_ct_ct
type(gsw_result_mpres) n2min_specvol
type(gsw_result_ice) frazil_properties_potential_ct_final
type(gsw_result) ct_from_rho
type(gsw_result) sa_freezing_from_ct
type(gsw_result) ct_t_wrt_t
integer, parameter cast_ice_m
type(gsw_result) beta_rab
elemental real(r8) function, public gsw_error_code(err_num, func_name, error_code)
type(gsw_result) specvol
type(gsw_result) h_sa_sa_ct_exact
type(gsw_result) sa_from_sp
type(gsw_result) v_ct_ct
real, parameter, public kappa
RDGAS / CP_AIR [dimensionless].
Definition: constants.F90:82
type(gsw_result) rho_sa_sa_wrt_h
integer, parameter cast_ice_n
type(gsw_result) pot_enthalpy_ice_freezing_sa
type(gsw_result) sstar_from_sp
type(gsw_result) ct_sa_wrt_t
type(gsw_result) rho_h_h
type(gsw_result_ice) melting_ice_sa_ct_ratio
real(r8), dimension(cast_m, cast_n) sa
type(gsw_result_ice) dsa_dct_frazil
type(gsw_result) ct_freezing
type(gsw_result_ice) dsa_dp_frazil
type(gsw_result) v_sa_sa
type(gsw_result_mpres) n2min_alpha
real(r8), dimension(cast_ice_m, cast_ice_n) ct_arctic
real(r8), dimension(cast_ice_m, cast_ice_n) t_ice
type(gsw_result) pt0_from_t
type(gsw_result) h_ct_ct_exact
type(gsw_result_mpres) n2min