SCALE-RM
mod_atmos_phy_cp_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_tracer
23  !-----------------------------------------------------------------------------
24  implicit none
25  private
26  !-----------------------------------------------------------------------------
27  !
28  !++ Public procedure
29  !
30  public :: atmos_phy_cp_vars_setup
34 
40 
41  !-----------------------------------------------------------------------------
42  !
43  !++ Public parameters & variables
44  !
45  logical, public :: atmos_phy_cp_restart_output = .false.
46 
47  character(len=H_LONG), public :: atmos_phy_cp_restart_in_basename = ''
48  logical, public :: atmos_phy_cp_restart_in_postfix_timelabel = .false.
50  character(len=H_LONG), public :: atmos_phy_cp_restart_out_basename = ''
52  logical, public :: atmos_phy_cp_restart_out_postfix_timelabel = .true.
53  character(len=H_MID), public :: atmos_phy_cp_restart_out_title = 'ATMOS_PHY_CP restart'
54  character(len=H_SHORT), public :: atmos_phy_cp_restart_out_dtype = 'DEFAULT'
55 
56  ! restart variables
57  real(rp), public, allocatable :: atmos_phy_cp_dens_t (:,:,:) ! tendency DENS [kg/m3/s]
58  real(rp), public, allocatable :: atmos_phy_cp_momz_t (:,:,:) ! tendency MOMZ [kg/m2/s2]
59  real(rp), public, allocatable :: atmos_phy_cp_rhot_t (:,:,:) ! tendency RHOT [K*kg/m3/s]
60  real(rp), public, allocatable :: atmos_phy_cp_rhoqv_t (:,:,:) ! tendency rho*QV [kg/kg/s]
61  real(rp), public, allocatable :: atmos_phy_cp_rhohyd_t(:,:,:,:) ! tendency rho*QHYD [kg/kg/s]
62 
63  ! only for K-F scheme
64  real(rp), public, allocatable :: atmos_phy_cp_w0mean (:,:,:) ! running mean vertical wind velocity [m/s]
65  real(rp), public, allocatable :: atmos_phy_cp_kf_nca (:,:) ! advection/cumulus convection timescale for KF[sec]
66 
67 
68  ! diagnostic variables
69  real(rp), public, allocatable :: atmos_phy_cp_mflx_cloudbase(:,:) ! cloud base mass flux [kg/m2/s]
70  real(rp), public, allocatable :: atmos_phy_cp_sflx_rain (:,:) ! convective rain [kg/m2/s]
71  real(rp), public, allocatable :: atmos_phy_cp_sflx_snow (:,:) ! convective snow [kg/m2/s]
72  real(rp), public, allocatable :: atmos_phy_cp_sflx_engi (:,:) ! internal energy [J/m2/s]
73  real(rp), public, allocatable :: atmos_phy_cp_cloudtop (:,:) ! cloud top height [m]
74  real(rp), public, allocatable :: atmos_phy_cp_cloudbase (:,:) ! cloud base height [m]
75  real(rp), public, allocatable :: atmos_phy_cp_cldfrac_dp (:,:,:) ! cloud fraction (deep convection) (0-1)
76  real(rp), public, allocatable :: atmos_phy_cp_cldfrac_sh (:,:,:) ! cloud fraction (shallow convection) (0-1)
77 
78  !-----------------------------------------------------------------------------
79  !
80  !++ Private procedure
81  !
82  !-----------------------------------------------------------------------------
83  !
84  !++ Private parameters & variables
85  !
86  integer, private, parameter :: vmax = 2
87  integer, private, parameter :: i_w0mean = 1
88  integer, private, parameter :: i_kf_nca = 2
89 
90 
91  character(len=H_SHORT), private :: var_name(vmax)
92  character(len=H_MID), private :: var_desc(vmax)
93  character(len=H_SHORT), private :: var_unit(vmax)
94  character(len=H_SHORT), private :: var_dim (vmax)
95  integer, private :: var_id (vmax)
96  integer, private :: restart_fid = -1 ! file ID
97 
98  data var_name / 'w0mean', &
99  'kf_nca' /
100 
101  data var_desc / 'running mean vertical velocity', &
102  'advection/cumulus convection timescale for KF' /
103 
104  data var_unit / 'm/s', &
105  'sec' /
106 
107  data var_dim / 'ZXY', &
108  'XY' /
109 
110 
111  ! tendency names
112  integer, private :: vmax_t
113  integer, private :: i_cp_dens_t = 1
114  integer, private :: i_cp_rhot_t = 2
115  integer, private :: i_cp_qv_t = 3
116 
117  character(len=H_SHORT), private, allocatable :: var_t_name(:)
118  character(len=H_MID), private, allocatable :: var_t_desc(:)
119  character(len=H_SHORT), private, allocatable :: var_t_unit(:)
120  integer, private, allocatable :: var_t_id (:)
121 
122  !-----------------------------------------------------------------------------
123 contains
124  !-----------------------------------------------------------------------------
126  subroutine atmos_phy_cp_vars_setup
127  use scale_prc, only: &
128  prc_abort
129  use scale_const, only: &
130  undef => const_undef
131  use scale_atmos_hydrometeor, only: &
132  n_hyd, &
133  hyd_name
134  implicit none
135 
136  namelist / param_atmos_phy_cp_vars / &
146 
147  integer :: ierr
148  integer :: iv
149  integer :: iq
150  !---------------------------------------------------------------------------
151 
152  log_newline
153  log_info("ATMOS_PHY_CP_vars_setup",*) 'Setup'
154 
155  allocate( atmos_phy_cp_dens_t(ka,ia,ja) )
156  allocate( atmos_phy_cp_momz_t(ka,ia,ja) )
157  allocate( atmos_phy_cp_rhot_t(ka,ia,ja) )
158  allocate( atmos_phy_cp_rhoqv_t(ka,ia,ja) )
159  allocate( atmos_phy_cp_rhohyd_t(ka,ia,ja,n_hyd) )
160  atmos_phy_cp_dens_t(:,:,:) = 0.0_rp
161  atmos_phy_cp_momz_t(:,:,:) = undef
162  atmos_phy_cp_rhot_t(:,:,:) = 0.0_rp
163  atmos_phy_cp_rhoqv_t(:,:,:) = 0.0_rp
164  atmos_phy_cp_rhohyd_t(:,:,:,:) = 0.0_rp
165 
166  allocate( atmos_phy_cp_w0mean(ka,ia,ja) )
167  allocate( atmos_phy_cp_kf_nca(ia,ja) )
168  atmos_phy_cp_w0mean(:,:,:) = 0.0_rp
169  atmos_phy_cp_kf_nca(:,:) = -100.0_rp
170 
171  ! for tendency restart
172  vmax_t = 3 + n_hyd
173  allocate( var_t_name(vmax_t) )
174  allocate( var_t_desc(vmax_t) )
175  allocate( var_t_unit(vmax_t) )
176  allocate( var_t_id(vmax_t) )
177 
178  var_t_name(i_cp_dens_t) = 'DENS_t_CP'
179  var_t_desc(i_cp_dens_t) = 'tendency DENS in CP'
180  var_t_unit(i_cp_dens_t) = 'kg/m3/s'
181  var_t_name(i_cp_rhot_t) = 'RHOT_t_CP'
182  var_t_desc(i_cp_rhot_t) = 'tendency RHOT in CP'
183  var_t_unit(i_cp_rhot_t) = 'K*kg/m3/s'
184 
185  var_t_name(i_cp_qv_t) = 'QV_t_CP'
186  var_t_desc(i_cp_qv_t) = 'tendency rho*QV in CP'
187  var_t_unit(i_cp_qv_t) = 'kg/m3/s'
188  do iq = 1, n_hyd
189  var_t_name(3+iq) = trim(hyd_name(iq))//'_t_CP'
190  var_t_desc(3+iq) = 'tendency rho*'//trim(hyd_name(iq))//' in CP'
191  var_t_unit(3+iq) = 'kg/m3/s'
192  enddo
193 
194 
195  allocate( atmos_phy_cp_mflx_cloudbase(ia,ja) )
196  allocate( atmos_phy_cp_sflx_rain(ia,ja) )
197  allocate( atmos_phy_cp_sflx_snow(ia,ja) )
198  allocate( atmos_phy_cp_sflx_engi(ia,ja) )
199  allocate( atmos_phy_cp_cloudtop(ia,ja) )
200  allocate( atmos_phy_cp_cloudbase(ia,ja) )
201  allocate( atmos_phy_cp_cldfrac_dp(ka,ia,ja) )
202  allocate( atmos_phy_cp_cldfrac_sh(ka,ia,ja) )
203  atmos_phy_cp_mflx_cloudbase(:,:) = 0.0_rp
204  atmos_phy_cp_sflx_rain(:,:) = 0.0_rp
205  atmos_phy_cp_sflx_snow(:,:) = 0.0_rp
206  atmos_phy_cp_sflx_engi(:,:) = 0.0_rp
207  atmos_phy_cp_cloudtop(:,:) = 0.0_rp
208  atmos_phy_cp_cloudbase(:,:) = 0.0_rp
209  atmos_phy_cp_cldfrac_dp(:,:,:) = 0.0_rp
210  atmos_phy_cp_cldfrac_sh(:,:,:) = 0.0_rp
211 
212 
213  !--- read namelist
214  rewind(io_fid_conf)
215  read(io_fid_conf,nml=param_atmos_phy_cp_vars,iostat=ierr)
216  if( ierr < 0 ) then !--- missing
217  log_info("ATMOS_PHY_CP_vars_setup",*) 'Not found namelist. Default used.'
218  elseif( ierr > 0 ) then !--- fatal error
219  log_error("ATMOS_PHY_CP_vars_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_PHY_CP_VARS. Check!'
220  call prc_abort
221  endif
222  log_nml(param_atmos_phy_cp_vars)
223 
224  log_newline
225  log_info("ATMOS_PHY_CP_vars_setup",*) '[ATMOS_PHY_CP] prognostic/diagnostic variables'
226  log_info_cont('(1x,A,A24,A,A48,A,A12,A)') &
227  ' |', 'VARNAME ','|', &
228  'DESCRIPTION ', '[', 'UNIT ', ']'
229  do iv = 1, vmax
230  log_info_cont('(1x,A,I3,A,A24,A,A48,A,A12,A)') &
231  'NO.',iv,'|',var_name(iv),'|',var_desc(iv),'[',var_unit(iv),']'
232  enddo
233 
234  ! tendency
235  do iv = 1, vmax_t
236  log_info_cont('(1x,A,I3,A,A24,A,A48,A,A12,A)') &
237  'NO.',iv+vmax,'|',var_t_name(iv),'|',var_t_desc(iv),'[',var_t_unit(iv),']'
238  enddo
239 
240  log_newline
241  if ( atmos_phy_cp_restart_in_basename /= '' ) then
242  log_info("ATMOS_PHY_CP_vars_setup",*) 'Restart input? : YES, file = ', trim(atmos_phy_cp_restart_in_basename)
243  log_info("ATMOS_PHY_CP_vars_setup",*) 'Add timelabel? : ', atmos_phy_cp_restart_in_postfix_timelabel
244  else
245  log_info("ATMOS_PHY_CP_vars_setup",*) 'Restart input? : NO'
246  endif
248  .AND. atmos_phy_cp_restart_out_basename /= '' ) then
249  log_info("ATMOS_PHY_CP_vars_setup",*) 'Restart output? : YES, file = ', trim(atmos_phy_cp_restart_out_basename)
250  log_info("ATMOS_PHY_CP_vars_setup",*) 'Add timelabel? : ', atmos_phy_cp_restart_out_postfix_timelabel
251  else
252  log_info("ATMOS_PHY_CP_vars_setup",*) 'Restart output? : NO'
254  endif
255 
256  return
257  end subroutine atmos_phy_cp_vars_setup
258 
259  !-----------------------------------------------------------------------------
261  subroutine atmos_phy_cp_vars_fillhalo
262  use scale_comm_cartesc, only: &
263  comm_vars8, &
264  comm_wait
265  use scale_atmos_hydrometeor, only: &
266  n_hyd
267  implicit none
268 
269  integer :: i, j
270  integer :: iq
271  !---------------------------------------------------------------------------
272 
273  !$omp parallel do
274  do j = js, je
275  do i = is, ie
284  end do
285  end do
286  do iq = 1, n_hyd
287  !$omp parallel do
288  do j = js, je
289  do i = is, ie
290  atmos_phy_cp_rhohyd_t( 1:ks-1,i,j,iq) = atmos_phy_cp_rhohyd_t(ks,i,j,iq)
291  atmos_phy_cp_rhohyd_t(ke+1:ka ,i,j,iq) = atmos_phy_cp_rhohyd_t(ke,i,j,iq)
292  enddo
293  enddo
294  end do
295 
296  call comm_vars8( atmos_phy_cp_w0mean(:,:,:), 1 )
297  call comm_vars8( atmos_phy_cp_kf_nca(:,:), 2 )
298 
299  ! tendency
300  call comm_vars8( atmos_phy_cp_dens_t(:,:,:), vmax+1 )
301  call comm_vars8( atmos_phy_cp_rhot_t(:,:,:), vmax+2 )
302  call comm_vars8( atmos_phy_cp_rhoqv_t(:,:,:), vmax+3 )
303  do iq = 1, n_hyd
304  call comm_vars8( atmos_phy_cp_rhohyd_t(:,:,:,iq), vmax+3+iq )
305  enddo
306 
307  call comm_wait ( atmos_phy_cp_w0mean(:,:,:), 1 )
308  call comm_wait ( atmos_phy_cp_kf_nca(:,:), 2 )
309 
310  call comm_wait ( atmos_phy_cp_dens_t(:,:,:), vmax+1 )
311  call comm_wait ( atmos_phy_cp_rhot_t(:,:,:), vmax+2 )
312  call comm_wait ( atmos_phy_cp_rhoqv_t(:,:,:), vmax+3 )
313  do iq = 1, n_hyd
314  call comm_wait ( atmos_phy_cp_rhohyd_t(:,:,:,iq), vmax+3+iq )
315  enddo
316 
317  return
318  end subroutine atmos_phy_cp_vars_fillhalo
319 
320  !-----------------------------------------------------------------------------
323  use scale_time, only: &
325  use scale_file_cartesc, only: &
327  implicit none
328 
329  character(len=19) :: timelabel
330  character(len=H_LONG) :: basename
331  !---------------------------------------------------------------------------
332 
333  log_newline
334  log_info("ATMOS_PHY_CP_vars_restart_open",*) 'Open restart file (ATMOS_PHY_CP) '
335 
336  if ( atmos_phy_cp_restart_in_basename /= '' ) then
337 
339  call time_gettimelabel( timelabel )
340  basename = trim(atmos_phy_cp_restart_in_basename)//'_'//trim(timelabel)
341  else
342  basename = trim(atmos_phy_cp_restart_in_basename)
343  endif
344 
345  log_info("ATMOS_PHY_CP_vars_restart_open",*) 'basename: ', trim(basename)
346 
347  call file_cartesc_open( basename, restart_fid, aggregate=atmos_phy_cp_restart_in_aggregate )
348  else
349  log_info("ATMOS_PHY_CP_vars_restart_open",*) 'restart file for ATMOS_PHY_CP is not specified.'
350  endif
351 
352  return
353  end subroutine atmos_phy_cp_vars_restart_open
354 
355  !-----------------------------------------------------------------------------
358  use scale_file, only: &
360  use scale_file_cartesc, only: &
361  file_cartesc_read, &
363  use scale_atmos_hydrometeor, only: &
364  n_hyd
365  implicit none
366 
367  integer :: i, j, iq
368  !---------------------------------------------------------------------------
369 
370  if ( restart_fid /= -1 ) then
371  log_newline
372  log_info("ATMOS_PHY_CP_vars_restart_read",*) 'Read from restart file (ATMOS_PHY_CP) '
373 
374  call file_cartesc_read( restart_fid, var_name(1), 'ZXY', & ! [IN]
375  atmos_phy_cp_w0mean(:,:,:) ) ! [OUT]
376  call file_cartesc_read( restart_fid, var_name(2), 'XY', & ! [IN]
377  atmos_phy_cp_kf_nca(:,:) ) ! [OUT]
378  ! tendency
379  call file_cartesc_read( restart_fid, var_t_name(1), 'ZXY', & ! [IN]
380  atmos_phy_cp_dens_t(:,:,:) ) ! [OUT]
381  call file_cartesc_read( restart_fid, var_t_name(2), 'ZXY', & ! [IN]
382  atmos_phy_cp_rhot_t(:,:,:) ) ! [OUT]
383  call file_cartesc_read( restart_fid, var_t_name(3), 'ZXY', & ! [IN]
384  atmos_phy_cp_rhoqv_t(:,:,:) ) ! [OUT]
385  do iq = 1, n_hyd
386  call file_cartesc_read( restart_fid, var_t_name(3+iq), 'ZXY', & ! [IN]
387  atmos_phy_cp_rhohyd_t(:,:,:,iq) ) ! [OUT]
388  enddo
389 
390  if ( file_get_aggregate(restart_fid) ) then
391  call file_cartesc_flush( restart_fid ) ! X/Y halos have been read from file
392 
393  ! fill K halos
394  !$omp parallel do
395  do j = 1, ja
396  do i = 1, ia
405  end do
406  end do
407  do iq = 1, n_hyd
408  !$omp parallel do
409  do j = 1, ja
410  do i = 1, ia
411  atmos_phy_cp_rhohyd_t( 1:ks-1,i,j,iq) = atmos_phy_cp_rhohyd_t(ks,i,j,iq)
412  atmos_phy_cp_rhohyd_t(ke+1:ka, i,j,iq) = atmos_phy_cp_rhohyd_t(ke,i,j,iq)
413  enddo
414  enddo
415  enddo
416  else
418  end if
419 
421 
422  else
423  log_info("ATMOS_PHY_CP_vars_restart_read",*) 'invalid restart file ID for ATMOS_PHY_CP.'
424  endif
425 
426  return
427  end subroutine atmos_phy_cp_vars_restart_read
428 
429  !-----------------------------------------------------------------------------
432  use scale_time, only: &
434  use scale_file_cartesc, only: &
436  implicit none
437 
438  character(len=19) :: timelabel
439  character(len=H_LONG) :: basename
440  !---------------------------------------------------------------------------
441 
442  if ( atmos_phy_cp_restart_out_basename /= '' ) then
443 
444  log_newline
445  log_info("ATMOS_PHY_CP_vars_restart_create",*) 'Create restart file (ATMOS_PHY_AE) '
446 
448  call time_gettimelabel( timelabel )
449  basename = trim(atmos_phy_cp_restart_out_basename)//'_'//trim(timelabel)
450  else
451  basename = trim(atmos_phy_cp_restart_out_basename)
452  endif
453 
454  log_info("ATMOS_PHY_CP_vars_restart_create",*) 'basename: ', trim(basename)
455 
456  call file_cartesc_create( &
458  restart_fid, & ! [OUT]
459  aggregate=atmos_phy_cp_restart_out_aggregate ) ! [IN]
460 
461  endif
462 
463  return
464  end subroutine atmos_phy_cp_vars_restart_create
465 
466  !-----------------------------------------------------------------------------
469  use scale_file_cartesc, only: &
471  implicit none
472 
473  if ( restart_fid /= -1 ) then
474  call file_cartesc_enddef( restart_fid ) ! [IN]
475  endif
476 
477  return
478  end subroutine atmos_phy_cp_vars_restart_enddef
479 
480  !-----------------------------------------------------------------------------
483  use scale_file_cartesc, only: &
485  implicit none
486  !---------------------------------------------------------------------------
487 
488  if ( restart_fid /= -1 ) then
489  log_newline
490  log_info("ATMOS_PHY_CP_vars_restart_close",*) 'Close restart file (ATMOS_PHY_CP) '
491 
492  call file_cartesc_close( restart_fid ) ! [IN]
493 
494  restart_fid = -1
495  endif
496 
497  return
498  end subroutine atmos_phy_cp_vars_restart_close
499 
500  !-----------------------------------------------------------------------------
503  use scale_file_cartesc, only: &
505  use scale_atmos_hydrometeor, only: &
506  n_hyd
507  implicit none
508 
509  integer :: i, iq
510  !---------------------------------------------------------------------------
511 
512  if ( restart_fid /= -1 ) then
513 
514  do i = 1, vmax
515  call file_cartesc_def_var( restart_fid, & ! [IN]
516  var_name(i), var_desc(i), var_unit(i), & ! [IN]
517  var_dim(i), atmos_phy_cp_restart_out_dtype, & ! [IN]
518  var_id(i) ) ! [OUT]
519  end do
520 
521  do i = 1, 3
522  call file_cartesc_def_var( restart_fid, & ! [IN]
523  var_t_name(i), var_t_desc(i), var_t_unit(i), & ! [IN]
524  'ZXY', atmos_phy_cp_restart_out_dtype, & ! [IN]
525  var_t_id(i) ) ! [OUT]
526  end do
527 
528  do iq = 1, n_hyd
529  call file_cartesc_def_var( restart_fid, & ! [IN]
530  var_t_name(3+iq), var_t_desc(3+iq), var_t_unit(3+iq), & ! [IN]
531  'ZXY', atmos_phy_cp_restart_out_dtype, & ! [IN]
532  var_t_id(3+iq) ) ! [OUT]
533  enddo
534 
535  endif
536 
537  return
538  end subroutine atmos_phy_cp_vars_restart_def_var
539 
540  !-----------------------------------------------------------------------------
543  use scale_file_cartesc, only: &
544  file_cartesc_write => file_cartesc_write_var
545  use scale_atmos_hydrometeor, only: &
546  n_hyd
547  implicit none
548 
549  integer :: iq
550  !---------------------------------------------------------------------------
551 
552  if ( restart_fid /= -1 ) then
553 
555 
557 
558  call file_cartesc_write( restart_fid, var_id(1), atmos_phy_cp_w0mean(:,:,:), & ! [IN]
559  var_name(1), 'ZXY' ) ! [IN]
560  call file_cartesc_write( restart_fid, var_id(2), atmos_phy_cp_kf_nca(:,:), & ! [IN]
561  var_name(2), 'XY' ) ! [IN]
562 
563  ! tendency
564  call file_cartesc_write( restart_fid, var_t_id(1), atmos_phy_cp_dens_t(:,:,:), & ! [IN]
565  var_t_name(1), 'ZXY' ) ! [IN]
566  call file_cartesc_write( restart_fid, var_t_id(2), atmos_phy_cp_rhot_t(:,:,:), & ! [IN]
567  var_t_name(2), 'ZXY' ) ! [IN]
568  call file_cartesc_write( restart_fid, var_t_id(3), atmos_phy_cp_rhoqv_t(:,:,:), & ! [IN]
569  var_t_name(3), 'ZXY' ) ! [IN]
570  do iq = 1, n_hyd
571  call file_cartesc_write( restart_fid, var_t_id(3+iq), atmos_phy_cp_rhohyd_t(:,:,:,iq), & ! [IN]
572  var_t_name(3+iq), 'ZXY' ) ! [IN]
573  enddo
574 
575  endif
576 
577  return
578  end subroutine atmos_phy_cp_vars_restart_write
579 
580  subroutine atmos_phy_cp_vars_check
581  use scale_statistics, only: &
583  statistics_total
584  use scale_atmos_grid_cartesc_real, only: &
589  use scale_atmos_hydrometeor, only: &
590  n_hyd
591  implicit none
592  integer :: iq
593  !---------------------------------------------------------------------------
594 
595  call valcheck( ka, ks, ke, ia, is, ie, ja, js, je, &
596  atmos_phy_cp_w0mean(:,:,:), & ! (in)
597  -100.0_rp, 100.0_rp, var_name(1), & ! (in)
598  __file__, __line__ ) ! (in)
599  call valcheck( ia, is, ie, ja, js, je, &
600  atmos_phy_cp_kf_nca(:,:), & ! (in)
601  -100.0_rp, 1.0e5_rp, var_name(2), & ! (in)
602  __file__, __line__ ) ! (in)
603  call valcheck( ka, ks, ke, ia, is, ie, ja, js, je, &
604  atmos_phy_cp_dens_t(:,:,:), & ! (in)
605  -1.0e0_rp, 1.0e0_rp, var_t_name(1), & ! (in)
606  __file__, __line__ ) ! (in)
607  call valcheck( ka, ks, ke, ia, is, ie, ja, js, je, &
608  atmos_phy_cp_rhot_t(:,:,:), & ! (in)
609  -1.0e3_rp, 1.0e3_rp, var_t_name(2), & ! (in)
610  __file__, __line__ ) ! (in)
611  call valcheck( ka, ks, ke, ia, is, ie, ja, js, je, &
612  atmos_phy_cp_rhoqv_t(:,:,:), & ! (in)
613  -1.0e0_rp, 1.0e0_rp, var_t_name(3), & ! (in)
614  __file__, __line__ ) ! (in)
615  do iq = 1, n_hyd
616  call valcheck( ka, ks, ke, ia, is, ie, ja, js, je, &
617  atmos_phy_cp_rhohyd_t(:,:,:,iq), & ! (in)
618  -1.0e0_rp, 1.0e0_rp, var_t_name(3+iq), & ! (in)
619  __file__, __line__ ) ! (in)
620  end do
621 
622  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
623  atmos_phy_cp_w0mean(:,:,:), var_name(1), & ! (in)
624  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
626  call statistics_total( ia, is, ie, ja, js, je, &
627  atmos_phy_cp_kf_nca(:,:) , var_name(2), & ! (in)
628  atmos_grid_cartesc_real_area(:,:), & ! (in)
630  ! tendency
631  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
632  atmos_phy_cp_dens_t(:,:,:), var_t_name(1), & ! (in)
633  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
635  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
636  atmos_phy_cp_rhot_t(:,:,:), var_t_name(2), & ! (in)
637  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
639  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
640  atmos_phy_cp_rhoqv_t(:,:,:), var_t_name(3), & ! (in)
641  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
643  do iq = 1, n_hyd
644  call statistics_total( ka, ks, ke, ia, is, ie, ja, js, je, &
645  atmos_phy_cp_rhohyd_t(:,:,:,iq), var_t_name(3+iq), & ! (in)
646  atmos_grid_cartesc_real_vol(:,:,:), & ! (in)
648  enddo
649 
650  return
651  end subroutine atmos_phy_cp_vars_check
652 
653 end module mod_atmos_phy_cp_vars
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_phy_cp_vars::atmos_phy_cp_mflx_cloudbase
real(rp), dimension(:,:), allocatable, public atmos_phy_cp_mflx_cloudbase
Definition: mod_atmos_phy_cp_vars.F90:69
scale_statistics
module Statistics
Definition: scale_statistics.F90:11
mod_atmos_phy_cp_vars::atmos_phy_cp_cloudbase
real(rp), dimension(:,:), allocatable, public atmos_phy_cp_cloudbase
Definition: mod_atmos_phy_cp_vars.F90:74
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_phy_cp_vars::atmos_phy_cp_restart_in_postfix_timelabel
logical, public atmos_phy_cp_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
Definition: mod_atmos_phy_cp_vars.F90:48
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:342
mod_atmos_phy_cp_vars::atmos_phy_cp_cldfrac_sh
real(rp), dimension(:,:,:), allocatable, public atmos_phy_cp_cldfrac_sh
Definition: mod_atmos_phy_cp_vars.F90:76
scale_atmos_hydrometeor::hyd_name
character(len=h_short), dimension(n_hyd), parameter, public hyd_name
Definition: scale_atmos_hydrometeor.F90:88
scale_file_cartesc::file_cartesc_enddef
subroutine, public file_cartesc_enddef(fid)
Exit netCDF file define mode.
Definition: scale_file_cartesC.F90:943
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
scale_precision
module PRECISION
Definition: scale_precision.F90:14
scale_atmos_grid_cartesc_index::ka
integer, public ka
Definition: scale_atmos_grid_cartesC_index.F90:47
mod_atmos_phy_cp_vars::atmos_phy_cp_restart_out_dtype
character(len=h_short), public atmos_phy_cp_restart_out_dtype
REAL4 or REAL8.
Definition: mod_atmos_phy_cp_vars.F90:54
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_totarea
real(rp), public atmos_grid_cartesc_real_totarea
total area (xy, local) [m2]
Definition: scale_atmos_grid_cartesC_real.F90:77
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_cldfrac_dp
real(rp), dimension(:,:,:), allocatable, public atmos_phy_cp_cldfrac_dp
Definition: mod_atmos_phy_cp_vars.F90:75
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_cp_vars::atmos_phy_cp_sflx_engi
real(rp), dimension(:,:), allocatable, public atmos_phy_cp_sflx_engi
Definition: mod_atmos_phy_cp_vars.F90:72
mod_atmos_phy_cp_vars::atmos_phy_cp_w0mean
real(rp), dimension(:,:,:), allocatable, public atmos_phy_cp_w0mean
Definition: mod_atmos_phy_cp_vars.F90:64
scale_atmos_hydrometeor
module atmosphere / hydrometeor
Definition: scale_atmos_hydrometeor.F90:12
mod_atmos_phy_cp_vars::atmos_phy_cp_restart_output
logical, public atmos_phy_cp_restart_output
output restart file?
Definition: mod_atmos_phy_cp_vars.F90:45
mod_atmos_phy_cp_vars::atmos_phy_cp_restart_out_title
character(len=h_mid), public atmos_phy_cp_restart_out_title
title of the output file
Definition: mod_atmos_phy_cp_vars.F90:53
mod_atmos_phy_cp_vars::atmos_phy_cp_restart_in_basename
character(len=h_long), public atmos_phy_cp_restart_in_basename
Basename of the input file.
Definition: mod_atmos_phy_cp_vars.F90:47
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
mod_atmos_phy_cp_vars::atmos_phy_cp_rhoqv_t
real(rp), dimension(:,:,:), allocatable, public atmos_phy_cp_rhoqv_t
Definition: mod_atmos_phy_cp_vars.F90:60
scale_atmos_grid_cartesc_real
module Atmosphere GRID CartesC Real(real space)
Definition: scale_atmos_grid_cartesC_real.F90:11
scale_file
module file
Definition: scale_file.F90:15
mod_atmos_phy_cp_vars::atmos_phy_cp_restart_out_basename
character(len=h_long), public atmos_phy_cp_restart_out_basename
Basename of the output file.
Definition: mod_atmos_phy_cp_vars.F90:50
scale_prc
module PROCESS
Definition: scale_prc.F90:11
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
scale_precision::rp
integer, parameter, public rp
Definition: scale_precision.F90:41
scale_atmos_grid_cartesc_index::ie
integer, public ie
end point of inner domain: x, local
Definition: scale_atmos_grid_cartesC_index.F90:54
scale_io
module STDIO
Definition: scale_io.F90:10
mod_atmos_phy_cp_vars::atmos_phy_cp_restart_out_postfix_timelabel
logical, public atmos_phy_cp_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
Definition: mod_atmos_phy_cp_vars.F90:52
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_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
scale_file_cartesc::file_cartesc_close
subroutine, public file_cartesc_close(fid)
Close a netCDF file.
Definition: scale_file_cartesC.F90:1023
mod_atmos_phy_cp_vars::atmos_phy_cp_restart_in_aggregate
logical, public atmos_phy_cp_restart_in_aggregate
Switch to use aggregate file.
Definition: mod_atmos_phy_cp_vars.F90:49
mod_atmos_phy_cp_vars::atmos_phy_cp_restart_out_aggregate
logical, public atmos_phy_cp_restart_out_aggregate
Switch to use aggregate file.
Definition: mod_atmos_phy_cp_vars.F90:51
mod_atmos_phy_cp_vars::atmos_phy_cp_rhot_t
real(rp), dimension(:,:,:), allocatable, public atmos_phy_cp_rhot_t
Definition: mod_atmos_phy_cp_vars.F90:59
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_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
scale_atmos_grid_cartesc_index::is
integer, public is
start point of inner domain: x, local
Definition: scale_atmos_grid_cartesC_index.F90:53
scale_atmos_grid_cartesc_index::ja
integer, public ja
Definition: scale_atmos_grid_cartesC_index.F90:49
scale_time
module TIME
Definition: scale_time.F90:11
mod_atmos_phy_cp_vars::atmos_phy_cp_cloudtop
real(rp), dimension(:,:), allocatable, public atmos_phy_cp_cloudtop
Definition: mod_atmos_phy_cp_vars.F90:73
scale_tracer
module TRACER
Definition: scale_tracer.F90:12
mod_atmos_phy_cp_vars::atmos_phy_cp_vars_check
subroutine atmos_phy_cp_vars_check
Definition: mod_atmos_phy_cp_vars.F90:581
mod_atmos_phy_cp_vars::atmos_phy_cp_vars_fillhalo
subroutine, public atmos_phy_cp_vars_fillhalo
HALO Communication.
Definition: mod_atmos_phy_cp_vars.F90:262
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_debug
module DEBUG
Definition: scale_debug.F90:11
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
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
mod_atmos_phy_cp_vars::atmos_phy_cp_rhohyd_t
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_cp_rhohyd_t
Definition: mod_atmos_phy_cp_vars.F90:61
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
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
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
scale_file::file_get_aggregate
logical function, public file_get_aggregate(fid)
Definition: scale_file.F90:4844
mod_atmos_phy_cp_vars::atmos_phy_cp_momz_t
real(rp), dimension(:,:,:), allocatable, public atmos_phy_cp_momz_t
Definition: mod_atmos_phy_cp_vars.F90:58
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_const::const_undef
real(rp), public const_undef
Definition: scale_const.F90:41
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
mod_atmos_phy_cp_vars::atmos_phy_cp_kf_nca
real(rp), dimension(:,:), allocatable, public atmos_phy_cp_kf_nca
Definition: mod_atmos_phy_cp_vars.F90:65
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_file_cartesc
module file / cartesianC
Definition: scale_file_cartesC.F90:11
scale_atmos_hydrometeor::n_hyd
integer, parameter, public n_hyd
Definition: scale_atmos_hydrometeor.F90:79
mod_atmos_phy_cp_vars::atmos_phy_cp_dens_t
real(rp), dimension(:,:,:), allocatable, public atmos_phy_cp_dens_t
Definition: mod_atmos_phy_cp_vars.F90:57
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_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