SCALE-RM
mod_atmos_vars.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
10 !-------------------------------------------------------------------------------
11 #include "scalelib.h"
13  !-----------------------------------------------------------------------------
14  !
15  !++ used modules
16  !
17  use scale_precision
18  use scale_io
19  use scale_prof
20  use scale_debug
22  use scale_index
23  use scale_tracer
24  !-----------------------------------------------------------------------------
25  implicit none
26  private
27  !-----------------------------------------------------------------------------
28  !
29  !++ Public procedure
30  !
31  public :: atmos_vars_setup
32  public :: atmos_vars_fillhalo
33  public :: atmos_vars_restart_read
34  public :: atmos_vars_restart_write
35  public :: atmos_vars_restart_check
37  public :: atmos_vars_history
38  public :: atmos_vars_check
40  public :: atmos_vars_get_diagnostic
41  public :: atmos_vars_monitor
42 
44  public :: atmos_vars_restart_open
47  public :: atmos_vars_restart_close
48 
49  interface atmos_vars_get_diagnostic
50  procedure ATMOS_vars_get_diagnostic_3D
51  procedure ATMOS_vars_get_diagnostic_2D
52  procedure ATMOS_vars_get_diagnostic_1D
53  end interface atmos_vars_get_diagnostic
54 
55  !-----------------------------------------------------------------------------
56  !
57  !++ Public parameters & variables
58  !
59  logical, public :: atmos_restart_output = .false.
60 
61  character(len=H_LONG), public :: atmos_restart_in_basename = ''
62  logical, public :: atmos_restart_in_aggregate
63  logical, public :: atmos_restart_in_postfix_timelabel = .false.
64  character(len=H_LONG), public :: atmos_restart_out_basename = ''
65  logical, public :: atmos_restart_out_aggregate
66  logical, public :: atmos_restart_out_postfix_timelabel = .true.
67  character(len=H_MID), public :: atmos_restart_out_title = 'ATMOS restart'
68  character(len=H_SHORT), public :: atmos_restart_out_dtype = 'DEFAULT'
69 
70  logical, public :: atmos_restart_check = .false.
71  character(len=H_LONG), public :: atmos_restart_check_basename = 'restart_check'
72  real(rp), public :: atmos_restart_check_criterion = 1.e-6_rp
73 
74  ! prognostic variables
75  real(rp), public, target, allocatable :: dens(:,:,:) ! Density [kg/m3]
76  real(rp), public, target, allocatable :: momz(:,:,:) ! momentum z [kg/m2/s]
77  real(rp), public, target, allocatable :: momx(:,:,:) ! momentum x [kg/m2/s]
78  real(rp), public, target, allocatable :: momy(:,:,:) ! momentum y [kg/m2/s]
79  real(rp), public, target, allocatable :: rhot(:,:,:) ! DENS * POTT [K*kg/m3]
80  real(rp), public, target, allocatable :: qtrc(:,:,:,:) ! ratio of mass of tracer to total mass[kg/kg]
81 
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(:,:,:,:)
88 
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(:,:,:,:)
95 
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(:,:,:)
103 
104  real(rp), public, target, allocatable :: qe(:,:,:,:)
105 
106  ! reference state
107  real(rp), public, allocatable :: dens_ref(:,:,:)
108  real(rp), public, allocatable :: pott_ref(:,:,:)
109  real(rp), public, allocatable :: temp_ref(:,:,:)
110  real(rp), public, allocatable :: pres_ref(:,:,:)
111  real(rp), public, allocatable :: qv_ref(:,:,:)
112 
113  ! tendency by physical processes
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(:,:,:,:)
121 
122  ! (obsolute)
123  real(rp), public, allocatable :: momx_tp(:,:,:)
124  real(rp), public, allocatable :: momy_tp(:,:,:)
125 
126 
127  ! public diagnostic variables
128  real(rp), public, allocatable, target :: w (:,:,:)
129  real(rp), public, allocatable, target :: u (:,:,:)
130  real(rp), public, allocatable, target :: v (:,:,:)
131 
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(:,:,:)
138 
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(:,:,:)
143 
144  real(rp), public, allocatable, target :: prec (:,:)
145  real(rp), public, allocatable :: prec_engi(:,:)
146  !-----------------------------------------------------------------------------
147  !
148  !++ Private procedure
149  !
150  !-----------------------------------------------------------------------------
151  !
152  !++ Private parameters & variables
153  !
154  logical, private :: atmos_vars_checkrange = .false.
155  real(rp), private :: atmos_vars_checkcfl_soft = 1.0_rp
156  real(rp), private :: atmos_vars_checkcfl_hard = 2.0_rp
157 
158  type vinfo
159  character(len=H_SHORT) :: name
160  character(len=H_MID) :: desc
161  character(len=H_SHORT) :: unit
162  integer :: ndims
163  character(len=H_SHORT) :: dim_type
164  character(len=H_MID) :: stdname
165  end type vinfo
166 
167  ! prognostic variables
168  integer, private, parameter :: pv_nmax = 5
169  type(vinfo), private :: pv_info(pv_nmax)
170  integer, private, allocatable :: pv_id(:)
171 
172  data pv_info / &
173  vinfo( 'DENS', 'density', 'kg/m3', 3, 'ZXY', 'air_density' ), &
174  vinfo( 'MOMZ', 'momentum z', 'kg/m2/s', 3, 'ZHXY', 'upward_mass_flux_of_air' ), &
175  vinfo( 'MOMX', 'momentum x', 'kg/m2/s', 3, 'ZXHY', 'eastward_mass_flux_of_air' ), &
176  vinfo( 'MOMY', 'momentum y', 'kg/m2/s', 3, 'ZXYH', 'northward_mass_flux_of_air' ), &
177  vinfo( 'RHOT', 'rho * theta', 'kg/m3*K', 3, 'ZXY', '' ) /
178 
179 
180  ! private diagnostic variables
181  real(rp), allocatable, target :: lhv (:,:,:)
182  real(rp), allocatable, target :: lhs (:,:,:)
183  real(rp), allocatable, target :: lhf (:,:,:)
184 
185  real(rp), allocatable, target :: potv (:,:,:)
186  real(rp), allocatable, target :: teml (:,:,:)
187  real(rp), allocatable, target :: potl (:,:,:)
188  real(rp), allocatable, target :: pote (:,:,:)
189 
190  real(rp), allocatable, target :: qtot (:,:,:)
191  real(rp), allocatable, target :: qhyd (:,:,:)
192  real(rp), allocatable, target :: qliq (:,:,:)
193  real(rp), allocatable, target :: qice (:,:,:)
194 
195  real(rp), allocatable, target :: lwp (:,:)
196  real(rp), allocatable, target :: iwp (:,:)
197  real(rp), allocatable, target :: pw (:,:)
198 
199  real(rp), allocatable, target :: rain (:,:)
200  real(rp), allocatable, target :: snow (:,:)
201 
202  real(rp), allocatable, target :: qsat (:,:,:)
203  real(rp), allocatable, target :: rha (:,:,:)
204  real(rp), allocatable, target :: rhl (:,:,:)
205  real(rp), allocatable, target :: rhi (:,:,:)
206 
207  real(rp), allocatable, target :: vor (:,:,:)
208  real(rp), allocatable, target :: div (:,:,:)
209  real(rp), allocatable, target :: hdiv (:,:,:)
210  real(rp), allocatable, target :: uabs (:,:,:)
211 
212  real(rp), allocatable, target :: n2 (:,:,:)
213  real(rp), allocatable, target :: pblh (:,:)
214 
215  real(rp), allocatable, target :: mse (:,:,:)
216  real(rp), allocatable, target :: tdew (:,:,:)
217 
218  real(rp), allocatable, target :: cape (:,:)
219  real(rp), allocatable, target :: cin (:,:)
220  real(rp), allocatable, target :: lcl (:,:)
221  real(rp), allocatable, target :: lfc (:,:)
222  real(rp), allocatable, target :: lnb (:,:)
223 
224  real(rp), allocatable, target :: engt (:,:,:)
225  real(rp), allocatable, target :: engp (:,:,:)
226  real(rp), allocatable, target :: engk (:,:,:)
227  real(rp), allocatable, target :: engi (:,:,:)
228 
229  real(rp), allocatable, target :: dens_mean(:)
230  real(rp), allocatable, target :: w_mean (:)
231  real(rp), allocatable, target :: u_mean (:)
232  real(rp), allocatable, target :: v_mean (:)
233  real(rp), allocatable, target :: pt_mean (:)
234  real(rp), allocatable, target :: t_mean (:)
235  real(rp), allocatable, target :: qv_mean (:)
236  real(rp), allocatable, target :: qhyd_mean(:)
237  real(rp), allocatable, target :: qliq_mean(:)
238  real(rp), allocatable, target :: qice_mean(:)
239 
240  real(rp), allocatable, target :: dens_prim(:,:,:)
241  real(rp), allocatable, target :: w_prim (:,:,:)
242  real(rp), allocatable, target :: u_prim (:,:,:)
243  real(rp), allocatable, target :: v_prim (:,:,:)
244  real(rp), allocatable, target :: pt_prim (:,:,:)
245  real(rp), allocatable, target :: w_prim2 (:,:,:)
246  real(rp), allocatable, target :: pt_w_prim(:,:,:)
247  real(rp), allocatable, target :: w_prim3 (:,:,:)
248  real(rp), allocatable, target :: tke_rs (:,:,:)
249 
250  real(rp), allocatable, target :: velz (:,:,:)
251  real(rp), allocatable, target :: velx (:,:,:)
252  real(rp), allocatable, target :: vely (:,:,:)
253  real(rp), allocatable, target :: umet (:,:,:)
254  real(rp), allocatable, target :: vmet (:,:,:)
255 
256  ! id of diagnostic variables
257  !! public
258  integer, private, parameter :: i_w = 1
259  integer, private, parameter :: i_u = 2
260  integer, private, parameter :: i_v = 3
261  integer, private, parameter :: i_pott = 4
262  integer, private, parameter :: i_temp = 5
263  integer, private, parameter :: i_pres = 6
264  integer, private, parameter :: i_exner = 7
265  integer, private, parameter :: i_phyd = 8
266  integer, private, parameter :: i_qdry = 9
267  integer, private, parameter :: i_rtot = 10
268  integer, private, parameter :: i_cvtot = 11
269  integer, private, parameter :: i_cptot = 12
270  !! private
271  integer, private, parameter :: i_lhv = 13
272  integer, private, parameter :: i_lhs = 14
273  integer, private, parameter :: i_lhf = 15
274  integer, private, parameter :: i_potv = 16
275  integer, private, parameter :: i_teml = 17
276  integer, private, parameter :: i_potl = 18
277  integer, private, parameter :: i_pote = 19
278  integer, private, parameter :: i_qtot = 20
279  integer, private, parameter :: i_qhyd = 21
280  integer, private, parameter :: i_qliq = 22
281  integer, private, parameter :: i_qice = 23
282  integer, private, parameter :: i_lwp = 24
283  integer, private, parameter :: i_iwp = 25
284  integer, private, parameter :: i_pw = 26
285  integer, private, parameter :: i_prec = 27
286  integer, private, parameter :: i_rain = 28
287  integer, private, parameter :: i_snow = 29
288  integer, private, parameter :: i_qsat = 30
289  integer, private, parameter :: i_rha = 31
290  integer, private, parameter :: i_rhl = 32
291  integer, private, parameter :: i_rhi = 33
292  integer, private, parameter :: i_vor = 34
293  integer, private, parameter :: i_div = 35
294  integer, private, parameter :: i_hdiv = 36
295  integer, private, parameter :: i_uabs = 37
296  integer, private, parameter :: i_n2 = 38
297  integer, private, parameter :: i_pblh = 39
298  integer, private, parameter :: i_mse = 40
299  integer, private, parameter :: i_tdew = 41
300  integer, private, parameter :: i_cape = 42
301  integer, private, parameter :: i_cin = 43
302  integer, private, parameter :: i_lcl = 44
303  integer, private, parameter :: i_lfc = 45
304  integer, private, parameter :: i_lnb = 46
305  integer, private, parameter :: i_engt = 47
306  integer, private, parameter :: i_engp = 48
307  integer, private, parameter :: i_engk = 49
308  integer, private, parameter :: i_engi = 50
309  integer, private, parameter :: i_dens_mean = 51
310  integer, private, parameter :: i_w_mean = 52
311  integer, private, parameter :: i_u_mean = 53
312  integer, private, parameter :: i_v_mean = 54
313  integer, private, parameter :: i_pt_mean = 55
314  integer, private, parameter :: i_t_mean = 56
315  integer, private, parameter :: i_qv_mean = 57
316  integer, private, parameter :: i_qhyd_mean = 58
317  integer, private, parameter :: i_qliq_mean = 59
318  integer, private, parameter :: i_qice_mean = 60
319  integer, private, parameter :: i_dens_prim = 61
320  integer, private, parameter :: i_w_prim = 62
321  integer, private, parameter :: i_u_prim = 63
322  integer, private, parameter :: i_v_prim = 64
323  integer, private, parameter :: i_pt_prim = 65
324  integer, private, parameter :: i_w_prim2 = 66
325  integer, private, parameter :: i_pt_w_prim = 67
326  integer, private, parameter :: i_w_prim3 = 68
327  integer, private, parameter :: i_tke_rs = 69
328  integer, private, parameter :: i_velz = 70
329  integer, private, parameter :: i_velx = 71
330  integer, private, parameter :: i_vely = 72
331  integer, private, parameter :: i_umet = 73
332  integer, private, parameter :: i_vmet = 74
333 
334  integer, private, parameter :: dv_nmax = 74
335  type(vinfo), private :: dv_info(dv_nmax)
336  logical, private :: dv_calculated(dv_nmax)
337 
338  data dv_info / &
339  vinfo( 'W', 'velocity w', 'm/s', 3, 'ZXY', 'upward_air_velocity' ), &
340  vinfo( 'U', 'velocity u', 'm/s', 3, 'ZXY', 'x_wind' ), &
341  vinfo( 'V', 'velocity v', 'm/s', 3, 'ZXY', 'y_wind' ), &
342  vinfo( 'PT', 'potential temp.', 'K', 3, 'ZXY', 'air_potential_temperature' ), &
343  vinfo( 'T', 'temperature', 'K', 3, 'ZXY', 'air_temperature' ), &
344  vinfo( 'PRES', 'pressure', 'Pa', 3, 'ZXY', 'air_pressure' ), &
345  vinfo( 'EXNER', 'Exner function', '1', 3, 'ZXY', 'dimensionless_exner_function' ), &
346  vinfo( 'PHYD', 'hydrostatic pressure', 'Pa', 3, 'ZXY', '' ), &
347  vinfo( 'QDRY', 'dry air', 'kg/kg', 3, 'ZXY', '' ), &
348  vinfo( 'RTOT', 'Total gas constant', 'J/kg/K', 3, 'ZXY', '' ), &
349  vinfo( 'CVTOT', 'Total heat capacity', 'J/kg/K', 3, 'ZXY', '' ), &
350  vinfo( 'CPTOT', 'Total heat capacity', 'J/kg/K', 3, 'ZXY', '' ), &
351  vinfo( 'LHV', 'latent heat for vaporization', 'J/kg', 3, 'ZXY', '' ), &
352  vinfo( 'LHS', 'latent heat for sublimation', 'J/kg', 3, 'ZXY', '' ), &
353  vinfo( 'LHF', 'latent heat for fusion', 'J/kg', 3, 'ZXY', '' ), &
354  vinfo( 'POTV', 'virtual potential temp.', 'K', 3, 'ZXY', '' ), &
355  vinfo( 'TEML', 'liquid water temperature', 'K', 3, 'ZXY', '' ), &
356  vinfo( 'POTL', 'liquid water potential temp.', 'K', 3, 'ZXY', '' ), &
357  vinfo( 'POTE', 'equivalent potential temp.', 'K', 3, 'ZXY', 'pseudo_equivalent_potential_temperature' ), &
358  vinfo( 'QTOT', 'total water', 'kg/kg', 3, 'ZXY', 'mass_fraction_of_water_in_air' ), &
359  vinfo( 'QHYD', 'total hydrometeors', 'kg/kg', 3, 'ZXY', 'mass_fraction_of_cloud_condensed_water_in_air' ), &
360  vinfo( 'QLIQ', 'total liquid water', 'kg/kg', 3, 'ZXY', '' ), &
361  vinfo( 'QICE', 'total ice water', 'kg/kg', 3, 'ZXY', '' ), &
362  vinfo( 'LWP', 'liquid water path', 'g/m2', 2, 'XY', 'atmosphere_mass_content_of_cloud_liquid_water' ), &
363  vinfo( 'IWP', 'ice water path', 'g/m2', 2, 'XY', '' ), &
364  vinfo( 'PW', 'precipitable water', 'g/m2', 2, 'XY', 'atmosphere_mass_content_of_vapor' ), &
365  vinfo( 'PREC', 'surface precipitation flux', 'kg/m2/s', 2, 'XY', 'precipitation_flux' ), &
366  vinfo( 'RAIN', 'surface rain flux', 'kg/m2/s', 2, 'XY', 'rainfall_flux' ), &
367  vinfo( 'SNOW', 'surface snow flux', 'kg/m2/s', 2, 'XY', 'snowfall_flux' ), &
368  vinfo( 'QSAT', 'saturation specific humidity', 'kg/kg', 3, 'ZXY', '' ), &
369  vinfo( 'RHA', 'relative humidity(liq+ice)', '%', 3, 'ZXY', '' ), &
370  vinfo( 'RH', 'relative humidity(liq)', '%', 3, 'ZXY', 'relative_humidity' ), &
371  vinfo( 'RHI', 'relative humidity(ice)', '%', 3, 'ZXY', '' ), &
372  vinfo( 'VOR', 'vertical vorticity', '1/s', 3, 'ZXY', 'atmosphere_relative_vorticity' ), &
373  vinfo( 'DIV', 'divergence', '1/s', 3, 'ZXY', 'divergence_of_wind' ), &
374  vinfo( 'HDIV', 'horizontal divergence', '1/s', 3, 'ZXY', '' ), &
375  vinfo( 'Uabs', 'absolute velocity', 'm/s', 3, 'ZXY', 'wind_speed' ), &
376  vinfo( 'N2', 'squared Brunt-Vaisala frequency', '1/s2', 3, 'ZXY', 'square_of_brunt_vaisala_frequency_in_air' ), &
377  vinfo( 'PBLH', 'PBL height', 'm', 2, 'XY', 'atmosphere_boundary_layer_thickness' ), &
378  vinfo( 'MSE', 'moist static energy', 'm2/s2', 3, 'ZXY', '' ), &
379  vinfo( 'TDEW', 'dew point', 'K', 3, 'ZXY', 'dew_point_temperature' ), &
380  vinfo( 'CAPE', 'convective avail. pot. energy', 'm2/s2', 2, 'XY', 'atmosphere_specific_convective_available_potential_energy' ), &
381  vinfo( 'CIN', 'convection inhibition', 'm2/s2', 2, 'XY', '' ), &
382  vinfo( 'LCL', 'lifted condensation level', 'm', 2, 'XY', 'atmosphere_lifting_condensation_level' ), &
383  vinfo( 'LFC', 'level of free convection', 'm', 2, 'XY', 'atmosphere_level_of_free_convection' ), &
384  vinfo( 'LNB', 'level of neutral buoyancy', 'm', 2, 'XY', '' ), &
385  vinfo( 'ENGT', 'total energy', 'J/m3', 3, 'ZXY', '' ), &
386  vinfo( 'ENGP', 'potential energy', 'J/m3', 3, 'ZXY', '' ), &
387  vinfo( 'ENGK', 'kinetic energy', 'J/m3', 3, 'ZXY', '' ), &
388  vinfo( 'ENGI', 'internal energy', 'J/m3', 3, 'ZXY', '' ), &
389  vinfo( 'DENS_MEAN', 'horiz. mean of density', 'kg/m3', 1, 'Z', '' ), &
390  vinfo( 'W_MEAN', 'horiz. mean of w', 'm/s', 1, 'Z', '' ), &
391  vinfo( 'U_MEAN', 'horiz. mean of u', 'm/s', 1, 'Z', '' ), &
392  vinfo( 'V_MEAN', 'horiz. mean of v', 'm/s', 1, 'Z', '' ), &
393  vinfo( 'PT_MEAN', 'horiz. mean of pot.', 'K', 1, 'Z', '' ), &
394  vinfo( 'T_MEAN', 'horiz. mean of t', 'K', 1, 'Z', '' ), &
395  vinfo( 'QV_MEAN', 'horiz. mean of QV', '1', 1, 'Z', '' ), &
396  vinfo( 'QHYD_MEAN', 'horiz. mean of QHYD', '1', 1, 'Z', '' ), &
397  vinfo( 'QLIQ_MEAN', 'horiz. mean of QLIQ', '1', 1, 'Z', '' ), &
398  vinfo( 'QICE_MEAN', 'horiz. mean of QICE', '1', 1, 'Z', '' ), &
399  vinfo( 'DENS_PRIM', 'horiz. deviation of density', 'kg/m3', 3, 'ZXY', '' ), &
400  vinfo( 'W_PRIM', 'horiz. deviation of w', 'm/s', 3, 'ZXY', '' ), &
401  vinfo( 'U_PRIM', 'horiz. deviation of u', 'm/s', 3, 'ZXY', '' ), &
402  vinfo( 'V_PRIM', 'horiz. deviation of v', 'm/s', 3, 'ZXY', '' ), &
403  vinfo( 'PT_PRIM', 'horiz. deviation of pot. temp.', 'K', 3, 'ZXY', '' ), &
404  vinfo( 'W_PRIM2', 'variance of w', 'm2/s2', 3, 'ZXY', '' ), &
405  vinfo( 'PT_W_PRIM', 'resolved scale heat flux', 'W/s', 3, 'ZXY', '' ), &
406  vinfo( 'W_PRIM3', 'skewness of w', 'm3/s3', 3, 'ZXY', '' ), &
407  vinfo( 'TKE_RS', 'resolved scale TKE', 'm2/s2', 3, 'ZXY', '' ), &
408  vinfo( 'VELZ', 'velocity w at the half level', 'm/s', 3, 'ZHXY','' ), &
409  vinfo( 'VELX', 'velocity u at the half level', 'm/s', 3, 'ZXHY','' ), &
410  vinfo( 'VELY', 'velocity v at the half level', 'm/s', 3, 'ZXYH','' ), &
411  vinfo( 'Umet', 'eastward velocity', 'm/s', 3, 'ZXY', 'eastward_wind' ), &
412  vinfo( 'Vmet', 'northward velocity', 'm/s', 3, 'ZXY', 'northward_wind' ) /
413 
414  ! for history output and monitor
415  integer, private :: pv_hist_id (pv_nmax)
416  integer, private :: pv_monit_id(pv_nmax)
417  integer, private, allocatable :: qp_hist_id (:)
418  integer, private, allocatable :: qp_monit_id(:)
419  integer, private :: dv_hist_id (dv_nmax)
420  integer, private :: hist_id_gph
421 
422  integer, private, parameter :: im_qdry = 1
423  integer, private, parameter :: im_qtot = 2
424  integer, private, parameter :: im_evap = 3
425  integer, private, parameter :: im_prec = 4
426  integer, private, parameter :: im_engt = 5
427  integer, private, parameter :: im_engp = 6
428  integer, private, parameter :: im_engk = 7
429  integer, private, parameter :: im_engi = 8
430  integer, private, parameter :: im_engflxt = 9
431  integer, private, parameter :: im_engsfc_sh = 10
432  integer, private, parameter :: im_engsfc_lh = 11
433  integer, private, parameter :: im_engsfc_evap = 12
434  integer, private, parameter :: im_engsfc_prec = 13
435  integer, private, parameter :: im_engsfc_rd = 14
436  integer, private, parameter :: im_engtom_rd = 15
437  integer, private, parameter :: im_engsfc_lw_up = 16
438  integer, private, parameter :: im_engsfc_lw_dn = 17
439  integer, private, parameter :: im_engsfc_sw_up = 18
440  integer, private, parameter :: im_engsfc_sw_dn = 19
441  integer, private, parameter :: im_engtom_lw_up = 20
442  integer, private, parameter :: im_engtom_lw_dn = 21
443  integer, private, parameter :: im_engtom_sw_up = 22
444  integer, private, parameter :: im_engtom_sw_dn = 23
445  integer, private, parameter :: dvm_nmax = 23
446  integer, private :: dv_monit_id(dvm_nmax)
447 
448 
449  logical, private :: moist
450  real(rp), private, target, allocatable :: zero(:,:,:)
451 
452 
453  ! for restart
454  integer, private :: restart_fid = -1 ! file ID
455  logical, private :: atmos_restart_in_check_coordinates = .true.
456 
457 
458  real(rp), private, allocatable :: work3d(:,:,:)
459  real(rp), private, allocatable :: work2d(:,:)
460  real(rp), private, allocatable :: work1d(:)
461 
462  !-----------------------------------------------------------------------------
463 contains
464  !-----------------------------------------------------------------------------
466  subroutine atmos_vars_setup
467  use scale_const, only: &
468  undef => const_undef
469  use scale_prc, only: &
470  prc_abort
471  use scale_file_history, only: &
473  use scale_monitor, only: &
475  use scale_atmos_hydrometeor, only: &
477  n_hyd, &
478  i_qv, &
479  i_hc, &
480  i_hr, &
481  i_hi, &
482  i_hs, &
483  i_hg, &
484  i_hh
485  use mod_atmos_admin, only: &
487  use mod_atmos_dyn_vars, only: &
489  use mod_atmos_phy_mp_vars, only: &
491  use mod_atmos_phy_ae_vars, only: &
493  use mod_atmos_phy_ch_vars, only: &
495  use mod_atmos_phy_rd_vars, only: &
497  use mod_atmos_phy_sf_vars, only: &
499  use mod_atmos_phy_tb_vars, only: &
501  use mod_atmos_phy_bl_vars, only: &
503  use mod_atmos_phy_cp_vars, only: &
505  use mod_atmos_phy_lt_vars, only: &
507  implicit none
508 
509  namelist / param_atmos_vars / &
513  atmos_restart_in_check_coordinates, &
523  atmos_vars_checkrange, &
524  atmos_vars_checkcfl_soft, &
525  atmos_vars_checkcfl_hard
526 
527  integer :: ierr
528  integer :: iv, iq
529  !---------------------------------------------------------------------------
530 
531  log_newline
532  log_info("ATMOS_vars_setup",*) 'Setup'
533 
534  allocate( dens(ka,ia,ja) )
535  allocate( momz(ka,ia,ja) )
536  allocate( momx(ka,ia,ja) )
537  allocate( momy(ka,ia,ja) )
538  allocate( rhot(ka,ia,ja) )
539  allocate( qtrc(ka,ia,ja,max(qa,1)) )
540 
541  if ( atmos_use_average ) then
542  allocate( dens_avw(ka,ia,ja) )
543  allocate( momz_avw(ka,ia,ja) )
544  allocate( momx_avw(ka,ia,ja) )
545  allocate( momy_avw(ka,ia,ja) )
546  allocate( rhot_avw(ka,ia,ja) )
547  allocate( qtrc_avw(ka,ia,ja,max(qa,1)) )
548 
549  dens_av => dens_avw
550  momz_av => momz_avw
551  momx_av => momx_avw
552  momy_av => momy_avw
553  rhot_av => rhot_avw
554  qtrc_av => qtrc_avw
555  else
556  dens_av => dens
557  momz_av => momz
558  momx_av => momx
559  momy_av => momy
560  rhot_av => rhot
561  qtrc_av => qtrc
562  endif
563 
564  allocate( dens_tp(ka,ia,ja) )
565  allocate( momz_tp(ka,ia,ja) )
566  allocate( rhou_tp(ka,ia,ja) )
567  allocate( rhov_tp(ka,ia,ja) )
568  allocate( rhot_tp(ka,ia,ja) )
569  allocate( rhoh_p(ka,ia,ja) )
570  allocate( rhoq_tp(ka,ia,ja,max(qa,1)) )
571 
572  allocate( w(ka,ia,ja) )
573  allocate( u(ka,ia,ja) )
574  allocate( v(ka,ia,ja) )
575  w(:,:,:) = undef
576  u(:,:,:) = undef
577  v(:,:,:) = undef
578 
579  allocate( pott(ka,ia,ja) )
580  allocate( temp(ka,ia,ja) )
581  allocate( pres(ka,ia,ja) )
582  allocate( exner(ka,ia,ja) )
583  allocate( phyd(ka,ia,ja) )
584  allocate( phydh(0:ka,ia,ja) )
585  pott(:,:,:) = undef
586  temp(:,:,:) = undef
587  pres(:,:,:) = undef
588  exner(:,:,:) = undef
589  phyd(:,:,:) = undef
590  phydh(:,:,:) = undef
591 
592  allocate( qdry(ka,ia,ja) )
593  allocate( rtot(ka,ia,ja) )
594  allocate( cvtot(ka,ia,ja) )
595  allocate( cptot(ka,ia,ja) )
596  qdry(:,:,:) = undef
597  rtot(:,:,:) = undef
598  cvtot(:,:,:) = undef
599  cptot(:,:,:) = undef
600 
601  allocate( prec(ia,ja) )
602  allocate( prec_engi(ia,ja) )
603  prec(:,:) = undef
604  prec_engi(:,:) = undef
605 
606  ! obsolute
607  allocate( momx_tp(ka,ia,ja) )
608  allocate( momy_tp(ka,ia,ja) )
609 
610 
611  momz(1:ks-1,:,:) = 0.0_rp
612  momz(ke:ka,:,:) = 0.0_rp
613 
614  allocate( work3d(ka,ia,ja) )
615  allocate( work2d( ia,ja) )
616  allocate( work1d(ka ) )
617 
618 
619  !--- read namelist
620  rewind(io_fid_conf)
621  read(io_fid_conf,nml=param_atmos_vars,iostat=ierr)
622  if( ierr < 0 ) then !--- missing
623  log_info("ATMOS_vars_setup",*) 'Not found namelist. Default used.'
624  elseif( ierr > 0 ) then !--- fatal error
625  log_error("ATMOS_vars_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_VARS. Check!'
626  call prc_abort
627  endif
628  log_nml(param_atmos_vars)
629 
630  log_newline
631  log_info("ATMOS_vars_setup",*) 'List of prognostic variables (ATMOS) '
632  log_info_cont('(1x,A,A24,A,A48,A,A12,A)') &
633  ' |', 'VARNAME ','|', &
634  'DESCRIPTION ', '[', 'UNIT ', ']'
635  do iv = 1, pv_nmax
636  log_info_cont('(1x,A,I3,A,A24,A,A48,A,A12,A)') &
637  'NO.',iv,'|',pv_info(iv)%NAME,'|', pv_info(iv)%DESC,'[', pv_info(iv)%UNIT,']'
638  enddo
639  do iq = 1, qa
640  log_info_cont('(1x,A,I3,A,A24,A,A48,A,A12,A)') &
641  'NO.',5+iq,'|',tracer_name(iq),'|', tracer_desc(iq),'[', tracer_unit(iq),']'
642  enddo
643 
644  log_newline
645  if ( atmos_restart_in_basename /= '' ) then
646  log_info("ATMOS_vars_setup",*) 'Restart input? : YES, file = ', trim(atmos_restart_in_basename)
647  log_info("ATMOS_vars_setup",*) 'Add timelabel? : ', atmos_restart_in_postfix_timelabel
648  else
649  log_info("ATMOS_vars_setup",*) 'Restart input? : NO'
650  endif
651  if ( atmos_restart_output &
652  .AND. atmos_restart_out_basename /= '' ) then
653  log_info("ATMOS_vars_setup",*) 'Restart output? : YES, file = ', trim(atmos_restart_out_basename)
654  log_info("ATMOS_vars_setup",*) 'Add timelabel? : ', atmos_restart_out_postfix_timelabel
655  else
656  log_info("ATMOS_vars_setup",*) 'Restart output? : NO'
657  atmos_restart_output = .false.
658  endif
659 
660  if ( atmos_restart_check_basename == '' ) then
661  atmos_restart_check = .false.
662  endif
663 
664  if ( atmos_vars_checkcfl_hard > 0.0_rp ) then
665  atmos_vars_checkcfl_soft = min( atmos_vars_checkcfl_soft, atmos_vars_checkcfl_hard )
666  endif
667 
668  log_newline
669  log_info("ATMOS_vars_setup",*) 'Check restart consistency? : ', atmos_restart_check
670  log_info("ATMOS_vars_setup",*) 'Check value range of variables? : ', atmos_vars_checkrange
671  if ( atmos_vars_checkcfl_soft > 0.0_rp ) then
672  log_info("ATMOS_vars_setup",*) 'Threshold of Courant number to warn : ', atmos_vars_checkcfl_soft
673  else
674  log_info("ATMOS_vars_setup",*) 'Threshold of Courant number to warn : disabled'
675  endif
676  if ( atmos_vars_checkcfl_hard > 0.0_rp ) then
677  log_info("ATMOS_vars_setup",*) 'Threshold of Courant number to stop : ', atmos_vars_checkcfl_hard
678  else
679  log_info("ATMOS_vars_setup",*) 'Threshold of Courant number to stop : disabled'
680  endif
681 
692 
693 
694  ! water content
695  if ( atmos_hydrometeor_dry ) then
696  allocate( zero(ka,ia,ja) )
697 !OCL XFILL
698  zero(:,:,:) = 0.0_rp
699 
700  qv => zero
701  qc => zero
702  qr => zero
703  qi => zero
704  qs => zero
705  qg => zero
706  qh => zero
707 
708  moist = .false.
709  else
710  allocate( qe(ka,ia,ja,n_hyd) )
711 !OCL XFILL
712  qe(:,:,:,:) = undef
713 
714  qv => qtrc_av(:,:,:,i_qv)
715  qc => qe(:,:,:,i_hc)
716  qr => qe(:,:,:,i_hr)
717  qi => qe(:,:,:,i_hi)
718  qs => qe(:,:,:,i_hs)
719  qg => qe(:,:,:,i_hg)
720  qh => qe(:,:,:,i_hh)
721 
722  moist = .true.
723  end if
724 
725 
726  dv_calculated(dv_nmax) = .false.
727 
728  !-----< history output setup >-----
729  allocate( qp_hist_id( max(qa,1) ) )
730  allocate( qp_monit_id( max(qa,1) ) )
731  pv_hist_id(:) = -1
732  pv_monit_id(:) = -1
733  qp_hist_id(:) = -1
734  qp_monit_id(:) = -1
735  dv_hist_id(:) = -1
736  dv_monit_id(:) = -1
737 
738 
739  do iv = 1, pv_nmax
740  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 )
741  end do
742 
743  do iq = 1, qa
744  call file_history_reg( tracer_name(iq), tracer_desc(iq), tracer_unit(iq), qp_hist_id(iq), dim_type='ZXY' )
745  enddo
746 
747  do iv = 1, dv_nmax
748  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 )
749  end do
750 
751  call file_history_reg( "GPH", "geopotential height", "m", hist_id_gph, dim_type='ZXY', standard_name="geopotential_height" )
752 
753 
754  !-----< monitor output setup >-----
755  do iv = 1, pv_nmax
756  call monitor_reg( pv_info(iv)%NAME, pv_info(iv)%DESC, trim(pv_info(iv)%UNIT)//"*m3", & ! (in)
757  pv_monit_id(iv), & ! (out)
758  dim_type=pv_info(iv)%dim_type, is_tendency=.false. ) ! (in)
759  end do
760  do iq = 1, qa
761  call monitor_reg( tracer_name(iq), tracer_desc(iq), tracer_unit(iq)//"*kg", & ! (in)
762  qp_monit_id(iq), & ! (out)
763  dim_type='ZXY', is_tendency=.false. ) ! (in)
764  enddo
765 
766  call monitor_reg( 'QDRY', 'dry air mass', 'kg', & ! (in)
767  dv_monit_id(im_qdry), & ! (out)
768  dim_type='ZXY', is_tendency=.false. ) ! (in)
769  call monitor_reg( 'QTOT', 'water mass', 'kg', & ! (in)
770  dv_monit_id(im_qtot), & ! (out)
771  dim_type='ZXY', is_tendency=.false. ) ! (in)
772  call monitor_reg( 'EVAP', 'evaporation at the surface', 'kg', & ! (in)
773  dv_monit_id(im_evap), & ! (out)
774  dim_type='XY', is_tendency=.true. ) ! (in)
775  call monitor_reg( 'PREC', 'precipitation', 'kg', & ! (in)
776  dv_monit_id(im_prec), & ! (out)
777  dim_type='XY', is_tendency=.true. ) ! (in)
778 
779  call monitor_reg( 'ENGT', 'total energy', 'J', & ! (in)
780  dv_monit_id(im_engt), & ! (out)
781  dim_type='ZXY', is_tendency=.false. ) ! (in)
782  call monitor_reg( 'ENGP', 'potential energy', 'J', & ! (in)
783  dv_monit_id(im_engp), & ! (out)
784  dim_type='ZXY', is_tendency=.false. ) ! (in)
785  call monitor_reg( 'ENGK', 'kinetic energy', 'J', & ! (in)
786  dv_monit_id(im_engk), & ! (out)
787  dim_type='ZXY', is_tendency=.false. ) ! (in)
788  call monitor_reg( 'ENGI', 'internal energy', 'J', & ! (in)
789  dv_monit_id(im_engi), & ! (out)
790  dim_type='ZXY', is_tendency=.false. ) ! (in)
791 
792  call monitor_reg( 'ENGFLXT', 'total energy flux convergence', 'J', & ! (in)
793  dv_monit_id(im_engflxt), & ! (out)
794  dim_type='XY', is_tendency=.true. ) ! (in)
795  call monitor_reg( 'ENGSFC_SH', 'SFC sensible heat flux', 'J', & ! (in)
796  dv_monit_id(im_engsfc_sh), & ! (out)
797  dim_type='XY', is_tendency=.true. ) ! (in)
798  call monitor_reg( 'ENGSFC_LH', 'SFC latent heat flux', 'J', & ! (in)
799  dv_monit_id(im_engsfc_lh), & ! (out)
800  dim_type='XY', is_tendency=.true. ) ! (in)
801  call monitor_reg( 'ENGSFC_EVAP', 'SFC internal energy flux of the evapolation', 'J', & ! (in)
802  dv_monit_id(im_engsfc_evap), & ! (out)
803  dim_type='XY', is_tendency=.true. ) ! (in)
804  call monitor_reg( 'ENGSFC_PREC', 'SFC internal energy flux of the precipitation', 'J', & ! (in)
805  dv_monit_id(im_engsfc_prec), & ! (out)
806  dim_type='XY', is_tendency=.true. ) ! (in)
807  call monitor_reg( 'ENGSFC_RD', 'SFC net radiation flux', 'J', & ! (in)
808  dv_monit_id(im_engsfc_rd), & ! (out)
809  dim_type='XY', is_tendency=.true. ) ! (in)
810  call monitor_reg( 'ENGTOM_RD', 'TOM net radiation flux', 'J', & ! (in)
811  dv_monit_id(im_engtom_rd), & ! (out)
812  dim_type='XY', is_tendency=.true. ) ! (in)
813 
814  call monitor_reg( 'ENGSFC_LW_up', 'SFC LW upward flux', 'J', & ! (in)
815  dv_monit_id(im_engsfc_lw_up), & ! (out)
816  dim_type='XY', is_tendency=.true. ) ! (in)
817  call monitor_reg( 'ENGSFC_LW_dn', 'SFC LW downward flux', 'J', & ! (in)
818  dv_monit_id(im_engsfc_lw_dn), & ! (out)
819  dim_type='XY', is_tendency=.true. ) ! (in)
820  call monitor_reg( 'ENGSFC_SW_up', 'SFC SW upward flux', 'J', & ! (in)
821  dv_monit_id(im_engsfc_sw_up), & ! (out)
822  dim_type='XY', is_tendency=.true. ) ! (in)
823  call monitor_reg( 'ENGSFC_SW_dn', 'SFC SW downward flux', 'J', & ! (in)
824  dv_monit_id(im_engsfc_sw_dn), & ! (out)
825  dim_type='XY', is_tendency=.true. ) ! (in)
826 
827  call monitor_reg( 'ENGTOM_LW_up', 'TOM LW upward flux', 'J', & ! (in)
828  dv_monit_id(im_engtom_lw_up), & ! (out)
829  dim_type='XY', is_tendency=.true. ) ! (in)
830  call monitor_reg( 'ENGTOM_LW_dn', 'TOM LW downward flux', 'J', & ! (in)
831  dv_monit_id(im_engtom_lw_dn), & ! (out)
832  dim_type='XY', is_tendency=.true. ) ! (in)
833  call monitor_reg( 'ENGTOM_SW_up', 'TOM SW upward flux', 'J', & ! (in)
834  dv_monit_id(im_engtom_sw_up), & ! (out)
835  dim_type='XY', is_tendency=.true. ) ! (in)
836  call monitor_reg( 'ENGTOM_SW_dn', 'TOM SW downward flux', 'J', & ! (in)
837  dv_monit_id(im_engtom_sw_dn), & ! (out)
838  dim_type='XY', is_tendency=.true. ) ! (in)
839 
840  return
841  end subroutine atmos_vars_setup
842 
843  !-----------------------------------------------------------------------------
845  subroutine atmos_vars_fillhalo( &
846  FILL_BND )
847  use scale_comm_cartesc, only: &
848  comm_vars8, &
849  comm_wait
850  implicit none
851 
852  logical, intent(in), optional :: fill_bnd
853 
854  logical :: fill_bnd_
855  integer :: i, j, iq
856  !---------------------------------------------------------------------------
857 
858  fill_bnd_ = .false.
859  if ( present(fill_bnd) ) fill_bnd_ = fill_bnd
860 
861  !$omp parallel do private(i,j) OMP_SCHEDULE_ collapse(2)
862  do j = jsb, jeb
863  do i = isb, ieb
864  dens( 1:ks-1,i,j) = dens(ks,i,j)
865  momz( 1:ks-2,i,j) = momz(ks-1,i,j)
866  momx( 1:ks-1,i,j) = momx(ks,i,j)
867  momy( 1:ks-1,i,j) = momy(ks,i,j)
868  rhot( 1:ks-1,i,j) = rhot(ks,i,j)
869  dens(ke+1:ka, i,j) = dens(ke,i,j)
870  momz(ke+1:ka, i,j) = momz(ke,i,j)
871  momx(ke+1:ka, i,j) = momx(ke,i,j)
872  momy(ke+1:ka, i,j) = momy(ke,i,j)
873  rhot(ke+1:ka, i,j) = rhot(ke,i,j)
874  enddo
875  enddo
876 
877  !$omp parallel do private(i,j,iq) OMP_SCHEDULE_ collapse(3)
878  do iq = 1, qa
879  do j = jsb, jeb
880  do i = isb, ieb
881  qtrc( 1:ks-1,i,j,iq) = qtrc(ks,i,j,iq)
882  qtrc(ke+1:ka, i,j,iq) = qtrc(ke,i,j,iq)
883  enddo
884  enddo
885  enddo
886 
887  call comm_vars8( dens(:,:,:), 1 )
888  call comm_vars8( momz(:,:,:), 2 )
889  call comm_vars8( momx(:,:,:), 3 )
890  call comm_vars8( momy(:,:,:), 4 )
891  call comm_vars8( rhot(:,:,:), 5 )
892  call comm_wait ( dens(:,:,:), 1, fill_bnd_ )
893  call comm_wait ( momz(:,:,:), 2, fill_bnd_ )
894  call comm_wait ( momx(:,:,:), 3, fill_bnd_ )
895  call comm_wait ( momy(:,:,:), 4, fill_bnd_ )
896  call comm_wait ( rhot(:,:,:), 5, fill_bnd_ )
897 
898  do iq = 1, qa
899  call comm_vars8( qtrc(:,:,:,iq), iq )
900  enddo
901  do iq = 1, qa
902  call comm_wait ( qtrc(:,:,:,iq), iq, fill_bnd_ )
903  enddo
904 
905  return
906  end subroutine atmos_vars_fillhalo
907 
908  !-----------------------------------------------------------------------------
910  subroutine atmos_vars_restart_open
911  use scale_prc, only: &
912  prc_abort
913  use scale_const, only: &
914  grav => const_grav
915  use scale_time, only: &
917  use scale_file_cartesc, only: &
919  file_cartesc_check_coordinates
920  use mod_atmos_admin, only: &
922  atmos_sw_dyn, &
923  atmos_sw_phy_mp, &
924  atmos_sw_phy_ae, &
925  atmos_sw_phy_ch, &
926  atmos_sw_phy_rd, &
927  atmos_sw_phy_sf, &
928  atmos_sw_phy_tb, &
929  atmos_sw_phy_bl, &
930  atmos_sw_phy_cp, &
932  use mod_atmos_dyn_vars, only: &
934  use mod_atmos_phy_mp_vars, only: &
936  use mod_atmos_phy_ae_vars, only: &
938  use mod_atmos_phy_ch_vars, only: &
940  use mod_atmos_phy_rd_vars, only: &
942  use mod_atmos_phy_sf_vars, only: &
944  use mod_atmos_phy_tb_vars, only: &
946  use mod_atmos_phy_bl_vars, only: &
948  use mod_atmos_phy_cp_vars, only: &
950  use mod_atmos_phy_lt_vars, only: &
952  use mod_cpl_admin, only: &
953  cpl_sw
954  implicit none
955 
956  character(len=19) :: timelabel
957  character(len=H_LONG) :: basename
958  !---------------------------------------------------------------------------
959 
960  log_newline
961  log_info("ATMOS_vars_restart_open",*) 'Open restart file (ATMOS) '
962 
963  if ( atmos_restart_in_basename /= '' ) then
964 
966  call time_gettimelabel( timelabel )
967  basename = trim(atmos_restart_in_basename)//'_'//trim(timelabel)
968  else
969  basename = trim(atmos_restart_in_basename)
970  endif
971 
972  log_info("ATMOS_vars_restart_open",*) 'basename: ', trim(basename)
973 
974  call file_cartesc_open( basename, restart_fid, aggregate=atmos_restart_in_aggregate )
975 
976  if ( atmos_restart_in_check_coordinates ) then
977  call file_cartesc_check_coordinates( restart_fid, atmos=.true. )
978  end if
979 
980  else
981  log_error("ATMOS_vars_restart_open",*) 'restart file for atmosphere is not specified. STOP!'
982  call prc_abort
983  endif
984 
985  if ( atmos_use_average ) then
986  dens_av(:,:,:) = dens(:,:,:)
987  momz_av(:,:,:) = momz(:,:,:)
988  momx_av(:,:,:) = momx(:,:,:)
989  momy_av(:,:,:) = momy(:,:,:)
990  rhot_av(:,:,:) = rhot(:,:,:)
991  qtrc_av(:,:,:,:) = qtrc(:,:,:,:)
992  endif
993 
999  if( atmos_sw_phy_sf .and. (.not. cpl_sw) ) call atmos_phy_sf_vars_restart_open
1004 
1005  return
1006  end subroutine atmos_vars_restart_open
1007 
1008  !-----------------------------------------------------------------------------
1010  subroutine atmos_vars_restart_read
1011  use scale_prc, only: &
1012  prc_abort
1013  use scale_file, only: &
1015  use scale_file_cartesc, only: &
1016  file_cartesc_read, &
1018  use mod_atmos_admin, only: &
1020  atmos_sw_dyn, &
1021  atmos_sw_phy_mp, &
1022  atmos_sw_phy_ae, &
1023  atmos_sw_phy_ch, &
1024  atmos_sw_phy_rd, &
1025  atmos_sw_phy_sf, &
1026  atmos_sw_phy_tb, &
1027  atmos_sw_phy_bl, &
1028  atmos_sw_phy_cp, &
1030  use mod_atmos_dyn_vars, only: &
1032  use mod_atmos_phy_mp_vars, only: &
1034  use mod_atmos_phy_ae_vars, only: &
1036  use mod_atmos_phy_ch_vars, only: &
1038  use mod_atmos_phy_rd_vars, only: &
1040  use mod_atmos_phy_sf_vars, only: &
1042  use mod_atmos_phy_tb_vars, only: &
1044  use mod_atmos_phy_bl_vars, only: &
1046  use mod_atmos_phy_cp_vars, only: &
1048  use mod_atmos_phy_lt_vars, only: &
1050  use mod_cpl_admin, only: &
1051  cpl_sw
1052  implicit none
1053 
1054  integer :: i, j, iq
1055  !---------------------------------------------------------------------------
1056 
1057  if ( restart_fid /= -1 ) then
1058  log_newline
1059  log_info("ATMOS_vars_restart_read",*) 'Read from restart file (ATMOS) '
1060 
1061  call file_cartesc_read( restart_fid, pv_info(i_dens)%NAME, 'ZXY', & ! [IN]
1062  dens(:,:,:) ) ! [OUT]
1063  call file_cartesc_read( restart_fid, pv_info(i_momz)%NAME, 'ZHXY', & ! [IN]
1064  momz(:,:,:) ) ! [OUT]
1065  call file_cartesc_read( restart_fid, pv_info(i_momx)%NAME, 'ZXHY', & ! [IN]
1066  momx(:,:,:) ) ! [OUT]
1067  call file_cartesc_read( restart_fid, pv_info(i_momy)%NAME, 'ZXYH', & ! [IN]
1068  momy(:,:,:) ) ! [OUT]
1069  call file_cartesc_read( restart_fid, pv_info(i_rhot)%NAME, 'ZXY', & ! [IN]
1070  rhot(:,:,:) ) ! [OUT]
1071 
1072  do iq = 1, qa
1073  call file_cartesc_read( restart_fid, tracer_name(iq), 'ZXY', & ! [IN]
1074  qtrc(:,:,:,iq) ) ! [OUT]
1075  enddo
1076 
1077  if ( file_get_aggregate(restart_fid) ) then
1078  call file_cartesc_flush( restart_fid ) ! X/Y halos have been read from file
1079  ! fill k halos
1080  do j = 1, ja
1081  do i = 1, ia
1082  dens( 1:ks-1,i,j) = dens(ks,i,j)
1083  momz( 1:ks-2,i,j) = momz(ks-1,i,j)
1084  momx( 1:ks-1,i,j) = momx(ks,i,j)
1085  momy( 1:ks-1,i,j) = momy(ks,i,j)
1086  rhot( 1:ks-1,i,j) = rhot(ks,i,j)
1087  dens(ke+1:ka, i,j) = dens(ke,i,j)
1088  momz(ke+1:ka, i,j) = momz(ke,i,j)
1089  momx(ke+1:ka, i,j) = momx(ke,i,j)
1090  momy(ke+1:ka, i,j) = momy(ke,i,j)
1091  rhot(ke+1:ka, i,j) = rhot(ke,i,j)
1092  do iq = 1, qa
1093  qtrc( 1:ks-1,i,j,iq) = qtrc(ks,i,j,iq)
1094  qtrc(ke+1:ka ,i,j,iq) = qtrc(ke,i,j,iq)
1095  end do
1096  enddo
1097  enddo
1098  else
1099  call atmos_vars_fillhalo
1100  end if
1101 
1103  call atmos_vars_check( force = .true. )
1104  else
1105  log_error("ATMOS_vars_restart_read",*) 'invalid restart file ID for atmosphere. STOP!'
1106  call prc_abort
1107  endif
1108 
1109  if ( atmos_use_average ) then
1110  dens_av(:,:,:) = dens(:,:,:)
1111  momz_av(:,:,:) = momz(:,:,:)
1112  momx_av(:,:,:) = momx(:,:,:)
1113  momy_av(:,:,:) = momy(:,:,:)
1114  rhot_av(:,:,:) = rhot(:,:,:)
1115  qtrc_av(:,:,:,:) = qtrc(:,:,:,:)
1116  endif
1117 
1123  if ( atmos_sw_phy_sf .and. (.not. cpl_sw) ) call atmos_phy_sf_vars_restart_read
1128 
1129  return
1130  end subroutine atmos_vars_restart_read
1131 
1132  !-----------------------------------------------------------------------------
1134  subroutine atmos_vars_history_setpres
1136  real_fz => atmos_grid_cartesc_real_fz
1137  use scale_atmos_bottom, only: &
1138  bottom_estimate => atmos_bottom_estimate
1139  use scale_file_history_cartesc, only: &
1141  use mod_atmos_phy_sf_vars, only: &
1142  sfc_temp => atmos_phy_sf_sfc_temp
1143  implicit none
1144 
1145  real(rp) :: sfc_dens(ia,ja)
1146  real(rp) :: sfc_pres(ia,ja)
1147  !---------------------------------------------------------------------------
1148 
1149  call bottom_estimate( ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
1150  dens_av(:,:,:), pres(:,:,:), qv(:,:,:), & ! [IN]
1151  sfc_temp(:,:), & ! [IN]
1152  real_fz(:,:,:), & ! [IN]
1153  sfc_dens(:,:), sfc_pres(:,:) ) ! [OUT]
1154 
1155  call file_history_cartesc_set_pres( phyd(:,:,:), & ! [IN]
1156  phydh(:,:,:), & ! [IN]
1157  sfc_pres(:,:) ) ! [IN]
1158 
1159  return
1160  end subroutine atmos_vars_history_setpres
1161 
1162  !-----------------------------------------------------------------------------
1164  subroutine atmos_vars_restart_check
1165  use scale_prc, only: &
1166  prc_myrank
1167  use scale_file, only: &
1169  use scale_file_cartesc, only: &
1171  file_cartesc_read, &
1174  implicit none
1175 
1176  real(rp) :: dens_check(ka,ia,ja) ! Density [kg/m3]
1177  real(rp) :: momz_check(ka,ia,ja) ! momentum z [kg/s/m2]
1178  real(rp) :: momx_check(ka,ia,ja) ! momentum x [kg/s/m2]
1179  real(rp) :: momy_check(ka,ia,ja) ! momentum y [kg/s/m2]
1180  real(rp) :: rhot_check(ka,ia,ja) ! DENS * POTT [K*kg/m3]
1181  real(rp) :: qtrc_check(ka,ia,ja,qa) ! tracer mixing ratio [kg/kg]
1182 
1183  character(len=H_LONG) :: basename
1184 
1185  logical :: datacheck
1186  integer :: k, i, j, iq
1187  integer :: fid
1188  !---------------------------------------------------------------------------
1189 
1190  call prof_rapstart('Debug')
1191 
1192  log_info("ATMOS_vars_restart_check",*) 'Compare last Data with ', trim(atmos_restart_check_basename), 'on PE=', prc_myrank
1193  log_info("ATMOS_vars_restart_check",*) 'criterion = ', atmos_restart_check_criterion
1194  datacheck = .true.
1195 
1196  basename = atmos_restart_check_basename
1197 
1198  call file_cartesc_open( basename, fid )
1199 
1200  call file_cartesc_read( fid, 'DENS', 'ZXY' , dens_check(:,:,:) )
1201  call file_cartesc_read( fid, 'MOMZ', 'ZHXY', momz_check(:,:,:) )
1202  call file_cartesc_read( fid, 'MOMX', 'ZXHY', momx_check(:,:,:) )
1203  call file_cartesc_read( fid, 'MOMY', 'ZXYH', momy_check(:,:,:) )
1204  call file_cartesc_read( fid, 'RHOT', 'ZXY' , rhot_check(:,:,:) )
1205  do iq = 1, qa
1206  call file_cartesc_read( fid, tracer_name(iq), 'ZXY', qtrc_check(:,:,:,iq) )
1207  end do
1208  if ( file_get_aggregate(fid) ) call file_cartesc_flush( fid )
1209 
1210  call file_cartesc_close( fid ) ! [IN]
1211 
1212  do k = ks, ke
1213  do j = js, je
1214  do i = is, ie
1215  if ( abs( dens(k,i,j)-dens_check(k,i,j) ) > atmos_restart_check_criterion ) then
1216  log_error("ATMOS_vars_restart_check",*) 'there is the difference : ', dens(k,i,j)-dens_check(k,i,j)
1217  log_error_cont(*) 'at (PE-id,k,i,j,varname) : ', prc_myrank, k, i, j, 'DENS'
1218  datacheck = .false.
1219  endif
1220  enddo
1221  enddo
1222  enddo
1223 
1224  do k = ks-1, ke
1225  do j = js, je
1226  do i = is, ie
1227  if ( abs( momz(k,i,j)-momz_check(k,i,j) ) > atmos_restart_check_criterion ) then
1228  log_error("ATMOS_vars_restart_check",*) 'there is the difference : ', momz(k,i,j)-momz_check(k,i,j)
1229  log_error_cont(*) 'at (PE-id,k,i,j,varname) : ', prc_myrank, k, i, j, 'MOMZ'
1230  datacheck = .false.
1231  endif
1232  enddo
1233  enddo
1234  enddo
1235 
1236  do k = ks, ke
1237  do j = js, je
1238  do i = is, ie
1239  if ( abs( momx(k,i,j)-momx_check(k,i,j) ) > atmos_restart_check_criterion ) then
1240  log_error("ATMOS_vars_restart_check",*) 'there is the difference : ', momx(k,i,j)-momx_check(k,i,j)
1241  log_error_cont(*) 'at (PE-id,k,i,j,varname) : ', prc_myrank, k, i, j, 'MOMX'
1242  datacheck = .false.
1243  endif
1244  enddo
1245  enddo
1246  enddo
1247 
1248  do k = ks, ke
1249  do j = js, je
1250  do i = is, ie
1251  if ( abs( momy(k,i,j)-momy_check(k,i,j) ) > atmos_restart_check_criterion ) then
1252  log_error("ATMOS_vars_restart_check",*) 'there is the difference : ', momy(k,i,j)-momy_check(k,i,j)
1253  log_error_cont(*) 'at (PE-id,k,i,j,varname) : ', prc_myrank, k, i, j, 'MOMY'
1254  datacheck = .false.
1255  endif
1256  enddo
1257  enddo
1258  enddo
1259 
1260  do k = ks, ke
1261  do j = js, je
1262  do i = is, ie
1263  if ( abs( rhot(k,i,j)-rhot_check(k,i,j) ) > atmos_restart_check_criterion ) then
1264  log_error("ATMOS_vars_restart_check",*) 'there is the difference : ', rhot(k,i,j)-rhot_check(k,i,j)
1265  log_error_cont(*) 'at (PE-id,k,i,j,varname) : ', prc_myrank, k, i, j, 'RHOT'
1266  datacheck = .false.
1267  endif
1268  enddo
1269  enddo
1270  enddo
1271 
1272  do iq = 1, qa
1273  do k = ks, ke
1274  do j = js, je
1275  do i = is, ie
1276  if ( abs( qtrc(k,i,j,iq)-qtrc_check(k,i,j,iq) ) > atmos_restart_check_criterion ) then
1277  log_error("ATMOS_vars_restart_check",*) 'there is the difference : ', qtrc(k,i,j,iq)-qtrc_check(k,i,j,iq)
1278  log_error_cont(*) 'at (PE-id,k,i,j,varname) : ', prc_myrank, k, i, j, tracer_name(iq)
1279  datacheck = .false.
1280  endif
1281  enddo
1282  enddo
1283  enddo
1284  enddo
1285 
1286  if (datacheck) then
1287  log_info("ATMOS_vars_restart_check",*) 'Data Check Clear.'
1288  else
1289  log_info("ATMOS_vars_restart_check",*) 'Data Check Failed. See std. output.'
1290  log_error("ATMOS_vars_restart_check",*) 'Data Check Failed.'
1291  endif
1292 
1293  call prof_rapend('Debug')
1294 
1295  return
1296  end subroutine atmos_vars_restart_check
1297 
1298  !-----------------------------------------------------------------------------
1300  subroutine atmos_vars_history
1301  use scale_file_history, only: &
1302  file_history_query, &
1303  file_history_put
1304  use scale_atmos_grid_cartesc_real, only: &
1305  real_cz => atmos_grid_cartesc_real_cz
1306  use mod_atmos_phy_mp_vars, only: &
1308  use mod_atmos_phy_ae_vars, only: &
1310  implicit none
1311 
1312  logical :: do_put
1313  integer :: iq, iv
1314  !---------------------------------------------------------------------------
1315 
1316  call prof_rapstart('ATM_History', 1)
1317 
1318  ! history output of prognostic variables
1319  call file_history_put ( pv_hist_id(i_dens), dens(:,:,:) )
1320  call file_history_put ( pv_hist_id(i_momz), momz(:,:,:) )
1321  call file_history_put ( pv_hist_id(i_momx), momx(:,:,:) )
1322  call file_history_put ( pv_hist_id(i_momy), momy(:,:,:) )
1323  call file_history_put ( pv_hist_id(i_rhot), rhot(:,:,:) )
1324  do iq = 1, qa
1325  call file_history_put ( qp_hist_id(iq), qtrc(:,:,:,iq) )
1326  enddo
1327 
1328 
1329  ! history output of diagnostic variables
1330  call file_history_put ( dv_hist_id(i_w ), w(:,:,:) )
1331  call file_history_put ( dv_hist_id(i_u ), u(:,:,:) )
1332  call file_history_put ( dv_hist_id(i_v ), v(:,:,:) )
1333  call file_history_put ( dv_hist_id(i_pott ), pott(:,:,:) )
1334  call file_history_put ( dv_hist_id(i_temp ), temp(:,:,:) )
1335  call file_history_put ( dv_hist_id(i_pres ), pres(:,:,:) )
1336 
1337  call file_history_put ( dv_hist_id(i_exner), exner(:,:,:) )
1338  call file_history_put ( dv_hist_id(i_phyd ), phyd(:,:,:) )
1339 
1340  call file_history_put ( dv_hist_id(i_qdry ), qdry(:,:,:) )
1341  call file_history_put ( dv_hist_id(i_rtot ), rtot(:,:,:) )
1342  call file_history_put ( dv_hist_id(i_cvtot), cvtot(:,:,:) )
1343  call file_history_put ( dv_hist_id(i_cptot), cptot(:,:,:) )
1344 
1345  do iv = i_cptot+1, dv_nmax
1346  if ( dv_hist_id(iv) > 0 ) then
1347  call file_history_query( dv_hist_id(iv), do_put )
1348 
1349  if ( do_put ) then
1350  select case( dv_info(iv)%ndims )
1351  case( 3 )
1352  call atmos_vars_get_diagnostic( dv_info(iv)%NAME, work3d(:,:,:) )
1353  call file_history_put( dv_hist_id(iv), work3d(:,:,:) )
1354  case( 2 )
1355  call atmos_vars_get_diagnostic( dv_info(iv)%NAME, work2d(:,:) )
1356  call file_history_put( dv_hist_id(iv), work2d(:,:) )
1357  case( 1 )
1358  call atmos_vars_get_diagnostic( dv_info(iv)%NAME, work1d(:) )
1359  call file_history_put( dv_hist_id(iv), work1d(:) )
1360  end select
1361  endif
1362  endif
1363  enddo
1364 
1365  call file_history_put( hist_id_gph, real_cz(:,:,:) )
1366 
1367 
1368  if ( moist ) &
1369  call atmos_phy_mp_vars_history( dens_av(:,:,:), temp(:,:,:), qtrc_av(:,:,:,:) )
1370 ! if ( .false. ) then
1371 ! call ATMOS_vars_get_diagnostic( "RH", WORK3D(:,:,:) )
1372 ! call ATMOS_PHY_AE_vars_history( QTRC_av(:,:,:,:), WORK3D(:,:,:) )
1373 ! end if
1374 
1375  call prof_rapend ('ATM_History', 1)
1376 
1377  return
1378  end subroutine atmos_vars_history
1379 
1380  !-----------------------------------------------------------------------------
1382  subroutine atmos_vars_check( force )
1383  use scale_prc, only: &
1384  prc_myrank, &
1385  prc_abort
1386  use scale_prc_cartesc, only: &
1387  prc_twod
1388  use scale_const, only: &
1389  grav => const_grav, &
1390  cvdry => const_cvdry
1391  use scale_statistics, only: &
1393  statistics_total, &
1394  statistics_detail
1395  use scale_atmos_grid_cartesc_real, only: &
1404  use mod_atmos_admin, only: &
1406  use scale_atmos_grid_cartesc, only: &
1407  rfdx => atmos_grid_cartesc_rfdx, &
1408  rfdy => atmos_grid_cartesc_rfdy
1409  use scale_atmos_grid_cartesc_real, only: &
1410  real_cz => atmos_grid_cartesc_real_cz
1411  use scale_atmos_grid_cartesc_metric, only: &
1413  use scale_time, only: &
1415  implicit none
1416  logical, intent(in), optional :: force
1417 
1418  real(rp) :: rhoq(ka,ia,ja)
1419 
1420  real(rp) :: work (ka,ia,ja,3)
1421  character(len=H_SHORT) :: wname(3)
1422  real(rp) :: cflmax
1423 
1424  integer :: k, i, j, iq
1425  logical :: check
1426  !---------------------------------------------------------------------------
1427 
1428  if ( present(force) ) then
1429  check = force
1430  else
1431  check = atmos_vars_checkrange
1432  end if
1433 
1434  ! value check for prognostic variables
1435  if ( check ) then
1436  call valcheck( ka, ks, ke, ia, is, ie, ja, js, je, &
1437  dens(:,:,:), 0.0_rp, 2.0_rp, pv_info(i_dens)%NAME, __file__, __line__ )
1438  call valcheck( ka, ks, ke, ia, is, ie, ja, js, je, &
1439  momz(:,:,:), -200.0_rp, 200.0_rp, pv_info(i_momz)%NAME, __file__, __line__ )
1440  call valcheck( ka, ks, ke, ia, is, ie, ja, js, je, &
1441  momx(:,:,:), -200.0_rp, 200.0_rp, pv_info(i_momx)%NAME, __file__, __line__ )
1442  call valcheck( ka, ks, ke, ia, is, ie, ja, js, je, &
1443  momy(:,:,:), -200.0_rp, 200.0_rp, pv_info(i_momy)%NAME, __file__, __line__ )
1444  call valcheck( ka, ks, ke, ia, is, ie, ja, js, je, &
1445  rhot(:,:,:), 0.0_rp, 1000.0_rp, pv_info(i_rhot)%NAME, __file__, __line__ )
1446 
1447  !$omp parallel workshare
1448 !OCL XFILL
1449  work(:,:,:,1) = w(:,:,:)
1450 !OCL XFILL
1451  work(:,:,:,2) = u(:,:,:)
1452 !OCL XFILL
1453  work(:,:,:,3) = v(:,:,:)
1454  !$omp end parallel workshare
1455 
1456  wname(1) = "W"
1457  wname(2) = "U"
1458  wname(3) = "V"
1459 
1460  call statistics_detail( ka, ks, ke, ia, is, ie, ja, js, je, 3, &
1461  wname(:), work(:,:,:,:) )
1462  endif
1463 
1464  if ( present(force) ) then
1465  check = force
1466  else
1468  end if
1469 
1470  if ( check ) then
1471 
1472  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
1473  dens(:,:,:), pv_info(i_dens)%NAME, & ! (in)
1474  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
1475  atmos_grid_cartesc_real_totvol ) ! (in)
1476  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
1477  momz(:,:,:), pv_info(i_momz)%NAME, & ! (in)
1478  atmos_grid_cartesc_real_volwxy(:,:,:), & ! (in)
1479  atmos_grid_cartesc_real_totvolwxy ) ! (in)
1480  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
1481  momx(:,:,:), pv_info(i_momx)%NAME, & ! (in)
1482  atmos_grid_cartesc_real_volzuy(:,:,:), & ! (in)
1483  atmos_grid_cartesc_real_totvolzuy ) ! (in)
1484  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
1485  momy(:,:,:), pv_info(i_momy)%NAME, & ! (in)
1486  atmos_grid_cartesc_real_volzxv(:,:,:), & ! (in)
1487  atmos_grid_cartesc_real_totvolzxv ) ! (in)
1488  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
1489  rhot(:,:,:), pv_info(i_rhot)%NAME, & ! (in)
1490  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
1491  atmos_grid_cartesc_real_totvol ) ! (in)
1492 
1493  do iq = 1, qa
1494  rhoq(ks:ke,is:ie,js:je) = dens(ks:ke,is:ie,js:je) * qtrc(ks:ke,is:ie,js:je,iq)
1495 
1496  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
1497  rhoq(:,:,:), tracer_name(iq), & ! (in)
1498  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
1499  atmos_grid_cartesc_real_totvol ) ! (in)
1500  enddo
1501 
1503 
1504 
1505  rhoq(ks:ke,is:ie,js:je) = dens(ks:ke,is:ie,js:je) * qdry(ks:ke,is:ie,js:je)
1506  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
1507  rhoq(:,:,:), 'QDRY', & ! (in)
1508  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
1509  atmos_grid_cartesc_real_totvol ) ! (in)
1510 
1511  rhoq(ks:ke,is:ie,js:je) = dens(ks:ke,is:ie,js:je) * ( 1.0_rp - qdry(ks:ke,is:ie,js:je) ) ! Qtotal
1512  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
1513  rhoq(:,:,:), 'QTOT', & ! (in)
1514  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
1515  atmos_grid_cartesc_real_totvol ) ! (in)
1516 
1517 
1518  call atmos_vars_get_diagnostic( 'ENGT', work3d(:,:,:) )
1519  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
1520  work3d(:,:,:), 'ENGT', & ! (in)
1521  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
1522  atmos_grid_cartesc_real_totvol ) ! (in)
1523  call atmos_vars_get_diagnostic( 'ENGP', work3d(:,:,:) )
1524  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
1525  work3d(:,:,:), 'ENGP', & ! (in)
1526  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
1527  atmos_grid_cartesc_real_totvol ) ! (in)
1528  call atmos_vars_get_diagnostic( 'ENGK', work3d(:,:,:) )
1529  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
1530  work3d(:,:,:), 'ENGK', & ! (in)
1531  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
1532  atmos_grid_cartesc_real_totvol ) ! (in)
1533  call atmos_vars_get_diagnostic( 'ENGI', work3d(:,:,:) )
1534  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
1535  work3d(:,:,:), 'ENGI', & ! (in)
1536  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
1537  atmos_grid_cartesc_real_totvol ) ! (in)
1538 
1539  end if
1540 
1541 
1542  ! CFL condition check
1543  if ( ( atmos_dyn_type /= 'OFF' .AND. atmos_dyn_type /= 'NONE' ) &
1544  .AND. ( atmos_vars_checkcfl_soft > 0.0_rp .OR. atmos_vars_checkcfl_hard > 0.0_rp ) ) then
1545  !$omp parallel workshare
1546 !OCL XFILL
1547  work(:,:,:,:) = 0.0_rp
1548  !$omp end parallel workshare
1549 
1550  !$omp parallel do
1551  do j = js, je
1552  do i = is, ie
1553  do k = ks, ke
1554  work(k,i,j,1) = 0.5_rp * abs(momz_av(k,i,j)) / ( dens_av(k+1,i,j) + dens_av(k,i,j) ) &
1555  * time_dtsec_atmos_dyn / ( real_cz(k+1,i,j) - real_cz(k,i,j) )
1556  work(k,i,j,3) = 0.5_rp * abs(momy_av(k,i,j)) / ( dens_av(k,i,j+1) + dens_av(k,i,j) ) &
1557  * time_dtsec_atmos_dyn * rfdy(j) * mapf(i,j,2,i_xv)
1558  enddo
1559  enddo
1560  enddo
1561  if ( prc_twod ) then
1562  !$omp parallel do
1563  do j = js, je
1564  do k = ks, ke
1565  work(k,is,j,2) = 0.0_rp
1566  enddo
1567  enddo
1568  else
1569  !$omp parallel do
1570  do j = js, je
1571  do i = is, ie
1572  do k = ks, ke
1573  work(k,i,j,2) = 0.5_rp * abs(momx_av(k,i,j)) / ( dens_av(k,i+1,j) + dens_av(k,i,j) ) &
1574  * time_dtsec_atmos_dyn * rfdx(i) * mapf(i,j,1,i_uy)
1575  enddo
1576  enddo
1577  enddo
1578  end if
1579 
1580  cflmax = maxval( work(:,:,:,:) )
1581 
1582  if ( atmos_vars_checkcfl_hard > 0.0_rp .AND. cflmax > atmos_vars_checkcfl_hard ) then
1583  log_info("ATMOS_vars_check",*) "Courant number =", cflmax, " exceeded the hard limit =", atmos_vars_checkcfl_hard
1584  log_error("ATMOS_vars_check",*) "Courant number =", cflmax, " exceeded the hard limit =", atmos_vars_checkcfl_hard
1585  log_error_cont(*) "Rank =", prc_myrank
1586  log_error_cont(*) "Please set ATMOS_VARS_CHECKCFL_HARD in the namelist PARAM_ATMOS_VARS when you want to change the limit."
1587 
1588  wname(1) = "Courant num. Z"
1589  wname(2) = "Courant num. X"
1590  wname(3) = "Courant num. Y"
1591  call statistics_detail( ka, ks, ke, ia, is, ie, ja, js, je, 3, &
1592  wname(:), work(:,:,:,:), &
1593  local=.true. )
1594 
1595  call prc_abort
1596  endif
1597 
1598  if ( atmos_vars_checkcfl_soft > 0.0_rp .AND. cflmax > atmos_vars_checkcfl_soft ) then
1599  log_info("ATMOS_vars_check",*) "Courant number =", cflmax, " exceeded the soft limit =", atmos_vars_checkcfl_soft
1600  log_error("ATMOS_vars_check",*) "Courant number =", cflmax, " exceeded the soft limit =", atmos_vars_checkcfl_soft
1601  log_error_cont(*) "Rank =", prc_myrank
1602 
1603  wname(1) = "Courant num. Z"
1604  wname(2) = "Courant num. X"
1605  wname(3) = "Courant num. Y"
1606  call statistics_detail( ka, ks, ke, ia, is, ie, ja, js, je, 3, &
1607  wname(:), work(:,:,:,:), &
1608  local=.true. )
1609  endif
1610 
1611  endif
1612 
1613 
1614  return
1615  end subroutine atmos_vars_check
1616 
1617  !-----------------------------------------------------------------------------
1619  subroutine atmos_vars_calc_diagnostics
1621  real_cz => atmos_grid_cartesc_real_cz, &
1622  real_fz => atmos_grid_cartesc_real_fz
1623  use scale_atmos_thermodyn, only: &
1624  atmos_thermodyn_specific_heat
1625  use scale_atmos_diagnostic, only: &
1628  use scale_atmos_diagnostic_cartesc, only: &
1630  use scale_comm_cartesc, only: &
1631  comm_vars8, &
1632  comm_wait
1633  use scale_atmos_hydrometeor, only: &
1634  n_hyd
1635  use mod_atmos_phy_mp_vars, only: &
1638  use mod_atmos_phy_ae_vars, only: &
1640  implicit none
1641 
1642  integer :: iq
1643 
1644  call atmos_thermodyn_specific_heat( &
1645  ka, ks, ke, ia, 1, ia, ja, 1, ja, qa, &
1646  qtrc_av(:,:,:,:), & ! (in)
1647  tracer_mass(:), tracer_r(:), tracer_cv(:), tracer_cp(:), & ! (in)
1648  qdry(:,:,:), rtot(:,:,:), cvtot(:,:,:), cptot(:,:,:) ) ! (out)
1649 
1651  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
1652  dens_av(:,:,:), momz_av(:,:,:), momx_av(:,:,:), momy_av(:,:,:), & ! (in)
1653  w(:,:,:), u(:,:,:), v(:,:,:) ) ! (out)
1654 
1656  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
1657  dens_av(:,:,:), rhot_av(:,:,:), & ! (in)
1658  rtot(:,:,:), cvtot(:,:,:), cptot(:,:,:), & ! (in)
1659  pott(:,:,:), temp(:,:,:), pres(:,:,:), exner(:,:,:) ) ! (out)
1660 
1662  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
1663  dens_av(:,:,:), pres(:,:,:), & ! (in)
1664  real_cz(:,:,:), real_fz(:,:,:), & ! (in)
1665  phyd(:,:,:), phydh(:,:,:) ) ! (out)
1666 
1669 
1670  if ( moist ) then
1672  dens_av(:,:,:), temp(:,:,:), qtrc_av(:,:,:,:), & ! (in)
1673  qe=qe(:,:,:,:) ) ! (out)
1674  do iq = 1, n_hyd
1675  call comm_vars8(qe(:,:,:,iq), iq)
1676  end do
1677  do iq = 1, n_hyd
1678  call comm_wait (qe(:,:,:,iq), iq)
1679  end do
1680  end if
1681 
1682  ! reset diagnostic variables
1683  dv_calculated(:) = .false.
1684 
1685  return
1686  end subroutine atmos_vars_calc_diagnostics
1687 
1688  !-----------------------------------------------------------------------------
1690  recursive subroutine atmos_vars_get_diagnostic_3d( &
1691  vname, &
1692  var )
1693  use scale_const, only: &
1694  grav => const_grav, &
1695  rvap => const_rvap, &
1696  cpdry => const_cpdry, &
1697  cvdry => const_cvdry
1698  use scale_prc, only: &
1699  prc_abort
1700  use scale_prc_cartesc, only: &
1701  prc_twod
1702  use scale_atmos_grid_cartesc, only: &
1703  rcdx => atmos_grid_cartesc_rcdx, &
1704  rcdy => atmos_grid_cartesc_rcdy
1705  use scale_atmos_grid_cartesc_real, only: &
1706  real_cz => atmos_grid_cartesc_real_cz, &
1707  real_fz => atmos_grid_cartesc_real_fz, &
1709  use scale_atmos_grid_cartesc_metric, only: &
1711  use scale_comm_cartesc, only: &
1712  comm_vars8, &
1713  comm_wait
1714  use scale_atmos_hydrometeor, only: &
1715  lhvc => lhv, &
1716  lhfc => lhf, &
1717  atmos_hydrometeor_lhv, &
1718  atmos_hydrometeor_lhf, &
1719  atmos_hydrometeor_lhs
1720  use scale_atmos_saturation, only: &
1721  atmos_saturation_dens2qsat_all, &
1722  atmos_saturation_psat_all, &
1723  atmos_saturation_psat_liq, &
1724  atmos_saturation_psat_ice, &
1725  atmos_saturation_tdew_liq, &
1726  atmos_saturation_pote
1727  use scale_atmos_diagnostic, only: &
1731  implicit none
1732  character(len=*), intent(in) :: vname
1733  real(rp), intent(out) :: var(:,:,:)
1734 
1735  real(rp) :: uh (ka,ia,ja)
1736  real(rp) :: vh (ka,ia,ja)
1737 
1738  real(rp) :: work(ka,ia,ja)
1739 
1740  integer :: k, i, j, iq
1741 
1742  select case ( vname )
1743  case ( 'W' )
1744  var(:,:,:) = w(:,:,:)
1745 
1746  case ( 'U' )
1747  var(:,:,:) = u(:,:,:)
1748 
1749  case ( 'V' )
1750  var(:,:,:) = v(:,:,:)
1751 
1752  case ( 'PT' )
1753  var(:,:,:) = pott(:,:,:)
1754 
1755  case ( 'T' )
1756  var(:,:,:) = temp(:,:,:)
1757 
1758  case ( 'EXNER' )
1759  var(:,:,:) = exner(:,:,:)
1760 
1761  case ( 'PHYD' )
1762  var(:,:,:) = phyd(:,:,:)
1763 
1764  case ( 'QDRY' )
1765  var(:,:,:) = qdry(:,:,:)
1766 
1767  case ( 'RTOT' )
1768  var(:,:,:) = rtot(:,:,:)
1769 
1770  case ( 'CVTOT' )
1771  var(:,:,:) = cvtot(:,:,:)
1772 
1773  case ( 'CPTOT' )
1774  var(:,:,:) = cptot(:,:,:)
1775 
1776  case ( 'LHV' )
1777  if ( .not. dv_calculated(i_lhv) ) then
1778  call allocate_3d( lhv )
1779  call atmos_hydrometeor_lhv( &
1780  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
1781  temp(:,:,:), & ! (in)
1782  lhv(:,:,:) ) ! (out)
1783  dv_calculated(i_lhv) = .true.
1784  end if
1785  var(ks:ke,:,:) = lhv(ks:ke,:,:)
1786 
1787  case ( 'LHS' )
1788  if ( .not. dv_calculated(i_lhs) ) then
1789  call allocate_3d( lhs )
1790  call atmos_hydrometeor_lhs( &
1791  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
1792  temp(:,:,:), & ! (in)
1793  lhs(:,:,:) ) ! (out)
1794  dv_calculated(i_lhs) = .true.
1795  end if
1796  var(ks:ke,:,:) = lhs(ks:ke,:,:)
1797 
1798  case ( 'LHF' )
1799  if ( .not. dv_calculated(i_lhf) ) then
1800  call allocate_3d( lhf )
1801  call atmos_hydrometeor_lhf( &
1802  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
1803  temp(:,:,:), & ! (in)
1804  lhf(:,:,:) ) ! (out)
1805  dv_calculated(i_lhf) = .true.
1806  end if
1807  var(ks:ke,:,:) = lhf(ks:ke,:,:)
1808 
1809  case ( 'POTV' )
1810  if ( .not. dv_calculated(i_potv) ) then
1811  call allocate_3d( potv )
1813  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
1814  pott(:,:,:), rtot(:,:,:), & ! (in)
1815  potv(:,:,:) ) ! (out)
1816  dv_calculated(i_potv) = .true.
1817  end if
1818  var(ks:ke,:,:) = potv(ks:ke,:,:)
1819 
1820  case ( 'TEML' )
1821  if ( .not. dv_calculated(i_teml) ) then
1822  call allocate_3d( teml )
1823  call atmos_vars_get_diagnostic( 'LHV', work3d(:,:,:) )
1824  call atmos_vars_get_diagnostic( 'LHS', work3d(:,:,:) )
1825  call atmos_vars_get_diagnostic( 'QLIQ', work3d(:,:,:) )
1826  call atmos_vars_get_diagnostic( 'QICE', work3d(:,:,:) )
1828  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
1829  temp(:,:,:), lhv(:,:,:), lhs(:,:,:), & ! (in)
1830  qc(:,:,:), qi(:,:,:), cptot(:,:,:), & ! (in)
1831  teml(:,:,:) ) ! (out)
1832  dv_calculated(i_teml) = .true.
1833  end if
1834  var(ks:ke,:,:) = teml(ks:ke,:,:)
1835 
1836  case ( 'POTL' )
1837  if ( .not. dv_calculated(i_potl) ) then
1838  call allocate_3d( potl )
1839  call atmos_vars_get_diagnostic( 'TEML', work3d(:,:,:) )
1840 !OCL XFILL
1841  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
1842  !$omp private(i,j,k) &
1843  !$omp shared(POTL,TEML,EXNER) &
1844  !$omp shared(KS,KE,IA,JA)
1845  do j = 1, ja
1846  do i = 1, ia
1847  do k = ks, ke
1848  potl(k,i,j) = teml(k,i,j) / exner(k,i,j)
1849  enddo
1850  enddo
1851  enddo
1852  dv_calculated(i_potl) = .true.
1853  end if
1854  var(ks:ke,:,:) = potl(ks:ke,:,:)
1855 
1856  case ( 'POTE' )
1857  if ( .not. dv_calculated(i_pote) ) then
1858  call allocate_3d( pote )
1859  call atmos_saturation_pote( &
1860  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
1861  dens(:,:,:), pott(:,:,:), temp(:,:,:), qv(:,:,:), & ! [IN]
1862  pote(:,:,:) ) ! [OUT]
1863  end if
1864  var(ks:ke,:,:) = pote(ks:ke,:,:)
1865  case ( 'QTOT' )
1866  if ( .not. dv_calculated(i_qtot) ) then
1867  call allocate_3d( qtot )
1868  if ( moist ) then
1869  call atmos_vars_get_diagnostic( 'QHYD', work3d(:,:,:) )
1870 !OCL XFILL
1871  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
1872  !$omp private(i,j,k) &
1873  !$omp shared(QTOT,QV,QHYD) &
1874  !$omp shared(KS,KE,IA,JA)
1875  do j = 1, ja
1876  do i = 1, ia
1877  do k = ks, ke
1878  qtot(k,i,j) = qv(k,i,j) + qhyd(k,i,j)
1879  enddo
1880  enddo
1881  enddo
1882  else
1883 !OCL XFILL
1884  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
1885  !$omp private(i,j,k) &
1886  !$omp shared(QTOT) &
1887  !$omp shared(KS,KE,IA,JA)
1888  do j = 1, ja
1889  do i = 1, ia
1890  do k = ks, ke
1891  qtot(k,i,j) = 0.0_rp
1892  enddo
1893  enddo
1894  enddo
1895  end if
1896  dv_calculated(i_qtot) = .true.
1897  end if
1898  var(ks:ke,:,:) = qtot(ks:ke,:,:)
1899 
1900  case ( 'QHYD' )
1901  if ( .not. dv_calculated(i_qhyd) ) then
1902  call allocate_3d( qhyd )
1903  if ( moist ) then
1904  call atmos_vars_get_diagnostic( 'QLIQ', work3d(:,:,:) )
1905  call atmos_vars_get_diagnostic( 'QICE', work3d(:,:,:) )
1906 !OCL XFILL
1907  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
1908  !$omp private(i,j,k) &
1909  !$omp shared(QHYD,QLIQ,QICE) &
1910  !$omp shared(KS,KE,IA,JA)
1911  do j = 1, ja
1912  do i = 1, ia
1913  do k = ks, ke
1914  qhyd(k,i,j) = qliq(k,i,j) + qice(k,i,j)
1915  enddo
1916  enddo
1917  enddo
1918  else
1919 !OCL XFILL
1920  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
1921  !$omp private(i,j,k) &
1922  !$omp shared(QHYD) &
1923  !$omp shared(KS,KE,IA,JA)
1924  do j = 1, ja
1925  do i = 1, ia
1926  do k = ks, ke
1927  qhyd(k,i,j) = 0.0_rp
1928  enddo
1929  enddo
1930  enddo
1931  end if
1932  dv_calculated(i_qhyd) = .true.
1933  end if
1934  var(ks:ke,:,:) = qhyd(ks:ke,:,:)
1935 
1936  case ( 'QLIQ' )
1937  if ( .not. dv_calculated(i_qliq) ) then
1938  call allocate_3d( qliq )
1939 !OCL XFILL
1940  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
1941  !$omp private(i,j,k) &
1942  !$omp shared(QLIQ,QC,QR) &
1943  !$omp shared(KS,KE,IA,JA)
1944  do j = 1, ja
1945  do i = 1, ia
1946  do k = ks, ke
1947  qliq(k,i,j) = qc(k,i,j) + qr(k,i,j)
1948  enddo
1949  enddo
1950  enddo
1951  dv_calculated(i_qliq) = .true.
1952  end if
1953  var(ks:ke,:,:) = qliq(ks:ke,:,:)
1954 
1955  case ( 'QICE' )
1956  if ( .not. dv_calculated(i_qice) ) then
1957  call allocate_3d( qice )
1958 !OCL XFILL
1959  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
1960  !$omp private(i,j,k) &
1961  !$omp shared(QICE,QI,QS,QG,QH) &
1962  !$omp shared(KS,KE,IA,JA)
1963  do j = 1, ja
1964  do i = 1, ia
1965  do k = ks, ke
1966  qice(k,i,j) = qi(k,i,j) + qs(k,i,j) + qg(k,i,j) + qh(k,i,j)
1967  enddo
1968  enddo
1969  enddo
1970  dv_calculated(i_qice) = .true.
1971  end if
1972  var(ks:ke,:,:) = qice(ks:ke,:,:)
1973 
1974  case ( 'QSAT' )
1975  if ( .not. dv_calculated(i_qsat) ) then
1976  call allocate_3d( qsat )
1977  call atmos_saturation_dens2qsat_all( &
1978  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
1979  temp(:,:,:), dens_av(:,:,:), & ! (in)
1980  qsat(:,:,:) ) ! (out)
1981  dv_calculated(i_qsat) = .true.
1982  end if
1983  var(ks:ke,:,:) = qsat(ks:ke,:,:)
1984 
1985  case ( 'RHA' )
1986  if ( .not. dv_calculated(i_rha) ) then
1987  call allocate_3d( rha )
1988  if ( moist ) then
1989  call atmos_saturation_psat_all( &
1990  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
1991  temp(:,:,:), & ! (in)
1992  work(:,:,:) ) ! (out)
1993 !OCL XFILL
1994  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
1995  !$omp private(i,j,k) &
1996  !$omp shared(RHA,DENS_av,QV,WORK,TEMP) &
1997  !$omp shared(KS,KE,IA,JA)
1998  do j = 1, ja
1999  do i = 1, ia
2000  do k = ks, ke
2001  rha(k,i,j) = dens_av(k,i,j) * qv(k,i,j) &
2002  / work(k,i,j) * rvap * temp(k,i,j) &
2003  * 100.0_rp
2004  enddo
2005  enddo
2006  enddo
2007  else
2008 !OCL XFILL
2009  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
2010  !$omp private(i,j,k) &
2011  !$omp shared(RHA) &
2012  !$omp shared(KS,KE,IA,JA)
2013  do j = 1, ja
2014  do i = 1, ia
2015  do k = ks, ke
2016  rha(k,i,j) = 0.0_rp
2017  enddo
2018  enddo
2019  enddo
2020  end if
2021  dv_calculated(i_rha) = .true.
2022  end if
2023  var(ks:ke,:,:) = rha(ks:ke,:,:)
2024 
2025  case ( 'RHL', 'RH' )
2026  if ( .not. dv_calculated(i_rhl) ) then
2027  call allocate_3d( rhl )
2028  if ( moist ) then
2029  call atmos_saturation_psat_liq( &
2030  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
2031  temp(:,:,:), & ! (in)
2032  work(:,:,:) ) ! (out)
2033 !OCL XFILL
2034  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
2035  !$omp private(i,j,k) &
2036  !$omp shared(RHL,DENS_av,QV,WORK,TEMP) &
2037  !$omp shared(KS,KE,IA,JA)
2038  do j = 1, ja
2039  do i = 1, ia
2040  do k = ks, ke
2041  rhl(k,i,j) = dens_av(k,i,j) * qv(k,i,j) &
2042  / work(k,i,j) * rvap * temp(k,i,j) &
2043  * 100.0_rp
2044  enddo
2045  enddo
2046  enddo
2047  else
2048 !OCL XFILL
2049  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
2050  !$omp private(i,j,k) &
2051  !$omp shared(RHL) &
2052  !$omp shared(KS,KE,IA,JA)
2053  do j = 1, ja
2054  do i = 1, ia
2055  do k = ks, ke
2056  rhl(k,i,j) = 0.0_rp
2057  enddo
2058  enddo
2059  enddo
2060  end if
2061  dv_calculated(i_rhl) = .true.
2062  end if
2063  var(ks:ke,:,:) = rhl(ks:ke,:,:)
2064 
2065  case ( 'RHI' )
2066  if ( .not. dv_calculated(i_rhi) ) then
2067  call allocate_3d( rhi )
2068  if ( moist ) then
2069  call atmos_saturation_psat_ice( &
2070  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
2071  temp(:,:,:), & ! (int)
2072  work(:,:,:) ) ! (out)
2073 !OCL XFILL
2074  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
2075  !$omp private(i,j,k) &
2076  !$omp shared(RHI,DENS_av,QV,WORK,TEMP) &
2077  !$omp shared(KS,KE,IA,JA)
2078  do j = 1, ja
2079  do i = 1, ia
2080  do k = ks, ke
2081  rhi(k,i,j) = dens_av(k,i,j) * qv(k,i,j) &
2082  / work(k,i,j) * rvap * temp(k,i,j) &
2083  * 100.0_rp
2084  enddo
2085  enddo
2086  enddo
2087  else
2088 !OCL XFILL
2089  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
2090  !$omp private(i,j,k) &
2091  !$omp shared(RHI) &
2092  !$omp shared(KS,KE,IA,JA)
2093  do j = 1, ja
2094  do i = 1, ia
2095  do k = ks, ke
2096  rhi(k,i,j) = 0.0_rp
2097  enddo
2098  enddo
2099  enddo
2100  end if
2101  dv_calculated(i_rhi) = .true.
2102  end if
2103  var(ks:ke,:,:) = rhi(ks:ke,:,:)
2104 
2105  case ( 'VOR' )
2106  if ( .not. dv_calculated(i_vor) ) then
2107  call allocate_3d( vor )
2108  !!! to move to grid !!!
2109  ! at x, v, layer
2110  ! at u, y, layer
2111  if ( prc_twod ) then
2112  !$omp parallel do private(j,k) OMP_SCHEDULE_
2113 !OCL XFILL
2114  do j = 1, ja-1
2115  do k = ks, ke
2116  uh(k,is,j) = ( momx_av(k,is,j) + momx_av(k,is,j+1) ) &
2117  / ( dens_av(k,is,j) + dens_av(k,is,j+1) )
2118  enddo
2119  enddo
2120  !$omp parallel do private(j,k) OMP_SCHEDULE_
2121 !OCL XFILL
2122  do j = 2, ja-1
2123  do k = ks, ke
2124  vor(k,is,j) = - ( uh(k,is,j) - uh(k,is,j-1) ) * rcdy(j)
2125  enddo
2126  enddo
2127  !$omp parallel do private(k) OMP_SCHEDULE_
2128  do k = ks, ke
2129  vor(k,is,1 ) = vor(k,is,2 )
2130  vor(k,is,ja) = vor(k,is,ja-1)
2131  enddo
2132  else
2133  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2134 !OCL XFILL
2135  do j = 1, ja-1
2136  do i = 2, ia
2137  do k = ks, ke
2138  uh(k,i,j) = 0.5_rp * ( momx_av(k,i ,j) + momx_av(k,i ,j+1) &
2139  + momx_av(k,i-1,j) + momx_av(k,i-1,j+1) ) &
2140  / ( dens_av(k,i,j) + dens_av(k,i,j+1) )
2141  enddo
2142  enddo
2143  enddo
2144  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2145 !OCL XFILL
2146  do j = 2, ja
2147  do i = 1, ia-1
2148  do k = ks, ke
2149  vh(k,i,j) = 0.5_rp * ( momy_av(k,i,j ) + momy_av(k,i+1,j ) &
2150  + momy_av(k,i,j-1) + momy_av(k,i+1,j-1) ) &
2151  / ( dens_av(k,i,j) + dens_av(k,i+1,j) )
2152  enddo
2153  enddo
2154  enddo
2155  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2156 !OCL XFILL
2157  do j = 2, ja-1
2158  do i = 2, ia-1
2159  do k = ks, ke
2160  vor(k,i,j) = ( vh(k,i,j ) - vh(k,i-1,j ) ) * rcdx(i) &
2161  - ( uh(k,i ,j) - uh(k,i ,j-1) ) * rcdy(j)
2162  enddo
2163  enddo
2164  enddo
2165  !$omp parallel do private(j,k) OMP_SCHEDULE_
2166  do j = 1, ja
2167  do k = ks, ke
2168  vor(k,1 ,j) = vor(k,2 ,j)
2169  vor(k,ia,j) = vor(k,ia-1,j)
2170  enddo
2171  enddo
2172  !$omp parallel do private(i,k) OMP_SCHEDULE_
2173  do i = 1, ia
2174  do k = ks, ke
2175  vor(k,i,1 ) = vor(k,i,2 )
2176  vor(k,i,ja) = vor(k,i,ja-1)
2177  enddo
2178  enddo
2179  end if
2180  dv_calculated(i_vor) = .true.
2181  end if
2182  call comm_vars8( vor(:,:,:), 1 )
2183  call comm_wait ( vor(:,:,:), 1, .false. )
2184  var(ks:ke,:,:) = vor(ks:ke,:,:)
2185 
2186  case ( 'DIV' )
2187  if ( .not. dv_calculated(i_div) ) then
2188  call allocate_3d( div )
2189  call atmos_vars_get_diagnostic( 'HDIV', work3d(:,:,:) )
2190  !!!! to move to grid !!!!
2191  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2192 !OCL XFILL
2193  do j = 1, ja
2194  do i = 1, ia
2195  do k = ks, ke
2196  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) ) &
2197  + hdiv(k,i,j)
2198  enddo
2199  enddo
2200  enddo
2201  dv_calculated(i_div) = .true.
2202  end if
2203  var(ks:ke,:,:) = div(ks:ke,:,:)
2204 
2205  case ( 'HDIV' )
2206  if ( .not. dv_calculated(i_hdiv) ) then
2207  call allocate_3d( hdiv )
2208  !!!! to move to grid !!!!
2209  if ( prc_twod ) then
2210  !$omp parallel do private(j,k) OMP_SCHEDULE_
2211 !OCL XFILL
2212  do j = 2, ja
2213  do k = ks, ke
2214  hdiv(k,is,j) = ( momy_av(k,is,j) - momy_av(k ,is,j-1) ) * rcdy(j)
2215  enddo
2216  enddo
2217  !$omp parallel do private(k) OMP_SCHEDULE_
2218  do k = ks, ke
2219  hdiv(k,is,1) = hdiv(k,is,2)
2220  enddo
2221  else
2222  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2223 !OCL XFILL
2224  do j = 2, ja
2225  do i = 2, ia
2226  do k = ks, ke
2227  hdiv(k,i,j) = ( momx_av(k,i,j) - momx_av(k ,i-1,j ) ) * rcdx(i) &
2228  + ( momy_av(k,i,j) - momy_av(k ,i ,j-1) ) * rcdy(j)
2229  enddo
2230  enddo
2231  enddo
2232  !$omp parallel do private(i,k) OMP_SCHEDULE_
2233  do i = 1, ia
2234  do k = ks, ke
2235  hdiv(k,i,1) = hdiv(k,i,2)
2236  enddo
2237  enddo
2238  !$omp parallel do private(j,k) OMP_SCHEDULE_
2239  do j = 1, ja
2240  do k = ks, ke
2241  hdiv(k,1,j) = hdiv(k,2,j)
2242  enddo
2243  enddo
2244  end if
2245  call comm_vars8( hdiv(:,:,:), 1 )
2246  call comm_wait ( hdiv(:,:,:), 1, .false. )
2247  dv_calculated(i_hdiv) = .true.
2248  end if
2249  var(ks:ke,:,:) = hdiv(ks:ke,:,:)
2250 
2251  case ( 'Uabs' )
2252  if ( .not. dv_calculated(i_uabs) ) then
2253  call allocate_3d( uabs )
2254 !OCL XFILL
2255  !$omp parallel do private(k,i,j) OMP_SCHEDULE_ collapse(2)
2256  do j = 1, ja
2257  do i = 1, ia
2258  do k = ks, ke
2259  uabs(k,i,j) = sqrt( w(k,i,j)**2 + u(k,i,j)**2 + v(k,i,j)**2 )
2260  enddo
2261  enddo
2262  enddo
2263  dv_calculated(i_uabs) = .true.
2264  end if
2265  var(ks:ke,:,:) = uabs(ks:ke,:,:)
2266 
2267  case ( 'N2' )
2268  if ( .not. dv_calculated(i_n2) ) then
2269  call allocate_3d( n2 )
2270  call atmos_diagnostic_get_n2( &
2271  ka, ks, ke, ia, 1, ia, ja, 1, ja, &
2272  pott(:,:,:), rtot(:,:,:), & !(in)
2273  real_cz(:,:,:), real_fz(:,:,:), & !(in)
2274  f2h(:,:,:,:), & !(in)
2275  n2(:,:,:) ) ! (out)
2276  dv_calculated(i_n2) = .true.
2277  end if
2278  var(ks:ke,:,:) = n2(ks:ke,:,:)
2279 
2280  case ( 'MSE' )
2281  if ( .not. dv_calculated(i_mse) ) then
2282  call allocate_3d( mse )
2283  call atmos_vars_get_diagnostic( 'LHV', work3d(:,:,:) )
2284 !OCL XFILL
2285  !$omp parallel do private(k,i,j) OMP_SCHEDULE_ collapse(2)
2286  do j = 1, ja
2287  do i = 1, ia
2288  do k = ks, ke
2289  mse(k,i,j) = cptot(k,i,j) * temp(k,i,j) &
2290  + grav * ( real_cz(k,i,j) - real_fz(ks-1,i,j) ) &
2291  + lhv(k,i,j) * qv(k,i,j)
2292  enddo
2293  enddo
2294  enddo
2295  dv_calculated(i_mse) = .true.
2296  end if
2297  var(ks:ke,:,:) = mse(ks:ke,:,:)
2298 
2299  case ( 'TDEW' )
2300  if ( .not. dv_calculated(i_tdew) ) then
2301  call allocate_3d( tdew )
2302  call atmos_saturation_tdew_liq( ka, ks, ke, ia, 1, ia, ja, 1, ja, &
2303  dens(:,:,:), temp(:,:,:), qv(:,:,:), & ! [IN]
2304  tdew(:,:,:) ) ! [OUT]
2305  dv_calculated(i_tdew) = .true.
2306  end if
2307  var(ks:ke,:,:) = tdew(ks:ke,:,:)
2308 
2309  case ( 'ENGP' )
2310  if ( .not. dv_calculated(i_engp) ) then
2311  call allocate_3d( engp )
2312  !$omp parallel do private(k,i,j) OMP_SCHEDULE_ collapse(2)
2313  do j = 1, ja
2314  do i = 1, ia
2315  do k = ks, ke
2316  engp(k,i,j) = dens_av(k,i,j) * grav * real_cz(k,i,j)
2317  end do
2318  end do
2319  end do
2320  dv_calculated(i_engp) = .true.
2321  end if
2322  var(ks:ke,:,:) = engp(ks:ke,:,:)
2323 
2324  case ( 'ENGK' )
2325  if ( .not. dv_calculated(i_engk) ) then
2326  call allocate_3d( engk )
2327  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2328  do j = 1, ja
2329  do i = 1, ia
2330  do k = ks, ke
2331  engk(k,i,j) = 0.5_rp * dens_av(k,i,j) &
2332  * ( w(k,i,j)**2 + u(k,i,j)**2 + v(k,i,j)**2 )
2333  end do
2334  end do
2335  end do
2336  dv_calculated(i_engk) = .true.
2337  end if
2338  var(ks:ke,:,:) = engk(ks:ke,:,:)
2339 
2340  case ( 'ENGI' )
2341  if ( .not. dv_calculated(i_engi) ) then
2342  call allocate_3d( engi )
2343  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2344  do j = 1, ja
2345  do i = 1, ia
2346  do k = ks, ke
2347  engi(k,i,j) = dens_av(k,i,j) * qdry(k,i,j) * temp(k,i,j) * cvdry
2348  do iq = 1, qa
2349  engi(k,i,j) = engi(k,i,j) &
2350  + dens_av(k,i,j) * qtrc_av(k,i,j,iq) * ( temp(k,i,j) * tracer_cv(iq) + tracer_engi0(iq) )
2351  enddo
2352  end do
2353  end do
2354  end do
2355  dv_calculated(i_engi) = .true.
2356  end if
2357  var(ks:ke,:,:) = engi(ks:ke,:,:)
2358 
2359  case ( 'ENGT' )
2360  if ( .not. dv_calculated(i_engt) ) then
2361  call allocate_3d( engt )
2362  call atmos_vars_get_diagnostic( 'ENGP', work3d(:,:,:) )
2363  call atmos_vars_get_diagnostic( 'ENGK', work3d(:,:,:) )
2364  call atmos_vars_get_diagnostic( 'ENGI', work3d(:,:,:) )
2365  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2366  do j = 1, ja
2367  do i = 1, ia
2368  do k = ks, ke
2369  engt(k,i,j) = engp(k,i,j) + engk(k,i,j) + engi(k,i,j)
2370  enddo
2371  enddo
2372  enddo
2373  dv_calculated(i_engt) = .true.
2374  end if
2375  var(ks:ke,:,:) = engt(ks:ke,:,:)
2376 
2377  case ( 'DENS_PRIM' )
2378  if ( .not. dv_calculated(i_dens_prim) ) then
2379  call allocate_3d( dens_prim )
2380  call atmos_vars_get_diagnostic( 'DENS_MEAN', work1d(:) )
2381 !OCL XFILL
2382  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2383  do j = 1, ja
2384  do i = 1, ia
2385  do k = ks, ke
2386  dens_prim(k,i,j) = dens_av(k,i,j) - dens_mean(k)
2387  enddo
2388  enddo
2389  enddo
2390  dv_calculated(i_dens_prim) = .true.
2391  end if
2392  var(ks:ke,:,:) = dens_prim(ks:ke,:,:)
2393 
2394  case ( 'W_PRIM' )
2395  if ( .not. dv_calculated(i_w_prim) ) then
2396  call allocate_3d( w_prim )
2397  call atmos_vars_get_diagnostic( 'W_MEAN', work1d(:) )
2398 !OCL XFILL
2399  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2400  do j = 1, ja
2401  do i = 1, ia
2402  do k = ks, ke
2403  w_prim(k,i,j) = w(k,i,j) - w_mean(k)
2404  enddo
2405  enddo
2406  enddo
2407  dv_calculated(i_w_prim) = .true.
2408  end if
2409  var(ks:ke,:,:) = w_prim(ks:ke,:,:)
2410 
2411  case ( 'U_PRIM' )
2412  if ( .not. dv_calculated(i_u_prim) ) then
2413  call allocate_3d( u_prim )
2414  call atmos_vars_get_diagnostic( 'U_MEAN', work1d(:) )
2415 !OCL XFILL
2416  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2417  do j = 1, ja
2418  do i = 1, ia
2419  do k = ks, ke
2420  u_prim(k,i,j) = u(k,i,j) - u_mean(k)
2421  enddo
2422  enddo
2423  enddo
2424  dv_calculated(i_u_prim) = .true.
2425  end if
2426  var(ks:ke,:,:) = u_prim(ks:ke,:,:)
2427 
2428  case ( 'V_PRIM' )
2429  if ( .not. dv_calculated(i_v_prim) ) then
2430  call allocate_3d( v_prim )
2431  call atmos_vars_get_diagnostic( 'V_MEAN', work1d(:) )
2432 !OCL XFILL
2433  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2434  do j = 1, ja
2435  do i = 1, ia
2436  do k = ks, ke
2437  v_prim(k,i,j) = v(k,i,j) - v_mean(k)
2438  enddo
2439  enddo
2440  enddo
2441  dv_calculated(i_v_prim) = .true.
2442  end if
2443  var(ks:ke,:,:) = v_prim(ks:ke,:,:)
2444 
2445  case ( 'PT_PRIM' )
2446  if ( .not. dv_calculated(i_pt_prim) ) then
2447  call allocate_3d( pt_prim )
2448  call atmos_vars_get_diagnostic( 'PT_MEAN', work1d(:) )
2449 !OCL XFILL
2450  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2451  do j = 1, ja
2452  do i = 1, ia
2453  do k = ks, ke
2454  pt_prim(k,i,j) = pott(k,i,j) - pt_mean(k)
2455  enddo
2456  enddo
2457  enddo
2458  dv_calculated(i_pt_prim) = .true.
2459  end if
2460  var(ks:ke,:,:) = pt_prim(ks:ke,:,:)
2461 
2462  case ( 'W_PRIM2' )
2463  if ( .not. dv_calculated(i_w_prim2) ) then
2464  call allocate_3d( w_prim2 )
2465  call atmos_vars_get_diagnostic( 'W_PRIM', work3d(:,:,:) )
2466 !OCL XFILL
2467  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2468  do j = 1, ja
2469  do i = 1, ia
2470  do k = ks, ke
2471  w_prim2(k,i,j) = w_prim(k,i,j)**2
2472  enddo
2473  enddo
2474  enddo
2475  dv_calculated(i_w_prim2) = .true.
2476  end if
2477  var(ks:ke,:,:) = w_prim2(ks:ke,:,:)
2478 
2479  case ( 'PT_W_PRIM' )
2480  if ( .not. dv_calculated(i_pt_w_prim) ) then
2481  call allocate_3d( pt_w_prim )
2482  call atmos_vars_get_diagnostic( 'W_PRIM', work3d(:,:,:) )
2483  call atmos_vars_get_diagnostic( 'PT_PRIM', work3d(:,:,:) )
2484  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2485  do j = 1, ja
2486  do i = 1, ia
2487  do k = ks, ke
2488  pt_w_prim(k,i,j) = w_prim(k,i,j) * pt_prim(k,i,j) * dens_av(k,i,j) * cpdry
2489  enddo
2490  enddo
2491  enddo
2492  dv_calculated(i_pt_w_prim) = .true.
2493  end if
2494  var(ks:ke,:,:) = pt_w_prim(ks:ke,:,:)
2495 
2496  case ( 'W_PRIM3' )
2497  if ( .not. dv_calculated(i_w_prim3) ) then
2498  call allocate_3d( w_prim3 )
2499  call atmos_vars_get_diagnostic( 'W_PRIM', work3d(:,:,:) )
2500 !OCL XFILL
2501  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2502  do j = 1, ja
2503  do i = 1, ia
2504  do k = ks, ke
2505  w_prim3(k,i,j) = w_prim(k,i,j)**3
2506  enddo
2507  enddo
2508  enddo
2509  dv_calculated(i_w_prim3) = .true.
2510  end if
2511  var(ks:ke,:,:) = w_prim3(ks:ke,:,:)
2512 
2513  case ( 'TKE_RS' )
2514  if ( .not. dv_calculated(i_tke_rs) ) then
2515  call allocate_3d( tke_rs )
2516  call atmos_vars_get_diagnostic( 'W_PRIM', work3d(:,:,:) )
2517  call atmos_vars_get_diagnostic( 'U_PRIM', work3d(:,:,:) )
2518  call atmos_vars_get_diagnostic( 'V_PRIM', work3d(:,:,:) )
2519 !OCL XFILL
2520  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2521  do j = 1, ja
2522  do i = 1, ia
2523  do k = ks, ke
2524  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 )
2525  enddo
2526  enddo
2527  enddo
2528  dv_calculated(i_tke_rs) = .true.
2529  end if
2530  var(ks:ke,:,:) = tke_rs(ks:ke,:,:)
2531 
2532  case ( 'VELZ' )
2533  if ( .not. dv_calculated(i_velz) ) then
2534  call allocate_3d( velz )
2535 !OCL XFILL
2536  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2537  do j = 1, ja
2538  do i = 1, ia
2539  velz(ks-1,i,j) = 0.0_rp
2540  do k = ks, ke-1
2541  velz(k,i,j) = momz(k,i,j) * 2.0_rp / ( dens(k,i,j) + dens(k+1,i,j) )
2542  end do
2543  velz(ke,i,j) = 0.0_rp
2544  enddo
2545  enddo
2546  dv_calculated(i_velz) = .true.
2547  end if
2548  var(ks-1:ke,:,:) = velz(ks-1:ke,:,:)
2549 
2550  case ( 'VELX' )
2551  if ( .not. dv_calculated(i_velx) ) then
2552  call allocate_3d( velx )
2553  if ( prc_twod ) then
2554 !OCL XFILL
2555  !$omp parallel do private(j,k) OMP_SCHEDULE_
2556  do j = 1, ja
2557  do k = ks, ke
2558  velx(k,is,j) = momx(k,is,j) / dens(k,is,j)
2559  enddo
2560  enddo
2561  else
2562  !OCL XFILL
2563  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2564  do j = 1, ja
2565  do i = 1, ia-1
2566  do k = ks, ke
2567  velx(k,i,j) = momx(k,i,j) * 2.0_rp / ( dens(k,i,j) + dens(k,i+1,j) )
2568  enddo
2569  enddo
2570  enddo
2571 !OCL XFILL
2572  !$omp parallel do private(j,k) OMP_SCHEDULE_
2573  do j = 1, ja
2574  do k = ks, ke
2575  velx(k,ia,j) = momx(k,ia,j) / dens(k,ia,j)
2576  enddo
2577  enddo
2578  call comm_vars8( velx(:,:,:), 1 )
2579  call comm_wait ( velx(:,:,:), 1, .false. )
2580  end if
2581  dv_calculated(i_velx) = .true.
2582  end if
2583  var(ks:ke,:,:) = velx(ks:ke,:,:)
2584 
2585  case ( 'VELY' )
2586  if ( .not. dv_calculated(i_vely) ) then
2587  call allocate_3d( vely )
2588 !OCL XFILL
2589  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2590  do j = 1, ja-1
2591  do i = 1, ia
2592  do k = ks, ke
2593  vely(k,i,j) = momy(k,i,j) * 2.0_rp / ( dens(k,i,j) + dens(k,i,j+1) )
2594  enddo
2595  enddo
2596  enddo
2597 !OCL XFILL
2598  !$omp parallel do private(i,k) OMP_SCHEDULE_
2599  do i = 1, ia
2600  do k = ks, ke
2601  vely(k,i,ja) = momy(k,i,ja) / dens(k,i,ja)
2602  enddo
2603  enddo
2604  call comm_vars8( vely(:,:,:), 1 )
2605  call comm_wait ( vely(:,:,:), 1, .false. )
2606  dv_calculated(i_vely) = .true.
2607  end if
2608  var(ks:ke,:,:) = vely(ks:ke,:,:)
2609 
2610  case ( 'Umet' )
2611  if ( .not. dv_calculated(i_umet) ) then
2612  call allocate_3d( umet )
2613 !OCL XFILL
2614  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2615  do j = 1, ja
2616  do i = 1, ia
2617  do k = ks, ke
2618  umet(k,i,j) = u(k,i,j) * rotc(i,j,1) - v(k,i,j) * rotc(i,j,2)
2619  end do
2620  end do
2621  end do
2622  dv_calculated(i_umet) = .true.
2623  end if
2624  var(ks:ke,:,:) = umet(ks:ke,:,:)
2625 
2626  case ( 'Vmet' )
2627  if ( .not. dv_calculated(i_vmet) ) then
2628  call allocate_3d( vmet )
2629 !OCL XFILL
2630  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2631  do j = 1, ja
2632  do i = 1, ia
2633  do k = ks, ke
2634  vmet(k,i,j) = u(k,i,j) * rotc(i,j,2) + v(k,i,j) * rotc(i,j,1)
2635  end do
2636  end do
2637  end do
2638  dv_calculated(i_vmet) = .true.
2639  end if
2640  var(ks:ke,:,:) = vmet(ks:ke,:,:)
2641 
2642  case default
2643  log_error("ATMOS_vars_calc_diagnostics",*) 'name is invalid for ATMOS_vars_get_diagnostic_3D: ', trim(vname)
2644  call prc_abort
2645  end select
2646 
2647 
2648  return
2649  end subroutine atmos_vars_get_diagnostic_3d
2650 
2651  !-----------------------------------------------------------------------------
2653  recursive subroutine atmos_vars_get_diagnostic_2d( &
2654  vname, &
2655  var )
2656  use scale_prc, only: &
2657  prc_abort
2658  use scale_atmos_grid_cartesc_real, only: &
2659  real_cz => atmos_grid_cartesc_real_cz, &
2660  real_fz => atmos_grid_cartesc_real_fz
2661  use scale_atmos_adiabat, only: &
2662  atmos_adiabat_cape
2663  use mod_atmos_phy_mp_vars, only: &
2664  sflx_rain_mp => atmos_phy_mp_sflx_rain, &
2665  sflx_snow_mp => atmos_phy_mp_sflx_snow
2666  use mod_atmos_phy_cp_vars, only: &
2667  sflx_rain_cp => atmos_phy_cp_sflx_rain, &
2668  sflx_snow_cp => atmos_phy_cp_sflx_snow
2669  implicit none
2670 
2671  character(len=*), intent(in) :: vname
2672  real(rp), intent(out) :: var(:,:)
2673 
2674  real(rp) :: fact
2675  integer :: k, i, j
2676  !---------------------------------------------------------------------------
2677 
2678  select case ( vname )
2679  case ( 'LWP' )
2680  if ( .not. dv_calculated(i_lwp) ) then
2681  call allocate_2d( lwp )
2682  call atmos_vars_get_diagnostic( 'QLIQ', work3d(:,:,:) )
2683  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
2684  !$omp private(i,j,k) &
2685  !$omp shared(LWP,QLIQ,DENS_av,REAL_FZ) &
2686  !$omp shared(KS,KE,IA,JA)
2687  do j = 1, ja
2688  do i = 1, ia
2689  lwp(i,j) = 0.0_rp
2690  do k = ks, ke
2691  lwp(i,j) = lwp(i,j) &
2692  + qliq(k,i,j) * dens_av(k,i,j) * ( real_fz(k,i,j)-real_fz(k-1,i,j) ) * 1.e3_rp ! [kg/m2->g/m2]
2693  enddo
2694  enddo
2695  enddo
2696  dv_calculated(i_lwp) = .true.
2697  end if
2698  var(:,:) = lwp(:,:)
2699 
2700  case ( 'IWP' )
2701  if ( .not. dv_calculated(i_iwp) ) then
2702  call allocate_2d( iwp )
2703  call atmos_vars_get_diagnostic( 'QICE', work3d(:,:,:) )
2704  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
2705  !$omp private(i,j,k) &
2706  !$omp shared(IWP,QICE,DENS_av,REAL_FZ) &
2707  !$omp shared(KS,KE,IA,JA)
2708  do j = 1, ja
2709  do i = 1, ia
2710  iwp(i,j) = 0.0_rp
2711  do k = ks, ke
2712  iwp(i,j) = iwp(i,j) &
2713  + qice(k,i,j) * dens_av(k,i,j) * ( real_fz(k,i,j)-real_fz(k-1,i,j) ) * 1.e3_rp ! [kg/m2->g/m2]
2714  enddo
2715  enddo
2716  enddo
2717  dv_calculated(i_iwp) = .true.
2718  end if
2719  var(:,:) = iwp(:,:)
2720 
2721  case ( 'PW' )
2722  if ( .not. dv_calculated(i_pw) ) then
2723  call allocate_2d( pw )
2724  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
2725  !$omp private(i,j,k) &
2726  !$omp shared(PW,QV,DENS_av,REAL_FZ) &
2727  !$omp shared(KS,KE,IA,JA)
2728  do j = 1, ja
2729  do i = 1, ia
2730  pw(i,j) = 0.0_rp
2731  do k = ks, ke
2732  pw(i,j) = pw(i,j) &
2733  + qv(k,i,j) * dens_av(k,i,j) * ( real_fz(k,i,j)-real_fz(k-1,i,j) ) * 1.e3_rp ! [kg/m2->g/m2]
2734  enddo
2735  enddo
2736  enddo
2737  dv_calculated(i_pw) = .true.
2738  end if
2739  var(:,:) = pw(:,:)
2740 
2741  case ( 'PBLH' )
2742  if ( .not. dv_calculated(i_pblh) ) then
2743  call allocate_2d( pblh )
2744  call atmos_vars_get_diagnostic( 'POTV', work3d(:,:,:) )
2745  !$omp parallel do default(none) OMP_SCHEDULE_ collapse(2) &
2746  !$omp private(k,i,j) &
2747  !$omp private(fact) &
2748  !$omp shared(PBLH,POTV,REAL_CZ,REAL_FZ) &
2749  !$omp shared(KS,KE,IA,JA)
2750  do j = 1, ja
2751  do i = 1, ia
2752  pblh(i,j) = real_cz(ks,i,j) - real_fz(ks-1,i,j)
2753  do k = ks+1, ke
2754  if ( potv(k,i,j) > potv(ks,i,j) ) then
2755  fact = ( potv(ks,i,j) - potv(k-1,i,j) ) &
2756  / ( potv(k,i,j) - potv(k-1,i,j) )
2757  pblh(i,j) = real_cz(k-1,i,j) - real_fz(ks-1,i,j) &
2758  + fact * ( real_cz(k,i,j) - real_cz(k-1,i,j) )
2759 
2760  exit
2761  endif
2762  enddo
2763  enddo
2764  enddo
2765  dv_calculated(i_pblh) = .true.
2766  end if
2767  var(:,:) = pblh(:,:)
2768 
2769  case ( 'CAPE', 'CIN', 'LCL', 'LFC', 'LNB' )
2770  if ( .not. dv_calculated(i_cape) ) then
2771  call allocate_2d( cape )
2772  call allocate_2d( cin )
2773  call allocate_2d( lcl )
2774  call allocate_2d( lfc )
2775  call allocate_2d( lnb )
2776  call atmos_adiabat_cape( &
2777  ka, ks, ke, ia, is, ie, ja, js, je, &
2778  ks, & ! (in)
2779  dens_av(:,:,:), temp(:,:,:), pres(:,:,:), & ! (in)
2780  qv(:,:,:), qc(:,:,:), qdry(:,:,:), & ! (in)
2781  rtot(:,:,:), cptot(:,:,:), & ! (in)
2782  real_cz(:,:,:), real_fz(:,:,:), & ! (in)
2783  cape(:,:), cin(:,:), lcl(:,:), lfc(:,:), lnb(:,:) ) ! (out)
2784  dv_calculated(i_cape) = .true.
2785  end if
2786  select case ( vname )
2787  case ( 'CAPE' )
2788  !$omp parallel do private(i,j) OMP_SCHEDULE_
2789  do j = js, je
2790  do i = is, ie
2791  var(i,j) = cape(i,j)
2792  end do
2793  end do
2794  case ( 'CIN' )
2795  !$omp parallel do private(i,j) OMP_SCHEDULE_
2796  do j = js, je
2797  do i = is, ie
2798  var(i,j) = cin(i,j)
2799  end do
2800  end do
2801  case ( 'LCL' )
2802  !$omp parallel do private(i,j) OMP_SCHEDULE_
2803  do j = js, je
2804  do i = is, ie
2805  var(i,j) = lcl(i,j)
2806  end do
2807  end do
2808  case ( 'LFC' )
2809  !$omp parallel do private(i,j) OMP_SCHEDULE_
2810  do j = js, je
2811  do i = is, ie
2812  var(i,j) = lfc(i,j)
2813  end do
2814  end do
2815  case ( 'LNB' )
2816  !$omp parallel do private(i,j) OMP_SCHEDULE_
2817  do j = js, je
2818  do i = is, ie
2819  var(i,j) = lnb(i,j)
2820  end do
2821  end do
2822  end select
2823 
2824  case ( 'PREC' )
2825  !$omp parallel do private(i,j) OMP_SCHEDULE_
2826  do j = js, je
2827  do i = is, ie
2828  var(i,j) = prec(i,j)
2829  end do
2830  end do
2831 
2832  case ( 'RAIN', 'SNOW' )
2833  if ( .not. dv_calculated(i_rain) ) then
2834  call allocate_2d( rain )
2835  call allocate_2d( snow )
2836  !$omp parallel do private(i,j) OMP_SCHEDULE_
2837  do j = js, je
2838  do i = is, ie
2839  rain(i,j) = sflx_rain_mp(i,j) + sflx_rain_cp(i,j)
2840  snow(i,j) = sflx_snow_mp(i,j) + sflx_snow_cp(i,j)
2841  enddo
2842  enddo
2843  dv_calculated(i_rain) = .true.
2844  end if
2845  select case (vname)
2846  case ( 'RAIN' )
2847  !$omp parallel do private(i,j) OMP_SCHEDULE_
2848  do j = js, je
2849  do i = is, ie
2850  var(i,j) = rain(i,j)
2851  end do
2852  end do
2853  case ( 'SNOW' )
2854  !$omp parallel do private(i,j) OMP_SCHEDULE_
2855  do j = js, je
2856  do i = is, ie
2857  var(i,j) = snow(i,j)
2858  end do
2859  end do
2860  end select
2861 
2862  case default
2863  log_error("ATMOS_vars_calc_diagnostics",*) 'name is invalid for ATMOS_vars_get_diagnostic_2D: ', trim(vname)
2864  call prc_abort
2865  end select
2866 
2867 
2868  return
2869  end subroutine atmos_vars_get_diagnostic_2d
2870 
2871  !-----------------------------------------------------------------------------
2873  recursive subroutine atmos_vars_get_diagnostic_1d( &
2874  vname, &
2875  var )
2876  use scale_const, only: &
2877  cpdry => const_cpdry
2878  use scale_prc, only: &
2879  prc_abort
2880  use scale_statistics, only: &
2881  statistics_horizontal_mean
2882  use scale_atmos_grid_cartesc_real, only: &
2884  implicit none
2885 
2886  character(len=*), intent(in) :: vname
2887  real(rp), intent(out) :: var(:)
2888 
2889  real(rp) :: work(ka,ia,ja)
2890  integer :: k, i, j
2891  !---------------------------------------------------------------------------
2892 
2893  select case ( vname )
2894  case ( 'DENS_MEAN' )
2895  if ( .not. dv_calculated(i_dens_mean) ) then
2896  call allocate_1d( dens_mean )
2897  call statistics_horizontal_mean( ka, ks, ke, ia, is, ie, ja, js, je, &
2898  dens(:,:,:), area(:,:), dens_mean(:) )
2899  dv_calculated(i_dens_mean) = .true.
2900  end if
2901  var(:) = dens_mean(:)
2902 
2903  case ( 'W_MEAN' )
2904  if ( .not. dv_calculated(i_w_mean) ) then
2905  call allocate_1d( w_mean )
2906  call atmos_vars_get_diagnostic( 'DENS_MEAN', work1d(:) )
2907 !OCL XFILL
2908  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2909  do j = jsb, jeb
2910  do i = isb, ieb
2911  do k = ks, ke
2912  work(k,i,j) = w(k,i,j) * dens_av(k,i,j)
2913  enddo
2914  enddo
2915  enddo
2916  call statistics_horizontal_mean( ka, ks, ke, ia, is, ie, ja, js, je, &
2917  work(:,:,:), area(:,:), w_mean(:) )
2918  do k = ks, ke
2919  w_mean(k) = w_mean(k) / dens_mean(k)
2920  enddo
2921  dv_calculated(i_w_mean) = .true.
2922  end if
2923  var(:) = w_mean(:)
2924 
2925  case ( 'U_MEAN' )
2926  if ( .not. dv_calculated(i_u_mean) ) then
2927  call allocate_1d( u_mean )
2928  call atmos_vars_get_diagnostic( 'DENS_MEAN', work1d(:) )
2929 !OCL XFILL
2930  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2931  do j = jsb, jeb
2932  do i = isb, ieb
2933  do k = ks, ke
2934  work(k,i,j) = u(k,i,j) * dens_av(k,i,j)
2935  enddo
2936  enddo
2937  enddo
2938  call statistics_horizontal_mean( ka, ks, ke, ia, is, ie, ja, js, je, &
2939  work(:,:,:), area(:,:), u_mean(:) )
2940  do k = ks, ke
2941  u_mean(k) = u_mean(k) / dens_mean(k)
2942  enddo
2943  dv_calculated(i_u_mean) = .true.
2944  end if
2945  var(:) = u_mean(:)
2946 
2947  case ( 'V_MEAN' )
2948  if ( .not. dv_calculated(i_v_mean) ) then
2949  call allocate_1d( v_mean )
2950  call atmos_vars_get_diagnostic( 'DENS_MEAN', work1d(:) )
2951 !OCL XFILL
2952  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2953  do j = jsb, jeb
2954  do i = isb, ieb
2955  do k = ks, ke
2956  work(k,i,j) = v(k,i,j) * dens_av(k,i,j)
2957  enddo
2958  enddo
2959  enddo
2960  call statistics_horizontal_mean( ka, ks, ke, ia, is, ie, ja, js, je, &
2961  work(:,:,:), area(:,:), v_mean(:) )
2962  do k = ks, ke
2963  v_mean(k) = v_mean(k) / dens_mean(k)
2964  enddo
2965  dv_calculated(i_v_mean) = .true.
2966  end if
2967  var(:) = v_mean(:)
2968 
2969  case ( 'PT_MEAN' )
2970  if ( .not. dv_calculated(i_pt_mean) ) then
2971  call allocate_1d( pt_mean )
2972  call atmos_vars_get_diagnostic( 'DENS_MEAN', work1d(:) )
2973  call statistics_horizontal_mean( ka, ks, ke, ia, is, ie, ja, js, je, &
2974  rhot(:,:,:), area(:,:), pt_mean(:) )
2975  do k = ks, ke
2976  pt_mean(k) = pt_mean(k) / dens_mean(k)
2977  enddo
2978  dv_calculated(i_pt_mean) = .true.
2979  end if
2980  var(:) = pt_mean(:)
2981 
2982  case ( 'T_MEAN' )
2983  if ( .not. dv_calculated(i_t_mean) ) then
2984  call allocate_1d( t_mean )
2985  call atmos_vars_get_diagnostic( 'DENS_MEAN', work1d(:) )
2986 !OCL XFILL
2987  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
2988  do j = jsb, jeb
2989  do i = isb, ieb
2990  do k = ks, ke
2991  work(k,i,j) = temp(k,i,j) * dens_av(k,i,j)
2992  enddo
2993  enddo
2994  enddo
2995  call statistics_horizontal_mean( ka, ks, ke, ia, is, ie, ja, js, je, &
2996  work(:,:,:), area(:,:), t_mean(:) )
2997  do k = ks, ke
2998  t_mean(k) = t_mean(k) / dens_mean(k)
2999  enddo
3000  dv_calculated(i_t_mean) = .true.
3001  end if
3002  var(:) = t_mean(:)
3003 
3004  case ( 'QV_MEAN' )
3005  if ( .not. dv_calculated(i_qv_mean) ) then
3006  call allocate_1d( qv_mean )
3007  if ( moist ) then
3008  call atmos_vars_get_diagnostic( 'DENS_MEAN', work1d(:) )
3009 !OCL XFILL
3010  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
3011  do j = jsb, jeb
3012  do i = isb, ieb
3013  do k = ks, ke
3014  work(k,i,j) = qv(k,i,j) * dens_av(k,i,j)
3015  enddo
3016  enddo
3017  enddo
3018  call statistics_horizontal_mean( ka, ks, ke, ia, is, ie, ja, js, je, &
3019  work(:,:,:), area(:,:), qv_mean(:) )
3020  do k = ks, ke
3021  qv_mean(k) = qv_mean(k) / dens_mean(k)
3022  enddo
3023  else
3024  !$omp parallel do private(k) OMP_SCHEDULE_
3025  do k = ks, ke
3026  qv_mean(k) = 0.0_rp
3027  enddo
3028  end if
3029  dv_calculated(i_qv_mean) = .true.
3030  end if
3031  var(:) = qv_mean(:)
3032 
3033  case ( 'QHYD_MEAN' )
3034  if ( .not. dv_calculated(i_qhyd_mean) ) then
3035  call allocate_1d( qhyd_mean )
3036  call atmos_vars_get_diagnostic( 'DENS_MEAN', work1d(:) )
3037  call atmos_vars_get_diagnostic( 'QHYD', work3d(:,:,:) )
3038 !OCL XFILL
3039  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
3040  do j = jsb, jeb
3041  do i = isb, ieb
3042  do k = ks, ke
3043  work(k,i,j) = qhyd(k,i,j) * dens_av(k,i,j)
3044  enddo
3045  enddo
3046  enddo
3047  call statistics_horizontal_mean( ka, ks, ke, ia, is, ie, ja, js, je, &
3048  work(:,:,:), area(:,:), qhyd_mean(:) )
3049  do k = ks, ke
3050  qhyd_mean(k) = qhyd_mean(k) / dens_mean(k)
3051  enddo
3052  dv_calculated(i_qhyd_mean) = .true.
3053  end if
3054  var(:) = qhyd_mean(:)
3055 
3056  case ( 'QLIQ_MEAN' )
3057  if ( .not. dv_calculated(i_qliq_mean) ) then
3058  call allocate_1d( qliq_mean )
3059  call atmos_vars_get_diagnostic( 'DENS_MEAN', work1d(:) )
3060  call atmos_vars_get_diagnostic( 'QLIQ', work3d(:,:,:) )
3061 !OCL XFILL
3062  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
3063  do j = jsb, jeb
3064  do i = isb, ieb
3065  do k = ks, ke
3066  work(k,i,j) = qliq(k,i,j) * dens_av(k,i,j)
3067  enddo
3068  enddo
3069  enddo
3070  call statistics_horizontal_mean( ka, ks, ke, ia, is, ie, ja, js, je, &
3071  work(:,:,:), area(:,:), qliq_mean(:) )
3072  do k = ks, ke
3073  qliq_mean(k) = qliq_mean(k) / dens_mean(k)
3074  enddo
3075  dv_calculated(i_qliq_mean) = .true.
3076  end if
3077  var(:) = qliq_mean(:)
3078 
3079  case ( 'QICE_MEAN' )
3080  if ( .not. dv_calculated(i_qice_mean) ) then
3081  call allocate_1d( qice_mean )
3082  call atmos_vars_get_diagnostic( 'DENS_MEAN', work1d(:) )
3083  call atmos_vars_get_diagnostic( 'QICE', work3d(:,:,:) )
3084 !OCL XFILL
3085  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
3086  do j = jsb, jeb
3087  do i = isb, ieb
3088  do k = ks, ke
3089  work(k,i,j) = qice(k,i,j) * dens_av(k,i,j)
3090  enddo
3091  enddo
3092  enddo
3093  call statistics_horizontal_mean( ka, ks, ke, ia, is, ie, ja, js, je, &
3094  work(:,:,:), area(:,:), qice_mean(:) )
3095  do k = ks, ke
3096  qice_mean(k) = qice_mean(k) / dens_mean(k)
3097  enddo
3098  dv_calculated(i_qice_mean) = .true.
3099  end if
3100  var(:) = qice_mean(:)
3101 
3102  case default
3103  log_error("ATMOS_vars_calc_diagnostics",*) 'name is invalid for ATMOS_vars_get_diagnostic_1D: ', trim(vname)
3104  call prc_abort
3105  end select
3106 
3107 
3108  return
3109  end subroutine atmos_vars_get_diagnostic_1d
3110 
3111  !-----------------------------------------------------------------------------
3113  subroutine atmos_vars_monitor
3114  use scale_monitor, only: &
3115  monitor_put
3116  use scale_atmos_hydrometeor, only: &
3117  i_qv
3118  use mod_atmos_phy_rd_vars, only: &
3119  sflx_lw_up => atmos_phy_rd_sflx_lw_up, &
3120  sflx_lw_dn => atmos_phy_rd_sflx_lw_dn, &
3121  sflx_sw_up => atmos_phy_rd_sflx_sw_up, &
3122  sflx_sw_dn => atmos_phy_rd_sflx_sw_dn, &
3123  tomflx_lw_up => atmos_phy_rd_tomflx_lw_up, &
3124  tomflx_lw_dn => atmos_phy_rd_tomflx_lw_dn, &
3125  tomflx_sw_up => atmos_phy_rd_tomflx_sw_up, &
3126  tomflx_sw_dn => atmos_phy_rd_tomflx_sw_dn
3127  use mod_atmos_phy_sf_vars, only: &
3128  sflx_sh => atmos_phy_sf_sflx_sh, &
3129  sflx_lh => atmos_phy_sf_sflx_lh, &
3130  sflx_engi => atmos_phy_sf_sflx_engi, &
3131  sflx_qtrc => atmos_phy_sf_sflx_qtrc
3132  implicit none
3133 
3134  real(rp) :: rhoq(ka,ia,ja)
3135 
3136  real(rp) :: engflxt (ia,ja) ! total flux [J/m2/s]
3137  real(rp) :: sflx_rd_net(ia,ja) ! net SFC radiation flux [J/m2/s]
3138  real(rp) :: tflx_rd_net(ia,ja) ! net TOM radiation flux [J/m2/s]
3139 
3140  integer :: k, i, j, iq
3141  !---------------------------------------------------------------------------
3142 
3143  call monitor_put( pv_monit_id(i_dens), dens(:,:,:) )
3144  call monitor_put( pv_monit_id(i_momz), momz(:,:,:) )
3145  call monitor_put( pv_monit_id(i_momx), momx(:,:,:) )
3146  call monitor_put( pv_monit_id(i_momy), momy(:,:,:) )
3147  call monitor_put( pv_monit_id(i_rhot), rhot(:,:,:) )
3148 
3149  !##### Mass Budget #####
3150 
3151  do iq = 1, qa
3152  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
3153 !OCL XFILL
3154  do j = js, je
3155  do i = is, ie
3156  do k = ks, ke
3157  rhoq(k,i,j) = dens_av(k,i,j) * qtrc_av(k,i,j,iq)
3158  enddo
3159  enddo
3160  enddo
3161 
3162  call monitor_put( qp_monit_id(iq), rhoq(:,:,:) )
3163  enddo
3164 
3165  ! total dry airmass
3166  if ( dv_monit_id(im_qdry) > 0 ) then
3167  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
3168 !OCL XFILL
3169  do j = js, je
3170  do i = is, ie
3171  do k = ks, ke
3172  rhoq(k,i,j) = dens(k,i,j) * qdry(k,i,j)
3173  enddo
3174  enddo
3175  enddo
3176  call monitor_put( dv_monit_id(im_qdry), rhoq(:,:,:) )
3177  end if
3178 
3179  ! total vapor,liquid,solid tracers
3180  if ( dv_monit_id(im_qtot) > 0 ) then
3181  call atmos_vars_get_diagnostic( 'QTOT', work3d(:,:,:) )
3182  !$omp parallel do private(i,j,k) OMP_SCHEDULE_ collapse(2)
3183 !OCL XFILL
3184  do j = js, je
3185  do i = is, ie
3186  do k = ks, ke
3187  rhoq(k,i,j) = dens(k,i,j) * qtot(k,i,j)
3188  enddo
3189  enddo
3190  enddo
3191  call monitor_put( dv_monit_id(im_qtot), rhoq(:,:,:) )
3192  end if
3193 
3194  ! total evapolation
3195  if ( moist ) call monitor_put( dv_monit_id(im_evap), sflx_qtrc(:,:,i_qv) )
3196 
3197  ! total precipitation
3198  if ( dv_monit_id(im_prec) > 0 ) then
3199  call monitor_put( dv_monit_id(im_prec), prec(:,:) )
3200  end if
3201 
3202 
3203  !##### Energy Budget #####
3204 
3205  if ( dv_monit_id(im_engt) > 0 ) then
3206  call atmos_vars_get_diagnostic( 'ENGT', work3d(:,:,:) )
3207  call monitor_put( dv_monit_id(im_engt), work3d(:,:,:) )
3208  end if
3209  if ( dv_monit_id(im_engp) > 0 ) then
3210  call atmos_vars_get_diagnostic( 'ENGP', work3d(:,:,:) )
3211  call monitor_put( dv_monit_id(im_engp), work3d(:,:,:) )
3212  end if
3213  if ( dv_monit_id(im_engk) > 0 ) then
3214  call atmos_vars_get_diagnostic( 'ENGK', work3d(:,:,:) )
3215  call monitor_put( dv_monit_id(im_engk), work3d(:,:,:) )
3216  end if
3217  if ( dv_monit_id(im_engi) > 0 ) then
3218  call atmos_vars_get_diagnostic( 'ENGI', work3d(:,:,:) )
3219  call monitor_put( dv_monit_id(im_engi), work3d(:,:,:) )
3220  end if
3221 
3222  ! radiation flux
3223 !OCL XFILL
3224  !$omp parallel do private(i,j) OMP_SCHEDULE_ collapse(2)
3225  do j = js, je
3226  do i = is, ie
3227  sflx_rd_net(i,j) = ( sflx_lw_up(i,j) - sflx_lw_dn(i,j) ) &
3228  + ( sflx_sw_up(i,j) - sflx_sw_dn(i,j) )
3229 
3230  tflx_rd_net(i,j) = ( tomflx_lw_up(i,j) - tomflx_lw_dn(i,j) ) &
3231  + ( tomflx_sw_up(i,j) - tomflx_sw_dn(i,j) )
3232 
3233  engflxt(i,j) = sflx_sh(i,j) &
3234  + sflx_engi(i,j) - prec_engi(i,j) &
3235  + sflx_rd_net(i,j) - tflx_rd_net(i,j)
3236  enddo
3237  enddo
3238 
3239  call monitor_put( dv_monit_id(im_engflxt), engflxt(:,:) )
3240 
3241  call monitor_put( dv_monit_id(im_engsfc_sh), sflx_sh(:,:) )
3242  call monitor_put( dv_monit_id(im_engsfc_lh), sflx_lh(:,:) )
3243  call monitor_put( dv_monit_id(im_engsfc_evap), sflx_engi(:,:) )
3244  call monitor_put( dv_monit_id(im_engsfc_prec), prec_engi(:,:) )
3245  call monitor_put( dv_monit_id(im_engsfc_rd), sflx_rd_net(:,:) )
3246  call monitor_put( dv_monit_id(im_engtom_rd), tflx_rd_net(:,:) )
3247 
3248  call monitor_put( dv_monit_id(im_engsfc_lw_up), sflx_lw_up(:,:) )
3249  call monitor_put( dv_monit_id(im_engsfc_lw_dn), sflx_lw_dn(:,:) )
3250  call monitor_put( dv_monit_id(im_engsfc_sw_up), sflx_sw_up(:,:) )
3251  call monitor_put( dv_monit_id(im_engsfc_sw_dn), sflx_sw_dn(:,:) )
3252 
3253  call monitor_put( dv_monit_id(im_engtom_lw_up), tomflx_lw_up(:,:) )
3254  call monitor_put( dv_monit_id(im_engtom_lw_dn), tomflx_lw_dn(:,:) )
3255  call monitor_put( dv_monit_id(im_engtom_sw_up), tomflx_sw_up(:,:) )
3256  call monitor_put( dv_monit_id(im_engtom_sw_dn), tomflx_sw_dn(:,:) )
3257 
3258  return
3259  end subroutine atmos_vars_monitor
3260 
3261  !-----------------------------------------------------------------------------
3263  subroutine atmos_vars_restart_create
3264  use scale_time, only: &
3266  use scale_file_cartesc, only: &
3268  use mod_atmos_admin, only: &
3269  atmos_sw_dyn, &
3270  atmos_sw_phy_mp, &
3271  atmos_sw_phy_ae, &
3272  atmos_sw_phy_ch, &
3273  atmos_sw_phy_rd, &
3274  atmos_sw_phy_sf, &
3275  atmos_sw_phy_tb, &
3276  atmos_sw_phy_bl, &
3277  atmos_sw_phy_cp, &
3279  use mod_cpl_admin, only: &
3280  cpl_sw
3281  use mod_atmos_dyn_vars, only: &
3283  use mod_atmos_phy_mp_vars, only: &
3285  use mod_atmos_phy_ae_vars, only: &
3287  use mod_atmos_phy_ch_vars, only: &
3289  use mod_atmos_phy_rd_vars, only: &
3291  use mod_atmos_phy_sf_vars, only: &
3293  use mod_atmos_phy_tb_vars, only: &
3295  use mod_atmos_phy_bl_vars, only: &
3297  use mod_atmos_phy_cp_vars, only: &
3299  use mod_atmos_phy_lt_vars, only: &
3301 #ifdef SDM
3302  use scale_atmos_phy_mp_sdm, only: &
3303  sd_rest_flg_out, &
3304  atmos_phy_mp_sdm_restart_create
3305  use scale_time, only: &
3306  nowdaysec => time_nowdaysec
3307 #endif
3308  implicit none
3309 
3310  character(len=19) :: timelabel
3311  character(len=H_LONG) :: basename
3312  !---------------------------------------------------------------------------
3313 
3314 #ifdef SDM
3315  if( sd_rest_flg_out ) then
3316  log_info("ATMOS_vars_restart_create",*) 'Output random number for SDM '
3317  call atmos_phy_mp_sdm_restart_create(nowdaysec)
3318  endif
3319 #endif
3320 
3321  if ( atmos_restart_out_basename /= '' ) then
3322 
3323  log_newline
3324  log_info("ATMOS_vars_restart_create",*) 'Create restart file (ATMOS) '
3325 
3327  call time_gettimelabel( timelabel )
3328  basename = trim(atmos_restart_out_basename)//'_'//trim(timelabel)
3329  else
3330  basename = trim(atmos_restart_out_basename)
3331  endif
3332 
3333  log_info("ATMOS_vars_restart_create",*) 'basename: ', trim(basename)
3334 
3335  call file_cartesc_create( &
3337  restart_fid, & ! [OUT]
3338  aggregate=atmos_restart_out_aggregate ) ! [IN]
3339 
3340  allocate( pv_id(pv_nmax+qa) )
3341  endif
3342 
3353 
3354  return
3355  end subroutine atmos_vars_restart_create
3356 
3357  !-----------------------------------------------------------------------------
3359  subroutine atmos_vars_restart_enddef
3360  use scale_file_cartesc, only: &
3362  use mod_atmos_admin, only: &
3363  atmos_sw_dyn, &
3364  atmos_sw_phy_mp, &
3365  atmos_sw_phy_ae, &
3366  atmos_sw_phy_ch, &
3367  atmos_sw_phy_rd, &
3368  atmos_sw_phy_sf, &
3369  atmos_sw_phy_tb, &
3370  atmos_sw_phy_bl, &
3371  atmos_sw_phy_cp, &
3373  use mod_cpl_admin, only: &
3374  cpl_sw
3375  use mod_atmos_dyn_vars, only: &
3377  use mod_atmos_phy_mp_vars, only: &
3379  use mod_atmos_phy_ae_vars, only: &
3381  use mod_atmos_phy_ch_vars, only: &
3383  use mod_atmos_phy_rd_vars, only: &
3385  use mod_atmos_phy_sf_vars, only: &
3387  use mod_atmos_phy_tb_vars, only: &
3389  use mod_atmos_phy_bl_vars, only: &
3391  use mod_atmos_phy_cp_vars, only: &
3393  use mod_atmos_phy_lt_vars, only: &
3395 #ifdef SDM
3396  use scale_atmos_phy_mp_sdm, only: &
3397  sd_rest_flg_out, &
3398  atmos_phy_mp_sdm_restart_enddef
3399 #endif
3400  implicit none
3401 
3402  !---------------------------------------------------------------------------
3403 
3404 #ifdef SDM
3405  if( sd_rest_flg_out ) then
3406  call atmos_phy_mp_sdm_restart_enddef
3407  endif
3408 #endif
3409 
3410  if ( restart_fid /= -1 ) then
3411  call file_cartesc_enddef( restart_fid ) ! [IN]
3412  endif
3413 
3424 
3425  return
3426  end subroutine atmos_vars_restart_enddef
3427 
3428  !-----------------------------------------------------------------------------
3430  subroutine atmos_vars_restart_close
3431  use scale_file_cartesc, only: &
3433  use mod_atmos_admin, only: &
3434  atmos_sw_dyn, &
3435  atmos_sw_phy_mp, &
3436  atmos_sw_phy_ae, &
3437  atmos_sw_phy_ch, &
3438  atmos_sw_phy_rd, &
3439  atmos_sw_phy_sf, &
3440  atmos_sw_phy_tb, &
3441  atmos_sw_phy_bl, &
3442  atmos_sw_phy_cp, &
3444  use mod_cpl_admin, only: &
3445  cpl_sw
3446  use mod_atmos_dyn_vars, only: &
3448  use mod_atmos_phy_mp_vars, only: &
3450  use mod_atmos_phy_ae_vars, only: &
3452  use mod_atmos_phy_ch_vars, only: &
3454  use mod_atmos_phy_rd_vars, only: &
3456  use mod_atmos_phy_sf_vars, only: &
3458  use mod_atmos_phy_tb_vars, only: &
3460  use mod_atmos_phy_bl_vars, only: &
3462  use mod_atmos_phy_cp_vars, only: &
3464  use mod_atmos_phy_lt_vars, only: &
3466 #ifdef SDM
3467  use scale_atmos_phy_mp_sdm, only: &
3468  sd_rest_flg_out, &
3469  atmos_phy_mp_sdm_restart_close
3470 #endif
3471  implicit none
3472  !---------------------------------------------------------------------------
3473 
3474 #ifdef SDM
3475  if( sd_rest_flg_out ) then
3476  call atmos_phy_mp_sdm_restart_close
3477  endif
3478 #endif
3479 
3480  if ( restart_fid /= -1 ) then
3481  log_newline
3482  log_info("ATMOS_vars_restart_close",*) 'Close restart file (ATMOS) '
3483 
3484  call file_cartesc_close( restart_fid ) ! [IN]
3485 
3486  restart_fid = -1
3487 
3488  if ( allocated(pv_id) ) deallocate( pv_id )
3489  endif
3490 
3496  if( atmos_sw_phy_sf .and. (.not. cpl_sw) ) call atmos_phy_sf_vars_restart_close
3501 
3502  return
3503  end subroutine atmos_vars_restart_close
3504 
3505  !-----------------------------------------------------------------------------
3507  subroutine atmos_vars_restart_def_var
3508  use scale_file_cartesc, only: &
3510  use mod_atmos_admin, only: &
3511  atmos_sw_dyn, &
3512  atmos_sw_phy_mp, &
3513  atmos_sw_phy_ae, &
3514  atmos_sw_phy_ch, &
3515  atmos_sw_phy_rd, &
3516  atmos_sw_phy_sf, &
3517  atmos_sw_phy_tb, &
3518  atmos_sw_phy_bl, &
3519  atmos_sw_phy_cp, &
3521  use mod_cpl_admin, only: &
3522  cpl_sw
3523  use mod_atmos_dyn_vars, only: &
3525  use mod_atmos_phy_mp_vars, only: &
3527  use mod_atmos_phy_ae_vars, only: &
3529  use mod_atmos_phy_ch_vars, only: &
3531  use mod_atmos_phy_rd_vars, only: &
3533  use mod_atmos_phy_sf_vars, only: &
3535  use mod_atmos_phy_tb_vars, only: &
3537  use mod_atmos_phy_bl_vars, only: &
3539  use mod_atmos_phy_cp_vars, only: &
3541  use mod_atmos_phy_lt_vars, only: &
3543 #ifdef SDM
3544  use scale_atmos_phy_mp_sdm, only: &
3545  sd_rest_flg_out, &
3546  atmos_phy_mp_sdm_restart_def_var
3547 #endif
3548  implicit none
3549 
3550  integer iq
3551  !---------------------------------------------------------------------------
3552 
3553 #ifdef SDM
3554  if( sd_rest_flg_out ) then
3555  call atmos_phy_mp_sdm_restart_def_var
3556  endif
3557 #endif
3558 
3559  if ( restart_fid /= -1 ) then
3560 
3561  call file_cartesc_def_var( restart_fid, pv_info(i_dens)%NAME, pv_info(i_dens)%DESC, pv_info(i_dens)%UNIT, 'ZXY', atmos_restart_out_dtype, &
3562  pv_id(i_dens), &
3563  standard_name=pv_info(i_dens)%STDNAME )
3564  call file_cartesc_def_var( restart_fid, pv_info(i_momz)%NAME, pv_info(i_momz)%DESC, pv_info(i_momz)%UNIT, 'ZHXY', atmos_restart_out_dtype, &
3565  pv_id(i_momz), &
3566  standard_name=pv_info(i_momz)%STDNAME )
3567  call file_cartesc_def_var( restart_fid, pv_info(i_momx)%NAME, pv_info(i_momx)%DESC, pv_info(i_momx)%UNIT, 'ZXHY', atmos_restart_out_dtype, &
3568  pv_id(i_momx), &
3569  standard_name=pv_info(i_momx)%STDNAME )
3570  call file_cartesc_def_var( restart_fid, pv_info(i_momy)%NAME, pv_info(i_momy)%DESC, pv_info(i_momy)%UNIT, 'ZXYH', atmos_restart_out_dtype, &
3571  pv_id(i_momy), &
3572  standard_name=pv_info(i_momy)%STDNAME )
3573  call file_cartesc_def_var( restart_fid, pv_info(i_rhot)%NAME, pv_info(i_rhot)%DESC, pv_info(i_rhot)%UNIT, 'ZXY', atmos_restart_out_dtype, &
3574  pv_id(i_rhot), &
3575  standard_name=pv_info(i_rhot)%STDNAME )
3576  do iq = 1, qa
3577  call file_cartesc_def_var( restart_fid, tracer_name(iq), tracer_desc(iq), tracer_unit(iq), 'ZXY', atmos_restart_out_dtype, &
3578  pv_id(pv_nmax+iq) )
3579  enddo
3580 
3581  endif
3582 
3593 
3594  return
3595  end subroutine atmos_vars_restart_def_var
3596 
3597  !-----------------------------------------------------------------------------
3599  subroutine atmos_vars_restart_write
3600  use scale_file_cartesc, only: &
3601  file_cartesc_write_var
3602  use mod_atmos_admin, only: &
3603  atmos_sw_dyn, &
3604  atmos_sw_phy_mp, &
3605  atmos_sw_phy_ae, &
3606  atmos_sw_phy_ch, &
3607  atmos_sw_phy_rd, &
3608  atmos_sw_phy_sf, &
3609  atmos_sw_phy_tb, &
3610  atmos_sw_phy_bl, &
3611  atmos_sw_phy_cp, &
3613  use mod_cpl_admin, only: &
3614  cpl_sw
3615  use mod_atmos_dyn_vars, only: &
3617  use mod_atmos_phy_mp_vars, only: &
3619  use mod_atmos_phy_ae_vars, only: &
3621  use mod_atmos_phy_ch_vars, only: &
3623  use mod_atmos_phy_rd_vars, only: &
3625  use mod_atmos_phy_sf_vars, only: &
3627  use mod_atmos_phy_tb_vars, only: &
3629  use mod_atmos_phy_bl_vars, only: &
3631  use mod_atmos_phy_cp_vars, only: &
3633  use mod_atmos_phy_lt_vars, only: &
3635 #ifdef SDM
3636  use scale_atmos_phy_mp_sdm, only: &
3637  sd_rest_flg_out, &
3638  atmos_phy_mp_sdm_restart_write
3639 #endif
3640  implicit none
3641 
3642  integer iq
3643  !---------------------------------------------------------------------------
3644 
3645 #ifdef SDM
3646  if( sd_rest_flg_out ) then
3647  call atmos_phy_mp_sdm_restart_write
3648  endif
3649 #endif
3650 
3651  if ( restart_fid /= -1 ) then
3652 
3653  call atmos_vars_fillhalo
3654 
3655  call atmos_vars_check( force = .true. )
3656 
3657  call file_cartesc_write_var( restart_fid, pv_id(i_dens), dens(:,:,:), pv_info(i_dens)%NAME, 'ZXY' ) ! [IN]
3658  call file_cartesc_write_var( restart_fid, pv_id(i_momz), momz(:,:,:), pv_info(i_momz)%NAME, 'ZHXY' ) ! [IN]
3659  call file_cartesc_write_var( restart_fid, pv_id(i_momx), momx(:,:,:), pv_info(i_momx)%NAME, 'ZXHY' ) ! [IN]
3660  call file_cartesc_write_var( restart_fid, pv_id(i_momy), momy(:,:,:), pv_info(i_momy)%NAME, 'ZXYH' ) ! [IN]
3661  call file_cartesc_write_var( restart_fid, pv_id(i_rhot), rhot(:,:,:), pv_info(i_rhot)%NAME, 'ZXY' ) ! [IN]
3662 
3663  do iq = 1, qa
3664  call file_cartesc_write_var( restart_fid, pv_id(pv_nmax+iq), qtrc(:,:,:,iq), tracer_name(iq), 'ZXY' ) ! [IN]
3665  enddo
3666 
3667  endif
3668 
3674  if( atmos_sw_phy_sf .and. (.not. cpl_sw) ) call atmos_phy_sf_vars_restart_write
3679 
3680  return
3681  end subroutine atmos_vars_restart_write
3682 
3683 
3684  ! private
3685  subroutine allocate_3d( ary )
3686  use scale_const, only: &
3687  undef => const_undef
3688  real(RP), intent(inout), allocatable :: ary(:,:,:)
3689 
3690  if ( .not. allocated(ary) ) then
3691  allocate( ary(ka,ia,ja) )
3692  ary(:,:,:) = undef
3693  end if
3694 
3695  return
3696  end subroutine allocate_3d
3697 
3698  subroutine allocate_2d( ary )
3699  use scale_const, only: &
3700  undef => const_undef
3701  real(RP), intent(inout), allocatable :: ary(:,:)
3702 
3703  if ( .not. allocated(ary) ) then
3704  allocate( ary(ia,ja) )
3705  ary(:,:) = undef
3706  end if
3707 
3708  return
3709  end subroutine allocate_2d
3710 
3711  subroutine allocate_1d( ary )
3712  use scale_const, only: &
3713  undef => const_undef
3714  real(RP), intent(inout), allocatable :: ary(:)
3715 
3716  if ( .not. allocated(ary) ) then
3717  allocate( ary(ka) )
3718  ary(:) = undef
3719  end if
3720 
3721  return
3722  end subroutine allocate_1d
3723 
3724 end module mod_atmos_vars
scale_const::const_grav
real(rp), public const_grav
standard acceleration of gravity [m/s2]
Definition: scale_const.F90:46
mod_atmos_phy_cp_vars::atmos_phy_cp_vars_restart_write
subroutine, public atmos_phy_cp_vars_restart_write
Write restart.
Definition: mod_atmos_phy_cp_vars.F90:543
mod_atmos_vars::momz_av
real(rp), dimension(:,:,:), pointer, public momz_av
Definition: mod_atmos_vars.F90:90
scale_atmos_grid_cartesc_index::isb
integer, public isb
Definition: scale_atmos_grid_cartesC_index.F90:63
mod_atmos_phy_tb_vars::atmos_phy_tb_vars_restart_close
subroutine, public atmos_phy_tb_vars_restart_close
Close restart file.
Definition: mod_atmos_phy_tb_vars.F90:311
mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_create
subroutine, public atmos_phy_ch_vars_restart_create
Create restart file.
Definition: mod_atmos_phy_ch_vars.F90:265
scale_statistics
module Statistics
Definition: scale_statistics.F90:11
mod_atmos_phy_mp_vars
module Atmosphere / Physics Cloud Microphysics
Definition: mod_atmos_phy_mp_vars.F90:12
mod_atmos_vars::atmos_vars_restart_write
subroutine, public atmos_vars_restart_write
Write restart of atmospheric variables.
Definition: mod_atmos_vars.F90:3600
mod_atmos_phy_rd_vars::atmos_phy_rd_vars_restart_create
subroutine, public atmos_phy_rd_vars_restart_create
Create restart file.
Definition: mod_atmos_phy_rd_vars.F90:339
mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_close
subroutine, public atmos_phy_ae_vars_restart_close
Close restart file.
Definition: mod_atmos_phy_ae_vars.F90:372
scale_atmos_grid_cartesc_index::i_uy
integer, public i_uy
Definition: scale_atmos_grid_cartesC_index.F90:99
mod_atmos_vars::qe
real(rp), dimension(:,:,:,:), allocatable, target, public qe
Definition: mod_atmos_vars.F90:104
mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_close
subroutine, public atmos_phy_ch_vars_restart_close
Close restart file.
Definition: mod_atmos_phy_ch_vars.F90:316
scale_atmos_grid_cartesc_index::ke
integer, public ke
end point of inner domain: z, local
Definition: scale_atmos_grid_cartesC_index.F90:52
mod_atmos_vars::rhot_avw
real(rp), dimension(:,:,:), allocatable, target, public rhot_avw
Definition: mod_atmos_vars.F90:86
scale_atmos_diagnostic::atmos_diagnostic_get_teml
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.
Definition: scale_atmos_diagnostic.F90:320
scale_time::time_nowdaysec
real(dp), public time_nowdaysec
second of current time [sec]
Definition: scale_time.F90:70
mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_open
subroutine, public atmos_phy_ch_vars_restart_open
Open restart file for read.
Definition: mod_atmos_phy_ch_vars.F90:187
mod_atmos_phy_lt_vars::atmos_phy_lt_vars_restart_write
subroutine, public atmos_phy_lt_vars_restart_write
Write restart.
Definition: mod_atmos_phy_lt_vars.F90:368
scale_atmos_grid_cartesc_index::i_xv
integer, public i_xv
Definition: scale_atmos_grid_cartesC_index.F90:100
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:342
mod_atmos_dyn_vars
module Atmosphere / Dynamics
Definition: mod_atmos_dyn_vars.F90:12
scale_atmos_hydrometeor::i_hr
integer, parameter, public i_hr
liquid water rain
Definition: scale_atmos_hydrometeor.F90:82
scale_index::i_momz
integer, parameter, public i_momz
Definition: scale_index.F90:29
mod_atmos_admin::atmos_sw_phy_tb
logical, public atmos_sw_phy_tb
Definition: mod_atmos_admin.F90:57
mod_atmos_phy_sf_vars::atmos_phy_sf_vars_restart_open
subroutine, public atmos_phy_sf_vars_restart_open
Open restart file for read.
Definition: mod_atmos_phy_sf_vars.F90:392
mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_enddef
subroutine, public atmos_phy_ch_vars_restart_enddef
Exit netCDF define mode.
Definition: mod_atmos_phy_ch_vars.F90:302
mod_atmos_phy_mp_vars::atmos_phy_mp_vars_get_diagnostic
subroutine, public atmos_phy_mp_vars_get_diagnostic(DENS, TEMP, QTRC, CLDFRAC, Re, Qe, Ne)
Definition: mod_atmos_phy_mp_vars.F90:573
scale_tracer::qa
integer, public qa
Definition: scale_tracer.F90:34
mod_atmos_vars::qr
real(rp), dimension(:,:,:), pointer, public qr
Definition: mod_atmos_vars.F90:98
mod_atmos_vars::momx_av
real(rp), dimension(:,:,:), pointer, public momx_av
Definition: mod_atmos_vars.F90:91
scale_index::i_momx
integer, parameter, public i_momx
Definition: scale_index.F90:30
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_totvolzxv
real(rp), public atmos_grid_cartesc_real_totvolzxv
total volume (zxv, local) [m3]
Definition: scale_atmos_grid_cartesC_real.F90:90
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_cz
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_cz
geopotential height [m] (zxy)
Definition: scale_atmos_grid_cartesC_real.F90:38
mod_atmos_vars::rhoq_tp
real(rp), dimension(:,:,:,:), allocatable, public rhoq_tp
Definition: mod_atmos_vars.F90:120
mod_atmos_phy_lt_vars::atmos_phy_lt_vars_restart_enddef
subroutine, public atmos_phy_lt_vars_restart_enddef
Exit netCDF define mode.
Definition: mod_atmos_phy_lt_vars.F90:318
scale_tracer::tracer_desc
character(len=h_mid), dimension(qa_max), public tracer_desc
Definition: scale_tracer.F90:39
scale_tracer::tracer_unit
character(len=h_short), dimension(qa_max), public tracer_unit
Definition: scale_tracer.F90:40
scale_index
module Index
Definition: scale_index.F90:11
mod_atmos_vars::pott
real(rp), dimension(:,:,:), allocatable, target, public pott
Definition: mod_atmos_vars.F90:132
mod_atmos_phy_rd_vars::atmos_phy_rd_vars_restart_close
subroutine, public atmos_phy_rd_vars_restart_close
Close restart file.
Definition: mod_atmos_phy_rd_vars.F90:390
mod_atmos_phy_tb_vars::atmos_phy_tb_vars_restart_enddef
subroutine, public atmos_phy_tb_vars_restart_enddef
Exit netCDF define mode.
Definition: mod_atmos_phy_tb_vars.F90:297
scale_atmos_hydrometeor::i_hs
integer, parameter, public i_hs
snow
Definition: scale_atmos_hydrometeor.F90:84
scale_tracer::tracer_mass
real(rp), dimension(qa_max), public tracer_mass
Definition: scale_tracer.F90:46
scale_atmos_grid_cartesc::atmos_grid_cartesc_rfdx
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rfdx
reciprocal of face-dx
Definition: scale_atmos_grid_cartesC.F90:67
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_volwxy
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_volwxy
control volume (wxy) [m3]
Definition: scale_atmos_grid_cartesC_real.F90:84
mod_atmos_vars::atmos_vars_fillhalo
subroutine, public atmos_vars_fillhalo(FILL_BND)
HALO Communication.
Definition: mod_atmos_vars.F90:847
scale_file_cartesc::file_cartesc_enddef
subroutine, public file_cartesc_enddef(fid)
Exit netCDF file define mode.
Definition: scale_file_cartesC.F90:943
mod_atmos_admin::atmos_use_average
logical, public atmos_use_average
Definition: mod_atmos_admin.F90:49
scale_file_cartesc::file_cartesc_def_var
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.
Definition: scale_file_cartesC.F90:3307
mod_atmos_phy_ae_vars::atmos_phy_ae_vars_reset_diagnostics
subroutine, public atmos_phy_ae_vars_reset_diagnostics
Definition: mod_atmos_phy_ae_vars.F90:532
mod_atmos_vars::qtrc_av
real(rp), dimension(:,:,:,:), pointer, public qtrc_av
Definition: mod_atmos_vars.F90:94
scale_atmos_diagnostic::atmos_diagnostic_get_potv
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.
Definition: scale_atmos_diagnostic.F90:277
mod_atmos_vars::allocate_1d
subroutine allocate_1d(ary)
Definition: mod_atmos_vars.F90:3712
mod_atmos_phy_bl_vars::atmos_phy_bl_vars_restart_def_var
subroutine, public atmos_phy_bl_vars_restart_def_var
Write restart.
Definition: mod_atmos_phy_bl_vars.F90:336
scale_precision
module PRECISION
Definition: scale_precision.F90:14
mod_atmos_vars::rhov_tp
real(rp), dimension(:,:,:), allocatable, public rhov_tp
Definition: mod_atmos_vars.F90:117
scale_atmos_grid_cartesc_index::ka
integer, public ka
Definition: scale_atmos_grid_cartesC_index.F90:47
mod_atmos_admin
module ATMOS admin
Definition: mod_atmos_admin.F90:11
mod_atmos_phy_sf_vars::atmos_phy_sf_vars_restart_def_var
subroutine, public atmos_phy_sf_vars_restart_def_var
Write restart.
Definition: mod_atmos_phy_sf_vars.F90:549
mod_atmos_phy_rd_vars::atmos_phy_rd_tomflx_lw_dn
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_tomflx_lw_dn
Definition: mod_atmos_phy_rd_vars.F90:67
mod_atmos_vars::atmos_vars_restart_def_var
subroutine, public atmos_vars_restart_def_var
Define atmospheric variables in restart file.
Definition: mod_atmos_vars.F90:3508
scale_file_history_cartesc::file_history_cartesc_set_pres
subroutine, public file_history_cartesc_set_pres(PRES, PRESH, SFC_PRES)
set hydrostatic pressure for pressure coordinate
Definition: scale_file_history_cartesC.F90:260
mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_def_var
subroutine, public atmos_phy_ch_vars_restart_def_var
Write restart.
Definition: mod_atmos_phy_ch_vars.F90:336
mod_atmos_vars::qdry
real(rp), dimension(:,:,:), allocatable, target, public qdry
Definition: mod_atmos_vars.F90:139
mod_atmos_phy_lt_vars
module Atmosphere / Physics Chemistry
Definition: mod_atmos_phy_lt_vars.F90:12
mod_atmos_vars::momx_avw
real(rp), dimension(:,:,:), allocatable, target, public momx_avw
Definition: mod_atmos_vars.F90:84
mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_create
subroutine, public atmos_phy_ae_vars_restart_create
Create restart file.
Definition: mod_atmos_phy_ae_vars.F90:321
scale_const::const_rvap
real(rp), parameter, public const_rvap
specific gas constant (water vapor) [J/kg/K]
Definition: scale_const.F90:63
scale_atmos_grid_cartesc::atmos_grid_cartesc_rcdx
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rcdx
reciprocal of center-dx
Definition: scale_atmos_grid_cartesC.F90:65
mod_atmos_vars::cptot
real(rp), dimension(:,:,:), allocatable, target, public cptot
Definition: mod_atmos_vars.F90:142
mod_atmos_admin::atmos_sw_dyn
logical, public atmos_sw_dyn
Definition: mod_atmos_admin.F90:51
mod_atmos_phy_cp_vars::atmos_phy_cp_vars_restart_open
subroutine, public atmos_phy_cp_vars_restart_open
Open restart file for read.
Definition: mod_atmos_phy_cp_vars.F90:323
mod_atmos_phy_cp_vars::atmos_phy_cp_vars_restart_create
subroutine, public atmos_phy_cp_vars_restart_create
Create restart file.
Definition: mod_atmos_phy_cp_vars.F90:432
mod_atmos_phy_tb_vars::atmos_phy_tb_vars_restart_read
subroutine, public atmos_phy_tb_vars_restart_read
Read restart.
Definition: mod_atmos_phy_tb_vars.F90:218
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_totvolwxy
real(rp), public atmos_grid_cartesc_real_totvolwxy
total volume (wxy, local) [m3]
Definition: scale_atmos_grid_cartesC_real.F90:88
scale_prof::prof_rapstart
subroutine, public prof_rapstart(rapname_base, level, disable_barrier)
Start raptime.
Definition: scale_prof.F90:159
scale_atmos_grid_cartesc_metric
module Atmosphere Grid CartesianC metirc
Definition: scale_atmos_grid_cartesC_metric.F90:12
mod_atmos_admin::atmos_sw_phy_mp
logical, public atmos_sw_phy_mp
Definition: mod_atmos_admin.F90:52
mod_atmos_phy_rd_vars::atmos_phy_rd_vars_restart_open
subroutine, public atmos_phy_rd_vars_restart_open
Open restart file for read.
Definition: mod_atmos_phy_rd_vars.F90:265
mod_atmos_phy_lt_vars::atmos_phy_lt_vars_setup
subroutine, public atmos_phy_lt_vars_setup
Setup.
Definition: mod_atmos_phy_lt_vars.F90:91
mod_atmos_vars::rhot_av
real(rp), dimension(:,:,:), pointer, public rhot_av
Definition: mod_atmos_vars.F90:93
scale_atmos_hydrometeor
module atmosphere / hydrometeor
Definition: scale_atmos_hydrometeor.F90:12
mod_atmos_phy_ch_vars::atmos_phy_ch_vars_setup
subroutine, public atmos_phy_ch_vars_setup
Setup.
Definition: mod_atmos_phy_ch_vars.F90:90
mod_atmos_vars::qh
real(rp), dimension(:,:,:), pointer, public qh
Definition: mod_atmos_vars.F90:102
scale_atmos_diagnostic
module atmosphere / diagnostic
Definition: scale_atmos_diagnostic.F90:12
mod_atmos_vars::phyd
real(rp), dimension(:,:,:), allocatable, target, public phyd
Definition: mod_atmos_vars.F90:136
mod_atmos_phy_rd_vars
module Atmosphere / Physics Radiation
Definition: mod_atmos_phy_rd_vars.F90:12
scale_prc::prc_myrank
integer, public prc_myrank
process num in local communicator
Definition: scale_prc.F90:90
scale_atmos_diagnostic::atmos_diagnostic_get_phyd
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.
Definition: scale_atmos_diagnostic.F90:157
mod_atmos_vars::atmos_vars_restart_enddef
subroutine, public atmos_vars_restart_enddef
Exit netCDF define mode.
Definition: mod_atmos_vars.F90:3360
mod_atmos_dyn_vars::atmos_dyn_vars_restart_read
subroutine, public atmos_dyn_vars_restart_read
Read restart.
Definition: mod_atmos_dyn_vars.F90:240
mod_atmos_phy_sf_vars
module ATMOSPHERIC Surface Variables
Definition: mod_atmos_phy_sf_vars.F90:12
mod_atmos_phy_mp_vars::atmos_phy_mp_sflx_rain
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_rain
Definition: mod_atmos_phy_mp_vars.F90:73
mod_atmos_phy_cp_vars::atmos_phy_cp_vars_restart_enddef
subroutine, public atmos_phy_cp_vars_restart_enddef
Exit netCDF define mode.
Definition: mod_atmos_phy_cp_vars.F90:469
scale_atmos_hydrometeor::i_hh
integer, parameter, public i_hh
hail
Definition: scale_atmos_hydrometeor.F90:86
mod_atmos_phy_lt_vars::atmos_phy_lt_vars_restart_create
subroutine, public atmos_phy_lt_vars_restart_create
Create restart file.
Definition: mod_atmos_phy_lt_vars.F90:281
mod_atmos_vars::prec_engi
real(rp), dimension(:,:), allocatable, public prec_engi
Definition: mod_atmos_vars.F90:145
scale_index::i_dens
integer, parameter, public i_dens
Definition: scale_index.F90:28
scale_atmos_hydrometeor::atmos_hydrometeor_dry
logical, public atmos_hydrometeor_dry
Definition: scale_atmos_hydrometeor.F90:97
mod_atmos_phy_rd_vars::atmos_phy_rd_tomflx_sw_up
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_tomflx_sw_up
Definition: mod_atmos_phy_rd_vars.F90:68
mod_atmos_phy_mp_vars::atmos_phy_mp_vars_restart_def_var
subroutine, public atmos_phy_mp_vars_restart_def_var
Define variables in restart file.
Definition: mod_atmos_phy_mp_vars.F90:428
mod_atmos_vars::rhot
real(rp), dimension(:,:,:), allocatable, target, public rhot
Definition: mod_atmos_vars.F90:79
mod_atmos_vars::atmos_restart_check_criterion
real(rp), public atmos_restart_check_criterion
Definition: mod_atmos_vars.F90:72
mod_atmos_vars::atmos_vars_check
subroutine, public atmos_vars_check(force)
Check variables for atmosphere.
Definition: mod_atmos_vars.F90:1383
mod_atmos_phy_tb_vars::atmos_phy_tb_vars_restart_create
subroutine, public atmos_phy_tb_vars_restart_create
Create restart file.
Definition: mod_atmos_phy_tb_vars.F90:261
scale_atmos_grid_cartesc_real
module Atmosphere GRID CartesC Real(real space)
Definition: scale_atmos_grid_cartesC_real.F90:11
mod_atmos_phy_sf_vars::atmos_phy_sf_sfc_temp
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sfc_temp
Definition: mod_atmos_phy_sf_vars.F90:64
mod_atmos_vars::qtrc
real(rp), dimension(:,:,:,:), allocatable, target, public qtrc
Definition: mod_atmos_vars.F90:80
scale_file_history
module file_history
Definition: scale_file_history.F90:15
scale_tracer::tracer_engi0
real(rp), dimension(qa_max), public tracer_engi0
Definition: scale_tracer.F90:44
scale_file
module file
Definition: scale_file.F90:15
mod_atmos_phy_tb_vars::atmos_phy_tb_vars_restart_write
subroutine, public atmos_phy_tb_vars_restart_write
Write restart.
Definition: mod_atmos_phy_tb_vars.F90:351
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_volzuy
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_volzuy
control volume (zuy) [m3]
Definition: scale_atmos_grid_cartesC_real.F90:85
mod_atmos_vars::qv_ref
real(rp), dimension(:,:,:), allocatable, public qv_ref
Definition: mod_atmos_vars.F90:111
mod_atmos_phy_mp_vars::atmos_phy_mp_vars_restart_create
subroutine, public atmos_phy_mp_vars_restart_create
Create restart file.
Definition: mod_atmos_phy_mp_vars.F90:357
scale_tracer::unit
character(len=h_short), public unit
Definition: scale_tracer.F90:40
mod_atmos_vars::atmos_restart_check
logical, public atmos_restart_check
Check value consistency?
Definition: mod_atmos_vars.F90:70
scale_atmos_grid_cartesc_index::jeb
integer, public jeb
Definition: scale_atmos_grid_cartesC_index.F90:66
scale_index::i_momy
integer, parameter, public i_momy
Definition: scale_index.F90:31
mod_atmos_vars::j
real(rp), allocatable, target, public j
Definition: mod_atmos_vars.F90:140
mod_atmos_vars::atmos_vars_get_diagnostic_1d
recursive subroutine atmos_vars_get_diagnostic_1d(vname, var)
get diagnostic variable 1D
Definition: mod_atmos_vars.F90:2876
scale_prc
module PROCESS
Definition: scale_prc.F90:11
mod_atmos_vars::atmos_restart_out_basename
character(len=h_long), public atmos_restart_out_basename
Basename of the output file.
Definition: mod_atmos_vars.F90:64
mod_atmos_phy_cp_vars::atmos_phy_cp_sflx_snow
real(rp), dimension(:,:), allocatable, public atmos_phy_cp_sflx_snow
Definition: mod_atmos_phy_cp_vars.F90:71
mod_atmos_admin::atmos_sw_phy_ae
logical, public atmos_sw_phy_ae
Definition: mod_atmos_admin.F90:53
mod_atmos_dyn_vars::atmos_dyn_vars_restart_open
subroutine, public atmos_dyn_vars_restart_open
Open restart file for read.
Definition: mod_atmos_dyn_vars.F90:203
mod_atmos_vars::atmos_vars_monitor
subroutine, public atmos_vars_monitor
monitor output
Definition: mod_atmos_vars.F90:3114
mod_atmos_phy_ae_vars::atmos_phy_ae_vars_history
subroutine, public atmos_phy_ae_vars_history(QTRC, RH)
Definition: mod_atmos_phy_ae_vars.F90:428
mod_atmos_vars::rhou_tp
real(rp), dimension(:,:,:), allocatable, public rhou_tp
Definition: mod_atmos_vars.F90:116
scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_mapf
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_metric_mapf
map factor
Definition: scale_atmos_grid_cartesC_metric.F90:34
mod_atmos_vars::atmos_vars_get_diagnostic_2d
recursive subroutine atmos_vars_get_diagnostic_2d(vname, var)
get diagnostic variable 2D
Definition: mod_atmos_vars.F90:2656
scale_precision::rp
integer, parameter, public rp
Definition: scale_precision.F90:41
scale_atmos_diagnostic_cartesc::atmos_diagnostic_cartesc_get_vel
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.
Definition: scale_atmos_diagnostic_cartesC.F90:58
scale_atmos_hydrometeor::i_hi
integer, parameter, public i_hi
ice water cloud
Definition: scale_atmos_hydrometeor.F90:83
scale_atmos_grid_cartesc_index::ie
integer, public ie
end point of inner domain: x, local
Definition: scale_atmos_grid_cartesC_index.F90:54
mod_atmos_vars::prec
real(rp), dimension(:,:), allocatable, target, public prec
Definition: mod_atmos_vars.F90:144
mod_atmos_phy_tb_vars::atmos_phy_tb_vars_setup
subroutine, public atmos_phy_tb_vars_setup
Setup.
Definition: mod_atmos_phy_tb_vars.F90:83
scale_io
module STDIO
Definition: scale_io.F90:10
mod_atmos_vars::atmos_restart_out_title
character(len=h_mid), public atmos_restart_out_title
Title of the output file.
Definition: mod_atmos_vars.F90:67
mod_atmos_vars::atmos_vars_restart_read
subroutine, public atmos_vars_restart_read
Read restart of atmospheric variables.
Definition: mod_atmos_vars.F90:1011
mod_atmos_phy_rd_vars::atmos_phy_rd_sflx_lw_dn
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_lw_dn
Definition: mod_atmos_phy_rd_vars.F90:61
scale_atmos_grid_cartesc::atmos_grid_cartesc_rcdy
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rcdy
reciprocal of center-dy
Definition: scale_atmos_grid_cartesC.F90:66
mod_atmos_vars::atmos_restart_out_aggregate
logical, public atmos_restart_out_aggregate
Switch to use aggregate file.
Definition: mod_atmos_vars.F90:65
mod_atmos_phy_bl_vars
module atmosphere / physics / PBL
Definition: mod_atmos_phy_bl_vars.F90:12
mod_atmos_phy_rd_vars::atmos_phy_rd_sflx_sw_dn
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_sw_dn
Definition: mod_atmos_phy_rd_vars.F90:63
mod_atmos_vars::dens
real(rp), dimension(:,:,:), allocatable, target, public dens
Definition: mod_atmos_vars.F90:75
mod_atmos_dyn_vars::atmos_dyn_vars_restart_create
subroutine, public atmos_dyn_vars_restart_create
Create restart file.
Definition: mod_atmos_dyn_vars.F90:292
mod_atmos_phy_mp_vars::atmos_phy_mp_vars_reset_diagnostics
subroutine, public atmos_phy_mp_vars_reset_diagnostics
Definition: mod_atmos_phy_mp_vars.F90:768
mod_atmos_phy_sf_vars::atmos_phy_sf_vars_restart_write
subroutine, public atmos_phy_sf_vars_restart_write
Write variables to restart file.
Definition: mod_atmos_phy_sf_vars.F90:574
mod_atmos_phy_sf_vars::atmos_phy_sf_vars_restart_close
subroutine, public atmos_phy_sf_vars_restart_close
Close restart file.
Definition: mod_atmos_phy_sf_vars.F90:529
scale_tracer::k
real(rp), public k
Definition: scale_tracer.F90:44
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_volzxv
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_volzxv
control volume (zxv) [m3]
Definition: scale_atmos_grid_cartesC_real.F90:86
mod_atmos_vars::allocate_2d
subroutine allocate_2d(ary)
Definition: mod_atmos_vars.F90:3699
scale_atmos_grid_cartesc_index
module atmosphere / grid / cartesC index
Definition: scale_atmos_grid_cartesC_index.F90:12
scale_const
module CONSTANT
Definition: scale_const.F90:11
scale_atmos_grid_cartesc_index::ia
integer, public ia
Definition: scale_atmos_grid_cartesC_index.F90:48
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_vol
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_vol
control volume (zxy) [m3]
Definition: scale_atmos_grid_cartesC_real.F90:83
mod_atmos_phy_sf_vars::atmos_phy_sf_vars_restart_enddef
subroutine, public atmos_phy_sf_vars_restart_enddef
Exit netCDF define mode.
Definition: mod_atmos_phy_sf_vars.F90:515
mod_atmos_vars::atmos_vars_setup
subroutine, public atmos_vars_setup
Setup.
Definition: mod_atmos_vars.F90:467
mod_atmos_vars::atmos_vars_history_setpres
subroutine, public atmos_vars_history_setpres
Set pressure for history output.
Definition: mod_atmos_vars.F90:1135
mod_atmos_phy_rd_vars::atmos_phy_rd_sflx_sw_up
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_sw_up
Definition: mod_atmos_phy_rd_vars.F90:62
mod_atmos_vars::atmos_vars_restart_check
subroutine, public atmos_vars_restart_check
Check and compare between last data and sample data.
Definition: mod_atmos_vars.F90:1165
scale_debug::check
subroutine, public check(current_line, v)
Undefined value checker.
Definition: scale_debug.F90:56
mod_atmos_phy_lt_vars::atmos_phy_lt_vars_restart_read
subroutine, public atmos_phy_lt_vars_restart_read
Read restart.
Definition: mod_atmos_phy_lt_vars.F90:228
mod_atmos_vars::temp_ref
real(rp), dimension(:,:,:), allocatable, public temp_ref
Definition: mod_atmos_vars.F90:109
mod_atmos_phy_rd_vars::atmos_phy_rd_sflx_lw_up
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_sflx_lw_up
Definition: mod_atmos_phy_rd_vars.F90:60
mod_atmos_vars::momz
real(rp), dimension(:,:,:), allocatable, target, public momz
Definition: mod_atmos_vars.F90:76
mod_atmos_phy_sf_vars::atmos_phy_sf_vars_setup
subroutine, public atmos_phy_sf_vars_setup
Setup.
Definition: mod_atmos_phy_sf_vars.F90:189
scale_atmos_hydrometeor::lhv
real(rp), public lhv
latent heat of vaporization for use [J/kg]
Definition: scale_atmos_hydrometeor.F90:126
mod_atmos_phy_rd_vars::atmos_phy_rd_vars_restart_def_var
subroutine, public atmos_phy_rd_vars_restart_def_var
Define variables in restart file.
Definition: mod_atmos_phy_rd_vars.F90:410
mod_atmos_admin::atmos_sw_phy_lt
logical, public atmos_sw_phy_lt
Definition: mod_atmos_admin.F90:60
scale_atmos_adiabat
module atmosphere / adiabat
Definition: scale_atmos_adiabat.F90:11
mod_atmos_phy_tb_vars
module Atmosphere / Physics Turbulence
Definition: mod_atmos_phy_tb_vars.F90:12
mod_atmos_vars::pres_ref
real(rp), dimension(:,:,:), allocatable, public pres_ref
Definition: mod_atmos_vars.F90:110
scale_const::const_cvdry
real(rp), public const_cvdry
specific heat (dry air,constant volume) [J/kg/K]
Definition: scale_const.F90:57
mod_atmos_vars::atmos_restart_out_dtype
character(len=h_short), public atmos_restart_out_dtype
REAL4 or REAL8.
Definition: mod_atmos_vars.F90:68
mod_atmos_phy_cp_vars::atmos_phy_cp_vars_restart_close
subroutine, public atmos_phy_cp_vars_restart_close
Close restart file.
Definition: mod_atmos_phy_cp_vars.F90:483
mod_atmos_vars::momy_av
real(rp), dimension(:,:,:), pointer, public momy_av
Definition: mod_atmos_vars.F90:92
scale_tracer::tracer_cv
real(rp), dimension(qa_max), public tracer_cv
Definition: scale_tracer.F90:41
mod_atmos_phy_rd_vars::atmos_phy_rd_vars_restart_write
subroutine, public atmos_phy_rd_vars_restart_write
Write variables to restart file.
Definition: mod_atmos_phy_rd_vars.F90:434
scale_file_cartesc::file_cartesc_close
subroutine, public file_cartesc_close(fid)
Close a netCDF file.
Definition: scale_file_cartesC.F90:1023
scale_prc_cartesc
module process / cartesC
Definition: scale_prc_cartesC.F90:11
scale_const::const_cpdry
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
Definition: scale_const.F90:56
mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_read
subroutine, public atmos_phy_ae_vars_restart_read
Read restart.
Definition: mod_atmos_phy_ae_vars.F90:278
mod_atmos_phy_lt_vars::atmos_phy_lt_vars_restart_def_var
subroutine, public atmos_phy_lt_vars_restart_def_var
Write restart.
Definition: mod_atmos_phy_lt_vars.F90:352
mod_atmos_vars::v
real(rp), dimension(:,:,:), allocatable, target, public v
Definition: mod_atmos_vars.F90:130
mod_atmos_phy_bl_vars::atmos_phy_bl_vars_restart_create
subroutine, public atmos_phy_bl_vars_restart_create
Create restart file.
Definition: mod_atmos_phy_bl_vars.F90:266
mod_atmos_phy_cp_vars::atmos_phy_cp_vars_setup
subroutine, public atmos_phy_cp_vars_setup
Setup.
Definition: mod_atmos_phy_cp_vars.F90:127
scale_tracer::tracer_name
character(len=h_short), dimension(qa_max), public tracer_name
Definition: scale_tracer.F90:38
mod_atmos_vars::w
real(rp), dimension(:,:,:), allocatable, target, public w
Definition: mod_atmos_vars.F90:128
mod_atmos_vars::qtrc_avw
real(rp), dimension(:,:,:,:), allocatable, target, public qtrc_avw
Definition: mod_atmos_vars.F90:87
scale_prof
module profiler
Definition: scale_prof.F90:11
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_area
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_area
horizontal area ( xy, normal z) [m2]
Definition: scale_atmos_grid_cartesC_real.F90:65
mod_atmos_phy_ch_vars
module Atmosphere / Physics Chemistry
Definition: mod_atmos_phy_ch_vars.F90:12
mod_atmos_vars::momy_avw
real(rp), dimension(:,:,:), allocatable, target, public momy_avw
Definition: mod_atmos_vars.F90:85
mod_atmos_vars::momz_tp
real(rp), dimension(:,:,:), allocatable, public momz_tp
Definition: mod_atmos_vars.F90:115
scale_index::i_rhot
integer, parameter, public i_rhot
Definition: scale_index.F90:32
mod_atmos_vars::momx
real(rp), dimension(:,:,:), allocatable, target, public momx
Definition: mod_atmos_vars.F90:77
mod_atmos_vars::exner
real(rp), dimension(:,:,:), allocatable, target, public exner
Definition: mod_atmos_vars.F90:135
mod_atmos_phy_rd_vars::atmos_phy_rd_tomflx_sw_dn
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_tomflx_sw_dn
Definition: mod_atmos_phy_rd_vars.F90:69
scale_atmos_grid_cartesc_index::is
integer, public is
start point of inner domain: x, local
Definition: scale_atmos_grid_cartesC_index.F90:53
mod_atmos_phy_sf_vars::atmos_phy_sf_vars_restart_create
subroutine, public atmos_phy_sf_vars_restart_create
Create restart file.
Definition: mod_atmos_phy_sf_vars.F90:479
mod_atmos_admin::atmos_sw_phy_cp
logical, public atmos_sw_phy_cp
Definition: mod_atmos_admin.F90:59
mod_atmos_admin::atmos_sw_phy_ch
logical, public atmos_sw_phy_ch
Definition: mod_atmos_admin.F90:54
scale_monitor::monitor_reg
subroutine, public monitor_reg(name, desc, unit, itemid, ndims, dim_type, is_tendency)
Search existing item, or matching check between requested and registered item.
Definition: scale_monitor.F90:241
mod_atmos_vars::temp
real(rp), dimension(:,:,:), allocatable, target, public temp
Definition: mod_atmos_vars.F90:133
scale_time::time_dtsec_atmos_dyn
real(dp), public time_dtsec_atmos_dyn
time interval of dynamics [sec]
Definition: scale_time.F90:35
mod_atmos_vars::dens_tp
real(rp), dimension(:,:,:), allocatable, public dens_tp
Definition: mod_atmos_vars.F90:114
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_totvolzuy
real(rp), public atmos_grid_cartesc_real_totvolzuy
total volume (zuy, local) [m3]
Definition: scale_atmos_grid_cartesC_real.F90:89
mod_atmos_phy_mp_vars::atmos_phy_mp_vars_restart_write
subroutine, public atmos_phy_mp_vars_restart_write
Write restart.
Definition: mod_atmos_phy_mp_vars.F90:450
scale_atmos_grid_cartesc_index::ja
integer, public ja
Definition: scale_atmos_grid_cartesC_index.F90:49
mod_atmos_vars::momy
real(rp), dimension(:,:,:), allocatable, target, public momy
Definition: mod_atmos_vars.F90:78
scale_time
module TIME
Definition: scale_time.F90:11
mod_atmos_vars::qv
real(rp), dimension(:,:,:), allocatable, pointer, target, public qv
Definition: mod_atmos_vars.F90:96
mod_atmos_dyn_vars::atmos_dyn_vars_restart_write
subroutine, public atmos_dyn_vars_restart_write
Write variables to restart file.
Definition: mod_atmos_dyn_vars.F90:387
mod_atmos_phy_sf_vars::atmos_phy_sf_sflx_qtrc
real(rp), dimension(:,:,:), allocatable, target, public atmos_phy_sf_sflx_qtrc
Definition: mod_atmos_phy_sf_vars.F90:84
scale_atmos_hydrometeor::i_hc
integer, parameter, public i_hc
liquid water cloud
Definition: scale_atmos_hydrometeor.F90:81
scale_tracer
module TRACER
Definition: scale_tracer.F90:12
mod_atmos_phy_bl_vars::atmos_phy_bl_vars_restart_open
subroutine, public atmos_phy_bl_vars_restart_open
Open restart file for read.
Definition: mod_atmos_phy_bl_vars.F90:196
mod_atmos_vars::phydh
real(rp), dimension(:,:,:), allocatable, target, public phydh
Definition: mod_atmos_vars.F90:137
scale_atmos_hydrometeor::i_qv
integer, public i_qv
Definition: scale_atmos_hydrometeor.F90:77
mod_atmos_phy_tb_vars::atmos_phy_tb_vars_restart_def_var
subroutine, public atmos_phy_tb_vars_restart_def_var
Write restart.
Definition: mod_atmos_phy_tb_vars.F90:331
mod_atmos_vars::atmos_vars_restart_open
subroutine, public atmos_vars_restart_open
Open restart file for reading atmospheric variables.
Definition: mod_atmos_vars.F90:911
mod_atmos_phy_rd_vars::atmos_phy_rd_vars_setup
subroutine, public atmos_phy_rd_vars_setup
Setup.
Definition: mod_atmos_phy_rd_vars.F90:121
scale_atmos_diagnostic_cartesc
module atmosphere / diagnostic / CartesianC
Definition: scale_atmos_diagnostic_cartesC.F90:12
scale_atmos_diagnostic::atmos_diagnostic_get_therm_rhot
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.
Definition: scale_atmos_diagnostic.F90:59
mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_write
subroutine, public atmos_phy_ae_vars_restart_write
Write restart.
Definition: mod_atmos_phy_ae_vars.F90:408
mod_atmos_vars::pres
real(rp), dimension(:,:,:), allocatable, target, public pres
Definition: mod_atmos_vars.F90:134
mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_def_var
subroutine, public atmos_phy_ae_vars_restart_def_var
Write restart.
Definition: mod_atmos_phy_ae_vars.F90:392
mod_atmos_phy_sf_vars::atmos_phy_sf_sflx_engi
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_engi
Definition: mod_atmos_phy_sf_vars.F90:85
mod_atmos_admin::atmos_sw_phy_rd
logical, public atmos_sw_phy_rd
Definition: mod_atmos_admin.F90:55
mod_atmos_vars::dens_av
real(rp), dimension(:,:,:), pointer, public dens_av
Definition: mod_atmos_vars.F90:89
mod_atmos_dyn_vars::atmos_dyn_vars_restart_enddef
subroutine, public atmos_dyn_vars_restart_enddef
Exit netCDF define mode.
Definition: mod_atmos_dyn_vars.F90:331
mod_atmos_vars::rtot
real(rp), dimension(:,:,:), allocatable, target, public rtot
Definition: mod_atmos_vars.F90:140
mod_atmos_phy_rd_vars::atmos_phy_rd_tomflx_lw_up
real(rp), dimension(:,:), allocatable, public atmos_phy_rd_tomflx_lw_up
Definition: mod_atmos_phy_rd_vars.F90:66
mod_atmos_phy_rd_vars::atmos_phy_rd_vars_restart_read
subroutine, public atmos_phy_rd_vars_restart_read
Read restart.
Definition: mod_atmos_phy_rd_vars.F90:300
mod_atmos_vars::u
real(rp), dimension(:,:,:), allocatable, target, public u
Definition: mod_atmos_vars.F90:129
scale_atmos_grid_cartesc_index::ks
integer, public ks
start point of inner domain: z, local
Definition: scale_atmos_grid_cartesC_index.F90:51
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_f2h
real(rp), dimension(:,:,:,:), allocatable, public atmos_grid_cartesc_real_f2h
coefficient for interpolation from full to half levels
Definition: scale_atmos_grid_cartesC_real.F90:46
mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_write
subroutine, public atmos_phy_ch_vars_restart_write
Write restart.
Definition: mod_atmos_phy_ch_vars.F90:352
mod_atmos_vars::atmos_restart_out_postfix_timelabel
logical, public atmos_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
Definition: mod_atmos_vars.F90:66
mod_atmos_phy_mp_vars::atmos_phy_mp_vars_setup
subroutine, public atmos_phy_mp_vars_setup
Setup.
Definition: mod_atmos_phy_mp_vars.F90:126
scale_debug
module DEBUG
Definition: scale_debug.F90:11
mod_atmos_phy_sf_vars::atmos_phy_sf_sflx_lh
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_lh
Definition: mod_atmos_phy_sf_vars.F90:80
scale_tracer::tracer_cp
real(rp), dimension(qa_max), public tracer_cp
Definition: scale_tracer.F90:42
mod_atmos_phy_mp_vars::atmos_phy_mp_vars_restart_read
subroutine, public atmos_phy_mp_vars_restart_read
Read restart.
Definition: mod_atmos_phy_mp_vars.F90:323
mod_atmos_dyn_vars::atmos_dyn_vars_restart_close
subroutine, public atmos_dyn_vars_restart_close
Close restart file.
Definition: mod_atmos_dyn_vars.F90:345
scale_file_history_cartesc
module file / history_cartesC
Definition: scale_file_history_cartesC.F90:12
mod_atmos_vars::atmos_vars_restart_close
subroutine, public atmos_vars_restart_close
Close restart file.
Definition: mod_atmos_vars.F90:3431
mod_atmos_vars::atmos_restart_in_postfix_timelabel
logical, public atmos_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
Definition: mod_atmos_vars.F90:63
scale_file_cartesc::file_cartesc_create
subroutine, public file_cartesc_create(basename, title, datatype, fid, date, subsec, haszcoord, append, aggregate, single)
Create/open a netCDF file.
Definition: scale_file_cartesC.F90:780
mod_atmos_vars::rhoh_p
real(rp), dimension(:,:,:), allocatable, public rhoh_p
Definition: mod_atmos_vars.F90:119
mod_atmos_dyn_vars::atmos_dyn_vars_restart_def_var
subroutine, public atmos_dyn_vars_restart_def_var
Define variables in restart file.
Definition: mod_atmos_dyn_vars.F90:365
mod_atmos_admin::atmos_dyn_type
character(len=h_short), public atmos_dyn_type
Definition: mod_atmos_admin.F90:35
scale_file_cartesc::file_cartesc_open
subroutine, public file_cartesc_open(basename, fid, aggregate)
open a netCDF file for read
Definition: scale_file_cartesC.F90:746
scale_statistics::statistics_checktotal
logical, public statistics_checktotal
calc&report variable totals to logfile?
Definition: scale_statistics.F90:64
scale_file_cartesc::file_cartesc_flush
subroutine, public file_cartesc_flush(fid)
Flush all pending requests to a netCDF file (PnetCDF only)
Definition: scale_file_cartesC.F90:997
mod_atmos_phy_ae_vars::atmos_phy_ae_vars_setup
subroutine, public atmos_phy_ae_vars_setup
Setup.
Definition: mod_atmos_phy_ae_vars.F90:109
scale_time::time_gettimelabel
subroutine, public time_gettimelabel(timelabel)
generate time label
Definition: scale_time.F90:91
scale_comm_cartesc
module COMMUNICATION
Definition: scale_comm_cartesC.F90:11
mod_atmos_vars
module ATMOSPHERIC Variables
Definition: mod_atmos_vars.F90:12
mod_atmos_phy_bl_vars::atmos_phy_bl_vars_restart_read
subroutine, public atmos_phy_bl_vars_restart_read
Read restart.
Definition: mod_atmos_phy_bl_vars.F90:231
scale_atmos_bottom
module atmosphere / bottom boundary extrapolation
Definition: scale_atmos_bottom.F90:12
mod_atmos_vars::qi
real(rp), dimension(:,:,:), pointer, public qi
Definition: mod_atmos_vars.F90:99
mod_atmos_vars::atmos_vars_history
subroutine, public atmos_vars_history
History output set for atmospheric variables.
Definition: mod_atmos_vars.F90:1301
scale_tracer::tracer_r
real(rp), dimension(qa_max), public tracer_r
Definition: scale_tracer.F90:43
mod_atmos_vars::rhot_tp
real(rp), dimension(:,:,:), allocatable, public rhot_tp
Definition: mod_atmos_vars.F90:118
scale_atmos_grid_cartesc_index::js
integer, public js
start point of inner domain: y, local
Definition: scale_atmos_grid_cartesC_index.F90:55
mod_atmos_phy_cp_vars::atmos_phy_cp_sflx_rain
real(rp), dimension(:,:), allocatable, public atmos_phy_cp_sflx_rain
Definition: mod_atmos_phy_cp_vars.F90:70
mod_atmos_vars::atmos_vars_restart_create
subroutine, public atmos_vars_restart_create
Create atmospheric restart file.
Definition: mod_atmos_vars.F90:3264
mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_enddef
subroutine, public atmos_phy_ae_vars_restart_enddef
Exit netCDF define mode.
Definition: mod_atmos_phy_ae_vars.F90:358
mod_atmos_vars::atmos_restart_in_aggregate
logical, public atmos_restart_in_aggregate
Switch to use aggregate file.
Definition: mod_atmos_vars.F90:62
mod_atmos_phy_mp_vars::atmos_phy_mp_sflx_snow
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_snow
Definition: mod_atmos_phy_mp_vars.F90:74
mod_atmos_vars::atmos_restart_output
logical, public atmos_restart_output
Output restart file?
Definition: mod_atmos_vars.F90:59
mod_atmos_vars::momy_tp
real(rp), dimension(:,:,:), allocatable, public momy_tp
Definition: mod_atmos_vars.F90:124
mod_atmos_phy_sf_vars::atmos_phy_sf_sflx_sh
real(rp), dimension(:,:), allocatable, public atmos_phy_sf_sflx_sh
Definition: mod_atmos_phy_sf_vars.F90:79
mod_atmos_admin::atmos_sw_phy_bl
logical, public atmos_sw_phy_bl
Definition: mod_atmos_admin.F90:58
mod_atmos_phy_tb_vars::atmos_phy_tb_vars_restart_open
subroutine, public atmos_phy_tb_vars_restart_open
Open restart file for read.
Definition: mod_atmos_phy_tb_vars.F90:183
scale_atmos_grid_cartesc_index::ieb
integer, public ieb
Definition: scale_atmos_grid_cartesC_index.F90:64
scale_atmos_diagnostic::atmos_diagnostic_get_n2
subroutine, public atmos_diagnostic_get_n2(KA, KS, KE, IA, IS, IE, JA, JS, JE, POTT, Rtot, CZ, FZ, F2H, N2)
ATMOS_DIAGNOSTIC_get_n2 N^2.
Definition: scale_atmos_diagnostic.F90:219
scale_atmos_hydrometeor::lhf
real(rp), public lhf
latent heat of fusion for use [J/kg]
Definition: scale_atmos_hydrometeor.F90:128
scale_file::file_get_aggregate
logical function, public file_get_aggregate(fid)
Definition: scale_file.F90:4844
mod_atmos_phy_ae_vars
module ATMOSPHERE / Physics Aerosol Microphysics
Definition: mod_atmos_phy_ae_vars.F90:12
mod_atmos_vars::momx_tp
real(rp), dimension(:,:,:), allocatable, public momx_tp
Definition: mod_atmos_vars.F90:123
scale_atmos_thermodyn
module atmosphere / thermodyn
Definition: scale_atmos_thermodyn.F90:11
mod_atmos_vars::atmos_vars_calc_diagnostics
subroutine, public atmos_vars_calc_diagnostics
Calc diagnostic variables.
Definition: mod_atmos_vars.F90:1620
scale_file_history::file_history_reg
subroutine, public file_history_reg(name, desc, unit, itemid, standard_name, ndims, dim_type, cell_measures, fill_halo)
Register/Append variable to history file.
Definition: scale_file_history.F90:650
mod_atmos_vars::atmos_vars_get_diagnostic_3d
recursive subroutine atmos_vars_get_diagnostic_3d(vname, var)
get diagnostic variable 3D
Definition: mod_atmos_vars.F90:1693
mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_open
subroutine, public atmos_phy_ae_vars_restart_open
Open restart file for read.
Definition: mod_atmos_phy_ae_vars.F90:243
scale_prof::prof_rapend
subroutine, public prof_rapend(rapname_base, level, disable_barrier)
Save raptime.
Definition: scale_prof.F90:217
mod_atmos_vars::allocate_3d
subroutine allocate_3d(ary)
Definition: mod_atmos_vars.F90:3686
mod_atmos_vars::qc
real(rp), dimension(:,:,:), pointer, public qc
Definition: mod_atmos_vars.F90:97
mod_atmos_phy_bl_vars::atmos_phy_bl_vars_restart_write
subroutine, public atmos_phy_bl_vars_restart_write
Write restart.
Definition: mod_atmos_phy_bl_vars.F90:356
mod_atmos_vars::atmos_restart_check_basename
character(len=h_long), public atmos_restart_check_basename
Definition: mod_atmos_vars.F90:71
mod_atmos_phy_rd_vars::atmos_phy_rd_vars_restart_enddef
subroutine, public atmos_phy_rd_vars_restart_enddef
Exit netCDF define mode.
Definition: mod_atmos_phy_rd_vars.F90:376
mod_atmos_phy_bl_vars::atmos_phy_bl_vars_restart_close
subroutine, public atmos_phy_bl_vars_restart_close
Close restart file.
Definition: mod_atmos_phy_bl_vars.F90:316
mod_atmos_phy_mp_vars::atmos_phy_mp_vars_restart_open
subroutine, public atmos_phy_mp_vars_restart_open
Open restart file for read.
Definition: mod_atmos_phy_mp_vars.F90:288
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_fz
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_fz
geopotential height [m] (wxy)
Definition: scale_atmos_grid_cartesC_real.F90:42
mod_atmos_phy_bl_vars::atmos_phy_bl_vars_setup
subroutine, public atmos_phy_bl_vars_setup
Setup.
Definition: mod_atmos_phy_bl_vars.F90:97
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_totvol
real(rp), public atmos_grid_cartesc_real_totvol
total volume (zxy, local) [m3]
Definition: scale_atmos_grid_cartesC_real.F90:87
scale_atmos_grid_cartesc
module atmosphere / grid / cartesC
Definition: scale_atmos_grid_cartesC.F90:12
mod_atmos_vars::pott_ref
real(rp), dimension(:,:,:), allocatable, public pott_ref
Definition: mod_atmos_vars.F90:108
mod_atmos_phy_lt_vars::atmos_phy_lt_vars_restart_open
subroutine, public atmos_phy_lt_vars_restart_open
Open restart file for read.
Definition: mod_atmos_phy_lt_vars.F90:193
mod_atmos_vars::dens_avw
real(rp), dimension(:,:,:), allocatable, target, public dens_avw
Definition: mod_atmos_vars.F90:82
mod_atmos_vars::momz_avw
real(rp), dimension(:,:,:), allocatable, target, public momz_avw
Definition: mod_atmos_vars.F90:83
scale_const::const_undef
real(rp), public const_undef
Definition: scale_const.F90:41
scale_atmos_grid_cartesc::atmos_grid_cartesc_rfdy
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_rfdy
reciprocal of face-dy
Definition: scale_atmos_grid_cartesC.F90:68
scale_atmos_grid_cartesc_index::jsb
integer, public jsb
Definition: scale_atmos_grid_cartesC_index.F90:65
mod_atmos_phy_sf_vars::atmos_phy_sf_vars_restart_read
subroutine, public atmos_phy_sf_vars_restart_read
Read restart.
Definition: mod_atmos_phy_sf_vars.F90:428
mod_atmos_phy_mp_vars::atmos_phy_mp_vars_restart_close
subroutine, public atmos_phy_mp_vars_restart_close
Close restart file.
Definition: mod_atmos_phy_mp_vars.F90:408
scale_atmos_saturation
module atmosphere / saturation
Definition: scale_atmos_saturation.F90:12
mod_atmos_phy_lt_vars::atmos_phy_lt_vars_restart_close
subroutine, public atmos_phy_lt_vars_restart_close
Close restart file.
Definition: mod_atmos_phy_lt_vars.F90:332
mod_atmos_phy_mp_vars::atmos_phy_mp_vars_history
subroutine, public atmos_phy_mp_vars_history(DENS, TEMP, QTRC)
Definition: mod_atmos_phy_mp_vars.F90:472
mod_atmos_phy_cp_vars
module Atmosphere / Physics Cumulus
Definition: mod_atmos_phy_cp_vars.F90:12
scale_io::io_fid_conf
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:56
scale_atmos_grid_cartesc_index::je
integer, public je
end point of inner domain: y, local
Definition: scale_atmos_grid_cartesC_index.F90:56
scale_prc_cartesc::prc_twod
logical, public prc_twod
2D experiment
Definition: scale_prc_cartesC.F90:55
scale_file_cartesc
module file / cartesianC
Definition: scale_file_cartesC.F90:11
mod_cpl_admin::cpl_sw
logical, public cpl_sw
Definition: mod_cpl_admin.F90:33
scale_tracer::name
character(len=h_short), public name
Definition: scale_tracer.F90:38
scale_atmos_hydrometeor::n_hyd
integer, parameter, public n_hyd
Definition: scale_atmos_hydrometeor.F90:79
mod_atmos_vars::atmos_restart_in_basename
character(len=h_long), public atmos_restart_in_basename
Basename of the input file.
Definition: mod_atmos_vars.F90:61
mod_atmos_vars::dens_ref
real(rp), dimension(:,:,:), allocatable, public dens_ref
Definition: mod_atmos_vars.F90:107
mod_atmos_vars::cvtot
real(rp), dimension(:,:,:), allocatable, target, public cvtot
Definition: mod_atmos_vars.F90:141
scale_atmos_bottom::atmos_bottom_estimate
subroutine, public atmos_bottom_estimate(KA, KS, KE, IA, IS, IE, JA, JS, JE, DENS, PRES, QV, SFC_TEMP, FZ, SFC_DENS, SFC_PRES)
Calc bottom boundary of atmosphere (just above surface)
Definition: scale_atmos_bottom.F90:51
mod_atmos_vars::qg
real(rp), dimension(:,:,:), pointer, public qg
Definition: mod_atmos_vars.F90:101
mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_read
subroutine, public atmos_phy_ch_vars_restart_read
Read restart.
Definition: mod_atmos_phy_ch_vars.F90:222
mod_atmos_phy_bl_vars::atmos_phy_bl_vars_restart_enddef
subroutine, public atmos_phy_bl_vars_restart_enddef
Exit netCDF define mode.
Definition: mod_atmos_phy_bl_vars.F90:302
mod_cpl_admin
module Coupler admin
Definition: mod_cpl_admin.F90:11
mod_atmos_phy_mp_vars::atmos_phy_mp_vars_restart_enddef
subroutine, public atmos_phy_mp_vars_restart_enddef
Exit netCDF define mode.
Definition: mod_atmos_phy_mp_vars.F90:394
mod_atmos_phy_cp_vars::atmos_phy_cp_vars_restart_def_var
subroutine, public atmos_phy_cp_vars_restart_def_var
Write restart.
Definition: mod_atmos_phy_cp_vars.F90:503
mod_atmos_dyn_vars::atmos_dyn_vars_setup
subroutine, public atmos_dyn_vars_setup
Setup.
Definition: mod_atmos_dyn_vars.F90:80
mod_atmos_vars::qs
real(rp), dimension(:,:,:), pointer, public qs
Definition: mod_atmos_vars.F90:100
scale_atmos_hydrometeor::i_hg
integer, parameter, public i_hg
graupel
Definition: scale_atmos_hydrometeor.F90:85
scale_atmos_grid_cartesc_metric::atmos_grid_cartesc_metric_rotc
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_metric_rotc
rotation coefficient
Definition: scale_atmos_grid_cartesC_metric.F90:35
mod_atmos_phy_cp_vars::atmos_phy_cp_vars_restart_read
subroutine, public atmos_phy_cp_vars_restart_read
Read restart.
Definition: mod_atmos_phy_cp_vars.F90:358
mod_atmos_admin::atmos_sw_phy_sf
logical, public atmos_sw_phy_sf
Definition: mod_atmos_admin.F90:56
scale_monitor
module MONITOR
Definition: scale_monitor.F90:12