FV3 Bundle
gsw_sa_freezing_estimate.f90
Go to the documentation of this file.
1 !==========================================================================
2 elemental function gsw_sa_freezing_estimate (p, saturation_fraction, ct, t)
3 !==========================================================================
4 !
5 ! Form an estimate of SA from a polynomial in CT and p
6 !
7 !--------------------------------------------------------------------------
8 
10 
12 
13 use gsw_mod_kinds
14 
15 implicit none
16 
17 real (r8), intent(in) :: p, saturation_fraction
18 real (r8), intent(in), optional :: ct, t
19 
20 real (r8) :: gsw_sa_freezing_estimate
21 
22 real (r8) :: ctx, ctsat, sa
23 
24 ! note that aa = 0.502500117621d0/35.16504
25 real (r8), parameter :: aa = 0.014289763856964_r8
26 real (r8), parameter :: bb = 0.057000649899720_r8
27 
28 real (r8), parameter :: p0 = 2.570124672768757e-1_r8
29 real (r8), parameter :: p1 = -1.917742353032266e1_r8
30 real (r8), parameter :: p2 = -1.413382858617969e-2_r8
31 real (r8), parameter :: p3 = -5.427484830917552e-1_r8
32 real (r8), parameter :: p4 = -4.126621135193472e-4_r8
33 real (r8), parameter :: p5 = -4.176407833276121e-7_r8
34 real (r8), parameter :: p6 = 4.688217641883641e-5_r8
35 real (r8), parameter :: p7 = -3.039808885885726e-8_r8
36 real (r8), parameter :: p8 = -4.990118091261456e-11_r8
37 real (r8), parameter :: p9 = -9.733920711119464e-9_r8
38 real (r8), parameter :: p10 = -7.723324202726337e-12_r8
39 real (r8), parameter :: p11 = 7.121854166249257e-16_r8
40 real (r8), parameter :: p12 = 1.256474634100811e-12_r8
41 real (r8), parameter :: p13 = 2.105103897918125e-15_r8
42 real (r8), parameter :: p14 = 8.663811778227171e-19_r8
43 
44 ! A very rough estimate of sa to get the saturated ct
45 if (present(ct)) then
46  sa = max(-(ct + 9e-4_r8*p)/0.06_r8, 0.0_r8)
47  ctx = ct
48 else if (present(t)) then
49  sa = max(-(t + 9e-4_r8*p)/0.06_r8, 0.0_r8)
50  ctx = gsw_ct_from_t(sa,t,p)
51 else
53  return
54 end if
55 
56 ! CTsat is the estimated value of CT if the seawater were saturated with
57 ! dissolved air, recognizing that it actually has the air fraction
58 ! saturation_fraction; see McDougall, Barker and Feistel, 2014).
59 
60 ctsat = ctx - (1.0_r8-saturation_fraction)* &
61  (1e-3_r8)*(2.4_r8-aa*sa)*(1.0_r8+bb*(1.0_r8-sa/gsw_sso))
62 
64  + p*(p2 + p4*ctsat + p*(p5 + ctsat*(p7 + p9*ctsat) &
65  + p*(p8 + ctsat*(p10 + p12*ctsat) + p*(p11 + p13*ctsat + p14*p)))) &
66  + ctsat*(p1 + ctsat*(p3 + p6*p))
67 
68 return
69 end function
70 
71 !--------------------------------------------------------------------------
elemental real(r8) function gsw_sa_freezing_estimate(p, saturation_fraction, ct, t)
#define max(a, b)
Definition: mosaic_util.h:33