FV3 Bundle
gsw_mod_toolbox.f90
Go to the documentation of this file.
2 
4 
5 implicit none
6 
7 public :: gsw_add_barrier
8 public :: gsw_add_mean
11 public :: gsw_alpha
12 public :: gsw_alpha_on_beta
13 public :: gsw_alpha_wrt_t_exact
14 public :: gsw_alpha_wrt_t_ice
15 public :: gsw_beta
16 public :: gsw_beta_const_t_exact
17 public :: gsw_c_from_sp
18 public :: gsw_cabbeling
21 public :: gsw_cp_ice
24 public :: gsw_ct_freezing
25 public :: gsw_ct_freezing_exact
28 public :: gsw_ct_freezing_poly
29 public :: gsw_ct_from_enthalpy
31 public :: gsw_ct_from_entropy
32 public :: gsw_ct_from_pt
33 public :: gsw_ct_from_rho
34 public :: gsw_ct_from_t
35 public :: gsw_ct_maxdensity
37 public :: gsw_deltasa_atlas
38 public :: gsw_deltasa_from_sp
40 public :: gsw_dynamic_enthalpy
41 public :: gsw_enthalpy
42 public :: gsw_enthalpy_ct_exact
43 public :: gsw_enthalpy_diff
46 public :: gsw_enthalpy_ice
49 public :: gsw_enthalpy_sso_0
50 public :: gsw_enthalpy_t_exact
52 public :: gsw_entropy_from_pt
53 public :: gsw_entropy_from_t
54 public :: gsw_entropy_ice
55 public :: gsw_entropy_part
56 public :: gsw_entropy_part_zerop
58 public :: gsw_fdelta
59 public :: gsw_frazil_properties
66 public :: gsw_gibbs
67 public :: gsw_gibbs_ice
68 public :: gsw_gibbs_ice_part_t
69 public :: gsw_gibbs_ice_pt0
70 public :: gsw_gibbs_ice_pt0_pt0
71 public :: gsw_gibbs_pt0_pt0
72 public :: gsw_grav
74 public :: gsw_hill_ratio_at_sp2
76 public :: gsw_internal_energy
79 public :: gsw_kappa
80 public :: gsw_kappa_const_t_ice
81 public :: gsw_kappa_ice
82 public :: gsw_kappa_t_exact
83 public :: gsw_latentheat_evap_ct
84 public :: gsw_latentheat_evap_t
85 public :: gsw_latentheat_melting
97 public :: gsw_mlp
98 public :: gsw_nsquared
100 public :: gsw_nsquared_min
101 public :: gsw_nsquared_min_const_t
102 public :: gsw_p_from_z
109 public :: gsw_pot_rho_t_exact
111 public :: gsw_pressure_freezing_ct
112 public :: gsw_pt0_cold_ice_poly
113 public :: gsw_pt0_from_t
114 public :: gsw_pt0_from_t_ice
115 public :: gsw_pt_first_derivatives
116 public :: gsw_pt_from_ct
117 public :: gsw_pt_from_entropy
121 public :: gsw_pt_from_t
122 public :: gsw_pt_from_t_ice
124 public :: gsw_rho
125 public :: gsw_rho_alpha_beta
126 public :: gsw_rho_alpha_beta_bsq
129 public :: gsw_rho_ice
132 public :: gsw_rho_t_exact
133 public :: gsw_rr68_interp_sa_ct
134 public :: gsw_sa_freezing_estimate
135 public :: gsw_sa_freezing_from_ct
137 public :: gsw_sa_freezing_from_t
139 public :: gsw_sa_from_rho
140 public :: gsw_sa_from_sp
141 public :: gsw_sa_from_sp_baltic
142 public :: gsw_sa_from_sstar
143 public :: gsw_sa_p_inrange
144 public :: gsw_saar
146 public :: gsw_sigma0
147 public :: gsw_sigma1
148 public :: gsw_sigma2
149 public :: gsw_sigma3
150 public :: gsw_sigma4
151 public :: gsw_sound_speed
152 public :: gsw_sound_speed_ice
153 public :: gsw_sound_speed_t_exact
154 public :: gsw_sp_from_c
155 public :: gsw_sp_from_sa
156 public :: gsw_sp_from_sa_baltic
157 public :: gsw_sp_from_sk
158 public :: gsw_sp_from_sr
159 public :: gsw_sp_from_sstar
160 public :: gsw_specvol
161 public :: gsw_specvol_alpha_beta
165 public :: gsw_specvol_ice
168 public :: gsw_specvol_sso_0
169 public :: gsw_specvol_t_exact
170 public :: gsw_spiciness0
171 public :: gsw_spiciness1
172 public :: gsw_spiciness2
173 public :: gsw_sr_from_sp
174 public :: gsw_sstar_from_sa
175 public :: gsw_sstar_from_sp
177 public :: gsw_t_freezing
178 public :: gsw_t_freezing_exact
181 public :: gsw_t_freezing_poly
182 public :: gsw_t_from_ct
183 public :: gsw_t_from_pt0_ice
184 public :: gsw_thermobaric
185 public :: gsw_turner_rsubrho
186 public :: gsw_util_indx
187 public :: gsw_util_interp1q_int
188 public :: gsw_util_xinterp1
189 public :: gsw_z_from_p
190 
191 interface
192 
193  pure subroutine gsw_add_barrier (input_data, long, lat, long_grid, &
194  lat_grid, dlong_grid, dlat_grid, output_data)
196  implicit none
197  real (r8), intent(in) :: long, lat, long_grid, lat_grid, dlong_grid
198  real (r8), intent(in) :: dlat_grid
199  real (r8), intent(in), dimension(4) :: input_data
200  real (r8), intent(out), dimension(4) :: output_data
201  end subroutine gsw_add_barrier
202 
203  pure subroutine gsw_add_mean (data_in, data_out)
205  implicit none
206  real (r8), intent(in), dimension(4) :: data_in
207  real (r8), intent(out), dimension(4) :: data_out
208  end subroutine gsw_add_mean
209 
210  elemental function gsw_adiabatic_lapse_rate_from_ct (sa, ct, p)
212  implicit none
213  real (r8), intent(in) :: sa, ct, p
216 
217  elemental function gsw_adiabatic_lapse_rate_ice (t, p)
219  implicit none
220  real (r8), intent(in) :: t, p
221  real (r8) :: gsw_adiabatic_lapse_rate_ice
222  end function gsw_adiabatic_lapse_rate_ice
223 
224  elemental function gsw_alpha (sa, ct, p)
226  implicit none
227  real (r8), intent(in) :: sa, ct, p
228  real (r8) :: gsw_alpha
229  end function gsw_alpha
230 
231  elemental function gsw_alpha_on_beta (sa, ct, p)
233  implicit none
234  real (r8), intent(in) :: sa, ct, p
235  real (r8) :: gsw_alpha_on_beta
236  end function gsw_alpha_on_beta
237 
238  elemental function gsw_alpha_wrt_t_exact (sa, t, p)
240  implicit none
241  real (r8), intent(in) :: sa, t, p
242  real (r8) :: gsw_alpha_wrt_t_exact
243  end function gsw_alpha_wrt_t_exact
244 
245  elemental function gsw_alpha_wrt_t_ice (t, p)
247  implicit none
248  real (r8), intent(in) :: t, p
249  real (r8) :: gsw_alpha_wrt_t_ice
250  end function gsw_alpha_wrt_t_ice
251 
252  elemental function gsw_beta (sa, ct, p)
254  implicit none
255  real (r8), intent(in) :: sa, ct, p
256  real (r8) :: gsw_beta
257  end function gsw_beta
258 
259  elemental function gsw_beta_const_t_exact (sa, t, p)
261  implicit none
262  real (r8), intent(in) :: sa, t, p
263  real (r8) :: gsw_beta_const_t_exact
264  end function gsw_beta_const_t_exact
265 
266  elemental function gsw_c_from_sp (sp, t, p)
268  implicit none
269  real (r8), intent(in) :: sp, t, p
270  real (r8) :: gsw_c_from_sp
271  end function gsw_c_from_sp
272 
273  elemental function gsw_cabbeling (sa, ct, p)
275  implicit none
276  real (r8), intent(in) :: sa, ct, p
277  real (r8) :: gsw_cabbeling
278  end function gsw_cabbeling
279 
280  elemental function gsw_chem_potential_water_ice (t, p)
282  implicit none
283  real (r8), intent(in) :: t, p
284  real (r8) :: gsw_chem_potential_water_ice
285  end function gsw_chem_potential_water_ice
286 
287  elemental function gsw_chem_potential_water_t_exact (sa, t, p)
289  implicit none
290  real (r8), intent(in) :: sa, t, p
293 
294  elemental function gsw_cp_ice (t, p)
296  implicit none
297  real (r8), intent(in) :: t, p
298  real (r8) :: gsw_cp_ice
299  end function gsw_cp_ice
300 
301  elemental subroutine gsw_ct_first_derivatives (sa, pt, ct_sa, ct_pt)
303  implicit none
304  real (r8), intent(in) :: sa, pt
305  real (r8), intent(out), optional :: ct_sa, ct_pt
306  end subroutine gsw_ct_first_derivatives
307 
308  elemental subroutine gsw_ct_first_derivatives_wrt_t_exact (sa, t, p, &
309  ct_sa_wrt_t, ct_t_wrt_t, ct_p_wrt_t)
311  implicit none
312  real (r8), intent(in) :: sa, t, p
313  real (r8), intent(out), optional :: ct_p_wrt_t, ct_sa_wrt_t, ct_t_wrt_t
315 
316  elemental function gsw_ct_freezing (sa, p, saturation_fraction, poly)
318  implicit none
319  real (r8), intent(in) :: sa, p, saturation_fraction
320  logical, intent(in), optional :: poly
321  real (r8) :: gsw_ct_freezing
322  end function gsw_ct_freezing
323 
324  elemental function gsw_ct_freezing_exact (sa, p, saturation_fraction)
326  implicit none
327  real (r8), intent(in) :: sa, p, saturation_fraction
328  real (r8) :: gsw_ct_freezing_exact
329  end function gsw_ct_freezing_exact
330 
331  elemental subroutine gsw_ct_freezing_first_derivatives (sa, p, &
332  saturation_fraction, ctfreezing_sa, ctfreezing_p)
334  implicit none
335  real (r8), intent(in) :: sa, p, saturation_fraction
336  real (r8), intent(out), optional :: ctfreezing_sa, ctfreezing_p
337  end subroutine gsw_ct_freezing_first_derivatives
338 
339  elemental subroutine gsw_ct_freezing_first_derivatives_poly (sa, p, &
340  saturation_fraction, ctfreezing_sa, ctfreezing_p)
342  implicit none
343  real (r8), intent(in) :: sa, p, saturation_fraction
344  real (r8), intent(out), optional :: ctfreezing_sa, ctfreezing_p
346 
347  elemental function gsw_ct_freezing_poly (sa, p, saturation_fraction)
349  implicit none
350  real (r8), intent(in) :: sa, p, saturation_fraction
351  real (r8) :: gsw_ct_freezing_poly
352  end function gsw_ct_freezing_poly
353 
354  elemental function gsw_ct_from_enthalpy (sa, h, p)
356  implicit none
357  real (r8), intent(in) :: sa, h, p
358  real (r8) :: gsw_ct_from_enthalpy
359  end function gsw_ct_from_enthalpy
360 
361  elemental function gsw_ct_from_enthalpy_exact (sa, h, p)
363  implicit none
364  real (r8), intent(in) :: sa, h, p
365  real (r8) :: gsw_ct_from_enthalpy_exact
366  end function gsw_ct_from_enthalpy_exact
367 
368  elemental function gsw_ct_from_entropy (sa, entropy)
370  implicit none
371  real (r8), intent(in) :: sa, entropy
372  real (r8) :: gsw_ct_from_entropy
373  end function gsw_ct_from_entropy
374 
375  elemental function gsw_ct_from_pt (sa, pt)
377  implicit none
378  real (r8), intent(in) :: sa, pt
379  real (r8) :: gsw_ct_from_pt
380  end function gsw_ct_from_pt
381 
382  elemental subroutine gsw_ct_from_rho (rho, sa, p, ct, ct_multiple)
384  implicit none
385  real (r8), intent(in) :: rho, sa, p
386  real (r8), intent(out) :: ct
387  real (r8), intent(out), optional :: ct_multiple
388  end subroutine gsw_ct_from_rho
389 
390  elemental function gsw_ct_from_t (sa, t, p)
392  implicit none
393  real (r8), intent(in) :: sa, t, p
394  real (r8) :: gsw_ct_from_t
395  end function gsw_ct_from_t
396 
397  elemental function gsw_ct_maxdensity (sa, p)
399  implicit none
400  real (r8), intent(in) :: sa, p
401  real (r8) :: gsw_ct_maxdensity
402  end function gsw_ct_maxdensity
403 
404  elemental subroutine gsw_ct_second_derivatives (sa, pt, ct_sa_sa, ct_sa_pt, &
405  ct_pt_pt)
407  implicit none
408  real (r8), intent(in) :: sa, pt
409  real (r8), intent(out), optional :: ct_sa_sa, ct_sa_pt, ct_pt_pt
410  end subroutine gsw_ct_second_derivatives
411 
412  elemental function gsw_deltasa_atlas (p, long, lat)
414  implicit none
415  real (r8), intent(in) :: p, long, lat
416  real (r8) :: gsw_deltasa_atlas
417  end function gsw_deltasa_atlas
418 
419  elemental function gsw_deltasa_from_sp (sp, p, long, lat)
421  implicit none
422  real (r8), intent(in) :: sp, p, long, lat
423  real (r8) :: gsw_deltasa_from_sp
424  end function gsw_deltasa_from_sp
425 
426  elemental function gsw_dilution_coefficient_t_exact (sa, t, p)
428  implicit none
429  real (r8), intent(in) :: sa, t, p
432 
433  elemental function gsw_dynamic_enthalpy (sa, ct, p)
435  implicit none
436  real (r8), intent(in) :: sa, ct, p
437  real (r8) :: gsw_dynamic_enthalpy
438  end function gsw_dynamic_enthalpy
439 
440  elemental function gsw_enthalpy (sa, ct, p)
442  implicit none
443  real (r8), intent(in) :: sa, ct, p
444  real (r8) :: gsw_enthalpy
445  end function gsw_enthalpy
446 
447  elemental function gsw_enthalpy_ct_exact (sa, ct, p)
449  implicit none
450  real (r8), intent(in) :: sa, ct, p
451  real (r8) :: gsw_enthalpy_ct_exact
452  end function gsw_enthalpy_ct_exact
453 
454  elemental function gsw_enthalpy_diff (sa, ct, p_shallow, p_deep)
456  implicit none
457  real (r8), intent(in) :: sa, ct, p_shallow, p_deep
458  real (r8) :: gsw_enthalpy_diff
459  end function gsw_enthalpy_diff
460 
461  elemental subroutine gsw_enthalpy_first_derivatives (sa, ct, p, h_sa, h_ct)
463  implicit none
464  real (r8), intent(in) :: sa, ct, p
465  real (r8), intent(out), optional :: h_sa, h_ct
466  end subroutine gsw_enthalpy_first_derivatives
467 
468  elemental subroutine gsw_enthalpy_first_derivatives_ct_exact (sa, ct, p, &
469  h_sa, h_ct)
471  implicit none
472  real (r8), intent(in) :: sa, ct, p
473  real (r8), intent(out), optional :: h_sa, h_ct
475 
476  elemental function gsw_enthalpy_ice (t, p)
478  implicit none
479  real (r8), intent(in) :: t, p
480  real (r8) :: gsw_enthalpy_ice
481  end function gsw_enthalpy_ice
482 
483  elemental subroutine gsw_enthalpy_second_derivatives (sa, ct, p, h_sa_sa, &
484  h_sa_ct, h_ct_ct)
486  implicit none
487  real (r8), intent(in) :: sa, ct, p
488  real (r8), intent(out), optional :: h_sa_sa, h_sa_ct, h_ct_ct
489  end subroutine gsw_enthalpy_second_derivatives
490 
491  elemental subroutine gsw_enthalpy_second_derivatives_ct_exact (sa, ct, p, &
492  h_sa_sa, h_sa_ct, h_ct_ct)
494  implicit none
495  real (r8), intent(in) :: sa, ct, p
496  real (r8), intent(out), optional :: h_sa_sa, h_sa_ct, h_ct_ct
498 
499  elemental function gsw_enthalpy_sso_0 (p)
501  implicit none
502  real (r8), intent(in) :: p
503  real (r8) :: gsw_enthalpy_sso_0
504  end function gsw_enthalpy_sso_0
505 
506  elemental function gsw_enthalpy_t_exact (sa, t, p)
508  implicit none
509  real (r8), intent(in) :: sa, t, p
510  real (r8) :: gsw_enthalpy_t_exact
511  end function gsw_enthalpy_t_exact
512 
513  elemental subroutine gsw_entropy_first_derivatives (sa, ct, eta_sa, eta_ct)
515  implicit none
516  real (r8), intent(in) :: sa, ct
517  real (r8), intent(out), optional :: eta_sa, eta_ct
518  end subroutine gsw_entropy_first_derivatives
519 
520  elemental function gsw_entropy_from_pt (sa, pt)
522  implicit none
523  real (r8), intent(in) :: sa, pt
524  real (r8) :: gsw_entropy_from_pt
525  end function gsw_entropy_from_pt
526 
527  elemental function gsw_entropy_from_t (sa, t, p)
529  implicit none
530  real (r8), intent(in) :: sa, t, p
531  real (r8) :: gsw_entropy_from_t
532  end function gsw_entropy_from_t
533 
534  elemental function gsw_entropy_ice (t, p)
536  implicit none
537  real (r8), intent(in) :: t, p
538  real (r8) :: gsw_entropy_ice
539  end function gsw_entropy_ice
540 
541  elemental function gsw_entropy_part (sa, t, p)
543  implicit none
544  real (r8), intent(in) :: sa, t, p
545  real (r8) :: gsw_entropy_part
546  end function gsw_entropy_part
547 
548  elemental function gsw_entropy_part_zerop (sa, pt0)
550  implicit none
551  real (r8), intent(in) :: sa, pt0
552  real (r8) :: gsw_entropy_part_zerop
553  end function gsw_entropy_part_zerop
554 
555  elemental subroutine gsw_entropy_second_derivatives (sa, ct, eta_sa_sa, &
556  eta_sa_ct, eta_ct_ct)
558  implicit none
559  real (r8), intent(in) :: sa, ct
560  real (r8), intent(out), optional :: eta_sa_sa, eta_sa_ct, eta_ct_ct
561  end subroutine gsw_entropy_second_derivatives
562 
563  elemental function gsw_fdelta (p, long, lat)
565  implicit none
566  real (r8), intent(in) :: p, long, lat
567  real (r8) :: gsw_fdelta
568  end function gsw_fdelta
569 
570  elemental subroutine gsw_frazil_properties (sa_bulk, h_bulk, p, &
571  sa_final, ct_final, w_ih_final)
573  implicit none
574  real (r8), intent(in) :: sa_bulk, h_bulk, p
575  real (r8), intent(out) :: sa_final, ct_final, w_ih_final
576  end subroutine gsw_frazil_properties
577 
578  elemental subroutine gsw_frazil_properties_potential (sa_bulk, h_pot_bulk,&
579  p, sa_final, ct_final, w_ih_final)
581  implicit none
582  real (r8), intent(in) :: sa_bulk, h_pot_bulk, p
583  real (r8), intent(out) :: sa_final, ct_final, w_ih_final
584  end subroutine gsw_frazil_properties_potential
585 
586  elemental subroutine gsw_frazil_properties_potential_poly (sa_bulk, &
587  h_pot_bulk, p, sa_final, ct_final, w_ih_final)
589  implicit none
590  real (r8), intent(in) :: sa_bulk, h_pot_bulk, p
591  real (r8), intent(out) :: sa_final, ct_final, w_ih_final
593 
594  elemental subroutine gsw_frazil_ratios_adiabatic (sa, p, w_ih, &
595  dsa_dct_frazil, dsa_dp_frazil, dct_dp_frazil)
597  implicit none
598  real (r8), intent(in) :: sa, p, w_ih
599  real (r8), intent(out) :: dsa_dct_frazil, dsa_dp_frazil, dct_dp_frazil
600  end subroutine gsw_frazil_ratios_adiabatic
601 
602  elemental subroutine gsw_frazil_ratios_adiabatic_poly (sa, p, w_ih, &
603  dsa_dct_frazil, dsa_dp_frazil, dct_dp_frazil)
605  implicit none
606  real (r8), intent(in) :: sa, p, w_ih
607  real (r8), intent(out) :: dsa_dct_frazil, dsa_dp_frazil, dct_dp_frazil
608  end subroutine gsw_frazil_ratios_adiabatic_poly
609 
610  pure function gsw_geo_strf_dyn_height (sa, ct, p, p_ref)
612  implicit none
613  real (r8), intent(in) :: sa(:), ct(:), p(:), p_ref
614  real (r8) :: gsw_geo_strf_dyn_height(size(sa))
615  end function gsw_geo_strf_dyn_height
616 
617  pure subroutine gsw_geo_strf_dyn_height_pc (sa, ct, delta_p, &
618  geo_strf_dyn_height_pc, p_mid)
620  implicit none
621  real (r8), intent(in) :: sa(:), ct(:), delta_p(:)
622  real (r8), intent(out) :: geo_strf_dyn_height_pc(:), p_mid(:)
623  end subroutine gsw_geo_strf_dyn_height_pc
624 
625  elemental function gsw_gibbs (ns, nt, np, sa, t, p)
627  implicit none
628  integer, intent(in) :: ns, nt, np
629  real (r8), intent(in) :: sa, t, p
630  real (r8) :: gsw_gibbs
631  end function gsw_gibbs
632 
633  elemental function gsw_gibbs_ice (nt, np, t, p)
635  implicit none
636  integer, intent(in) :: nt, np
637  real (r8), intent(in) :: t, p
638  real (r8) :: gsw_gibbs_ice
639  end function gsw_gibbs_ice
640 
641  elemental function gsw_gibbs_ice_part_t (t, p)
643  implicit none
644  real (r8), intent(in) :: t, p
645  real (r8) :: gsw_gibbs_ice_part_t
646  end function gsw_gibbs_ice_part_t
647 
648  elemental function gsw_gibbs_ice_pt0 (pt0)
650  implicit none
651  real (r8), intent(in) :: pt0
652  real (r8) :: gsw_gibbs_ice_pt0
653  end function gsw_gibbs_ice_pt0
654 
655  elemental function gsw_gibbs_ice_pt0_pt0 (pt0)
657  implicit none
658  real (r8), intent(in) :: pt0
659  real (r8) :: gsw_gibbs_ice_pt0_pt0
660  end function gsw_gibbs_ice_pt0_pt0
661 
662  elemental function gsw_gibbs_pt0_pt0 (sa, pt0)
664  implicit none
665  real (r8), intent(in) :: sa, pt0
666  real (r8) :: gsw_gibbs_pt0_pt0
667  end function gsw_gibbs_pt0_pt0
668 
669  elemental function gsw_grav (lat, p)
671  implicit none
672  real (r8), intent(in) :: lat, p
673  real (r8) :: gsw_grav
674  end function gsw_grav
675 
676  elemental function gsw_helmholtz_energy_ice (t, p)
678  implicit none
679  real (r8), intent(in) :: t, p
680  real (r8) :: gsw_helmholtz_energy_ice
681  end function gsw_helmholtz_energy_ice
682 
683  elemental function gsw_hill_ratio_at_sp2 (t)
685  implicit none
686  real (r8), intent(in) :: t
687  real (r8) :: gsw_hill_ratio_at_sp2
688  end function gsw_hill_ratio_at_sp2
689 
690  elemental subroutine gsw_ice_fraction_to_freeze_seawater (sa, ct, p, &
691  t_ih, sa_freeze, ct_freeze, w_ih)
693  implicit none
694  real (r8), intent(in) :: sa, ct, p, t_ih
695  real (r8), intent(out) :: sa_freeze, ct_freeze, w_ih
697 
698  elemental function gsw_internal_energy (sa, ct, p)
700  implicit none
701  real (r8), intent(in) :: sa, ct, p
702  real (r8) :: gsw_internal_energy
703  end function gsw_internal_energy
704 
705  elemental function gsw_internal_energy_ice (t, p)
707  implicit none
708  real (r8), intent(in) :: t, p
709  real (r8) :: gsw_internal_energy_ice
710  end function gsw_internal_energy_ice
711 
712  pure subroutine gsw_ipv_vs_fnsquared_ratio (sa, ct, p, p_ref, &
713  ipv_vs_fnsquared_ratio, p_mid)
715  implicit none
716  real (r8), intent(in) :: sa(:), ct(:), p(:), p_ref
717  real (r8), intent(out) :: ipv_vs_fnsquared_ratio(:), p_mid(:)
718  end subroutine gsw_ipv_vs_fnsquared_ratio
719 
720  elemental function gsw_kappa (sa, ct, p)
722  implicit none
723  real (r8), intent(in) :: sa, ct, p
724  real (r8) :: gsw_kappa
725  end function gsw_kappa
726 
727  elemental function gsw_kappa_const_t_ice (t, p)
729  implicit none
730  real (r8), intent(in) :: t, p
731  real (r8) :: gsw_kappa_const_t_ice
732  end function gsw_kappa_const_t_ice
733 
734  elemental function gsw_kappa_ice (t, p)
736  implicit none
737  real (r8), intent(in) :: t, p
738  real (r8) :: gsw_kappa_ice
739  end function gsw_kappa_ice
740 
741  elemental function gsw_kappa_t_exact (sa, t, p)
743  implicit none
744  real (r8), intent(in) :: sa, t, p
745  real (r8) :: gsw_kappa_t_exact
746  end function gsw_kappa_t_exact
747 
748  elemental function gsw_latentheat_evap_ct (sa, ct)
750  implicit none
751  real (r8), intent(in) :: sa, ct
752  real (r8) :: gsw_latentheat_evap_ct
753  end function gsw_latentheat_evap_ct
754 
755  elemental function gsw_latentheat_evap_t (sa, t)
757  implicit none
758  real (r8), intent(in) :: sa, t
759  real (r8) :: gsw_latentheat_evap_t
760  end function gsw_latentheat_evap_t
761 
762  elemental function gsw_latentheat_melting (sa, p)
764  implicit none
765  real (r8), intent(in) :: sa, p
766  real (r8) :: gsw_latentheat_melting
767  end function gsw_latentheat_melting
768 
769  pure subroutine gsw_linear_interp_sa_ct (sa, ct, p, p_i, sa_i, ct_i)
771  implicit none
772  real (r8), intent(in) :: sa(:), ct(:), p(:), p_i(:)
773  real (r8), intent(out) :: sa_i(:), ct_i(:)
774  end subroutine gsw_linear_interp_sa_ct
775 
776  elemental function gsw_melting_ice_equilibrium_sa_ct_ratio (sa, p)
778  implicit none
779  real (r8), intent(in) :: sa, p
782 
785  implicit none
786  real (r8), intent(in) :: sa, p
789 
790  elemental subroutine gsw_melting_ice_into_seawater (sa, ct, p, w_ih, t_ih,&
791  sa_final, ct_final, w_ih_final)
793  implicit none
794  real (r8), intent(in) :: sa, ct, p, w_ih, t_ih
795  real (r8), intent(out) :: sa_final, ct_final, w_ih_final
796  end subroutine gsw_melting_ice_into_seawater
797 
798  elemental function gsw_melting_ice_sa_ct_ratio (sa, ct, p, t_ih)
800  implicit none
801  real (r8), intent(in) :: sa, ct, p, t_ih
802  real (r8) :: gsw_melting_ice_sa_ct_ratio
803  end function gsw_melting_ice_sa_ct_ratio
804 
805  elemental function gsw_melting_ice_sa_ct_ratio_poly (sa, ct, p, t_ih)
807  implicit none
808  real (r8), intent(in) :: sa, ct, p, t_ih
811 
814  implicit none
815  real (r8), intent(in) :: sa, p
818 
821  implicit none
822  real (r8), intent(in) :: sa, p
825 
826  elemental subroutine gsw_melting_seaice_into_seawater (sa, ct, p, &
827  w_seaice, sa_seaice, t_seaice, sa_final, ct_final)
829  implicit none
830  real (r8), intent(in) :: sa, ct, p, w_seaice, sa_seaice, t_seaice
831  real (r8), intent(out) :: sa_final, ct_final
832  end subroutine gsw_melting_seaice_into_seawater
833 
834  elemental function gsw_melting_seaice_sa_ct_ratio (sa, ct, p, sa_seaice, &
835  t_seaice)
837  implicit none
838  real (r8), intent(in) :: sa, ct, p, sa_seaice, t_seaice
839  real (r8) :: gsw_melting_seaice_sa_ct_ratio
840  end function gsw_melting_seaice_sa_ct_ratio
841 
842  elemental function gsw_melting_seaice_sa_ct_ratio_poly (sa, ct, p, &
843  sa_seaice, t_seaice)
845  implicit none
846  real (r8), intent(in) :: sa, ct, p, sa_seaice, t_seaice
849 
850  pure function gsw_mlp (sa, ct, p)
852  implicit none
853  real (r8), intent(in) :: sa(:), ct(:), p(:)
854  real (r8) :: gsw_mlp
855  end function gsw_mlp
856 
857  pure subroutine gsw_nsquared (sa, ct, p, lat, n2, p_mid)
859  implicit none
860  real (r8), intent(in) :: sa(:), ct(:), p(:), lat(:)
861  real (r8), intent(out) :: n2(:), p_mid(:)
862  end subroutine gsw_nsquared
863 
864  elemental function gsw_nsquared_lowerlimit (p, long, lat)
866  implicit none
867  real (r8), intent(in) :: p, long, lat
868  real (r8) :: gsw_nsquared_lowerlimit
869  end function gsw_nsquared_lowerlimit
870 
871  pure subroutine gsw_nsquared_min (sa, ct, p, lat, n2, n2_p, &
872  n2_specvol, n2_alpha, n2_beta, dsa, dct, dp)
874  implicit none
875  real (r8), intent(in) :: sa(:), ct(:), p(:), lat(:)
876  real (r8), intent(out) :: n2(:), n2_p(:), n2_specvol(:), n2_alpha(:)
877  real (r8), intent(out) :: n2_beta(:), dsa(:), dct(:), dp(:)
878  end subroutine gsw_nsquared_min
879 
880  pure subroutine gsw_nsquared_min_const_t (sa, t, p, lat, n2, n2_p, &
881  n2_specvol, n2_alpha, n2_beta, dsa, dct, dp, n2_beta_ratio)
883  implicit none
884  real (r8), intent(in) :: sa(:), t(:), p(:), lat
885  real (r8), intent(out) :: n2(:), n2_p(:), n2_specvol(:), n2_alpha(:)
886  real (r8), intent(out) :: n2_beta(:), dsa(:), dct(:), dp(:)
887  real (r8), intent(out) :: n2_beta_ratio(:)
888  end subroutine gsw_nsquared_min_const_t
889 
890  elemental function gsw_p_from_z (z, lat, geo_strf_dyn_height, &
891  sea_surface_geopotental)
893  implicit none
894  real (r8), intent(in) :: z, lat
895  real (r8), intent(in), optional :: geo_strf_dyn_height
896  real (r8), intent(in), optional :: sea_surface_geopotental
897  real (r8) :: gsw_p_from_z
898  end function gsw_p_from_z
899 
900  elemental function gsw_pot_enthalpy_from_pt_ice (pt0_ice)
902  implicit none
903  real (r8), intent(in) :: pt0_ice
904  real (r8) :: gsw_pot_enthalpy_from_pt_ice
905  end function gsw_pot_enthalpy_from_pt_ice
906 
907  elemental function gsw_pot_enthalpy_from_pt_ice_poly (pt0_ice)
909  implicit none
910  real (r8), intent(in) :: pt0_ice
913 
914  elemental function gsw_pot_enthalpy_ice_freezing (sa, p)
916  implicit none
917  real (r8), intent(in) :: sa, p
918  real (r8) :: gsw_pot_enthalpy_ice_freezing
919  end function gsw_pot_enthalpy_ice_freezing
920 
922  p, pot_enthalpy_ice_freezing_sa, pot_enthalpy_ice_freezing_p)
924  implicit none
925  real (r8), intent(in) :: sa, p
926  real (r8), intent(out), optional :: pot_enthalpy_ice_freezing_sa
927  real (r8), intent(out), optional :: pot_enthalpy_ice_freezing_p
929 
931  sa, p, pot_enthalpy_ice_freezing_sa, pot_enthalpy_ice_freezing_p)
933  implicit none
934  real (r8), intent(in) :: sa, p
935  real (r8), intent(out), optional :: pot_enthalpy_ice_freezing_sa
936  real (r8), intent(out), optional :: pot_enthalpy_ice_freezing_p
938 
939  elemental function gsw_pot_enthalpy_ice_freezing_poly (sa, p)
941  implicit none
942  real (r8), intent(in) :: sa, p
945 
946  elemental function gsw_pot_rho_t_exact (sa, t, p, p_ref)
948  implicit none
949  real (r8), intent(in) :: sa, t, p, p_ref
950  real (r8) :: gsw_pot_rho_t_exact
951  end function gsw_pot_rho_t_exact
952 
953  elemental function gsw_pressure_coefficient_ice (t, p)
955  implicit none
956  real (r8), intent(in) :: t, p
957  real (r8) :: gsw_pressure_coefficient_ice
958  end function gsw_pressure_coefficient_ice
959 
960  elemental function gsw_pressure_freezing_ct (sa, ct, saturation_fraction)
962  implicit none
963  real (r8), intent(in) :: sa, ct, saturation_fraction
964  real (r8) :: gsw_pressure_freezing_ct
965  end function gsw_pressure_freezing_ct
966 
967  elemental function gsw_pt0_cold_ice_poly (pot_enthalpy_ice)
969  implicit none
970  real (r8), intent(in) :: pot_enthalpy_ice
971  real (r8) :: gsw_pt0_cold_ice_poly
972  end function gsw_pt0_cold_ice_poly
973 
974  elemental function gsw_pt0_from_t (sa, t, p)
976  implicit none
977  real (r8), intent(in) :: sa, t, p
978  real (r8) :: gsw_pt0_from_t
979  end function gsw_pt0_from_t
980 
981  elemental function gsw_pt0_from_t_ice (t, p)
983  implicit none
984  real (r8), intent(in) :: t, p
985  real (r8) :: gsw_pt0_from_t_ice
986  end function gsw_pt0_from_t_ice
987 
988  elemental subroutine gsw_pt_first_derivatives (sa, ct, pt_sa, pt_ct)
990  implicit none
991  real (r8), intent(in) :: sa, ct
992  real (r8), intent(out), optional :: pt_sa, pt_ct
993  end subroutine gsw_pt_first_derivatives
994 
995  elemental function gsw_pt_from_ct (sa, ct)
997  implicit none
998  real (r8), intent(in) :: sa, ct
999  real (r8) :: gsw_pt_from_ct
1000  end function gsw_pt_from_ct
1001 
1002  elemental function gsw_pt_from_entropy (sa, entropy)
1004  implicit none
1005  real (r8), intent(in) :: sa, entropy
1006  real (r8) :: gsw_pt_from_entropy
1007  end function gsw_pt_from_entropy
1008 
1009  elemental function gsw_pt_from_pot_enthalpy_ice (pot_enthalpy_ice)
1011  implicit none
1012  real (r8), intent(in) :: pot_enthalpy_ice
1013  real (r8) :: gsw_pt_from_pot_enthalpy_ice
1014  end function gsw_pt_from_pot_enthalpy_ice
1015 
1016  elemental function gsw_pt_from_pot_enthalpy_ice_poly (pot_enthalpy_ice)
1018  implicit none
1019  real (r8), intent(in) :: pot_enthalpy_ice
1022 
1023  elemental function gsw_pt_from_pot_enthalpy_ice_poly_dh (pot_enthalpy_ice)
1025  implicit none
1026  real (r8), intent(in) :: pot_enthalpy_ice
1029 
1030  elemental function gsw_pt_from_t (sa, t, p, p_ref)
1032  implicit none
1033  real (r8), intent(in) :: sa, t, p, p_ref
1034  real (r8) :: gsw_pt_from_t
1035  end function gsw_pt_from_t
1036 
1037  elemental function gsw_pt_from_t_ice (t, p, p_ref)
1039  implicit none
1040  real (r8), intent(in) :: t, p, p_ref
1041  real (r8) :: gsw_pt_from_t_ice
1042  end function gsw_pt_from_t_ice
1043 
1044  elemental subroutine gsw_pt_second_derivatives (sa, ct, pt_sa_sa, &
1045  pt_sa_ct, pt_ct_ct)
1047  implicit none
1048  real (r8), intent(in) :: sa, ct
1049  real (r8), intent(out), optional :: pt_sa_sa, pt_sa_ct, pt_ct_ct
1050  end subroutine gsw_pt_second_derivatives
1051 
1052  elemental function gsw_rho (sa, ct, p)
1054  implicit none
1055  real (r8), intent(in) :: sa, ct, p
1056  real (r8) :: gsw_rho
1057  end function gsw_rho
1058 
1059  elemental subroutine gsw_rho_alpha_beta (sa, ct, p, rho, alpha, beta)
1061  implicit none
1062  real (r8), intent(in) :: sa, ct, p
1063  real (r8), intent(out), optional :: rho, alpha, beta
1064  end subroutine gsw_rho_alpha_beta
1065 
1066  elemental subroutine gsw_rho_alpha_beta_bsq (sa, ct, p, rho, alpha, beta, &
1067  stiffened)
1069  implicit none
1070  real (r8), intent(in) :: sa, ct, p
1071  logical, intent(in), optional :: stiffened
1072  real (r8), intent(out) :: rho
1073  real (r8), intent(out), optional :: alpha, beta
1074  end subroutine gsw_rho_alpha_beta_bsq
1075 
1076  elemental subroutine gsw_rho_first_derivatives (sa, ct, p, drho_dsa, &
1077  drho_dct, drho_dp)
1079  implicit none
1080  real (r8), intent(in) :: sa, ct, p
1081  real (r8), intent(out), optional :: drho_dsa, drho_dct, drho_dp
1082  end subroutine gsw_rho_first_derivatives
1083 
1084  elemental subroutine gsw_rho_first_derivatives_wrt_enthalpy (sa, ct, p, &
1085  rho_sa, rho_h)
1087  implicit none
1088  real (r8), intent(in) :: sa, ct, p
1089  real (r8), intent(out), optional :: rho_sa, rho_h
1091 
1092  elemental function gsw_rho_ice (t, p)
1094  implicit none
1095  real (r8), intent(in) :: t, p
1096  real (r8) :: gsw_rho_ice
1097  end function gsw_rho_ice
1098 
1099  elemental subroutine gsw_rho_second_derivatives (sa, ct, p, rho_sa_sa, &
1100  rho_sa_ct, rho_ct_ct, rho_sa_p, rho_ct_p)
1102  implicit none
1103  real (r8), intent(in) :: sa, ct, p
1104  real (r8), intent(out), optional :: rho_sa_sa, rho_sa_ct, rho_ct_ct
1105  real (r8), intent(out), optional :: rho_sa_p, rho_ct_p
1106  end subroutine gsw_rho_second_derivatives
1107 
1108  elemental subroutine gsw_rho_second_derivatives_wrt_enthalpy (sa, ct, p, &
1109  rho_sa_sa, rho_sa_h, rho_h_h)
1111  implicit none
1112  real (r8), intent(in) :: sa, ct, p
1113  real (r8), intent(out), optional :: rho_sa_sa, rho_sa_h, rho_h_h
1115 
1116  elemental function gsw_rho_t_exact (sa, t, p)
1118  implicit none
1119  real (r8), intent(in) :: sa, t, p
1120  real (r8) :: gsw_rho_t_exact
1121  end function gsw_rho_t_exact
1122 
1123  pure subroutine gsw_rr68_interp_sa_ct (sa, ct, p, p_i, sa_i, ct_i)
1125  implicit none
1126  real (r8), intent(in) :: sa(:), ct(:), p(:), p_i(:)
1127  real (r8), intent(out) :: sa_i(:), ct_i(:)
1128  end subroutine gsw_rr68_interp_sa_ct
1129 
1130  elemental function gsw_sa_freezing_estimate (p, saturation_fraction, ct, t)
1132  implicit none
1133  real (r8), intent(in) :: p, saturation_fraction
1134  real (r8), intent(in), optional :: ct, t
1135  real (r8) :: gsw_sa_freezing_estimate
1136  end function gsw_sa_freezing_estimate
1137 
1138  elemental function gsw_sa_freezing_from_ct (ct, p, saturation_fraction)
1140  implicit none
1141  real (r8), intent(in) :: ct, p, saturation_fraction
1142  real (r8) :: gsw_sa_freezing_from_ct
1143  end function gsw_sa_freezing_from_ct
1144 
1145  elemental function gsw_sa_freezing_from_ct_poly (ct, p, saturation_fraction)
1147  implicit none
1148  real (r8), intent(in) :: ct, p, saturation_fraction
1149  real (r8) :: gsw_sa_freezing_from_ct_poly
1150  end function gsw_sa_freezing_from_ct_poly
1151 
1152  elemental function gsw_sa_freezing_from_t (t, p, saturation_fraction)
1154  implicit none
1155  real (r8), intent(in) :: t, p, saturation_fraction
1156  real (r8) :: gsw_sa_freezing_from_t
1157  end function gsw_sa_freezing_from_t
1158 
1159  elemental function gsw_sa_freezing_from_t_poly (t, p, saturation_fraction)
1161  implicit none
1162  real (r8), intent(in) :: t, p, saturation_fraction
1163  real (r8) :: gsw_sa_freezing_from_t_poly
1164  end function gsw_sa_freezing_from_t_poly
1165 
1166  elemental function gsw_sa_from_rho (rho, ct, p)
1168  implicit none
1169  real (r8), intent(in) :: rho, ct, p
1170  real (r8) :: gsw_sa_from_rho
1171  end function gsw_sa_from_rho
1172 
1173  elemental function gsw_sa_from_sp (sp, p, long, lat)
1175  implicit none
1176  real (r8), intent(in) :: sp, p, long, lat
1177  real (r8) :: gsw_sa_from_sp
1178  end function gsw_sa_from_sp
1179 
1180  elemental function gsw_sa_from_sp_baltic (sp, long, lat)
1182  implicit none
1183  real (r8), intent(in) :: sp, long, lat
1184  real (r8) :: gsw_sa_from_sp_baltic
1185  end function gsw_sa_from_sp_baltic
1186 
1187  elemental function gsw_sa_from_sstar (sstar, p, long, lat)
1189  implicit none
1190  real (r8), intent(in) :: sstar, p, long, lat
1191  real (r8) :: gsw_sa_from_sstar
1192  end function gsw_sa_from_sstar
1193 
1194  elemental function gsw_sa_p_inrange (sa, p)
1196  implicit none
1197  real (r8), intent(in) :: sa, p
1198  logical :: gsw_sa_p_inrange
1199  end function gsw_sa_p_inrange
1200 
1201  elemental function gsw_saar (p, long, lat)
1203  implicit none
1204  real (r8), intent(in) :: p, long, lat
1205  real (r8) :: gsw_saar
1206  end function gsw_saar
1207 
1208  elemental subroutine gsw_seaice_fraction_to_freeze_seawater (sa, ct, p, &
1209  sa_seaice, t_seaice, sa_freeze, ct_freeze, w_seaice)
1211  implicit none
1212  real (r8), intent(in) :: sa, ct, p, sa_seaice, t_seaice
1213  real (r8), intent(out) :: sa_freeze, ct_freeze, w_seaice
1215 
1216  elemental function gsw_sigma0 (sa, ct)
1218  implicit none
1219  real (r8), intent(in) :: sa, ct
1220  real (r8) :: gsw_sigma0
1221  end function gsw_sigma0
1222 
1223  elemental function gsw_sigma1 (sa, ct)
1225  implicit none
1226  real (r8), intent(in) :: sa, ct
1227  real (r8) :: gsw_sigma1
1228  end function gsw_sigma1
1229 
1230  elemental function gsw_sigma2 (sa, ct)
1232  implicit none
1233  real (r8), intent(in) :: sa, ct
1234  real (r8) :: gsw_sigma2
1235  end function gsw_sigma2
1236 
1237  elemental function gsw_sigma3 (sa, ct)
1239  implicit none
1240  real (r8), intent(in) :: sa, ct
1241  real (r8) :: gsw_sigma3
1242  end function gsw_sigma3
1243 
1244  elemental function gsw_sigma4 (sa, ct)
1246  implicit none
1247  real (r8), intent(in) :: sa, ct
1248  real (r8) :: gsw_sigma4
1249  end function gsw_sigma4
1250 
1251  elemental function gsw_sound_speed (sa, ct, p)
1253  implicit none
1254  real (r8), intent(in) :: sa, ct, p
1255  real (r8) :: gsw_sound_speed
1256  end function gsw_sound_speed
1257 
1258  elemental function gsw_sound_speed_ice (t, p)
1260  implicit none
1261  real (r8), intent(in) :: t, p
1262  real (r8) :: gsw_sound_speed_ice
1263  end function gsw_sound_speed_ice
1264 
1265  elemental function gsw_sound_speed_t_exact (sa, t, p)
1267  implicit none
1268  real (r8), intent(in) :: sa, t, p
1269  real (r8) :: gsw_sound_speed_t_exact
1270  end function gsw_sound_speed_t_exact
1271 
1272  elemental function gsw_sp_from_c (c, t, p)
1274  implicit none
1275  real (r8), intent(in) :: c, t, p
1276  real (r8) :: gsw_sp_from_c
1277  end function gsw_sp_from_c
1278 
1279  elemental function gsw_sp_from_sa (sa, p, long, lat)
1281  implicit none
1282  real (r8), intent(in) :: sa, p, long, lat
1283  real (r8) :: gsw_sp_from_sa
1284  end function gsw_sp_from_sa
1285 
1286  elemental function gsw_sp_from_sa_baltic (sa, long, lat)
1288  implicit none
1289  real (r8), intent(in) :: sa, long, lat
1290  real (r8) :: gsw_sp_from_sa_baltic
1291  end function gsw_sp_from_sa_baltic
1292 
1293  elemental function gsw_sp_from_sk (sk)
1295  implicit none
1296  real (r8), intent(in) :: sk
1297  real (r8) :: gsw_sp_from_sk
1298  end function gsw_sp_from_sk
1299 
1300  elemental function gsw_sp_from_sr (sr)
1302  implicit none
1303  real (r8), intent(in) :: sr
1304  real (r8) :: gsw_sp_from_sr
1305  end function gsw_sp_from_sr
1306 
1307  elemental function gsw_sp_from_sstar (sstar, p, long, lat)
1309  implicit none
1310  real (r8), intent(in) :: sstar, p, long, lat
1311  real (r8) :: gsw_sp_from_sstar
1312  end function gsw_sp_from_sstar
1313 
1314  elemental function gsw_specvol (sa, ct, p)
1316  implicit none
1317  real (r8), intent(in) :: sa, ct, p
1318  real (r8) :: gsw_specvol
1319  end function gsw_specvol
1320 
1321  elemental subroutine gsw_specvol_alpha_beta (sa, ct, p, specvol, alpha, &
1322  beta)
1324  implicit none
1325  real (r8), intent(in) :: sa, ct, p
1326  real (r8), intent(out), optional :: specvol, alpha, beta
1327  end subroutine gsw_specvol_alpha_beta
1328 
1329  elemental function gsw_specvol_anom_standard (sa, ct, p)
1331  implicit none
1332  real (r8), intent(in) :: sa, ct, p
1333  real (r8) :: gsw_specvol_anom_standard
1334  end function gsw_specvol_anom_standard
1335 
1336  elemental subroutine gsw_specvol_first_derivatives (sa, ct, p, v_sa, v_ct, &
1337  v_p, iflag)
1339  implicit none
1340  real (r8), intent(in) :: sa, ct, p
1341  integer, intent(in), optional :: iflag
1342  real (r8), intent(out), optional :: v_sa, v_ct, v_p
1343  end subroutine gsw_specvol_first_derivatives
1344 
1345  elemental subroutine gsw_specvol_first_derivatives_wrt_enthalpy (sa, ct, &
1346  p, v_sa, v_h, iflag)
1348  implicit none
1349  real (r8), intent(in) :: sa, ct, p
1350  integer, intent(in), optional :: iflag
1351  real (r8), intent(out), optional :: v_sa, v_h
1353 
1354  elemental function gsw_specvol_ice (t, p)
1356  implicit none
1357  real (r8), intent(in) :: t, p
1358  real (r8) :: gsw_specvol_ice
1359  end function gsw_specvol_ice
1360 
1361  elemental subroutine gsw_specvol_second_derivatives (sa, ct, p, v_sa_sa, &
1362  v_sa_ct, v_ct_ct, v_sa_p, v_ct_p, iflag)
1364  implicit none
1365  real (r8), intent(in) :: sa, ct, p
1366  integer, intent(in), optional :: iflag
1367  real (r8), intent(out), optional :: v_sa_sa, v_sa_ct, v_ct_ct, v_sa_p, v_ct_p
1368  end subroutine gsw_specvol_second_derivatives
1369 
1370  elemental subroutine gsw_specvol_second_derivatives_wrt_enthalpy (sa, ct, &
1371  p, v_sa_sa, v_sa_h, v_h_h, iflag)
1373  implicit none
1374  real (r8), intent(in) :: sa, ct, p
1375  integer, intent(in), optional :: iflag
1376  real (r8), intent(out), optional :: v_sa_sa, v_sa_h, v_h_h
1378 
1379  elemental function gsw_specvol_sso_0 (p)
1381  implicit none
1382  real (r8), intent(in) :: p
1383  real (r8) :: gsw_specvol_sso_0
1384  end function gsw_specvol_sso_0
1385 
1386  elemental function gsw_specvol_t_exact (sa, t, p)
1388  implicit none
1389  real (r8), intent(in) :: sa, t, p
1390  real (r8) :: gsw_specvol_t_exact
1391  end function gsw_specvol_t_exact
1392 
1393  elemental function gsw_spiciness0 (sa, ct)
1395  implicit none
1396  real (r8), intent(in) :: sa, ct
1397  real (r8) :: gsw_spiciness0
1398  end function gsw_spiciness0
1399 
1400  elemental function gsw_spiciness1 (sa, ct)
1402  implicit none
1403  real (r8), intent(in) :: sa, ct
1404  real (r8) :: gsw_spiciness1
1405  end function gsw_spiciness1
1406 
1407  elemental function gsw_spiciness2 (sa, ct)
1409  implicit none
1410  real (r8), intent(in) :: sa, ct
1411  real (r8) :: gsw_spiciness2
1412  end function gsw_spiciness2
1413 
1414  elemental function gsw_sr_from_sp (sp)
1416  implicit none
1417  real (r8), intent(in) :: sp
1418  real (r8) :: gsw_sr_from_sp
1419  end function gsw_sr_from_sp
1420 
1421  elemental function gsw_sstar_from_sa (sa, p, long, lat)
1423  implicit none
1424  real (r8), intent(in) :: sa, p, long, lat
1425  real (r8) :: gsw_sstar_from_sa
1426  end function gsw_sstar_from_sa
1427 
1428  elemental function gsw_sstar_from_sp (sp, p, long, lat)
1430  implicit none
1431  real (r8), intent(in) :: sp, p, long, lat
1432  real (r8) :: gsw_sstar_from_sp
1433  end function gsw_sstar_from_sp
1434 
1435  elemental function gsw_t_deriv_chem_potential_water_t_exact (sa, t, p)
1437  implicit none
1438  real (r8), intent(in) :: sa, t, p
1441 
1442  elemental function gsw_t_freezing (sa, p, saturation_fraction, poly)
1444  implicit none
1445  real (r8), intent(in) :: sa, p, saturation_fraction
1446  logical, intent(in), optional :: poly
1447  real (r8) :: gsw_t_freezing
1448  end function gsw_t_freezing
1449 
1450  elemental function gsw_t_freezing_exact (sa, p, saturation_fraction)
1452  implicit none
1453  real (r8), intent(in) :: sa, p, saturation_fraction
1454  real (r8) :: gsw_t_freezing_exact
1455  end function gsw_t_freezing_exact
1456 
1457  elemental subroutine gsw_t_freezing_first_derivatives (sa, p, &
1458  saturation_fraction, tfreezing_sa, tfreezing_p)
1460  implicit none
1461  real (r8), intent(in) :: sa, p, saturation_fraction
1462  real (r8), intent(out), optional :: tfreezing_sa, tfreezing_p
1463  end subroutine gsw_t_freezing_first_derivatives
1464 
1465  elemental subroutine gsw_t_freezing_first_derivatives_poly (sa, p, &
1466  saturation_fraction, tfreezing_sa, tfreezing_p)
1468  implicit none
1469  real (r8), intent(in) :: sa, p, saturation_fraction
1470  real (r8), intent(out), optional :: tfreezing_sa, tfreezing_p
1472 
1473  elemental function gsw_t_freezing_poly (sa, p, saturation_fraction, polynomial)
1475  implicit none
1476  real (r8), intent(in) :: sa, p
1477  real (r8), intent(in), optional :: saturation_fraction
1478  logical, intent(in), optional :: polynomial
1479  real (r8) :: gsw_t_freezing_poly
1480  end function gsw_t_freezing_poly
1481 
1482  elemental function gsw_t_from_ct (sa, ct, p)
1484  implicit none
1485  real (r8), intent(in) :: sa, ct, p
1486  real (r8) :: gsw_t_from_ct
1487  end function gsw_t_from_ct
1488 
1489  elemental function gsw_t_from_pt0_ice (pt0_ice, p)
1491  implicit none
1492  real (r8), intent(in) :: pt0_ice, p
1493  real (r8) :: gsw_t_from_pt0_ice
1494  end function gsw_t_from_pt0_ice
1495 
1496  elemental function gsw_thermobaric (sa, ct, p)
1498  implicit none
1499  real (r8), intent(in) :: sa, ct, p
1500  real (r8) :: gsw_thermobaric
1501  end function gsw_thermobaric
1502 
1503  pure subroutine gsw_turner_rsubrho (sa, ct, p, tu, rsubrho, p_mid)
1505  implicit none
1506  real (r8), intent(in) :: sa(:), ct(:), p(:)
1507  real (r8), intent(out) :: tu(:), rsubrho(:), p_mid(:)
1508  end subroutine gsw_turner_rsubrho
1509 
1510  pure function gsw_util_indx (x, z, kstart) result(ki)
1512  implicit none
1513  real (r8), intent(in) :: x(:), z
1514  integer, intent(in), optional :: kstart
1515  integer :: ki
1516  end function gsw_util_indx
1517 
1518  pure function gsw_util_interp1q_int (x, iy, x_i) result(y_i)
1520  implicit none
1521  integer, intent(in) :: iy(:)
1522  real (r8), intent(in) :: x(:), x_i(:)
1523  real (r8) :: y_i(size(x_i))
1524  end function gsw_util_interp1q_int
1525 
1526  pure function gsw_util_xinterp1 (x, y, x0)
1528  implicit none
1529  real (r8), intent(in) :: x0
1530  real (r8), intent(in) :: x(:), y(:)
1531  real (r8) :: gsw_util_xinterp1
1532  end function gsw_util_xinterp1
1533 
1534  elemental function gsw_z_from_p (p, lat, geo_strf_dyn_height, &
1535  sea_surface_geopotental)
1537  implicit none
1538  real (r8), intent(in) :: p, lat
1539  real (r8), intent(in), optional :: geo_strf_dyn_height
1540  real (r8), intent(in), optional :: sea_surface_geopotental
1541  real (r8) :: gsw_z_from_p
1542  end function gsw_z_from_p
1543 
1544 end interface
1545 
1546 end module gsw_mod_toolbox
integer, parameter, public long
Definition: Type_Kinds.f90:76
************************************************************************GNU Lesser General Public License **This file is part of the GFDL Flexible Modeling System(FMS). ! *! *FMS is free software without even the implied warranty of MERCHANTABILITY or *FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License *for more details **You should have received a copy of the GNU Lesser General Public *License along with FMS If see< http:! ***********************************************************************subroutine READ_RECORD_CORE_(unit, field, nwords, data, start, axsiz) integer, intent(in) ::unit type(fieldtype), intent(in) ::field integer, intent(in) ::nwords MPP_TYPE_, intent(inout) ::data(nwords) integer, intent(in) ::start(:), axsiz(:) integer(SHORT_KIND) ::i2vals(nwords)!rab used in conjunction with transfer intrinsic to determine size of a variable integer(KIND=1) ::one_byte(8) integer ::word_sz!#ifdef __sgi integer(INT_KIND) ::ivals(nwords) real(FLOAT_KIND) ::rvals(nwords)!#else! integer ::ivals(nwords)! real ::rvals(nwords)!#endif real(DOUBLE_KIND) ::r8vals(nwords) pointer(ptr1, i2vals) pointer(ptr2, ivals) pointer(ptr3, rvals) pointer(ptr4, r8vals) if(mpp_io_stack_size< nwords) call mpp_io_set_stack_size(nwords) call mpp_error(FATAL, 'MPP_READ currently requires use_netCDF option') end subroutine READ_RECORD_CORE_ subroutine READ_RECORD_(unit, field, nwords, data, time_level, domain, position, tile_count, start_in, axsiz_in)!routine that is finally called by all mpp_read routines to perform the read!a non-netCDF record contains:! field ID! a set of 4 coordinates(is:ie, js:je) giving the data subdomain! a timelevel and a timestamp(=NULLTIME if field is static)! 3D real data(stored as 1D)!if you are using direct access I/O, the RECL argument to OPEN must be large enough for the above!in a global direct access file, record position on PE is given by %record.!Treatment of timestamp:! We assume that static fields have been passed without a timestamp.! Here that is converted into a timestamp of NULLTIME.! For non-netCDF fields, field is treated no differently, but is written! with a timestamp of NULLTIME. There is no check in the code to prevent! the user from repeatedly writing a static field. integer, intent(in) ::unit, nwords type(fieldtype), intent(in) ::field MPP_TYPE_, intent(inout) ::data(nwords) integer, intent(in), optional ::time_level type(domain2D), intent(in), optional ::domain integer, intent(in), optional ::position, tile_count integer, intent(in), optional ::start_in(:), axsiz_in(:) integer, dimension(size(field%axes(:))) ::start, axsiz integer ::tlevel !, subdomain(4) integer ::i, error, is, ie, js, je, isg, ieg, jsg, jeg type(domain2d), pointer ::io_domain=> tlevel if(PRESENT(start_in) .AND. PRESENT(axsiz_in)) then if(size(start(! the data domain and compute domain must refer to the subdomain being passed ! In this ! since that attempts to gather all data on PE size(field%axes(:)) axsiz(i)