-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqsat_eau.F90
136 lines (99 loc) · 3.87 KB
/
qsat_eau.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
!------------------------------------------------------------------------------
subroutine qsat_eau (len, pl, tl, qsats)
!------------------------------------------------------------------------------
!eau_sat computes the saturation mixing ratio, vapor pressure, and saturation,
!and their derivatives with respect to temperature over water, ice and mixed-
!phase clouds. the parameterization is that used in the Community Climate Com-
!munity Climate Model at NCAR.
!Laura D. Fowler /slikrock (07-01-01).
!send comments to [email protected].
!subroutines called:
!none.
!argument list variables:
!input arguments:
!----------------
use kinds
use physical_parameters, only: hltm, rv
implicit none
integer (kind=int_kind), intent(in):: &
len !length of vector.
real(kind=dbl_kind), intent(in), dimension(len):: &
pl, &!pressure (Pa).
tl !temperature (K).
!output arguments:
!-----------------
real (kind=dbl_kind), intent(out), dimension(len), optional :: &
qsats !saturation mixing ratio (kg/kg).
!local variables:
integer (kind=int_kind):: i
real (kind=dbl_kind):: &
twmin=173.16, &!lowest allowed temperature boundary for water (K).
twmax=373.16, &!highest allowed temperature boundary for water (K).
timin=173.16, &!lowest allowed temperature boundary for ice (K).
timax=273.16 !highest allowed temperature boundary for ice (K).
real (kind=dbl_kind) :: tstl , t0tl
real (kind=dbl_kind), dimension(len):: &
esw , esi , &
esm , tl0, &
qsati , qsatm , &
wghtm , qsatw
!ccm parameterization of saturation vapor pressure over water and ice:
real (kind=dbl_kind), parameter:: &
ps = 1013.246, &!reference pressure (hPa).
ts = 373.16, &!reference temperature (K).
t0 = 273.16, &!freezing temperature (K)
tbgmin = 253.15_dbl_kind, &!
tbgmax = 273.15_dbl_kind !
real (kind=dbl_kind):: &
e1 , e2 , f , f1 ,&
f2 , f3 , f4 , f5 ,&
term3 , term1 , term2
!------------------------------------------------------------------------------
!initialization of different arrays:
tl0 = tl
esw = 0.0_dbl_kind
esi = 0.0_dbl_kind
esm = 0.0_dbl_kind
qsatw = 0.0_dbl_kind
qsati = 0.0_dbl_kind
qsatm = 0.0_dbl_kind
qsats = 0.0_dbl_kind
!saturation over water:
do i = 1, len
tl0(i) = max(twmin,tl0(i))
tl0(i) = min(twmax,tl0(i))
tstl = ts / tl0(i)
e1 = 11.344*(1.0 - tl0(i)/ts)
e2 = -3.49149*(tstl - 1.0)
f1 = -7.90298*(tstl - 1.0)
f2 = 5.02808*log10(tstl)
f3 = -1.3816*(10.0**e1-1.0)/10000000.0
f4 = 8.1328*(10.0**e2-1.0)/1000.0
f5 = log10(ps)
f = f1 + f2 + f3 + f4 + f5
esw(i) = (10.0**f)*1.e+02
esw(i) = min(esw(i),pl(i)*0.9)
qsatw(i) = 0.622*esw(i)/(pl(i)-esw(i))
qsats(i) = qsatw(i)
!saturation over ice:
if(tl0(i).lt.timax) then
tl0(i) = max(tl0(i),timin)
t0tl = t0 / tl0(i)
term1 = 2.01889049/(t0tl)
term2 = 3.56654*log(t0tl)
term3 = 20.947031*(t0tl)
esi(i) = 575.185606e10*exp(-(term1 + term2 + term3))
esi(i) = min(esi(i),pl(i)*0.9)
qsati(i) = 0.622*esi(i) / (pl(i)-esi(i))
qsats(i) = qsati(i)
endif
!interpolated saturation variables:
if(tl0(i).lt.tbgmax .and. tl0(i).ge.tbgmin) then
wghtm(i) = (tl0(i)-tbgmin)/(tbgmax-tbgmin)
esm(i) = wghtm(i)*esw(i) + (1.-wghtm(i))*esi(i)
esm(i) = min(esm(i),pl(i)*0.9)
qsatm(i) = 0.622*esm(i) / (pl(i) - esm(i))
qsats(i) = qsatm(i)
endif
enddo
end subroutine qsat_eau