forked from KuangLab-Harvard/SAM_SRCv6.11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhbuf_conditionals_init.f90
203 lines (184 loc) · 10.3 KB
/
hbuf_conditionals_init.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
subroutine hbuf_conditionals_init(count,trcount)
use vars, only: ncondavg, condavgname, condavglongname
use rad, only: do_output_clearsky_heating_profiles
use params, only: dodgw, dotgr, dohadley, &
dowtg_decomp, dowtg_decompdgw, dowtg_decomptgr, &
dowtg_raymondzeng_QJRMS2005, dowtg_hermanraymond_JAMES2014
implicit none
! Initialize the list of UW statistics variables written in statistics.f90
integer count,trcount, n
call add_to_namelist(count,trcount,'TBIAS', &
'Absolute temperature bias (model-OBS)','K',0)
call add_to_namelist(count,trcount,'QBIAS', &
'Water vapor mass mixing ratio bias (model-OBS)','g/kg',0)
if(do_output_clearsky_heating_profiles) then
call add_to_namelist(count,trcount,'RADQRCLW', &
'Clearsky longwave heating rate','K/d',0)
call add_to_namelist(count,trcount,'RADQRCSW', &
'Clearsky shortwave heating rate','K/d',0)
end if
if(dodgw.OR.dotgr) then
call add_to_namelist(count,trcount,'WWTG', &
'Large-scale W induced by weak temperature gradient approx','m/s',0)
call add_to_namelist(count,trcount,'OWTG', &
'Large-scale Omega induced by weak temperature gradient approx','Pa/s',0)
call add_to_namelist(count,trcount,'WOBSREF', &
'Reference Large-scale W Before Modifications by WTG/Scaling','m/s',0)
end if
if(dowtg_raymondzeng_QJRMS2005) then
call add_to_namelist(count,trcount,'WWTGRAW', &
'Raw (Non-Adjusted) Component of the WTG Vertical Velocity','m/s',0)
call add_to_namelist(count,trcount,'OWTGRAW', &
'Raw (Non-Adjusted) Component of the WTG Pressure Velocity','Pa/s',0)
end if
if(dowtg_hermanraymond_JAMES2014.OR.dowtg_decomp) then
call add_to_namelist(count,trcount,'WTGCOEF', &
'Coefficients of Vertical Modes for Decomposed WTG Velocities',' ',0)
call add_to_namelist(count,trcount,'WWTGRAW', &
'Raw (Non-Adjusted) Component of the WTG Vertical Velocity','m/s',0)
call add_to_namelist(count,trcount,'OWTGRAW', &
'Raw (Non-Adjusted) Component of the WTG Pressure Velocity','Pa/s',0)
end if
if(dohadley) then
call add_to_namelist(count,trcount,'WHADLEY', &
'Vertical Velocity of Simulated Hadley Cell','m/s',0)
end if
!bloss: setup to add an arbitrary number of conditional statistics
do n = 1,ncondavg
!bloss: add all of the conditional statistics here, so that they don't
! have to be added to the lst file
call add_to_namelist(count,trcount,TRIM(condavgname(n)), &
TRIM(condavglongname(n))//' Fraction',' ',0)
call add_to_namelist(count,trcount,'W'//TRIM(condavgname(n)), &
'Mean W in '//TRIM(condavglongname(n)),'m/s',n)
call add_to_namelist(count,trcount,'U'//TRIM(condavgname(n)), &
'Mean U in '//TRIM(condavglongname(n)),'m/s',n)
call add_to_namelist(count,trcount,'V'//TRIM(condavgname(n)), &
'Mean V in '//TRIM(condavglongname(n)),'m/s',n)
call add_to_namelist(count,trcount,'MSE'//TRIM(condavgname(n)), &
'Mean moist static energy in '//TRIM(condavglongname(n)),'K',n)
call add_to_namelist(count,trcount,'DSE'//TRIM(condavgname(n)), &
'Mean dry static energy in '//TRIM(condavglongname(n)),'K',n)
call add_to_namelist(count,trcount,'TL'//TRIM(condavgname(n)), &
'Mean liquid-ice static energy in '//TRIM(condavglongname(n)),'K',n)
call add_to_namelist(count,trcount,'TA'//TRIM(condavgname(n)), &
'Mean TABS in '//TRIM(condavglongname(n)),'K',n)
call add_to_namelist(count,trcount,'TV'//TRIM(condavgname(n)), &
'Mean THETAV in '//TRIM(condavglongname(n)),'K',n)
call add_to_namelist(count,trcount,'TV'//TRIM(condavgname(n))//'A', &
'Mean THETAV anomaly in '//TRIM(condavglongname(n)),'K',n)
call add_to_namelist(count,trcount,'QT'//TRIM(condavgname(n)), &
'Mean QT in '//TRIM(condavglongname(n)),'g/kg',n)
call add_to_namelist(count,trcount,'QN'//TRIM(condavgname(n)), &
'Mean QN in '//TRIM(condavglongname(n)),'g/kg',n)
!bloss: these conditional averages are now computed inside the microphysics
! routines.
!bloss call add_to_namelist(count,trcount,'QC'//TRIM(condavgname(n)), &
!bloss 'Mean QC in '//TRIM(condavglongname(n)),'g/kg',n)
!bloss call add_to_namelist(count,trcount,'QI'//TRIM(condavgname(n)), &
!bloss 'Mean QI in '//TRIM(condavglongname(n)),'g/kg',n)
call add_to_namelist(count,trcount,'QP'//TRIM(condavgname(n)), &
'Mean QP in '//TRIM(condavglongname(n)),'g/kg',n)
call add_to_namelist(count,trcount,'S'//TRIM(condavgname(n)), &
'Mean scalar in '//TRIM(condavglongname(n)),'K',n)
call add_to_namelist(count,trcount,'W'//TRIM(condavgname(n))//'A', &
'W in '//TRIM(condavglongname(n))//' averaged over the whole domain','m/s',0)
call add_to_namelist(count,trcount,'TLW'//TRIM(condavgname(n)), &
'TLW in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'Km/s',0)
call add_to_namelist(count,trcount,'TVW'//TRIM(condavgname(n)), &
'TVW in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'Km/s',0)
call add_to_namelist(count,trcount,'SW'//TRIM(condavgname(n)), &
'SW in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'Km/s',0)
call add_to_namelist(count,trcount,'QTW'//TRIM(condavgname(n)), &
'QTW in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'g/kg m/s',0)
call add_to_namelist(count,trcount,'QCW'//TRIM(condavgname(n)), &
'QCW in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'g/kg m/s',0)
call add_to_namelist(count,trcount,'QIW'//TRIM(condavgname(n)), &
'QIW in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'g/kg m/s',0)
!bloss: frozen moist static energy statistics
call add_to_namelist(count,trcount,'HF'//TRIM(condavgname(n)), &
'Mean Frozen MSE in '//TRIM(condavglongname(n)),'K',n)
call add_to_namelist(count,trcount,'HF'//TRIM(condavgname(n))//'A', &
'Mean Frozen MSE anomaly in '//TRIM(condavglongname(n)),'K',n)
!bloss: velocity anomalies
call add_to_namelist(count,trcount,'U'//TRIM(condavgname(n))//'A', &
'Mean U anomaly in '//TRIM(condavglongname(n)),'m/s',n)
call add_to_namelist(count,trcount,'V'//TRIM(condavgname(n))//'A', &
'Mean V anomaly in '//TRIM(condavglongname(n)),'m/s',n)
!bloss: pressure gradients
call add_to_namelist(count,trcount,'UPGF'//TRIM(condavgname(n)), &
'Zonal pressure gradient in '//TRIM(condavglongname(n)),'m/s2',n)
call add_to_namelist(count,trcount,'VPGF'//TRIM(condavgname(n)), &
'Meridional pressure gradient in '//TRIM(condavglongname(n)),'m/s2',n)
call add_to_namelist(count,trcount,'WPGF'//TRIM(condavgname(n)), &
'Vertical pressure gradient in '//TRIM(condavglongname(n)),'m/s2',n)
!bloss: momentum statistics
call add_to_namelist(count,trcount,'UW'//TRIM(condavgname(n)), &
'UW in '//TRIM(condavglongname(n)),'m2/s2',n)
call add_to_namelist(count,trcount,'VW'//TRIM(condavgname(n)), &
'VW in '//TRIM(condavglongname(n)),'m2/s2',n)
call add_to_namelist(count,trcount,'UWSB'//TRIM(condavgname(n)), &
'Subgrid UW in '//TRIM(condavglongname(n)),'m2/s2',n)
call add_to_namelist(count,trcount,'VWSB'//TRIM(condavgname(n)), &
'Subgrid VW in '//TRIM(condavglongname(n)),'m2/s2',n)
!bloss: UW-added mass flux weighted statistics
call add_to_namelist(count,trcount,'MF'//TRIM(condavgname(n)), &
'Mass flux in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'kg/m2/s',0)
call add_to_namelist(count,trcount,'MFH'//TRIM(condavgname(n)), &
'RHO*W*HF in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'K kg/m2/s',0)
call add_to_namelist(count,trcount,'MFH'//TRIM(condavgname(n))//'A', &
'RHO*W*HF anomaly in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'K kg/m2/s',0)
call add_to_namelist(count,trcount,'MFTL'//TRIM(condavgname(n)), &
'RHO*W*TL in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'K kg/m2/s',0)
call add_to_namelist(count,trcount,'MFTL'//TRIM(condavgname(n))//'A', &
'RHO*W*TL anomaly in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'K kg/m2/s',0)
call add_to_namelist(count,trcount,'MFTV'//TRIM(condavgname(n)), &
'RHO*W*TV in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'K kg/m2/s',0)
call add_to_namelist(count,trcount,'MFTV'//TRIM(condavgname(n))//'A', &
'RHO*W*TV anomaly in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'K kg/m2/s',0)
call add_to_namelist(count,trcount,'MFQT'//TRIM(condavgname(n)), &
'RHO*W*QT in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'g/m2/s',0)
call add_to_namelist(count,trcount,'MFQT'//TRIM(condavgname(n))//'A', &
'RHO*W*QT anomaly in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'g/m2/s',0)
call add_to_namelist(count,trcount,'RUW'//TRIM(condavgname(n)), &
'RHOUW in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'kg/m/s2',0)
call add_to_namelist(count,trcount,'RVW'//TRIM(condavgname(n)), &
'RHOVW in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'kg/m/s2',0)
call add_to_namelist(count,trcount,'RWW'//TRIM(condavgname(n)), &
'RHOWW in '//TRIM(condavglongname(n))//' averaged over the whole domain', &
'kg/m/s2',0)
end do ! n = 1,ncondavg
end
subroutine add_to_namelist(count,trcount,varname,varlongname,varunits,varavg)
use hbuffer, only: namelist,deflist,unitlist,status,average_type
implicit none
! add variable to namelist
integer count, trcount, ntr, n, varstatus, varavg
character(*) varname
character(*) varlongname
character(*) varunits
count = count + 1
trcount = trcount + 1
namelist(count) = trim(varname)
deflist(count) = trim(varlongname)
unitlist(count) = trim(varunits)
status(count) = 1
average_type(count) = varavg
end subroutine add_to_namelist