40 public :: atmos_vars_get_diagnostic
49 interface atmos_vars_get_diagnostic
53 end interface atmos_vars_get_diagnostic
75 real(RP),
public,
target,
allocatable ::
dens(:,:,:)
76 real(RP),
public,
target,
allocatable ::
momz(:,:,:)
77 real(RP),
public,
target,
allocatable ::
momx(:,:,:)
78 real(RP),
public,
target,
allocatable ::
momy(:,:,:)
79 real(RP),
public,
target,
allocatable ::
rhot(:,:,:)
80 real(RP),
public,
target,
allocatable ::
qtrc(:,:,:,:)
82 real(RP),
public,
target,
allocatable ::
dens_avw(:,:,:)
83 real(RP),
public,
target,
allocatable ::
momz_avw(:,:,:)
84 real(RP),
public,
target,
allocatable ::
momx_avw(:,:,:)
85 real(RP),
public,
target,
allocatable ::
momy_avw(:,:,:)
86 real(RP),
public,
target,
allocatable ::
rhot_avw(:,:,:)
87 real(RP),
public,
target,
allocatable ::
qtrc_avw(:,:,:,:)
89 real(RP),
public,
pointer ::
dens_av(:,:,:)
90 real(RP),
public,
pointer ::
momz_av(:,:,:)
91 real(RP),
public,
pointer ::
momx_av(:,:,:)
92 real(RP),
public,
pointer ::
momy_av(:,:,:)
93 real(RP),
public,
pointer ::
rhot_av(:,:,:)
94 real(RP),
public,
pointer ::
qtrc_av(:,:,:,:)
96 real(RP),
public,
pointer ::
qv(:,:,:)
97 real(RP),
public,
pointer ::
qc(:,:,:)
98 real(RP),
public,
pointer ::
qr(:,:,:)
99 real(RP),
public,
pointer ::
qi(:,:,:)
100 real(RP),
public,
pointer ::
qs(:,:,:)
101 real(RP),
public,
pointer ::
qg(:,:,:)
102 real(RP),
public,
pointer ::
qh(:,:,:)
104 real(RP),
public,
target,
allocatable ::
qe(:,:,:,:)
111 real(RP),
public,
allocatable ::
qv_ref(:,:,:)
114 real(RP),
public,
allocatable ::
dens_tp(:,:,:)
115 real(RP),
public,
allocatable ::
momz_tp(:,:,:)
116 real(RP),
public,
allocatable ::
rhou_tp(:,:,:)
117 real(RP),
public,
allocatable ::
rhov_tp(:,:,:)
118 real(RP),
public,
allocatable ::
rhot_tp(:,:,:)
119 real(RP),
public,
allocatable ::
rhoh_p (:,:,:)
120 real(RP),
public,
allocatable ::
rhoq_tp(:,:,:,:)
123 real(RP),
public,
allocatable ::
momx_tp(:,:,:)
124 real(RP),
public,
allocatable ::
momy_tp(:,:,:)
128 real(RP),
public,
allocatable,
target ::
w (:,:,:)
129 real(RP),
public,
allocatable,
target ::
u (:,:,:)
130 real(RP),
public,
allocatable,
target ::
v (:,:,:)
132 real(RP),
public,
allocatable,
target ::
pott (:,:,:)
133 real(RP),
public,
allocatable,
target ::
temp (:,:,:)
134 real(RP),
public,
allocatable,
target ::
pres (:,:,:)
135 real(RP),
public,
allocatable,
target ::
exner(:,:,:)
136 real(RP),
public,
allocatable,
target ::
phyd (:,:,:)
137 real(RP),
public,
allocatable,
target ::
phydh(:,:,:)
139 real(RP),
public,
allocatable,
target ::
qdry (:,:,:)
140 real(RP),
public,
allocatable,
target ::
rtot (:,:,:)
141 real(RP),
public,
allocatable,
target ::
cvtot(:,:,:)
142 real(RP),
public,
allocatable,
target ::
cptot(:,:,:)
152 logical,
private :: atmos_vars_checkrange = .false.
153 real(RP),
private :: atmos_vars_checkcfl_soft = 1.0_rp
154 real(RP),
private :: atmos_vars_checkcfl_hard = 2.0_rp
157 character(len=H_SHORT) :: name
158 character(len=H_MID) :: desc
159 character(len=H_SHORT) :: unit
161 character(len=H_SHORT) :: dim_type
162 character(len=H_MID) :: stdname
166 integer,
private,
parameter :: pv_nmax = 5
167 type(vinfo),
private :: pv_info(pv_nmax)
168 integer,
private,
allocatable :: pv_id(:)
171 vinfo(
'DENS',
'density',
'kg/m3', 3,
'ZXY',
'air_density' ), &
172 vinfo(
'MOMZ',
'momentum z',
'kg/m2/s', 3,
'ZHXY',
'upward_mass_flux_of_air' ), &
173 vinfo(
'MOMX',
'momentum x',
'kg/m2/s', 3,
'ZXHY',
'eastward_mass_flux_of_air' ), &
174 vinfo(
'MOMY',
'momentum y',
'kg/m2/s', 3,
'ZXYH',
'northward_mass_flux_of_air' ), &
175 vinfo(
'RHOT',
'rho * theta',
'kg/m3*K', 3,
'ZXY',
'' ) /
179 real(RP),
allocatable,
target :: lhv (:,:,:)
180 real(RP),
allocatable,
target :: lhs (:,:,:)
181 real(RP),
allocatable,
target :: lhf (:,:,:)
183 real(RP),
allocatable,
target :: potv (:,:,:)
184 real(RP),
allocatable,
target :: teml (:,:,:)
185 real(RP),
allocatable,
target :: potl (:,:,:)
186 real(RP),
allocatable,
target :: pote (:,:,:)
188 real(RP),
allocatable,
target :: qtot (:,:,:)
189 real(RP),
allocatable,
target :: qhyd (:,:,:)
190 real(RP),
allocatable,
target :: qliq (:,:,:)
191 real(RP),
allocatable,
target :: qice (:,:,:)
193 real(RP),
allocatable,
target :: lwp (:,:)
194 real(RP),
allocatable,
target :: iwp (:,:)
195 real(RP),
allocatable,
target :: pw (:,:)
197 real(RP),
allocatable,
target :: prec (:,:)
198 real(RP),
allocatable,
target :: rain (:,:)
199 real(RP),
allocatable,
target :: snow (:,:)
201 real(RP),
allocatable,
target :: qsat (:,:,:)
202 real(RP),
allocatable,
target :: rha (:,:,:)
203 real(RP),
allocatable,
target :: rhl (:,:,:)
204 real(RP),
allocatable,
target :: rhi (:,:,:)
206 real(RP),
allocatable,
target :: vor (:,:,:)
207 real(RP),
allocatable,
target :: div (:,:,:)
208 real(RP),
allocatable,
target :: hdiv (:,:,:)
209 real(RP),
allocatable,
target :: uabs (:,:,:)
211 real(RP),
allocatable,
target :: n2 (:,:,:)
212 real(RP),
allocatable,
target :: pblh (:,:)
214 real(RP),
allocatable,
target :: mse (:,:,:)
215 real(RP),
allocatable,
target :: tdew (:,:,:)
217 real(RP),
allocatable,
target :: cape (:,:)
218 real(RP),
allocatable,
target :: cin (:,:)
219 real(RP),
allocatable,
target :: lcl (:,:)
220 real(RP),
allocatable,
target :: lfc (:,:)
221 real(RP),
allocatable,
target :: lnb (:,:)
223 real(RP),
allocatable,
target :: engt (:,:,:)
224 real(RP),
allocatable,
target :: engp (:,:,:)
225 real(RP),
allocatable,
target :: engk (:,:,:)
226 real(RP),
allocatable,
target :: engi (:,:,:)
228 real(RP),
allocatable,
target :: dens_mean(:)
229 real(RP),
allocatable,
target :: w_mean (:)
230 real(RP),
allocatable,
target :: u_mean (:)
231 real(RP),
allocatable,
target :: v_mean (:)
232 real(RP),
allocatable,
target :: pt_mean (:)
233 real(RP),
allocatable,
target :: t_mean (:)
234 real(RP),
allocatable,
target :: qv_mean (:)
235 real(RP),
allocatable,
target :: qhyd_mean(:)
236 real(RP),
allocatable,
target :: qliq_mean(:)
237 real(RP),
allocatable,
target :: qice_mean(:)
239 real(RP),
allocatable,
target :: dens_prim(:,:,:)
240 real(RP),
allocatable,
target :: w_prim (:,:,:)
241 real(RP),
allocatable,
target :: u_prim (:,:,:)
242 real(RP),
allocatable,
target :: v_prim (:,:,:)
243 real(RP),
allocatable,
target :: pt_prim (:,:,:)
244 real(RP),
allocatable,
target :: w_prim2 (:,:,:)
245 real(RP),
allocatable,
target :: pt_w_prim(:,:,:)
246 real(RP),
allocatable,
target :: w_prim3 (:,:,:)
247 real(RP),
allocatable,
target :: tke_rs (:,:,:)
249 real(RP),
allocatable,
target :: velz (:,:,:)
250 real(RP),
allocatable,
target :: velx (:,:,:)
251 real(RP),
allocatable,
target :: vely (:,:,:)
252 real(RP),
allocatable,
target :: umet (:,:,:)
253 real(RP),
allocatable,
target :: vmet (:,:,:)
257 integer,
private,
parameter :: i_w = 1
258 integer,
private,
parameter :: i_u = 2
259 integer,
private,
parameter :: i_v = 3
260 integer,
private,
parameter :: i_pott = 4
261 integer,
private,
parameter :: i_temp = 5
262 integer,
private,
parameter :: i_pres = 6
263 integer,
private,
parameter :: i_exner = 7
264 integer,
private,
parameter :: i_phyd = 8
265 integer,
private,
parameter :: i_qdry = 9
266 integer,
private,
parameter :: i_rtot = 10
267 integer,
private,
parameter :: i_cvtot = 11
268 integer,
private,
parameter :: i_cptot = 12
270 integer,
private,
parameter :: i_lhv = 13
271 integer,
private,
parameter :: i_lhs = 14
272 integer,
private,
parameter :: i_lhf = 15
273 integer,
private,
parameter :: i_potv = 16
274 integer,
private,
parameter :: i_teml = 17
275 integer,
private,
parameter :: i_potl = 18
276 integer,
private,
parameter :: i_pote = 19
277 integer,
private,
parameter :: i_qtot = 20
278 integer,
private,
parameter :: i_qhyd = 21
279 integer,
private,
parameter :: i_qliq = 22
280 integer,
private,
parameter :: i_qice = 23
281 integer,
private,
parameter :: i_lwp = 24
282 integer,
private,
parameter :: i_iwp = 25
283 integer,
private,
parameter :: i_pw = 26
284 integer,
private,
parameter :: i_prec = 27
285 integer,
private,
parameter :: i_rain = 28
286 integer,
private,
parameter :: i_snow = 29
287 integer,
private,
parameter :: i_qsat = 30
288 integer,
private,
parameter :: i_rha = 31
289 integer,
private,
parameter :: i_rhl = 32
290 integer,
private,
parameter :: i_rhi = 33
291 integer,
private,
parameter :: i_vor = 34
292 integer,
private,
parameter :: i_div = 35
293 integer,
private,
parameter :: i_hdiv = 36
294 integer,
private,
parameter :: i_uabs = 37
295 integer,
private,
parameter :: i_n2 = 38
296 integer,
private,
parameter :: i_pblh = 39
297 integer,
private,
parameter :: i_mse = 40
298 integer,
private,
parameter :: i_tdew = 41
299 integer,
private,
parameter :: i_cape = 42
300 integer,
private,
parameter :: i_cin = 43
301 integer,
private,
parameter :: i_lcl = 44
302 integer,
private,
parameter :: i_lfc = 45
303 integer,
private,
parameter :: i_lnb = 46
304 integer,
private,
parameter :: i_engt = 47
305 integer,
private,
parameter :: i_engp = 48
306 integer,
private,
parameter :: i_engk = 49
307 integer,
private,
parameter :: i_engi = 50
308 integer,
private,
parameter :: i_dens_mean = 51
309 integer,
private,
parameter :: i_w_mean = 52
310 integer,
private,
parameter :: i_u_mean = 53
311 integer,
private,
parameter :: i_v_mean = 54
312 integer,
private,
parameter :: i_pt_mean = 55
313 integer,
private,
parameter :: i_t_mean = 56
314 integer,
private,
parameter :: i_qv_mean = 57
315 integer,
private,
parameter :: i_qhyd_mean = 58
316 integer,
private,
parameter :: i_qliq_mean = 59
317 integer,
private,
parameter :: i_qice_mean = 60
318 integer,
private,
parameter :: i_dens_prim = 61
319 integer,
private,
parameter :: i_w_prim = 62
320 integer,
private,
parameter :: i_u_prim = 63
321 integer,
private,
parameter :: i_v_prim = 64
322 integer,
private,
parameter :: i_pt_prim = 65
323 integer,
private,
parameter :: i_w_prim2 = 66
324 integer,
private,
parameter :: i_pt_w_prim = 67
325 integer,
private,
parameter :: i_w_prim3 = 68
326 integer,
private,
parameter :: i_tke_rs = 69
327 integer,
private,
parameter :: i_velz = 70
328 integer,
private,
parameter :: i_velx = 71
329 integer,
private,
parameter :: i_vely = 72
330 integer,
private,
parameter :: i_umet = 73
331 integer,
private,
parameter :: i_vmet = 74
333 integer,
private,
parameter :: dv_nmax = 74
334 type(vinfo),
private :: dv_info(dv_nmax)
335 logical,
private :: dv_calculated(dv_nmax)
338 vinfo(
'W',
'velocity w',
'm/s', 3,
'ZXY',
'upward_air_velocity' ), &
339 vinfo(
'U',
'velocity u',
'm/s', 3,
'ZXY',
'x_wind' ), &
340 vinfo(
'V',
'velocity v',
'm/s', 3,
'ZXY',
'y_wind' ), &
341 vinfo(
'PT',
'potential temp.',
'K', 3,
'ZXY',
'air_potential_temperature' ), &
342 vinfo(
'T',
'temperature',
'K', 3,
'ZXY',
'air_temperature' ), &
343 vinfo(
'PRES',
'pressure',
'Pa', 3,
'ZXY',
'air_pressure' ), &
344 vinfo(
'EXNER',
'Exner function',
'1', 3,
'ZXY',
'dimensionless_exner_function' ), &
345 vinfo(
'PHYD',
'hydrostatic pressure',
'Pa', 3,
'ZXY',
'' ), &
346 vinfo(
'QDRY',
'dry air',
'kg/kg', 3,
'ZXY',
'' ), &
347 vinfo(
'RTOT',
'Total gas constant',
'J/kg/K', 3,
'ZXY',
'' ), &
348 vinfo(
'CVTOT',
'Total heat capacity',
'J/kg/K', 3,
'ZXY',
'' ), &
349 vinfo(
'CPTOT',
'Total heat capacity',
'J/kg/K', 3,
'ZXY',
'' ), &
350 vinfo(
'LHV',
'latent heat for vaporization',
'J/kg', 3,
'ZXY',
'' ), &
351 vinfo(
'LHS',
'latent heat for sublimation',
'J/kg', 3,
'ZXY',
'' ), &
352 vinfo(
'LHF',
'latent heat for fusion',
'J/kg', 3,
'ZXY',
'' ), &
353 vinfo(
'POTV',
'virtual potential temp.',
'K', 3,
'ZXY',
'' ), &
354 vinfo(
'TEML',
'liquid water temperature',
'K', 3,
'ZXY',
'' ), &
355 vinfo(
'POTL',
'liquid water potential temp.',
'K', 3,
'ZXY',
'' ), &
356 vinfo(
'POTE',
'equivalent potential temp.',
'K', 3,
'ZXY',
'pseudo_equivalent_potential_temperature' ), &
357 vinfo(
'QTOT',
'total water',
'kg/kg', 3,
'ZXY',
'mass_fraction_of_water_in_air' ), &
358 vinfo(
'QHYD',
'total hydrometeors',
'kg/kg', 3,
'ZXY',
'mass_fraction_of_cloud_condensed_water_in_air' ), &
359 vinfo(
'QLIQ',
'total liquid water',
'kg/kg', 3,
'ZXY',
'' ), &
360 vinfo(
'QICE',
'total ice water',
'kg/kg', 3,
'ZXY',
'' ), &
361 vinfo(
'LWP',
'liquid water path',
'g/m2', 2,
'XY',
'atmosphere_mass_content_of_cloud_liquid_water' ), &
362 vinfo(
'IWP',
'ice water path',
'g/m2', 2,
'XY',
'' ), &
363 vinfo(
'PW',
'precipitable water',
'g/m2', 2,
'XY',
'atmosphere_mass_content_of_vapor' ), &
364 vinfo(
'PREC',
'surface precipitation flux',
'kg/m2/s', 2,
'XY',
'precipitation_flux' ), &
365 vinfo(
'RAIN',
'surface rain flux',
'kg/m2/s', 2,
'XY',
'rainfall_flux' ), &
366 vinfo(
'SNOW',
'surface snow flux',
'kg/m2/s', 2,
'XY',
'snowfall_flux' ), &
367 vinfo(
'QSAT',
'saturation specific humidity',
'kg/kg', 3,
'ZXY',
'' ), &
368 vinfo(
'RHA',
'relative humidity(liq+ice)',
'%', 3,
'ZXY',
'' ), &
369 vinfo(
'RH',
'relative humidity(liq)',
'%', 3,
'ZXY',
'relative_humidity' ), &
370 vinfo(
'RHI',
'relative humidity(ice)',
'%', 3,
'ZXY',
'' ), &
371 vinfo(
'VOR',
'vertical vorticity',
'1/s', 3,
'ZXY',
'atmosphere_relative_vorticity' ), &
372 vinfo(
'DIV',
'divergence',
'1/s', 3,
'ZXY',
'divergence_of_wind' ), &
373 vinfo(
'HDIV',
'horizontal divergence',
'1/s', 3,
'ZXY',
'' ), &
374 vinfo(
'Uabs',
'absolute velocity',
'm/s', 3,
'ZXY',
'wind_speed' ), &
375 vinfo(
'N2',
'squared Brunt-Vaisala frequency',
'1/s2', 3,
'ZXY',
'square_of_brunt_vaisala_frequency_in_air' ), &
376 vinfo(
'PBLH',
'PBL height',
'm', 2,
'XY',
'atmosphere_boundary_layer_thickness' ), &
377 vinfo(
'MSE',
'moist static energy',
'm2/s2', 3,
'ZXY',
'' ), &
378 vinfo(
'TDEW',
'dew point',
'K', 3,
'ZXY',
'dew_point_temperature' ), &
379 vinfo(
'CAPE',
'convective avail. pot. energy',
'm2/s2', 2,
'XY',
'atmosphere_specific_convective_available_potential_energy' ), &
380 vinfo(
'CIN',
'convection inhibition',
'm2/s2', 2,
'XY',
'' ), &
381 vinfo(
'LCL',
'lifted condensation level',
'm', 2,
'XY',
'atmosphere_lifting_condensation_level' ), &
382 vinfo(
'LFC',
'level of free convection',
'm', 2,
'XY',
'atmosphere_level_of_free_convection' ), &
383 vinfo(
'LNB',
'level of neutral buoyancy',
'm', 2,
'XY',
'' ), &
384 vinfo(
'ENGT',
'total energy',
'J/m3', 3,
'ZXY',
'' ), &
385 vinfo(
'ENGP',
'potential energy',
'J/m3', 3,
'ZXY',
'' ), &
386 vinfo(
'ENGK',
'kinetic energy',
'J/m3', 3,
'ZXY',
'' ), &
387 vinfo(
'ENGI',
'internal energy',
'J/m3', 3,
'ZXY',
'' ), &
388 vinfo(
'DENS_MEAN',
'horiz. mean of density',
'kg/m3', 1,
'Z',
'' ), &
389 vinfo(
'W_MEAN',
'horiz. mean of w',
'm/s', 1,
'Z',
'' ), &
390 vinfo(
'U_MEAN',
'horiz. mean of u',
'm/s', 1,
'Z',
'' ), &
391 vinfo(
'V_MEAN',
'horiz. mean of v',
'm/s', 1,
'Z',
'' ), &
392 vinfo(
'PT_MEAN',
'horiz. mean of pot.',
'K', 1,
'Z',
'' ), &
393 vinfo(
'T_MEAN',
'horiz. mean of t',
'K', 1,
'Z',
'' ), &
394 vinfo(
'QV_MEAN',
'horiz. mean of QV',
'1', 1,
'Z',
'' ), &
395 vinfo(
'QHYD_MEAN',
'horiz. mean of QHYD',
'1', 1,
'Z',
'' ), &
396 vinfo(
'QLIQ_MEAN',
'horiz. mean of QLIQ',
'1', 1,
'Z',
'' ), &
397 vinfo(
'QICE_MEAN',
'horiz. mean of QICE',
'1', 1,
'Z',
'' ), &
398 vinfo(
'DENS_PRIM',
'horiz. deviation of density',
'kg/m3', 3,
'ZXY',
'' ), &
399 vinfo(
'W_PRIM',
'horiz. deviation of w',
'm/s', 3,
'ZXY',
'' ), &
400 vinfo(
'U_PRIM',
'horiz. deviation of u',
'm/s', 3,
'ZXY',
'' ), &
401 vinfo(
'V_PRIM',
'horiz. deviation of v',
'm/s', 3,
'ZXY',
'' ), &
402 vinfo(
'PT_PRIM',
'horiz. deviation of pot. temp.',
'K', 3,
'ZXY',
'' ), &
403 vinfo(
'W_PRIM2',
'variance of w',
'm2/s2', 3,
'ZXY',
'' ), &
404 vinfo(
'PT_W_PRIM',
'resolved scale heat flux',
'W/s', 3,
'ZXY',
'' ), &
405 vinfo(
'W_PRIM3',
'skewness of w',
'm3/s3', 3,
'ZXY',
'' ), &
406 vinfo(
'TKE_RS',
'resolved scale TKE',
'm2/s2', 3,
'ZXY',
'' ), &
407 vinfo(
'VELZ',
'velocity w at the half level',
'm/s', 3,
'ZHXY',
'' ), &
408 vinfo(
'VELX',
'velocity u at the half level',
'm/s', 3,
'ZXHY',
'' ), &
409 vinfo(
'VELY',
'velocity v at the half level',
'm/s', 3,
'ZXYH',
'' ), &
410 vinfo(
'Umet',
'eastward velocity',
'm/s', 3,
'ZXY',
'eastward_wind' ), &
411 vinfo(
'Vmet',
'northward velocity',
'm/s', 3,
'ZXY',
'northward_wind' ) /
414 integer,
private :: pv_hist_id (pv_nmax)
415 integer,
private :: pv_monit_id(pv_nmax)
416 integer,
private,
allocatable :: qp_hist_id (:)
417 integer,
private,
allocatable :: qp_monit_id(:)
418 integer,
private :: dv_hist_id (dv_nmax)
419 integer,
private :: hist_id_gph
421 integer,
private,
parameter :: im_qdry = 1
422 integer,
private,
parameter :: im_qtot = 2
423 integer,
private,
parameter :: im_evap = 3
424 integer,
private,
parameter :: im_prec = 4
425 integer,
private,
parameter :: im_engt = 5
426 integer,
private,
parameter :: im_engp = 6
427 integer,
private,
parameter :: im_engk = 7
428 integer,
private,
parameter :: im_engi = 8
429 integer,
private,
parameter :: im_engflxt = 9
430 integer,
private,
parameter :: im_engsfc_sh = 10
431 integer,
private,
parameter :: im_engsfc_lh = 11
432 integer,
private,
parameter :: im_engsfc_rd = 12
433 integer,
private,
parameter :: im_engtoa_rd = 13
434 integer,
private,
parameter :: im_engsfc_lw_up = 14
435 integer,
private,
parameter :: im_engsfc_lw_dn = 15
436 integer,
private,
parameter :: im_engsfc_sw_up = 16
437 integer,
private,
parameter :: im_engsfc_sw_dn = 17
438 integer,
private,
parameter :: im_engtoa_lw_up = 18
439 integer,
private,
parameter :: im_engtoa_lw_dn = 19
440 integer,
private,
parameter :: im_engtoa_sw_up = 20
441 integer,
private,
parameter :: im_engtoa_sw_dn = 21
442 integer,
private,
parameter :: dvm_nmax = 21
443 integer,
private :: dv_monit_id(dvm_nmax)
446 logical,
private :: moist
447 real(RP),
private,
target,
allocatable :: zero(:,:,:)
451 integer,
private :: restart_fid = -1
452 logical,
private :: atmos_restart_in_check_coordinates = .true.
455 real(RP),
private,
allocatable :: work3d(:,:,:)
456 real(RP),
private,
allocatable :: work2d(:,:)
457 real(RP),
private,
allocatable :: work1d(:)
504 namelist / param_atmos_vars / &
508 atmos_restart_in_check_coordinates, &
518 atmos_vars_checkrange, &
519 atmos_vars_checkcfl_soft, &
520 atmos_vars_checkcfl_hard
527 log_info(
"ATMOS_vars_setup",*)
'Setup' 604 allocate( work3d(
ka,
ia,
ja) )
605 allocate( work2d(
ia,
ja) )
606 allocate( work1d(
ka ) )
613 log_info(
"ATMOS_vars_setup",*)
'Not found namelist. Default used.' 614 elseif( ierr > 0 )
then 615 log_error(
"ATMOS_vars_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_VARS. Check!' 618 log_nml(param_atmos_vars)
621 log_info(
"ATMOS_vars_setup",*)
'List of prognostic variables (ATMOS) ' 622 log_info_cont(
'(1x,A,A24,A,A48,A,A12,A)') &
623 ' |',
'VARNAME ',
'|', &
624 'DESCRIPTION ',
'[',
'UNIT ',
']' 626 log_info_cont(
'(1x,A,I3,A,A24,A,A48,A,A12,A)') &
627 'NO.',iv,
'|',pv_info(iv)%NAME,
'|', pv_info(iv)%DESC,
'[', pv_info(iv)%UNIT,
']' 630 log_info_cont(
'(1x,A,I3,A,A24,A,A48,A,A12,A)') &
639 log_info(
"ATMOS_vars_setup",*)
'Restart input? : NO' 646 log_info(
"ATMOS_vars_setup",*)
'Restart output? : NO' 654 if ( atmos_vars_checkcfl_hard > 0.0_rp )
then 655 atmos_vars_checkcfl_soft = min( atmos_vars_checkcfl_soft, atmos_vars_checkcfl_hard )
660 log_info(
"ATMOS_vars_setup",*)
'Check value range of variables? : ', atmos_vars_checkrange
661 if ( atmos_vars_checkcfl_soft > 0.0_rp )
then 662 log_info(
"ATMOS_vars_setup",*)
'Threshold of Courant number to warn : ', atmos_vars_checkcfl_soft
664 log_info(
"ATMOS_vars_setup",*)
'Threshold of Courant number to warn : disabled' 666 if ( atmos_vars_checkcfl_hard > 0.0_rp )
then 667 log_info(
"ATMOS_vars_setup",*)
'Threshold of Courant number to stop : ', atmos_vars_checkcfl_hard
669 log_info(
"ATMOS_vars_setup",*)
'Threshold of Courant number to stop : disabled' 685 allocate( zero(
ka,
ia,
ja) )
715 dv_calculated(dv_nmax) = .false.
718 allocate( qp_hist_id( max(
qa,1) ) )
719 allocate( qp_monit_id( max(
qa,1) ) )
729 call file_history_reg( pv_info(iv)%NAME, pv_info(iv)%DESC, pv_info(iv)%UNIT, pv_hist_id(iv), dim_type=pv_info(iv)%dim_type, standard_name=pv_info(iv)%STDNAME )
737 call file_history_reg( dv_info(iv)%NAME, dv_info(iv)%DESC, dv_info(iv)%UNIT, dv_hist_id(iv), dim_type=dv_info(iv)%dim_type, standard_name=dv_info(iv)%STDNAME )
740 call file_history_reg(
"GPH",
"geopotential height",
"m", hist_id_gph, dim_type=
'ZXY', standard_name=
"geopotential_height" )
745 call monitor_reg( pv_info(iv)%NAME, pv_info(iv)%DESC, trim(pv_info(iv)%UNIT)//
"*m3", &
747 dim_type=pv_info(iv)%dim_type, isflux=.false. )
752 dim_type=
'ZXY', isflux=.false. )
756 dv_monit_id(im_qdry), &
757 dim_type=
'ZXY', isflux=.false. )
759 dv_monit_id(im_qtot), &
760 dim_type=
'ZXY', isflux=.false. )
761 call monitor_reg(
'EVAP',
'evaporation at the surface',
'kg', &
762 dv_monit_id(im_evap), &
763 dim_type=
'XY', isflux=.true. )
765 dv_monit_id(im_prec), &
766 dim_type=
'XY', isflux=.true. )
769 dv_monit_id(im_engt), &
770 dim_type=
'ZXY', isflux=.false. )
771 call monitor_reg(
'ENGP',
'potential energy',
'J', &
772 dv_monit_id(im_engp), &
773 dim_type=
'ZXY', isflux=.false. )
775 dv_monit_id(im_engk), &
776 dim_type=
'ZXY', isflux=.false. )
777 call monitor_reg(
'ENGI',
'internal energy',
'J', &
778 dv_monit_id(im_engi), &
779 dim_type=
'ZXY', isflux=.false. )
781 call monitor_reg(
'ENGFLXT',
'total energy flux convergence',
'J', &
782 dv_monit_id(im_engflxt), &
783 dim_type=
'XY', isflux=.true. )
784 call monitor_reg(
'ENGSFC_SH',
'SFC specific heat flux',
'J', &
785 dv_monit_id(im_engsfc_sh), &
786 dim_type=
'XY', isflux=.true. )
787 call monitor_reg(
'ENGSFC_LH',
'SFC latent heat flux',
'J', &
788 dv_monit_id(im_engsfc_lh), &
789 dim_type=
'XY', isflux=.true. )
790 call monitor_reg(
'ENGSFC_RD',
'SFC net radiation flux',
'J', &
791 dv_monit_id(im_engsfc_rd), &
792 dim_type=
'XY', isflux=.true. )
793 call monitor_reg(
'ENGTOA_RD',
'TOA net radiation flux',
'J', &
794 dv_monit_id(im_engtoa_rd), &
795 dim_type=
'XY', isflux=.true. )
797 call monitor_reg(
'ENGSFC_LW_up',
'SFC LW upward flux',
'J', &
798 dv_monit_id(im_engsfc_lw_up), &
799 dim_type=
'XY', isflux=.true. )
800 call monitor_reg(
'ENGSFC_LW_dn',
'SFC LW downward flux',
'J', &
801 dv_monit_id(im_engsfc_lw_dn), &
802 dim_type=
'XY', isflux=.true. )
803 call monitor_reg(
'ENGSFC_SW_up',
'SFC SW upward flux',
'J', &
804 dv_monit_id(im_engsfc_sw_up), &
805 dim_type=
'XY', isflux=.true. )
806 call monitor_reg(
'ENGSFC_SW_dn',
'SFC SW downward flux',
'J', &
807 dv_monit_id(im_engsfc_sw_dn), &
808 dim_type=
'XY', isflux=.true. )
810 call monitor_reg(
'ENGTOA_LW_up',
'TOA LW upward flux',
'J', &
811 dv_monit_id(im_engtoa_lw_up), &
812 dim_type=
'XY', isflux=.true. )
813 call monitor_reg(
'ENGTOA_LW_dn',
'TOA LW downward flux',
'J', &
814 dv_monit_id(im_engtoa_lw_dn), &
815 dim_type=
'XY', isflux=.true. )
816 call monitor_reg(
'ENGTOA_SW_up',
'TOA SW upward flux',
'J', &
817 dv_monit_id(im_engtoa_sw_up), &
818 dim_type=
'XY', isflux=.true. )
819 call monitor_reg(
'ENGTOA_SW_dn',
'TOA SW downward flux',
'J', &
820 dv_monit_id(im_engtoa_sw_dn), &
821 dim_type=
'XY', isflux=.true. )
835 logical,
intent(in),
optional :: FILL_BND
842 if (
present(fill_bnd) ) fill_bnd_ = fill_bnd
870 call comm_vars8(
dens(:,:,:), 1 )
871 call comm_vars8(
momz(:,:,:), 2 )
872 call comm_vars8(
momx(:,:,:), 3 )
873 call comm_vars8(
momy(:,:,:), 4 )
874 call comm_vars8(
rhot(:,:,:), 5 )
875 call comm_wait (
dens(:,:,:), 1, fill_bnd_ )
876 call comm_wait (
momz(:,:,:), 2, fill_bnd_ )
877 call comm_wait (
momx(:,:,:), 3, fill_bnd_ )
878 call comm_wait (
momy(:,:,:), 4, fill_bnd_ )
879 call comm_wait (
rhot(:,:,:), 5, fill_bnd_ )
882 call comm_vars8(
qtrc(:,:,:,iq), iq )
885 call comm_wait (
qtrc(:,:,:,iq), iq, fill_bnd_ )
902 file_cartesc_check_coordinates
933 character(len=19) :: timelabel
934 character(len=H_LONG) :: basename
938 log_info(
"ATMOS_vars_restart_open",*)
'Open restart file (ATMOS) ' 949 log_info(
"ATMOS_vars_restart_open",*)
'basename: ', trim(basename)
953 if ( atmos_restart_in_check_coordinates )
then 954 call file_cartesc_check_coordinates( restart_fid, atmos=.true. )
958 log_error(
"ATMOS_vars_restart_open",*)
'restart file for atmosphere is not specified. STOP!' 1026 if ( restart_fid /= -1 )
then 1028 log_info(
"ATMOS_vars_restart_read",*)
'Read from restart file (ATMOS) ' 1030 call file_cartesc_read( restart_fid, pv_info(
i_dens)%NAME,
'ZXY', &
1032 call file_cartesc_read( restart_fid, pv_info(
i_momz)%NAME,
'ZHXY', &
1034 call file_cartesc_read( restart_fid, pv_info(
i_momx)%NAME,
'ZXHY', &
1036 call file_cartesc_read( restart_fid, pv_info(
i_momy)%NAME,
'ZXYH', &
1038 call file_cartesc_read( restart_fid, pv_info(
i_rhot)%NAME,
'ZXY', &
1042 call file_cartesc_read( restart_fid,
tracer_name(iq),
'ZXY', &
1070 log_error(
"ATMOS_vars_restart_read",*)
'invalid restart file ID for atmosphere. STOP!' 1109 real(RP) :: SFC_DENS(
ia,
ja)
1110 real(RP) :: SFC_PRES(
ia,
ja)
1115 real_cz(:,:,:),
topo_zsfc(:,:), real_z1(:,:), &
1116 sfc_dens(:,:), sfc_pres(:,:) )
1134 file_cartesc_read, &
1139 real(RP) :: DENS_check(
ka,
ia,
ja)
1140 real(RP) :: MOMZ_check(
ka,
ia,
ja)
1141 real(RP) :: MOMX_check(
ka,
ia,
ja)
1142 real(RP) :: MOMY_check(
ka,
ia,
ja)
1143 real(RP) :: RHOT_check(
ka,
ia,
ja)
1144 real(RP) :: QTRC_check(
ka,
ia,
ja,
qa)
1146 character(len=H_LONG) :: basename
1148 logical :: datacheck
1149 integer :: k, i, j, iq
1163 call file_cartesc_read( fid,
'DENS',
'ZXY' , dens_check(:,:,:) )
1164 call file_cartesc_read( fid,
'MOMZ',
'ZHXY', momz_check(:,:,:) )
1165 call file_cartesc_read( fid,
'MOMX',
'ZXHY', momx_check(:,:,:) )
1166 call file_cartesc_read( fid,
'MOMY',
'ZXYH', momy_check(:,:,:) )
1167 call file_cartesc_read( fid,
'RHOT',
'ZXY' , rhot_check(:,:,:) )
1169 call file_cartesc_read( fid,
tracer_name(iq),
'ZXY', qtrc_check(:,:,:,iq) )
1179 log_error(
"ATMOS_vars_restart_check",*)
'there is the difference : ',
dens(k,i,j)-dens_check(k,i,j)
1180 log_error_cont(*)
'at (PE-id,k,i,j,varname) : ',
prc_myrank, k, i, j,
'DENS' 1191 log_error(
"ATMOS_vars_restart_check",*)
'there is the difference : ',
momz(k,i,j)-momz_check(k,i,j)
1192 log_error_cont(*)
'at (PE-id,k,i,j,varname) : ',
prc_myrank, k, i, j,
'MOMZ' 1203 log_error(
"ATMOS_vars_restart_check",*)
'there is the difference : ',
momx(k,i,j)-momx_check(k,i,j)
1204 log_error_cont(*)
'at (PE-id,k,i,j,varname) : ',
prc_myrank, k, i, j,
'MOMX' 1215 log_error(
"ATMOS_vars_restart_check",*)
'there is the difference : ',
momy(k,i,j)-momy_check(k,i,j)
1216 log_error_cont(*)
'at (PE-id,k,i,j,varname) : ',
prc_myrank, k, i, j,
'MOMY' 1227 log_error(
"ATMOS_vars_restart_check",*)
'there is the difference : ',
rhot(k,i,j)-rhot_check(k,i,j)
1228 log_error_cont(*)
'at (PE-id,k,i,j,varname) : ',
prc_myrank, k, i, j,
'RHOT' 1240 log_error(
"ATMOS_vars_restart_check",*)
'there is the difference : ',
qtrc(k,i,j,iq)-qtrc_check(k,i,j,iq)
1250 log_info(
"ATMOS_vars_restart_check",*)
'Data Check Clear.' 1252 log_info(
"ATMOS_vars_restart_check",*)
'Data Check Failed. See std. output.' 1253 log_error(
"ATMOS_vars_restart_check",*)
'Data Check Failed.' 1265 file_history_query, &
1282 if ( atmos_vars_checkrange )
then 1283 call valcheck(
dens(:,:,:), 0.0_rp, 2.0_rp, pv_info(
i_dens)%NAME, __file__, __line__ )
1284 call valcheck(
momz(:,:,:), -200.0_rp, 200.0_rp, pv_info(
i_momz)%NAME, __file__, __line__ )
1285 call valcheck(
momx(:,:,:), -200.0_rp, 200.0_rp, pv_info(
i_momx)%NAME, __file__, __line__ )
1286 call valcheck(
momy(:,:,:), -200.0_rp, 200.0_rp, pv_info(
i_momy)%NAME, __file__, __line__ )
1287 call valcheck(
rhot(:,:,:), 0.0_rp, 1000.0_rp, pv_info(
i_rhot)%NAME, __file__, __line__ )
1291 call file_history_put ( pv_hist_id(
i_dens),
dens(:,:,:) )
1292 call file_history_put ( pv_hist_id(
i_momz),
momz(:,:,:) )
1293 call file_history_put ( pv_hist_id(
i_momx),
momx(:,:,:) )
1294 call file_history_put ( pv_hist_id(
i_momy),
momy(:,:,:) )
1295 call file_history_put ( pv_hist_id(
i_rhot),
rhot(:,:,:) )
1297 call file_history_put ( qp_hist_id(iq),
qtrc(:,:,:,iq) )
1302 call file_history_put ( dv_hist_id(i_w ),
w(:,:,:) )
1303 call file_history_put ( dv_hist_id(i_u ),
u(:,:,:) )
1304 call file_history_put ( dv_hist_id(i_v ),
v(:,:,:) )
1305 call file_history_put ( dv_hist_id(i_pott ),
pott(:,:,:) )
1306 call file_history_put ( dv_hist_id(i_temp ),
temp(:,:,:) )
1307 call file_history_put ( dv_hist_id(i_pres ),
pres(:,:,:) )
1309 call file_history_put ( dv_hist_id(i_exner),
exner(:,:,:) )
1310 call file_history_put ( dv_hist_id(i_phyd ),
phyd(:,:,:) )
1312 call file_history_put ( dv_hist_id(i_qdry ),
qdry(:,:,:) )
1313 call file_history_put ( dv_hist_id(i_rtot ),
rtot(:,:,:) )
1314 call file_history_put ( dv_hist_id(i_cvtot),
cvtot(:,:,:) )
1315 call file_history_put ( dv_hist_id(i_cptot),
cptot(:,:,:) )
1317 do iv = i_cptot+1, dv_nmax
1318 if ( dv_hist_id(iv) > 0 )
then 1319 call file_history_query( dv_hist_id(iv), do_put )
1322 select case( dv_info(iv)%ndims )
1324 call atmos_vars_get_diagnostic( dv_info(iv)%NAME, work3d(:,:,:) )
1325 call file_history_put( dv_hist_id(iv), work3d(:,:,:) )
1327 call atmos_vars_get_diagnostic( dv_info(iv)%NAME, work2d(:,:) )
1328 call file_history_put( dv_hist_id(iv), work2d(:,:) )
1330 call atmos_vars_get_diagnostic( dv_info(iv)%NAME, work1d(:) )
1331 call file_history_put( dv_hist_id(iv), work1d(:) )
1337 call file_history_put( hist_id_gph, real_cz(:,:,:) )
1372 real(RP) :: RHOQ(
ka,
ia,
ja)
1400 rhoq(:,:,:) =
dens(:,:,:) *
qtrc(:,:,:,iq)
1413 rhoq(:,:,:),
'QDRY', &
1419 rhoq(:,:,:),
'QTOT', &
1424 call atmos_vars_get_diagnostic(
'ENGT', work3d(:,:,:) )
1426 work3d(:,:,:),
'ENGT', &
1429 call atmos_vars_get_diagnostic(
'ENGP', work3d(:,:,:) )
1431 work3d(:,:,:),
'ENGP', &
1434 call atmos_vars_get_diagnostic(
'ENGK', work3d(:,:,:) )
1436 work3d(:,:,:),
'ENGK', &
1439 call atmos_vars_get_diagnostic(
'ENGI', work3d(:,:,:) )
1441 work3d(:,:,:),
'ENGI', &
1457 atmos_thermodyn_specific_heat
1477 call atmos_thermodyn_specific_heat( &
1478 ka,
ks,
ke,
ia, 1,
ia,
ja, 1,
ja,
qa, &
1481 qdry(:,:,:),
rtot(:,:,:),
cvtot(:,:,:),
cptot(:,:,:) )
1485 dens_av(:,:,:),
momz_av(:,:,:),
momx_av(:,:,:),
momy_av(:,:,:), &
1486 w(:,:,:),
u(:,:,:),
v(:,:,:) )
1492 pott(:,:,:),
temp(:,:,:),
pres(:,:,:),
exner(:,:,:) )
1497 real_cz(:,:,:), real_fz(:,:,:), &
1505 dens_av(:,:,:),
temp(:,:,:),
qtrc_av(:,:,:,:), &
1508 call comm_vars8(
qe(:,:,:,iq), iq)
1511 call comm_wait (
qe(:,:,:,iq), iq)
1516 dv_calculated(:) = .false.
1547 atmos_hydrometeor_lhv, &
1548 atmos_hydrometeor_lhf, &
1549 atmos_hydrometeor_lhs
1551 atmos_saturation_dens2qsat_all, &
1552 atmos_saturation_psat_all, &
1553 atmos_saturation_psat_liq, &
1554 atmos_saturation_psat_ice, &
1555 atmos_saturation_tdew_liq, &
1556 atmos_saturation_pote
1562 character(len=*),
intent(in) :: vname
1563 real(RP),
intent(out) :: var(:,:,:)
1565 real(RP) :: UH (
ka,
ia,
ja)
1566 real(RP) :: VH (
ka,
ia,
ja)
1568 real(RP) :: WORK(
ka,
ia,
ja)
1570 integer :: k, i, j, iq
1572 select case ( vname )
1574 var(:,:,:) =
w(:,:,:)
1577 var(:,:,:) =
u(:,:,:)
1580 var(:,:,:) =
v(:,:,:)
1583 var(:,:,:) =
pott(:,:,:)
1586 var(:,:,:) =
temp(:,:,:)
1589 var(:,:,:) =
exner(:,:,:)
1592 var(:,:,:) =
phyd(:,:,:)
1595 var(:,:,:) =
qdry(:,:,:)
1598 var(:,:,:) =
rtot(:,:,:)
1601 var(:,:,:) =
cvtot(:,:,:)
1604 var(:,:,:) =
cptot(:,:,:)
1607 if ( .not. dv_calculated(i_lhv) )
then 1609 call atmos_hydrometeor_lhv( &
1613 dv_calculated(i_lhv) = .true.
1618 if ( .not. dv_calculated(i_lhs) )
then 1620 call atmos_hydrometeor_lhs( &
1624 dv_calculated(i_lhs) = .true.
1629 if ( .not. dv_calculated(i_lhf) )
then 1631 call atmos_hydrometeor_lhf( &
1635 dv_calculated(i_lhf) = .true.
1640 if ( .not. dv_calculated(i_potv) )
then 1646 dv_calculated(i_potv) = .true.
1651 if ( .not. dv_calculated(i_teml) )
then 1653 call atmos_vars_get_diagnostic(
'LHV', work3d(:,:,:) )
1654 call atmos_vars_get_diagnostic(
'LHS', work3d(:,:,:) )
1655 call atmos_vars_get_diagnostic(
'QLIQ', work3d(:,:,:) )
1656 call atmos_vars_get_diagnostic(
'QICE', work3d(:,:,:) )
1659 temp(:,:,:),
lhv(:,:,:), lhs(:,:,:), &
1662 dv_calculated(i_teml) = .true.
1667 if ( .not. dv_calculated(i_potl) )
then 1669 call atmos_vars_get_diagnostic(
'TEML', work3d(:,:,:) )
1678 potl(k,i,j) = teml(k,i,j) /
exner(k,i,j)
1682 dv_calculated(i_potl) = .true.
1687 if ( .not. dv_calculated(i_pote) )
then 1689 call atmos_saturation_pote( &
1691 dens(:,:,:),
pott(:,:,:),
temp(:,:,:),
qv(:,:,:), &
1696 if ( .not. dv_calculated(i_qtot) )
then 1699 call atmos_vars_get_diagnostic(
'QHYD', work3d(:,:,:) )
1708 qtot(k,i,j) =
qv(k,i,j) + qhyd(k,i,j)
1721 qtot(k,i,j) = 0.0_rp
1726 dv_calculated(i_qtot) = .true.
1731 if ( .not. dv_calculated(i_qhyd) )
then 1734 call atmos_vars_get_diagnostic(
'QLIQ', work3d(:,:,:) )
1735 call atmos_vars_get_diagnostic(
'QICE', work3d(:,:,:) )
1744 qhyd(k,i,j) = qliq(k,i,j) + qice(k,i,j)
1757 qhyd(k,i,j) = 0.0_rp
1762 dv_calculated(i_qhyd) = .true.
1767 if ( .not. dv_calculated(i_qliq) )
then 1777 qliq(k,i,j) =
qc(k,i,j) +
qr(k,i,j)
1781 dv_calculated(i_qliq) = .true.
1786 if ( .not. dv_calculated(i_qice) )
then 1796 qice(k,i,j) =
qi(k,i,j) +
qs(k,i,j) +
qg(k,i,j) +
qh(k,i,j)
1800 dv_calculated(i_qice) = .true.
1805 if ( .not. dv_calculated(i_qsat) )
then 1807 call atmos_saturation_dens2qsat_all( &
1811 dv_calculated(i_qsat) = .true.
1816 if ( .not. dv_calculated(i_rha) )
then 1819 call atmos_saturation_psat_all( &
1831 rha(k,i,j) =
dens_av(k,i,j) *
qv(k,i,j) &
1832 / work(k,i,j) * rvap *
temp(k,i,j) &
1851 dv_calculated(i_rha) = .true.
1855 case (
'RHL',
'RH' )
1856 if ( .not. dv_calculated(i_rhl) )
then 1859 call atmos_saturation_psat_liq( &
1871 rhl(k,i,j) =
dens_av(k,i,j) *
qv(k,i,j) &
1872 / work(k,i,j) * rvap *
temp(k,i,j) &
1891 dv_calculated(i_rhl) = .true.
1896 if ( .not. dv_calculated(i_rhi) )
then 1899 call atmos_saturation_psat_ice( &
1911 rhi(k,i,j) =
dens_av(k,i,j) *
qv(k,i,j) &
1912 / work(k,i,j) * rvap *
temp(k,i,j) &
1931 dv_calculated(i_rhi) = .true.
1936 if ( .not. dv_calculated(i_vor) )
then 1968 vor(k,i,j) = ( vh(k,i,j ) - vh(k,i-1,j ) ) * rcdx(i) &
1969 - ( uh(k,i ,j) - uh(k,i ,j-1) ) * rcdy(j)
1976 vor(k,1 ,j) = vor(k,2 ,j)
1977 vor(k,
ia,j) = vor(k,
ia-1,j)
1983 vor(k,i,1 ) = vor(k,i,2 )
1984 vor(k,i,
ja) = vor(k,i,
ja-1)
1987 dv_calculated(i_vor) = .true.
1992 if ( .not. dv_calculated(i_div) )
then 1994 call atmos_vars_get_diagnostic(
'HDIV', work3d(:,:,:) )
2001 div(k,i,j) = (
momz_av(k,i,j) -
momz_av(k-1,i ,j ) ) * ( real_fz(k,i,j)-real_fz(k-1,i,j) ) &
2006 dv_calculated(i_div) = .true.
2011 if ( .not. dv_calculated(i_hdiv) )
then 2019 hdiv(k,i,j) = (
momx_av(k,i,j) -
momx_av(k ,i-1,j ) ) * rcdx(i) &
2027 hdiv(k,i,1) = hdiv(k,i,2)
2033 hdiv(k,1,j) = hdiv(k,2,j)
2036 dv_calculated(i_hdiv) = .true.
2041 if ( .not. dv_calculated(i_uabs) )
then 2048 uabs(k,i,j) = sqrt(
w(k,i,j)**2 +
u(k,i,j)**2 +
v(k,i,j)**2 )
2052 dv_calculated(i_uabs) = .true.
2057 if ( .not. dv_calculated(i_n2) )
then 2064 dv_calculated(i_n2) = .true.
2069 if ( .not. dv_calculated(i_mse) )
then 2071 call atmos_vars_get_diagnostic(
'LHV', work3d(:,:,:) )
2077 mse(k,i,j) =
cptot(k,i,j) *
temp(k,i,j) &
2078 + grav * ( real_cz(k,i,j) - real_fz(
ks-1,i,j) ) &
2079 +
lhv(k,i,j) *
qv(k,i,j)
2083 dv_calculated(i_mse) = .true.
2088 if ( .not. dv_calculated(i_tdew) )
then 2090 call atmos_saturation_tdew_liq(
ka,
ks,
ke,
ia, 1,
ia,
ja, 1,
ja, &
2093 dv_calculated(i_tdew) = .true.
2098 if ( .not. dv_calculated(i_engp) )
then 2104 engp(k,i,j) =
dens_av(k,i,j) * grav * real_cz(k,i,j)
2108 dv_calculated(i_engp) = .true.
2113 if ( .not. dv_calculated(i_engk) )
then 2119 engk(k,i,j) = 0.5_rp *
dens_av(k,i,j) &
2120 * (
w(k,i,j)**2 +
u(k,i,j)**2 +
v(k,i,j)**2 )
2124 dv_calculated(i_engk) = .true.
2129 if ( .not. dv_calculated(i_engi) )
then 2132 call atmos_vars_get_diagnostic(
'QICE', work3d(:,:,:) )
2140 engi(k,i,j) = engi(k,i,j) &
2144 engi(k,i,j) = engi(k,i,j) &
2146 - qice(k,i,j) * lhfc )
2151 dv_calculated(i_engi) = .true.
2156 if ( .not. dv_calculated(i_engt) )
then 2158 call atmos_vars_get_diagnostic(
'ENGP', work3d(:,:,:) )
2159 call atmos_vars_get_diagnostic(
'ENGK', work3d(:,:,:) )
2160 call atmos_vars_get_diagnostic(
'ENGI', work3d(:,:,:) )
2165 engt(k,i,j) = engp(k,i,j) + engk(k,i,j) + engi(k,i,j)
2169 dv_calculated(i_engt) = .true.
2173 case (
'DENS_PRIM' )
2174 if ( .not. dv_calculated(i_dens_prim) )
then 2176 call atmos_vars_get_diagnostic(
'DENS_MEAN', work1d(:) )
2182 dens_prim(k,i,j) =
dens_av(k,i,j) - dens_mean(k)
2186 dv_calculated(i_dens_prim) = .true.
2188 var(
ks:
ke,:,:) = dens_prim(
ks:
ke,:,:)
2191 if ( .not. dv_calculated(i_w_prim) )
then 2193 call atmos_vars_get_diagnostic(
'W_MEAN', work1d(:) )
2199 w_prim(k,i,j) =
w(k,i,j) - w_mean(k)
2203 dv_calculated(i_w_prim) = .true.
2208 if ( .not. dv_calculated(i_u_prim) )
then 2210 call atmos_vars_get_diagnostic(
'U_MEAN', work1d(:) )
2216 u_prim(k,i,j) =
u(k,i,j) - u_mean(k)
2220 dv_calculated(i_u_prim) = .true.
2225 if ( .not. dv_calculated(i_v_prim) )
then 2227 call atmos_vars_get_diagnostic(
'V_MEAN', work1d(:) )
2233 v_prim(k,i,j) =
v(k,i,j) - v_mean(k)
2237 dv_calculated(i_v_prim) = .true.
2242 if ( .not. dv_calculated(i_pt_prim) )
then 2244 call atmos_vars_get_diagnostic(
'PT_MEAN', work1d(:) )
2250 pt_prim(k,i,j) =
pott(k,i,j) - pt_mean(k)
2254 dv_calculated(i_pt_prim) = .true.
2256 var(
ks:
ke,:,:) = pt_prim(
ks:
ke,:,:)
2259 if ( .not. dv_calculated(i_w_prim2) )
then 2261 call atmos_vars_get_diagnostic(
'W_PRIM', work3d(:,:,:) )
2267 w_prim2(k,i,j) = w_prim(k,i,j)**2
2271 dv_calculated(i_w_prim2) = .true.
2273 var(
ks:
ke,:,:) = w_prim2(
ks:
ke,:,:)
2275 case (
'PT_W_PRIM' )
2276 if ( .not. dv_calculated(i_pt_w_prim) )
then 2278 call atmos_vars_get_diagnostic(
'W_PRIM', work3d(:,:,:) )
2279 call atmos_vars_get_diagnostic(
'PT_PRIM', work3d(:,:,:) )
2284 pt_w_prim(k,i,j) = w_prim(k,i,j) * pt_prim(k,i,j) *
dens_av(k,i,j) * cpdry
2288 dv_calculated(i_pt_w_prim) = .true.
2290 var(
ks:
ke,:,:) = pt_w_prim(
ks:
ke,:,:)
2293 if ( .not. dv_calculated(i_w_prim3) )
then 2295 call atmos_vars_get_diagnostic(
'W_PRIM', work3d(:,:,:) )
2301 w_prim3(k,i,j) = w_prim(k,i,j)**3
2305 dv_calculated(i_w_prim3) = .true.
2307 var(
ks:
ke,:,:) = w_prim3(
ks:
ke,:,:)
2310 if ( .not. dv_calculated(i_tke_rs) )
then 2312 call atmos_vars_get_diagnostic(
'W_PRIM', work3d(:,:,:) )
2313 call atmos_vars_get_diagnostic(
'U_PRIM', work3d(:,:,:) )
2314 call atmos_vars_get_diagnostic(
'V_PRIM', work3d(:,:,:) )
2320 tke_rs(k,i,j) = 0.5_rp * ( w_prim(k,i,j)**2 + u_prim(k,i,j)**2 + v_prim(k,i,j)**2 )
2324 dv_calculated(i_tke_rs) = .true.
2329 if ( .not. dv_calculated(i_velz) )
then 2335 velz(
ks-1,i,j) = 0.0_rp
2337 velz(k,i,j) =
momz(k,i,j) * 2.0_rp / (
dens(k,i,j) +
dens(k+1,i,j) )
2339 velz(
ke,i,j) = 0.0_rp
2342 dv_calculated(i_velz) = .true.
2344 var(
ks-1:
ke,:,:) = velz(
ks-1:
ke,:,:)
2347 if ( .not. dv_calculated(i_velx) )
then 2354 velx(k,i,j) =
momx(k,i,j) * 2.0_rp / (
dens(k,i,j) +
dens(k,i+1,j) )
2365 call comm_vars8( velx(:,:,:), 1 )
2366 call comm_wait ( velx(:,:,:), 1, .false. )
2367 dv_calculated(i_velx) = .true.
2372 if ( .not. dv_calculated(i_vely) )
then 2379 vely(k,i,j) =
momy(k,i,j) * 2.0_rp / (
dens(k,i,j) +
dens(k,i,j+1) )
2390 call comm_vars8( vely(:,:,:), 1 )
2391 call comm_wait ( vely(:,:,:), 1, .false. )
2392 dv_calculated(i_vely) = .true.
2397 if ( .not. dv_calculated(i_umet) )
then 2404 umet(k,i,j) =
u(k,i,j) * rotc(i,j,1) -
v(k,i,j) * rotc(i,j,2)
2408 dv_calculated(i_umet) = .true.
2413 if ( .not. dv_calculated(i_vmet) )
then 2420 vmet(k,i,j) =
u(k,i,j) * rotc(i,j,2) +
v(k,i,j) * rotc(i,j,1)
2424 dv_calculated(i_vmet) = .true.
2429 log_error(
"ATMOS_vars_calc_diagnostics",*)
'name is invalid for ATMOS_vars_get_diagnostic_3D: ', trim(vname)
2456 character(len=*),
intent(in) :: vname
2457 real(RP),
intent(out) :: var(:,:)
2463 select case ( vname )
2465 if ( .not. dv_calculated(i_lwp) )
then 2467 call atmos_vars_get_diagnostic(
'QLIQ', work3d(:,:,:) )
2476 lwp(i,j) = lwp(i,j) &
2477 + qliq(k,i,j) *
dens_av(k,i,j) * ( real_fz(k,i,j)-real_fz(k-1,i,j) ) * 1.e3_rp
2481 dv_calculated(i_lwp) = .true.
2486 if ( .not. dv_calculated(i_iwp) )
then 2488 call atmos_vars_get_diagnostic(
'QICE', work3d(:,:,:) )
2497 iwp(i,j) = iwp(i,j) &
2498 + qice(k,i,j) *
dens_av(k,i,j) * ( real_fz(k,i,j)-real_fz(k-1,i,j) ) * 1.e3_rp
2502 dv_calculated(i_iwp) = .true.
2507 if ( .not. dv_calculated(i_pw) )
then 2518 +
qv(k,i,j) *
dens_av(k,i,j) * ( real_fz(k,i,j)-real_fz(k-1,i,j) ) * 1.e3_rp
2522 dv_calculated(i_pw) = .true.
2527 if ( .not. dv_calculated(i_pblh) )
then 2529 call atmos_vars_get_diagnostic(
'POTV', work3d(:,:,:) )
2537 pblh(i,j) = real_cz(
ks,i,j) - real_fz(
ks-1,i,j)
2539 if ( potv(k,i,j) > potv(
ks,i,j) )
then 2540 fact = ( potv(
ks,i,j) - potv(k-1,i,j) ) &
2541 / ( potv(k,i,j) - potv(k-1,i,j) )
2542 pblh(i,j) = real_cz(k-1,i,j) - real_fz(
ks-1,i,j) &
2543 + fact * ( real_cz(k,i,j) - real_cz(k-1,i,j) )
2550 dv_calculated(i_pblh) = .true.
2552 var(:,:) = pblh(:,:)
2554 case (
'CAPE',
'CIN',
'LCL',
'LFC',
'LNB' )
2555 if ( .not. dv_calculated(i_cape) )
then 2561 call atmos_adiabat_cape( &
2565 qv(:,:,:),
qc(:,:,:),
qdry(:,:,:), &
2567 real_cz(:,:,:), real_fz(:,:,:), &
2568 cape(:,:), cin(:,:), lcl(:,:), lfc(:,:), lnb(:,:) )
2569 dv_calculated(i_cape) = .true.
2571 select case ( vname )
2573 var(:,:) = cape(:,:)
2584 case (
'PREC',
'RAIN',
'SNOW' )
2585 if ( .not. dv_calculated(i_prec) )
then 2592 rain(i,j) = sflx_rain_mp(i,j) + sflx_rain_cp(i,j)
2593 snow(i,j) = sflx_snow_mp(i,j)
2594 prec(i,j) = rain(i,j) + snow(i,j)
2597 dv_calculated(i_prec) = .true.
2601 var(:,:) = rain(:,:)
2603 var(:,:) = snow(:,:)
2605 var(:,:) = prec(:,:)
2609 log_error(
"ATMOS_vars_calc_diagnostics",*)
'name is invalid for ATMOS_vars_get_diagnostic_2D: ', trim(vname)
2627 statistics_horizontal_mean
2632 character(len=*),
intent(in) :: vname
2633 real(RP),
intent(out) :: var(:)
2635 real(RP) :: WORK(
ka,
ia,
ja)
2639 select case ( vname )
2640 case (
'DENS_MEAN' )
2641 if ( .not. dv_calculated(i_dens_mean) )
then 2644 dens(:,:,:), area(:,:), dens_mean(:) )
2645 dv_calculated(i_dens_mean) = .true.
2647 var(:) = dens_mean(:)
2650 if ( .not. dv_calculated(i_w_mean) )
then 2652 call atmos_vars_get_diagnostic(
'DENS_MEAN', work1d(:) )
2658 work(k,i,j) =
w(k,i,j) *
dens_av(k,i,j)
2663 work(:,:,:), area(:,:), w_mean(:) )
2665 w_mean(k) = w_mean(k) / dens_mean(k)
2667 dv_calculated(i_w_mean) = .true.
2672 if ( .not. dv_calculated(i_u_mean) )
then 2674 call atmos_vars_get_diagnostic(
'DENS_MEAN', work1d(:) )
2680 work(k,i,j) =
u(k,i,j) *
dens_av(k,i,j)
2685 work(:,:,:), area(:,:), u_mean(:) )
2687 u_mean(k) = u_mean(k) / dens_mean(k)
2689 dv_calculated(i_u_mean) = .true.
2694 if ( .not. dv_calculated(i_v_mean) )
then 2696 call atmos_vars_get_diagnostic(
'DENS_MEAN', work1d(:) )
2702 work(k,i,j) =
v(k,i,j) *
dens_av(k,i,j)
2707 work(:,:,:), area(:,:), v_mean(:) )
2709 v_mean(k) = v_mean(k) / dens_mean(k)
2711 dv_calculated(i_v_mean) = .true.
2716 if ( .not. dv_calculated(i_pt_mean) )
then 2718 call atmos_vars_get_diagnostic(
'DENS_MEAN', work1d(:) )
2720 rhot(:,:,:), area(:,:), pt_mean(:) )
2722 pt_mean(k) = pt_mean(k) / dens_mean(k)
2724 dv_calculated(i_pt_mean) = .true.
2729 if ( .not. dv_calculated(i_t_mean) )
then 2731 call atmos_vars_get_diagnostic(
'DENS_MEAN', work1d(:) )
2742 work(:,:,:), area(:,:), t_mean(:) )
2744 t_mean(k) = t_mean(k) / dens_mean(k)
2746 dv_calculated(i_t_mean) = .true.
2751 if ( .not. dv_calculated(i_qv_mean) )
then 2754 call atmos_vars_get_diagnostic(
'DENS_MEAN', work1d(:) )
2760 work(k,i,j) =
qv(k,i,j) *
dens_av(k,i,j)
2765 work(:,:,:), area(:,:), qv_mean(:) )
2767 qv_mean(k) = qv_mean(k) / dens_mean(k)
2775 dv_calculated(i_qv_mean) = .true.
2779 case (
'QHYD_MEAN' )
2780 if ( .not. dv_calculated(i_qhyd_mean) )
then 2782 call atmos_vars_get_diagnostic(
'DENS_MEAN', work1d(:) )
2783 call atmos_vars_get_diagnostic(
'QHYD', work3d(:,:,:) )
2789 work(k,i,j) = qhyd(k,i,j) *
dens_av(k,i,j)
2794 work(:,:,:), area(:,:), qhyd_mean(:) )
2796 qhyd_mean(k) = qhyd_mean(k) / dens_mean(k)
2798 dv_calculated(i_qhyd_mean) = .true.
2800 var(:) = qhyd_mean(:)
2802 case (
'QLIQ_MEAN' )
2803 if ( .not. dv_calculated(i_qliq_mean) )
then 2805 call atmos_vars_get_diagnostic(
'DENS_MEAN', work1d(:) )
2806 call atmos_vars_get_diagnostic(
'QLIQ', work3d(:,:,:) )
2812 work(k,i,j) = qliq(k,i,j) *
dens_av(k,i,j)
2817 work(:,:,:), area(:,:), qliq_mean(:) )
2819 qliq_mean(k) = qliq_mean(k) / dens_mean(k)
2821 dv_calculated(i_qliq_mean) = .true.
2823 var(:) = qliq_mean(:)
2825 case (
'QICE_MEAN' )
2826 if ( .not. dv_calculated(i_qice_mean) )
then 2828 call atmos_vars_get_diagnostic(
'DENS_MEAN', work1d(:) )
2829 call atmos_vars_get_diagnostic(
'QICE', work3d(:,:,:) )
2835 work(k,i,j) = qice(k,i,j) *
dens_av(k,i,j)
2840 work(:,:,:), area(:,:), qice_mean(:) )
2842 qice_mean(k) = qice_mean(k) / dens_mean(k)
2844 dv_calculated(i_qice_mean) = .true.
2846 var(:) = qice_mean(:)
2849 log_error(
"ATMOS_vars_calc_diagnostics",*)
'name is invalid for ATMOS_vars_get_diagnostic_1D: ', trim(vname)
2905 real(RP) :: RHOQ(
ka,
ia,
ja)
2907 real(RP) :: ENGFLXT (
ia,
ja)
2908 real(RP) :: SFLX_RD_net(
ia,
ja)
2909 real(RP) :: TFLX_RD_net(
ia,
ja)
2911 real(RP) :: WORK (
ka,
ia,
ja,3)
2912 character(len=H_SHORT) :: WNAME(3)
2915 integer :: k, i, j, iq
2918 call monitor_put( pv_monit_id(
i_dens),
dens(:,:,:) )
2919 call monitor_put( pv_monit_id(
i_momz),
momz(:,:,:) )
2920 call monitor_put( pv_monit_id(
i_momx),
momx(:,:,:) )
2921 call monitor_put( pv_monit_id(
i_momy),
momy(:,:,:) )
2922 call monitor_put( pv_monit_id(
i_rhot),
rhot(:,:,:) )
2937 call monitor_put( qp_monit_id(iq), rhoq(:,:,:) )
2941 if ( dv_monit_id(im_qdry) > 0 )
then 2947 rhoq(k,i,j) =
dens(k,i,j) *
qdry(k,i,j)
2951 call monitor_put( dv_monit_id(im_qdry), rhoq(:,:,:) )
2955 if ( dv_monit_id(im_qtot) > 0 )
then 2956 call atmos_vars_get_diagnostic(
'QTOT', work3d(:,:,:) )
2962 rhoq(k,i,j) =
dens(k,i,j) * qtot(k,i,j)
2966 call monitor_put( dv_monit_id(im_qtot), rhoq(:,:,:) )
2970 if ( moist )
call monitor_put( dv_monit_id(im_evap), sflx_qtrc(:,:,
i_qv) )
2973 if ( dv_monit_id(im_prec) > 0 )
then 2974 call atmos_vars_get_diagnostic(
'PREC', work2d(:,:) )
2975 call monitor_put( dv_monit_id(im_prec), work2d(:,:) )
2981 if ( dv_monit_id(im_engt) > 0 )
then 2982 call atmos_vars_get_diagnostic(
'ENGT', work3d(:,:,:) )
2983 call monitor_put( dv_monit_id(im_engt), work3d(:,:,:) )
2985 if ( dv_monit_id(im_engp) > 0 )
then 2986 call atmos_vars_get_diagnostic(
'ENGP', work3d(:,:,:) )
2987 call monitor_put( dv_monit_id(im_engp), work3d(:,:,:) )
2989 if ( dv_monit_id(im_engk) > 0 )
then 2990 call atmos_vars_get_diagnostic(
'ENGK', work3d(:,:,:) )
2991 call monitor_put( dv_monit_id(im_engk), work3d(:,:,:) )
2993 if ( dv_monit_id(im_engi) > 0 )
then 2994 call atmos_vars_get_diagnostic(
'ENGI', work3d(:,:,:) )
2995 call monitor_put( dv_monit_id(im_engi), work3d(:,:,:) )
3004 sflx_rd_net(i,j) = ( sflx_lw_up(i,j) - sflx_lw_dn(i,j) ) &
3005 + ( sflx_sw_up(i,j) - sflx_sw_dn(i,j) )
3007 tflx_rd_net(i,j) = ( toaflx_lw_up(i,j) - toaflx_lw_dn(i,j) ) &
3008 + ( toaflx_sw_up(i,j) - toaflx_sw_dn(i,j) )
3010 engflxt(i,j) = sflx_sh(i,j) + sflx_lh(i,j) &
3011 + sflx_rd_net(i,j) - tflx_rd_net(i,j)
3015 call monitor_put( dv_monit_id(im_engflxt), engflxt(:,:) )
3017 call monitor_put( dv_monit_id(im_engsfc_sh), sflx_sh(:,:) )
3018 call monitor_put( dv_monit_id(im_engsfc_lh), sflx_lh(:,:) )
3019 call monitor_put( dv_monit_id(im_engsfc_rd), sflx_rd_net(:,:) )
3020 call monitor_put( dv_monit_id(im_engtoa_rd), tflx_rd_net(:,:) )
3022 call monitor_put( dv_monit_id(im_engsfc_lw_up), sflx_lw_up(:,:) )
3023 call monitor_put( dv_monit_id(im_engsfc_lw_dn), sflx_lw_dn(:,:) )
3024 call monitor_put( dv_monit_id(im_engsfc_sw_up), sflx_sw_up(:,:) )
3025 call monitor_put( dv_monit_id(im_engsfc_sw_dn), sflx_sw_dn(:,:) )
3027 call monitor_put( dv_monit_id(im_engtoa_lw_up), toaflx_lw_up(:,:) )
3028 call monitor_put( dv_monit_id(im_engtoa_lw_dn), toaflx_lw_dn(:,:) )
3029 call monitor_put( dv_monit_id(im_engtoa_sw_up), toaflx_sw_up(:,:) )
3030 call monitor_put( dv_monit_id(im_engtoa_sw_dn), toaflx_sw_dn(:,:) )
3034 if ( atmos_vars_checkrange )
then 3036 work(:,:,:,1) =
w(:,:,:)
3038 work(:,:,:,2) =
u(:,:,:)
3040 work(:,:,:,3) =
v(:,:,:)
3046 call statistics_detail(
ka,
ks,
ke,
ia,
is,
ie,
ja,
js,
je, 3, &
3047 wname(:), work(:,:,:,:) )
3051 .AND. ( atmos_vars_checkcfl_soft > 0.0_rp .OR. atmos_vars_checkcfl_hard > 0.0_rp ) )
then 3053 work(:,:,:,:) = 0.0_rp
3068 cflmax = maxval( work(:,:,:,:) )
3070 if ( atmos_vars_checkcfl_hard > 0.0_rp .AND. cflmax > atmos_vars_checkcfl_hard )
then 3071 log_info(
"ATMOS_vars_monitor",*)
"Courant number =", cflmax,
" exceeded the hard limit =", atmos_vars_checkcfl_hard
3072 log_error(
"ATMOS_vars_monitor",*)
"Courant number =", cflmax,
" exceeded the hard limit =", atmos_vars_checkcfl_hard
3074 log_error_cont(*)
"Please set ATMOS_VARS_CHECKCFL_HARD in the namelist PARAM_ATMOS_VARS when you want to change the limit." 3076 wname(1) =
"Courant num. Z" 3077 wname(2) =
"Courant num. X" 3078 wname(3) =
"Courant num. Y" 3079 call statistics_detail(
ka,
ks,
ke,
ia,
is,
ie,
ja,
js,
je, 3, &
3080 wname(:), work(:,:,:,:), &
3086 if ( atmos_vars_checkcfl_soft > 0.0_rp .AND. cflmax > atmos_vars_checkcfl_soft )
then 3087 log_info(
"ATMOS_vars_monitor",*)
"Courant number =", cflmax,
" exceeded the soft limit =", atmos_vars_checkcfl_soft
3088 log_error(
"ATMOS_vars_monitor",*)
"Courant number =", cflmax,
" exceeded the soft limit =", atmos_vars_checkcfl_soft
3091 wname(1) =
"Courant num. Z" 3092 wname(2) =
"Courant num. X" 3093 wname(3) =
"Courant num. Y" 3094 call statistics_detail(
ka,
ks,
ke,
ia,
is,
ie,
ja,
js,
je, 3, &
3095 wname(:), work(:,:,:,:), &
3138 use scale_atmos_phy_mp_sdm
, only: &
3140 atmos_phy_mp_sdm_restart_create
3146 character(len=19) :: timelabel
3147 character(len=H_LONG) :: basename
3151 if( sd_rest_flg_out )
then 3152 log_info(
"ATMOS_vars_restart_create",*)
'Output random number for SDM ' 3153 call atmos_phy_mp_sdm_restart_create(nowdaysec)
3160 log_info(
"ATMOS_vars_restart_create",*)
'Create restart file (ATMOS) ' 3163 call time_gettimelabel( timelabel )
3169 log_info(
"ATMOS_vars_restart_create",*)
'basename: ', trim(basename)
3176 allocate( pv_id(pv_nmax+
qa) )
3224 use scale_atmos_phy_mp_sdm
, only: &
3226 atmos_phy_mp_sdm_restart_enddef
3233 if( sd_rest_flg_out )
then 3234 call atmos_phy_mp_sdm_restart_enddef
3238 if ( restart_fid /= -1 )
then 3287 use scale_atmos_phy_mp_sdm
, only: &
3289 atmos_phy_mp_sdm_restart_close
3295 if( sd_rest_flg_out )
then 3296 call atmos_phy_mp_sdm_restart_close
3300 if ( restart_fid /= -1 )
then 3302 log_info(
"ATMOS_vars_restart_close",*)
'Close restart file (ATMOS) ' 3308 if (
allocated(pv_id) )
deallocate( pv_id )
3356 use scale_atmos_phy_mp_sdm
, only: &
3358 atmos_phy_mp_sdm_restart_def_var
3366 if( sd_rest_flg_out )
then 3367 call atmos_phy_mp_sdm_restart_def_var
3371 if ( restart_fid /= -1 )
then 3375 standard_name=pv_info(
i_dens)%STDNAME )
3378 standard_name=pv_info(
i_momz)%STDNAME )
3381 standard_name=pv_info(
i_momx)%STDNAME )
3384 standard_name=pv_info(
i_momy)%STDNAME )
3387 standard_name=pv_info(
i_rhot)%STDNAME )
3411 file_cartesc_write_var
3440 use scale_atmos_phy_mp_sdm
, only: &
3442 atmos_phy_mp_sdm_restart_write
3450 if( sd_rest_flg_out )
then 3451 call atmos_phy_mp_sdm_restart_write
3455 if ( restart_fid /= -1 )
then 3461 call file_cartesc_write_var( restart_fid, pv_id(
i_dens),
dens(:,:,:), pv_info(
i_dens)%NAME,
'ZXY' )
3462 call file_cartesc_write_var( restart_fid, pv_id(
i_momz),
momz(:,:,:), pv_info(
i_momz)%NAME,
'ZHXY' )
3463 call file_cartesc_write_var( restart_fid, pv_id(
i_momx),
momx(:,:,:), pv_info(
i_momx)%NAME,
'ZXHY' )
3464 call file_cartesc_write_var( restart_fid, pv_id(
i_momy),
momy(:,:,:), pv_info(
i_momy)%NAME,
'ZXYH' )
3465 call file_cartesc_write_var( restart_fid, pv_id(
i_rhot),
rhot(:,:,:), pv_info(
i_rhot)%NAME,
'ZXY' )
3468 call file_cartesc_write_var( restart_fid, pv_id(pv_nmax+iq),
qtrc(:,:,:,iq),
tracer_name(iq),
'ZXY' )
3490 real(RP),
intent(inout),
allocatable :: ary(:,:,:)
3492 if ( .not.
allocated(ary) )
then 3493 allocate( ary(
ka,
ia,
ja) )
3503 real(RP),
intent(inout),
allocatable :: ary(:,:)
3505 if ( .not.
allocated(ary) )
then 3506 allocate( ary(
ia,
ja) )
3516 real(RP),
intent(inout),
allocatable :: ary(:)
3518 if ( .not.
allocated(ary) )
then
subroutine, public atmos_phy_sf_vars_restart_def_var
Write restart.
real(rp), dimension(:,:,:), allocatable, public dens_tp
integer, parameter, public i_rhot
module atmosphere / adiabat
subroutine, public atmos_phy_sf_vars_restart_open
Open restart file for read.
subroutine, public atmos_diagnostic_get_n2(KA, KS, KE, IA, IS, IE, JA, JS, JE, POTT, Rtot, CZ, N2)
ATMOS_DIAGNOSTIC_get_n2 N^2.
subroutine, public atmos_phy_ae_vars_restart_create
Create restart file.
real(rp), dimension(:,:,:), allocatable, public pres_ref
subroutine, public atmos_dyn_vars_restart_def_var
Define variables in restart file.
subroutine, public atmos_phy_cp_vars_restart_def_var
Write restart.
logical, public atmos_sw_phy_cp
subroutine, public atmos_vars_restart_open
Open restart file for reading atmospheric variables.
real(rp), dimension(:,:,:), allocatable, target, public momz
subroutine, public atmos_phy_rd_vars_restart_close
Close restart file.
real(rp), public const_cvdry
specific heat (dry air,constant volume) [J/kg/K]
subroutine, public atmos_phy_tb_vars_restart_enddef
Exit netCDF define mode.
subroutine, public atmos_bottom_estimate(KA, KS, KE, IA, IS, IE, JA, JS, JE, DENS, PRES, CZ, Zsfc, Z1, SFC_DENS, SFC_PRES)
Calc bottom boundary of atmosphere (just above surface)
module Atmosphere / Physics Cumulus
subroutine, public atmos_phy_sf_vars_restart_read
Read restart.
subroutine, public atmos_phy_tb_vars_restart_read
Read restart.
subroutine, public atmos_dyn_vars_restart_open
Open restart file for read.
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
real(rp), dimension(:,:,:), allocatable, public dens_ref
module atmosphere / saturation
subroutine, public atmos_phy_rd_vars_restart_create
Create restart file.
subroutine, public atmos_phy_ch_vars_setup
Setup.
real(rp), dimension(:,:,:), pointer, public qc
subroutine, public atmos_phy_ch_vars_restart_close
Close restart file.
recursive subroutine atmos_vars_get_diagnostic_2d(vname, var)
get diagnostic variable 2D
real(rp), dimension(:,:,:), allocatable, target, public phydh
subroutine, public atmos_phy_cp_vars_restart_enddef
Exit netCDF define mode.
logical, public atmos_sw_phy_rd
subroutine, public atmos_phy_mp_vars_get_diagnostic(DENS, TEMP, QTRC, CLDFRAC, Re, Qe, Ne)
real(rp), dimension(:,:,:), allocatable, target, public rhot
real(rp), dimension(:,:,:), allocatable, public momy_tp
subroutine, public atmos_phy_mp_vars_restart_enddef
Exit netCDF define mode.
subroutine, public atmos_vars_restart_close
Close restart file.
subroutine, public atmos_vars_fillhalo(FILL_BND)
HALO Communication.
real(rp), dimension(qa_max), public tracer_r
real(rp), dimension(:,:,:), allocatable, target, public qdry
integer, public ia
of whole cells: x, local, with HALO
subroutine, public atmos_phy_cp_vars_restart_open
Open restart file for read.
module Atmosphere / Physics Cloud Microphysics
integer, parameter, public i_momx
integer, parameter, public i_hs
snow
logical, public atmos_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
subroutine, public atmos_phy_cp_vars_restart_write
Write restart.
module atmosphere / bottom boundary extrapolation
subroutine, public atmos_dyn_vars_restart_enddef
Exit netCDF define mode.
module Atmosphere Grid CartesianC metirc
module Atmosphere / Dynamics
subroutine, public atmos_phy_tb_vars_restart_write
Write restart.
integer, parameter, public i_momz
subroutine, public atmos_dyn_vars_restart_close
Close restart file.
module ATMOSPHERIC Variables
subroutine allocate_1d(ary)
real(rp), dimension(:,:,:,:), pointer, public qtrc_av
integer, parameter, public i_hr
liquid water rain
real(rp), dimension(:,:,:), allocatable, target, public momx
integer, parameter, public i_hi
ice water cloud
real(dp), public time_nowdaysec
second of current time [sec]
subroutine, public atmos_vars_restart_write
Write restart of atmospheric variables.
subroutine, public atmos_phy_ch_vars_restart_enddef
Exit netCDF define mode.
subroutine, public atmos_phy_ch_vars_restart_def_var
Write restart.
real(rp), public atmos_grid_cartesc_real_totvolzxv
total volume (zxv, local) [m3]
character(len=h_short), public atmos_restart_out_dtype
REAL4 or REAL8.
subroutine, public atmos_phy_mp_vars_restart_def_var
Define variables in restart file.
real(rp), dimension(:,:,:), allocatable, public rhot_tp
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_vol
control volume (zxy) [m3]
real(rp), public atmos_grid_cartesc_real_totvol
total volume (zxy, local) [m3]
subroutine, public atmos_phy_cp_vars_restart_create
Create restart file.
real(rp), public atmos_restart_check_criterion
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_fz
geopotential height [m] (wxy)
logical, public atmos_sw_phy_ae
integer, public ja
of whole cells: y, local, with HALO
integer, public io_fid_conf
Config file ID.
subroutine, public atmos_vars_calc_diagnostics
Calc diagnostic variables.
subroutine, public atmos_phy_ae_vars_reset_diagnostics
subroutine, public file_history_reg(name, desc, unit, itemid, standard_name, ndims, dim_type, cell_measures, fill_halo)
Register/Append variable to history file.
real(rp), dimension(:,:,:), pointer, public qr
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_volzxv
control volume (zxv) [m3]
real(rp), dimension(:,:,:), allocatable, target, public dens
subroutine allocate_3d(ary)
subroutine, public atmos_phy_sf_vars_restart_enddef
Exit netCDF define mode.
integer, parameter, public i_hh
hail
subroutine, public atmos_dyn_vars_restart_write
Write variables to restart file.
logical, public atmos_restart_in_aggregate
Switch to use aggregate file.
subroutine, public file_history_cartesc_set_pres(PRES, PRESH, SFC_PRES)
set hydrostatic pressure for pressure coordinate
subroutine, public atmos_diagnostic_get_potv(KA, KS, KE, IA, IS, IE, JA, JS, JE, POTT, Rtot, POTV)
ATMOS_DIAGNOSTIC_get_potv virtual potential temperature.
recursive subroutine atmos_vars_get_diagnostic_1d(vname, var)
get diagnostic variable 1D
real(rp), dimension(:,:,:), allocatable, public rhov_tp
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_lw_up
character(len=h_short), dimension(qa_max), public tracer_name
integer, parameter, public i_dens
real(rp), dimension(:,:,:), pointer, public qg
logical, public statistics_checktotal
calc&report variable totals to logfile?
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_rain
subroutine, public atmos_phy_ae_vars_history(QTRC, RH)
character(len=h_long), public atmos_restart_check_basename
real(rp), dimension(qa_max), public tracer_cv
integer, parameter, public i_momy
subroutine, public atmos_diagnostic_get_phyd(KA, KS, KE, IA, IS, IE, JA, JS, JE, DENS, PRES, CZ, FZ, PHYD, PHYDH)
ATMOS_DIAGNOSTIC_get_phyd hydrostatic pressure.
subroutine, public atmos_phy_sf_vars_setup
Setup.
real(rp), dimension(:,:,:), allocatable, public rhoh_p
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_toaflx_sw_up
real(rp), public const_undef
subroutine, public atmos_phy_tb_vars_restart_create
Create restart file.
subroutine, public atmos_diagnostic_cartesc_get_vel(KA, KS, KE, IA, IS, IE, JA, JS, JE, DENS, MOMZ, MOMX, MOMY, W, U, V)
ATMOS_DIAGNOSTIC_CARTESC_get_vel W, U, V.
character(len=h_short), dimension(qa_max), public tracer_unit
real(rp), dimension(:,:,:), pointer, public qi
subroutine, public atmos_phy_cp_vars_restart_close
Close restart file.
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rcdy
reciprocal of center-dy
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_lw_dn
logical, public atmos_restart_output
Output restart file?
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_z1
Height of the lowermost grid from surface (cell center) [m].
real(rp), public atmos_grid_cartesc_real_totvolzuy
total volume (zuy, local) [m3]
module Atmosphere / Physics Radiation
subroutine, public atmos_phy_rd_vars_restart_open
Open restart file for read.
integer, public is
start point of inner domain: x, local
real(rp), dimension(:,:,:), allocatable, target, public momz_avw
real(rp), dimension(qa_max), public tracer_cp
module ATMOSPHERIC Surface Variables
subroutine, public atmos_phy_sf_vars_restart_write
Write variables to restart file.
subroutine, public atmos_phy_sf_vars_restart_close
Close restart file.
integer, public ie
end point of inner domain: x, local
real(rp), dimension(:,:,:,:), allocatable, target, public qtrc_avw
subroutine, public file_cartesc_create(basename, title, datatype, fid, date, subsec, haszcoord, append, aggregate, single)
Create/open a netCDF file.
subroutine, public atmos_phy_cp_vars_setup
Setup.
real(rp), dimension(:,:,:), pointer, public momx_av
logical, public atmos_sw_phy_tb
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_sw_up
logical, public atmos_hydrometeor_dry
subroutine, public atmos_phy_rd_vars_restart_def_var
Define variables in restart file.
module atmosphere / hydrometeor
recursive subroutine atmos_vars_get_diagnostic_3d(vname, var)
get diagnostic variable 3D
subroutine, public time_gettimelabel(timelabel)
generate time label
module atmosphere / grid / cartesC index
integer, public ke
end point of inner domain: z, local
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_volwxy
control volume (wxy) [m3]
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_sw_dn
subroutine, public atmos_phy_mp_vars_reset_diagnostics
real(rp), dimension(:,:,:), allocatable, public qv_ref
subroutine, public atmos_diagnostic_get_therm_rhot(KA, KS, KE, IA, IS, IE, JA, JS, JE, DENS, RHOT, Rtot, CVtot, CPtot, POTT, TEMP, PRES, EXNER)
ATMOS_DIAGNOSTIC_get_therm_rhot potential temperature, temperature, pressure.
subroutine, public atmos_phy_mp_vars_restart_create
Create restart file.
real(rp), dimension(:,:,:,:), allocatable, public rhoq_tp
integer, public je
end point of inner domain: y, local
module atmosphere / diagnostic / CartesianC
module atmosphere / diagnostic
real(rp), dimension(:,:,:), allocatable, target, public temp
subroutine, public atmos_vars_setup
Setup.
logical, public atmos_sw_dyn
real(rp), dimension(:,:,:), allocatable, target, public w
subroutine, public atmos_vars_total
Budget monitor for atmosphere.
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_lh
real(rp), public const_grav
standard acceleration of gravity [m/s2]
module atmosphere / physics / PBL
logical, public atmos_restart_out_aggregate
Switch to use aggregate file.
subroutine, public file_cartesc_enddef(fid)
Exit netCDF file define mode.
subroutine, public atmos_phy_tb_vars_setup
Setup.
real(rp), dimension(:,:,:), pointer, public qs
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_toaflx_lw_dn
real(rp), dimension(:,:,:), allocatable, target, public atmos_phy_sf_sflx_qtrc
subroutine, public atmos_dyn_vars_restart_read
Read restart.
module atmosphere / grid / cartesC
integer, public ks
start point of inner domain: z, local
real(dp), public time_dtsec_atmos_dyn
time interval of dynamics [sec]
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_metric_rotc
rotation coefficient
logical, public atmos_sw_phy_sf
subroutine, public atmos_phy_rd_vars_setup
Setup.
integer, public prc_myrank
process num in local communicator
real(rp), dimension(:,:,:), allocatable, target, public pott
logical, public atmos_sw_phy_ch
subroutine, public atmos_phy_ae_vars_restart_enddef
Exit netCDF define mode.
module Atmosphere / Physics Turbulence
real(rp), dimension(:,:,:), pointer, public qh
logical, public atmos_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
real(rp), dimension(:,:,:), allocatable, target, public momx_avw
real(rp), dimension(:,:,:), pointer, public dens_av
real(rp), dimension(:,:,:), allocatable, target, public phyd
real(rp), public lhf
latent heat of fusion for use [J/kg]
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
subroutine, public prc_abort
Abort Process.
real(rp), dimension(:,:,:), allocatable, public temp_ref
real(rp), public lhv
latent heat of vaporization for use [J/kg]
real(rp), dimension(:,:,:), allocatable, pointer, target, public qv
logical, public atmos_sw_phy_mp
integer, parameter, public i_hc
liquid water cloud
integer, public js
start point of inner domain: y, local
subroutine, public atmos_phy_rd_vars_restart_write
Write variables to restart file.
subroutine, public file_cartesc_def_var(fid, varname, desc, unit, dim_type, datatype, vid, standard_name, timeintv, nsteps, cell_measures)
Define a variable to file.
subroutine, public atmos_dyn_vars_setup
Setup.
subroutine, public atmos_phy_ae_vars_setup
Setup.
subroutine, public atmos_phy_ae_vars_restart_read
Read restart.
real(rp), public atmos_grid_cartesc_real_totvolwxy
total volume (wxy, local) [m3]
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_mapf
map factor
real(rp), dimension(:,:,:), allocatable, public momx_tp
real(rp), dimension(:,:,:), allocatable, target, public cvtot
real(rp), dimension(:,:,:), allocatable, target, public momy
subroutine, public atmos_phy_mp_vars_restart_open
Open restart file for read.
logical function, public file_get_aggregate(fid)
module Atmosphere / Physics Chemistry
real(rp), dimension(:,:,:), allocatable, target, public v
subroutine, public atmos_phy_bl_vars_setup
Setup.
subroutine, public prof_rapstart(rapname_base, level)
Start raptime.
real(rp), dimension(:,:,:), allocatable, target, public exner
subroutine, public atmos_vars_monitor
monitor output
subroutine, public atmos_vars_restart_create
Create atmospheric restart file.
real(rp), dimension(:,:,:), allocatable, target, public u
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_snow
real(rp), dimension(:,:,:), allocatable, public momz_tp
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_sh
subroutine, public atmos_vars_restart_enddef
Exit netCDF define mode.
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_cz
geopotential height [m] (zxy)
real(rp), dimension(:,:,:), allocatable, public pott_ref
real(rp), dimension(:,:,:), allocatable, target, public dens_avw
subroutine, public atmos_phy_mp_vars_setup
Setup.
subroutine, public atmos_phy_sf_vars_restart_create
Create restart file.
character(len=h_mid), public atmos_restart_out_title
Title of the output file.
logical, public atmos_restart_check
Check value consistency?
subroutine, public atmos_phy_mp_vars_restart_write
Write restart.
subroutine, public atmos_phy_mp_vars_restart_read
Read restart.
subroutine, public atmos_phy_mp_vars_restart_close
Close restart file.
module atmosphere / thermodyn
module Atmosphere GRID CartesC Real(real space)
subroutine, public atmos_phy_rd_vars_restart_enddef
Exit netCDF define mode.
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_toaflx_sw_dn
character(len=h_long), public atmos_restart_in_basename
Basename of the input file.
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rcdx
reciprocal of center-dx
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_area
horizontal area ( xy, normal z) [m2]
subroutine, public atmos_vars_history_setpres
Set pressure for history output.
subroutine, public atmos_phy_tb_vars_restart_def_var
Write restart.
character(len=h_long), public atmos_restart_out_basename
Basename of the output file.
real(rp), dimension(:,:), allocatable, public topo_zsfc
absolute ground height [m]
subroutine, public atmos_phy_ae_vars_restart_def_var
Write restart.
subroutine, public atmos_phy_ae_vars_restart_write
Write restart.
real(rp), dimension(:,:,:), allocatable, public rhou_tp
integer, public ka
of whole cells: z, local, with HALO
subroutine, public atmos_phy_rd_vars_restart_read
Read restart.
character(len=h_short), public atmos_dyn_type
real(rp), dimension(:,:,:), pointer, public momz_av
character(len=h_mid), dimension(qa_max), public tracer_desc
subroutine, public atmos_phy_ch_vars_restart_write
Write restart.
module file / history_cartesC
subroutine, public atmos_phy_cp_vars_restart_read
Read restart.
real(rp), dimension(:,:,:), allocatable, target, public rhot_avw
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rfdy
reciprocal of face-dy
real(rp), dimension(:,:,:,:), allocatable, target, public qe
real(rp), dimension(:,:,:), pointer, public rhot_av
real(rp), dimension(:,:,:), allocatable, target, public cptot
subroutine, public atmos_phy_ch_vars_restart_create
Create restart file.
subroutine, public atmos_phy_mp_vars_history(DENS, TEMP, QTRC)
subroutine, public atmos_vars_restart_def_var
Define atmospheric variables in restart file.
subroutine allocate_2d(ary)
subroutine, public atmos_phy_ae_vars_restart_close
Close restart file.
subroutine, public file_cartesc_flush(fid)
Flush all pending requests to a netCDF file (PnetCDF only)
subroutine, public atmos_diagnostic_get_teml(KA, KS, KE, IA, IS, IE, JA, JS, JE, TEMP, LHV, LHS, QC, QI, CPtot, TEML)
ATMOS_DIAGNOSTIC_get_teml liqued water temperature.
subroutine, public atmos_vars_history
History output set for atmospheric variables.
integer, parameter, public n_hyd
subroutine, public monitor_reg(name, desc, unit, itemid, ndims, dim_type, isflux)
Search existing item, or matching check between requested and registered item.
subroutine, public atmos_phy_ch_vars_restart_open
Open restart file for read.
real(rp), dimension(:,:,:), pointer, public momy_av
subroutine, public prof_rapend(rapname_base, level)
Save raptime.
subroutine, public atmos_vars_restart_check
Check and compare between last data and sample data.
real(rp), dimension(:,:,:), allocatable, target, public momy_avw
subroutine, public atmos_phy_ch_vars_restart_read
Read restart.
module ATMOSPHERE / Physics Aerosol Microphysics
real(rp), dimension(:,:), allocatable, public atmos_phy_cp_sflx_rain
subroutine, public file_cartesc_open(basename, fid, aggregate)
open a netCDF file for read
real(rp), dimension(:,:,:), allocatable, target, public pres
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_volzuy
control volume (zuy) [m3]
subroutine, public atmos_dyn_vars_restart_create
Create restart file.
subroutine, public atmos_phy_tb_vars_restart_open
Open restart file for read.
integer, parameter, public i_hg
graupel
subroutine, public file_cartesc_close(fid)
Close a netCDF file.
real(rp), dimension(:,:,:), allocatable, target, public rtot
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_toaflx_lw_up
subroutine, public atmos_phy_tb_vars_restart_close
Close restart file.
real(rp), dimension(qa_max), public tracer_mass
subroutine, public atmos_vars_restart_read
Read restart of atmospheric variables.
subroutine, public atmos_phy_ae_vars_restart_open
Open restart file for read.
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rfdx
reciprocal of face-dx
logical, public atmos_use_average
real(rp), dimension(:,:,:,:), allocatable, target, public qtrc