FV3 Bundle
gsw_enthalpy_first_derivatives.f90
Go to the documentation of this file.
1
!==========================================================================
2
elemental subroutine
gsw_enthalpy_first_derivatives
(sa, ct, p, h_sa, h_ct)
3
!==========================================================================
4
!
5
! Calculates the following two derivatives of specific enthalpy (h) of
6
! seawater using the computationally-efficient expression for
7
! specific volume in terms of SA, CT and p (Roquet et al., 2014).
8
! (1) h_SA, the derivative with respect to Absolute Salinity at
9
! constant CT and p, and
10
! (2) h_CT, derivative with respect to CT at constant SA and p.
11
! Note that h_P is specific volume (1/rho) it can be caclulated by calling
12
! gsw_specvol(SA,CT,p).
13
!
14
! SA = Absolute Salinity [ g/kg ]
15
! CT = Conservative Temperature (ITS-90) [ deg C ]
16
! p = sea pressure [ dbar ]
17
! ( i.e. absolute pressure - 10.1325 dbar )
18
!
19
! h_SA = The first derivative of specific enthalpy with respect to
20
! Absolute Salinity at constant CT and p.
21
! [ J/(kg (g/kg))] i.e. [ J/g ]
22
! h_CT = The first derivative of specific enthalpy with respect to
23
! CT at constant SA and p. [ J/(kg K) ]
24
!--------------------------------------------------------------------------
25
26
use
gsw_mod_teos10_constants
,
only
:
gsw_cp0
,
gsw_sfac
,
offset
27
28
use
gsw_mod_specvol_coefficients
29
30
use
gsw_mod_kinds
31
32
implicit none
33
34
real (r8)
,
intent(in)
:: sa, ct, p
35
real (r8)
,
intent(out)
,
optional
:: h_sa, h_ct
36
37
real (r8)
:: dynamic_h_ct_part, dynamic_h_sa_part, xs, ys, z
38
39
xs = sqrt(
gsw_sfac
*sa +
offset
)
40
ys = ct*0.025_r8
41
z = p*1e-4_r8
42
43
if
(
present
(h_sa))
then
44
45
dynamic_h_sa_part = z*(
h101
+ xs*(2.0_r8*
h201
+ xs*(3.0_r8*
h301
&
46
+ xs*(4.0_r8*
h401
+ xs*(5.0_r8*
h501
+ 6.0_r8*
h601
*xs)))) + ys*(
h111
&
47
+ xs*(2.0_r8*
h211
+ xs*(3.0_r8*
h311
+ xs*(4.0_r8*
h411
&
48
+ 5.0_r8*
h511
*xs))) + ys*(
h121
+ xs*(2.0_r8*
h221
+ xs*(3.0_r8*
h321
&
49
+ 4.0_r8*
h421
*xs)) + ys*(
h131
+ xs*(2.0_r8*
h231
+ 3.0_r8*
h331
*xs) &
50
+ ys*(
h141
+ 2.0_r8*
h241
*xs +
h151
*ys)))) + z*(
h102
&
51
+ xs*(2.0_r8*
h202
+ xs*(3.0_r8*
h302
+ xs*(4.0_r8*
h402
&
52
+ 5.0_r8*
h502
*xs))) + ys*(
h112
+ xs*(2.0_r8*
h212
+ xs*(3.0_r8*
h312
&
53
+ 4.0_r8*
h412
*xs)) + ys*(
h122
+ xs*(2.0_r8*
h222
+ 3.0_r8*
h322
*xs) &
54
+ ys*(
h132
+ 2.0_r8*
h232
*xs +
h142
*ys ))) + z*(
h103
+ xs*(2.0_r8*
h203
&
55
+ xs*(3.0_r8*
h303
+ 4.0_r8*
h403
*xs)) + ys*(
h113
+ xs*(2.0_r8*
h213
&
56
+ 3.0_r8*
h313
*xs) + ys*(
h123
+ 2.0_r8*
h223
*xs +
h133
*ys)) &
57
+ z*(
h104
+ 2.0_r8*
h204
*xs +
h114
*ys +
h105
*z))))
58
59
h_sa = 1e8_r8*0.5_r8*
gsw_sfac
*dynamic_h_sa_part/xs
60
61
end if
62
63
if
(
present
(h_ct))
then
64
65
dynamic_h_ct_part = z*(
h011
+ xs*(
h111
+ xs*(
h211
+ xs*(
h311
+ xs*(
h411
&
66
+
h511
*xs)))) + ys*(2.0_r8*(
h021
+ xs*(
h121
+ xs*(
h221
+ xs*(
h321
&
67
+
h421
*xs)))) + ys*(3.0_r8*(
h031
+ xs*(
h131
+ xs*(
h231
+
h331
*xs))) &
68
+ ys*(4.0_r8*(
h041
+ xs*(
h141
+
h241
*xs)) + ys*(5.0_r8*(
h051
&
69
+
h151
*xs) + 6.0_r8*
h061
*ys)))) + z*(
h012
+ xs*(
h112
+ xs*(
h212
&
70
+ xs*(
h312
+
h412
*xs))) + ys*(2.0_r8*(
h022
+ xs*(
h122
+ xs*(
h222
&
71
+
h322
*xs))) + ys*(3.0_r8*(
h032
+ xs*(
h132
+
h232
*xs)) &
72
+ ys*(4.0_r8*(
h042
+
h142
*xs) + 5.0_r8*
h052
*ys))) + z*(
h013
&
73
+ xs*(
h113
+ xs*(
h213
+
h313
*xs)) + ys*(2.0_r8*(
h023
+ xs*(
h123
&
74
+
h223
*xs)) + ys*(3.0_r8*(
h033
+
h133
*xs) + 4.0_r8*
h043
*ys)) &
75
+ z*(
h014
+
h114
*xs + 2.0_r8*
h024
*ys +
h015
*z ))))
76
77
h_ct =
gsw_cp0
+ 1e8_r8*0.025_r8*dynamic_h_ct_part
78
79
end if
80
81
return
82
end subroutine
83
84
!--------------------------------------------------------------------------
gsw_mod_specvol_coefficients::h011
real(r8), parameter h011
Definition:
gsw_mod_specvol_coefficients.f90:166
gsw_mod_specvol_coefficients::h203
real(r8), parameter h203
Definition:
gsw_mod_specvol_coefficients.f90:204
gsw_mod_specvol_coefficients::h122
real(r8), parameter h122
Definition:
gsw_mod_specvol_coefficients.f90:194
gsw_mod_specvol_coefficients::h204
real(r8), parameter h204
Definition:
gsw_mod_specvol_coefficients.f90:205
gsw_mod_specvol_coefficients::h511
real(r8), parameter h511
Definition:
gsw_mod_specvol_coefficients.f90:232
gsw_mod_specvol_coefficients::h023
real(r8), parameter h023
Definition:
gsw_mod_specvol_coefficients.f90:173
gsw_mod_specvol_coefficients::h052
real(r8), parameter h052
Definition:
gsw_mod_specvol_coefficients.f90:182
gsw_mod_specvol_coefficients::h213
real(r8), parameter h213
Definition:
gsw_mod_specvol_coefficients.f90:208
gsw_mod_specvol_coefficients::h141
real(r8), parameter h141
Definition:
gsw_mod_specvol_coefficients.f90:199
gsw_mod_specvol_coefficients::h132
real(r8), parameter h132
Definition:
gsw_mod_specvol_coefficients.f90:197
gsw_mod_specvol_coefficients::h022
real(r8), parameter h022
Definition:
gsw_mod_specvol_coefficients.f90:172
gsw_mod_specvol_coefficients::h321
real(r8), parameter h321
Definition:
gsw_mod_specvol_coefficients.f90:221
gsw_mod_specvol_coefficients::h024
real(r8), parameter h024
Definition:
gsw_mod_specvol_coefficients.f90:174
gsw_mod_specvol_coefficients::h041
real(r8), parameter h041
Definition:
gsw_mod_specvol_coefficients.f90:180
gsw_mod_specvol_coefficients::h211
real(r8), parameter h211
Definition:
gsw_mod_specvol_coefficients.f90:206
gsw_mod_specvol_coefficients::h102
real(r8), parameter h102
Definition:
gsw_mod_specvol_coefficients.f90:185
gsw_mod_specvol_coefficients::h212
real(r8), parameter h212
Definition:
gsw_mod_specvol_coefficients.f90:207
gsw_mod_specvol_coefficients::h201
real(r8), parameter h201
Definition:
gsw_mod_specvol_coefficients.f90:202
gsw_mod_specvol_coefficients::h105
real(r8), parameter h105
Definition:
gsw_mod_specvol_coefficients.f90:188
gsw_mod_specvol_coefficients::h412
real(r8), parameter h412
Definition:
gsw_mod_specvol_coefficients.f90:229
gsw_mod_specvol_coefficients::h331
real(r8), parameter h331
Definition:
gsw_mod_specvol_coefficients.f90:223
gsw_mod_specvol_coefficients::h043
real(r8), parameter h043
Definition:
gsw_mod_specvol_coefficients.f90:179
gsw_mod_specvol_coefficients::h231
real(r8), parameter h231
Definition:
gsw_mod_specvol_coefficients.f90:212
gsw_mod_specvol_coefficients::h012
real(r8), parameter h012
Definition:
gsw_mod_specvol_coefficients.f90:167
gsw_mod_teos10_constants
Definition:
gsw_mod_teos10_constants.f90:2
gsw_mod_specvol_coefficients::h303
real(r8), parameter h303
Definition:
gsw_mod_specvol_coefficients.f90:217
gsw_mod_specvol_coefficients::h312
real(r8), parameter h312
Definition:
gsw_mod_specvol_coefficients.f90:219
gsw_mod_specvol_coefficients::h502
real(r8), parameter h502
Definition:
gsw_mod_specvol_coefficients.f90:231
gsw_enthalpy_first_derivatives
elemental subroutine gsw_enthalpy_first_derivatives(sa, ct, p, h_sa, h_ct)
Definition:
gsw_enthalpy_first_derivatives.f90:3
gsw_mod_specvol_coefficients::h051
real(r8), parameter h051
Definition:
gsw_mod_specvol_coefficients.f90:181
gsw_mod_specvol_coefficients::h401
real(r8), parameter h401
Definition:
gsw_mod_specvol_coefficients.f90:224
gsw_mod_specvol_coefficients::h131
real(r8), parameter h131
Definition:
gsw_mod_specvol_coefficients.f90:196
gsw_mod_specvol_coefficients::h403
real(r8), parameter h403
Definition:
gsw_mod_specvol_coefficients.f90:226
gsw_mod_specvol_coefficients::h033
real(r8), parameter h033
Definition:
gsw_mod_specvol_coefficients.f90:177
gsw_mod_specvol_coefficients::h014
real(r8), parameter h014
Definition:
gsw_mod_specvol_coefficients.f90:169
gsw_mod_specvol_coefficients::h021
real(r8), parameter h021
Definition:
gsw_mod_specvol_coefficients.f90:171
gsw_mod_specvol_coefficients::h402
real(r8), parameter h402
Definition:
gsw_mod_specvol_coefficients.f90:225
gsw_mod_teos10_constants::offset
real(r8), parameter offset
Definition:
gsw_mod_teos10_constants.f90:49
gsw_mod_specvol_coefficients::h202
real(r8), parameter h202
Definition:
gsw_mod_specvol_coefficients.f90:203
gsw_mod_specvol_coefficients::h302
real(r8), parameter h302
Definition:
gsw_mod_specvol_coefficients.f90:216
gsw_mod_specvol_coefficients::h101
real(r8), parameter h101
Definition:
gsw_mod_specvol_coefficients.f90:184
gsw_mod_specvol_coefficients::h113
real(r8), parameter h113
Definition:
gsw_mod_specvol_coefficients.f90:191
gsw_mod_specvol_coefficients::h103
real(r8), parameter h103
Definition:
gsw_mod_specvol_coefficients.f90:186
gsw_mod_specvol_coefficients::h031
real(r8), parameter h031
Definition:
gsw_mod_specvol_coefficients.f90:175
gsw_mod_specvol_coefficients::h322
real(r8), parameter h322
Definition:
gsw_mod_specvol_coefficients.f90:222
gsw_mod_specvol_coefficients::h221
real(r8), parameter h221
Definition:
gsw_mod_specvol_coefficients.f90:209
gsw_mod_specvol_coefficients::h133
real(r8), parameter h133
Definition:
gsw_mod_specvol_coefficients.f90:198
gsw_mod_specvol_coefficients::h142
real(r8), parameter h142
Definition:
gsw_mod_specvol_coefficients.f90:200
gsw_mod_kinds
Definition:
gsw_mod_kinds.f90:2
gsw_mod_teos10_constants::gsw_cp0
real(r8), parameter gsw_cp0
Definition:
gsw_mod_teos10_constants.f90:24
gsw_mod_specvol_coefficients::h015
real(r8), parameter h015
Definition:
gsw_mod_specvol_coefficients.f90:170
gsw_mod_specvol_coefficients::h121
real(r8), parameter h121
Definition:
gsw_mod_specvol_coefficients.f90:193
gsw_mod_specvol_coefficients::h111
real(r8), parameter h111
Definition:
gsw_mod_specvol_coefficients.f90:189
gsw_mod_specvol_coefficients::h114
real(r8), parameter h114
Definition:
gsw_mod_specvol_coefficients.f90:192
gsw_mod_specvol_coefficients::h411
real(r8), parameter h411
Definition:
gsw_mod_specvol_coefficients.f90:227
gsw_mod_specvol_coefficients::h151
real(r8), parameter h151
Definition:
gsw_mod_specvol_coefficients.f90:201
gsw_mod_specvol_coefficients::h313
real(r8), parameter h313
Definition:
gsw_mod_specvol_coefficients.f90:220
gsw_mod_teos10_constants::gsw_sfac
real(r8), parameter gsw_sfac
Definition:
gsw_mod_teos10_constants.f90:45
gsw_mod_specvol_coefficients::h501
real(r8), parameter h501
Definition:
gsw_mod_specvol_coefficients.f90:230
gsw_mod_specvol_coefficients::h222
real(r8), parameter h222
Definition:
gsw_mod_specvol_coefficients.f90:210
gsw_mod_specvol_coefficients::h042
real(r8), parameter h042
Definition:
gsw_mod_specvol_coefficients.f90:178
gsw_mod_specvol_coefficients::h013
real(r8), parameter h013
Definition:
gsw_mod_specvol_coefficients.f90:168
gsw_mod_specvol_coefficients::h032
real(r8), parameter h032
Definition:
gsw_mod_specvol_coefficients.f90:176
gsw_mod_specvol_coefficients::h112
real(r8), parameter h112
Definition:
gsw_mod_specvol_coefficients.f90:190
gsw_mod_specvol_coefficients::h061
real(r8), parameter h061
Definition:
gsw_mod_specvol_coefficients.f90:183
gsw_mod_specvol_coefficients::h601
real(r8), parameter h601
Definition:
gsw_mod_specvol_coefficients.f90:233
gsw_mod_specvol_coefficients::h123
real(r8), parameter h123
Definition:
gsw_mod_specvol_coefficients.f90:195
gsw_mod_specvol_coefficients::h301
real(r8), parameter h301
Definition:
gsw_mod_specvol_coefficients.f90:215
gsw_mod_specvol_coefficients::h421
real(r8), parameter h421
Definition:
gsw_mod_specvol_coefficients.f90:228
gsw_mod_specvol_coefficients::h241
real(r8), parameter h241
Definition:
gsw_mod_specvol_coefficients.f90:214
gsw_mod_specvol_coefficients::h311
real(r8), parameter h311
Definition:
gsw_mod_specvol_coefficients.f90:218
gsw_mod_specvol_coefficients::h104
real(r8), parameter h104
Definition:
gsw_mod_specvol_coefficients.f90:187
gsw_mod_specvol_coefficients
Definition:
gsw_mod_specvol_coefficients.f90:2
gsw_mod_specvol_coefficients::h223
real(r8), parameter h223
Definition:
gsw_mod_specvol_coefficients.f90:211
gsw_mod_specvol_coefficients::h232
real(r8), parameter h232
Definition:
gsw_mod_specvol_coefficients.f90:213
src
fv3-bundle
gsw
toolbox
gsw_enthalpy_first_derivatives.f90
Generated on Tue Nov 6 2018 11:38:36 for FV3 Bundle by
1.8.14