SCALE-RM
mod_atmos_phy_mp_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
21  use scale_tracer
22  !-----------------------------------------------------------------------------
23  implicit none
24  private
25  !-----------------------------------------------------------------------------
26  !
27  !++ Public procedure
28  !
29  public :: atmos_phy_mp_vars_setup
33 
39 
41 
44 
45  !-----------------------------------------------------------------------------
46  !
47  !++ Public parameters & variables
48  !
49  logical, public :: atmos_phy_mp_restart_output = .false.
50 
51  character(len=H_LONG), public :: atmos_phy_mp_restart_in_basename = ''
53  logical, public :: atmos_phy_mp_restart_in_postfix_timelabel = .false.
54  character(len=H_LONG), public :: atmos_phy_mp_restart_out_basename = ''
56  logical, public :: atmos_phy_mp_restart_out_postfix_timelabel = .true.
57  character(len=H_MID), public :: atmos_phy_mp_restart_out_title = 'ATMOS_PHY_MP restart'
58  character(len=H_SHORT), public :: atmos_phy_mp_restart_out_dtype = 'DEFAULT'
59 
60  real(RP), public :: atmos_phy_mp_cldfrac_thleshold
61 
62  real(RP), public, allocatable :: atmos_phy_mp_dens_t(:,:,:) ! tendency DENS [kg/m3/s]
63  real(RP), public, allocatable :: atmos_phy_mp_momz_t(:,:,:) ! tendency MOMZ [kg/m2/s2]
64  real(RP), public, allocatable :: atmos_phy_mp_rhou_t(:,:,:) ! tendency dens*U [kg/m2/s2]
65  real(RP), public, allocatable :: atmos_phy_mp_rhov_t(:,:,:) ! tendency dens*V [kg/m2/s2]
66  real(RP), public, allocatable :: atmos_phy_mp_rhot_t(:,:,:) ! tendency RHOT [K*kg/m3/s]
67  real(RP), public, allocatable :: atmos_phy_mp_rhoq_t(:,:,:,:) ! tendency rho*QTRC [kg/kg/s]
68  real(RP), public, allocatable :: atmos_phy_mp_rhoh (:,:,:) ! diabatic heating rate [J/kg/s]
69 
70  real(RP), public, allocatable :: atmos_phy_mp_evaporate(:,:,:) ! number concentration of evaporated cloud [/m3]
71  real(RP), public, allocatable :: atmos_phy_mp_sflx_rain(:,:) ! precipitation flux (liquid) [kg/m2/s]
72  real(RP), public, allocatable :: atmos_phy_mp_sflx_snow(:,:) ! precipitation flux (solid) [kg/m2/s]
73 
74  integer, public :: qa_mp = 0
75  integer, public :: qs_mp = -1
76  integer, public :: qe_mp = -2
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_sflx_rain = 1
88  integer, private, parameter :: i_sflx_snow = 2
89 
90  character(len=H_SHORT), private :: var_name(vmax)
91  character(len=H_MID), private :: var_desc(vmax)
92  character(len=H_SHORT), private :: var_unit(vmax)
93  integer, private :: var_id(vmax)
94  integer, private :: restart_fid = -1 ! file ID
95 
96  data var_name / 'SFLX_rain', &
97  'SFLX_snow' /
98  data var_desc / 'precipitation flux (liquid)', &
99  'precipitation flux (solid)' /
100  data var_unit / 'kg/m2/s', &
101  'kg/m2/s' /
102 
103 
104  ! for diagnostics
105  real(RP), private, allocatable :: atmos_phy_mp_cldfrac(:,:,:)
106  real(RP), private, allocatable :: atmos_phy_mp_re (:,:,:,:)
107  real(RP), private, allocatable :: atmos_phy_mp_qe (:,:,:,:)
108  real(RP), private, allocatable :: atmos_phy_mp_ne (:,:,:,:)
109  logical, private :: diag_cldfrac
110  logical, private :: diag_re
111  logical, private :: diag_qe
112  logical, private :: diag_ne
113 
114  ! for history
115  integer, private :: hist_cldfrac_id
116  logical, private :: hist_re
117  logical, private :: hist_qe
118  logical, private :: hist_ne
119  integer, private, allocatable :: hist_re_id(:)
120  integer, private, allocatable :: hist_qe_id(:)
121  integer, private, allocatable :: hist_ne_id(:)
122 
123  !-----------------------------------------------------------------------------
124 contains
125  !-----------------------------------------------------------------------------
127  subroutine atmos_phy_mp_vars_setup
128  use scale_prc, only: &
129  prc_abort
130  use scale_const, only: &
131  undef => const_undef
132  use scale_atmos_hydrometeor, only: &
133  n_hyd, &
134  qha, &
135  hyd_name, &
136  num_name, &
137  hyd_desc
138  use scale_file_history, only: &
140  implicit none
141 
142  namelist / param_atmos_phy_mp_vars / &
152 
153  integer :: ierr
154  integer :: iv, ih
155  !---------------------------------------------------------------------------
156 
157  log_newline
158  log_info("ATMOS_PHY_MP_vars_setup",*) 'Setup'
159 
160  allocate( atmos_phy_mp_dens_t(ka,ia,ja) )
161  allocate( atmos_phy_mp_momz_t(ka,ia,ja) )
162  allocate( atmos_phy_mp_rhou_t(ka,ia,ja) )
163  allocate( atmos_phy_mp_rhov_t(ka,ia,ja) )
164  allocate( atmos_phy_mp_rhot_t(ka,ia,ja) )
165  allocate( atmos_phy_mp_rhoq_t(ka,ia,ja,qs_mp:qe_mp) )
166  allocate( atmos_phy_mp_rhoh(ka,ia,ja) )
167  allocate( atmos_phy_mp_evaporate(ka,ia,ja) )
168  ! tentative approach
169  atmos_phy_mp_dens_t(:,:,:) = 0.0_rp
170  atmos_phy_mp_momz_t(:,:,:) = 0.0_rp
171  atmos_phy_mp_rhou_t(:,:,:) = 0.0_rp
172  atmos_phy_mp_rhov_t(:,:,:) = 0.0_rp
173  atmos_phy_mp_rhot_t(:,:,:) = 0.0_rp
174  atmos_phy_mp_rhoq_t(:,:,:,:) = 0.0_rp
175  atmos_phy_mp_rhoh(:,:,:) = 0.0_rp
176  atmos_phy_mp_evaporate(:,:,:) = 0.0_rp
177 
178  allocate( atmos_phy_mp_sflx_rain(ia,ja) )
179  allocate( atmos_phy_mp_sflx_snow(ia,ja) )
180  atmos_phy_mp_sflx_rain(:,:) = undef
181  atmos_phy_mp_sflx_snow(:,:) = undef
182 
183  !--- read namelist
184  rewind(io_fid_conf)
185  read(io_fid_conf,nml=param_atmos_phy_mp_vars,iostat=ierr)
186  if( ierr < 0 ) then !--- missing
187  log_info("ATMOS_PHY_MP_vars_setup",*) 'Not found namelist. Default used.'
188  elseif( ierr > 0 ) then !--- fatal error
189  log_error("ATMOS_PHY_MP_vars_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_PHY_MP_VARS. Check!'
190  call prc_abort
191  endif
192  log_nml(param_atmos_phy_mp_vars)
193 
194  log_newline
195  log_info("ATMOS_PHY_MP_vars_setup",*) '[ATMOS_PHY_MP] prognostic/diagnostic variables'
196  log_info_cont('(1x,A,A24,A,A48,A,A12,A)') &
197  ' |', 'VARNAME ','|', &
198  'DESCRIPTION ', '[', 'UNIT ', ']'
199  do iv = 1, vmax
200  log_info_cont('(1x,A,I3,A,A24,A,A48,A,A12,A)') &
201  'NO.',iv,'|',var_name(iv),'|',var_desc(iv),'[',var_unit(iv),']'
202  enddo
203 
204  log_newline
205  if ( atmos_phy_mp_restart_in_basename /= '' ) then
206  log_info("ATMOS_PHY_MP_vars_setup",*) 'Restart input? : YES, file = ', trim(atmos_phy_mp_restart_in_basename)
207  log_info("ATMOS_PHY_MP_vars_setup",*) 'Add timelabel? : ', atmos_phy_mp_restart_in_postfix_timelabel
208  else
209  log_info("ATMOS_PHY_MP_vars_setup",*) 'Restart input? : NO'
210  endif
212  .AND. atmos_phy_mp_restart_out_basename /= '' ) then
213  log_info("ATMOS_PHY_MP_vars_setup",*) 'Restart output? : YES, file = ', trim(atmos_phy_mp_restart_out_basename)
214  log_info("ATMOS_PHY_MP_vars_setup",*) 'Add timelabel? : ', atmos_phy_mp_restart_out_postfix_timelabel
215  else
216  log_info("ATMOS_PHY_MP_vars_setup",*) 'Restart output? : NO'
218  endif
219 
220 
221  ! diagnostices
222  allocate( atmos_phy_mp_cldfrac(ka,ia,ja) )
223  allocate( atmos_phy_mp_re(ka,ia,ja,n_hyd) )
224  allocate( atmos_phy_mp_qe(ka,ia,ja,n_hyd) )
225  allocate( atmos_phy_mp_ne(ka,ia,ja,n_hyd) )
226 !OCL XFILL
227  atmos_phy_mp_cldfrac(:,:,:) = undef
228 !OCL XFILL
229  atmos_phy_mp_re(:,:,:,:) = undef
230 !OCL XFILL
231  atmos_phy_mp_qe(:,:,:,:) = undef
232  atmos_phy_mp_ne(:,:,:,:) = undef
233  diag_cldfrac = .false.
234  diag_re = .false.
235  diag_qe = .false.
236  diag_ne = .false.
237 
238  ! history
239  allocate( hist_re_id(n_hyd) )
240  allocate( hist_qe_id(n_hyd) )
241  allocate( hist_ne_id(n_hyd) )
242 
243  call file_history_reg( 'CLDFRAC', 'cloud fraction', '1', hist_cldfrac_id, fill_halo=.true., dim_type='ZXY' )
244 
245  hist_re = .false.
246  do ih = 1, n_hyd
247  call file_history_reg( 'Re_'//trim(hyd_name(ih)), 'effective radius of '//trim(hyd_desc(ih)), 'cm', hist_re_id(ih), fill_halo=.true., dim_type='ZXY' )
248  if( hist_re_id(ih) > 0 ) hist_re = .true.
249  enddo
250 
251  hist_qe = .false.
252  do ih = 1, n_hyd
253  call file_history_reg( trim(hyd_name(ih))//'_hyd', 'mass ratio of '//trim(hyd_desc(ih)), 'kg/kg', hist_qe_id(ih), fill_halo=.true., dim_type='ZXY' )
254  if( hist_qe_id(ih) > 0 ) hist_qe = .true.
255  enddo
256 
257  hist_ne = .false.
258  do ih = 1, n_hyd
259  call file_history_reg( trim(num_name(ih))//'_hyd', 'number concentration of '//trim(hyd_desc(ih)), '1/m3', hist_ne_id(ih), fill_halo=.true., dim_type='ZXY' )
260  if( hist_ne_id(ih) > 0 ) hist_ne = .true.
261  enddo
262 
263  return
264  end subroutine atmos_phy_mp_vars_setup
265 
266  !-----------------------------------------------------------------------------
268  subroutine atmos_phy_mp_vars_fillhalo
269  use scale_comm_cartesc, only: &
270  comm_vars8, &
271  comm_wait
272  implicit none
273  !---------------------------------------------------------------------------
274 
275  call comm_vars8( atmos_phy_mp_sflx_rain(:,:), 1 )
276  call comm_vars8( atmos_phy_mp_sflx_snow(:,:), 2 )
277  call comm_wait ( atmos_phy_mp_sflx_rain(:,:), 1 )
278  call comm_wait ( atmos_phy_mp_sflx_snow(:,:), 2 )
279 
280  return
281  end subroutine atmos_phy_mp_vars_fillhalo
282 
283  !-----------------------------------------------------------------------------
286  use scale_time, only: &
288  use scale_file_cartesc, only: &
290  implicit none
291 
292  character(len=19) :: timelabel
293  character(len=H_LONG) :: basename
294  !---------------------------------------------------------------------------
295 
296  log_newline
297  log_info("ATMOS_PHY_MP_vars_restart_open",*) 'Open restart file (ATMOS_PHY_MP) '
298 
299  if ( atmos_phy_mp_restart_in_basename /= '' ) then
300 
302  call time_gettimelabel( timelabel )
303  basename = trim(atmos_phy_mp_restart_in_basename)//'_'//trim(timelabel)
304  else
305  basename = trim(atmos_phy_mp_restart_in_basename)
306  endif
307 
308  log_info("ATMOS_PHY_MP_vars_restart_open",*) 'basename: ', trim(basename)
309 
310  call file_cartesc_open( basename, restart_fid, aggregate=atmos_phy_mp_restart_in_aggregate )
311  else
312  log_info("ATMOS_PHY_MP_vars_restart_open",*) 'restart file for ATMOS_PHY_MP is not specified.'
313  endif
314 
315  return
316  end subroutine atmos_phy_mp_vars_restart_open
317 
318  !-----------------------------------------------------------------------------
321  use scale_statistics, only: &
323  statistics_total
324  use scale_atmos_grid_cartesc_real, only: &
327  use scale_file, only: &
329  use scale_file_cartesc, only: &
330  file_cartesc_read, &
332  implicit none
333 
334  !---------------------------------------------------------------------------
335 
336  if ( restart_fid /= -1 ) then
337  log_newline
338  log_info("ATMOS_PHY_MP_vars_restart_read",*) 'Read from restart file (ATMOS_PHY_MP) '
339 
340  call file_cartesc_read( restart_fid, var_name(1), 'XY', & ! [IN]
341  atmos_phy_mp_sflx_rain(:,:) ) ! [OUT]
342 
343  call file_cartesc_read( restart_fid, var_name(2), 'XY', & ! [IN]
344  atmos_phy_mp_sflx_snow(:,:) ) ! [OUT]
345 
346  if ( file_get_aggregate(restart_fid) ) then
347  call file_cartesc_flush( restart_fid ) ! X/Y halos have been read from file
348  else
350  end if
351 
352  if ( statistics_checktotal ) then
353  call statistics_total( ia, is, ie, ja, js, je, &
354  atmos_phy_mp_sflx_rain(:,:), var_name(1), & ! (in)
355  atmos_grid_cartesc_real_area(:,:), & ! (in)
357  call statistics_total( ia, is, ie, ja, js, je, &
358  atmos_phy_mp_sflx_snow(:,:), var_name(2), & ! (in)
359  atmos_grid_cartesc_real_area(:,:), & ! (in)
361  endif
362  else
363  log_info("ATMOS_PHY_MP_vars_restart_read",*) 'invalid restart file ID for ATMOS_PHY_MP.'
364  endif
365 
366  return
367  end subroutine atmos_phy_mp_vars_restart_read
368 
369  !-----------------------------------------------------------------------------
372  use scale_time, only: &
374  use scale_file_cartesc, only: &
376  implicit none
377 
378  character(len=19) :: timelabel
379  character(len=H_LONG) :: basename
380  !---------------------------------------------------------------------------
381 
382  if ( atmos_phy_mp_restart_out_basename /= '' ) then
383 
384  log_newline
385  log_info("ATMOS_PHY_MP_vars_restart_create",*) 'Create restart file (ATMOS_PHY_AE) '
386 
388  call time_gettimelabel( timelabel )
389  basename = trim(atmos_phy_mp_restart_out_basename)//'_'//trim(timelabel)
390  else
391  basename = trim(atmos_phy_mp_restart_out_basename)
392  endif
393 
394  log_info("ATMOS_PHY_MP_vars_restart_create",*) 'basename: ', trim(basename)
395 
396  call file_cartesc_create( &
398  restart_fid, & ! [OUT]
399  aggregate=atmos_phy_mp_restart_out_aggregate ) ! [IN]
400 
401  endif
402 
403  return
404  end subroutine atmos_phy_mp_vars_restart_create
405 
406  !-----------------------------------------------------------------------------
409  use scale_file_cartesc, only: &
411  implicit none
412 
413  if ( restart_fid /= -1 ) then
414  call file_cartesc_enddef( restart_fid ) ! [IN]
415  endif
416 
417  return
418  end subroutine atmos_phy_mp_vars_restart_enddef
419 
420  !-----------------------------------------------------------------------------
423  use scale_file_cartesc, only: &
425  implicit none
426  !---------------------------------------------------------------------------
427 
428  if ( restart_fid /= -1 ) then
429  log_newline
430  log_info("ATMOS_PHY_MP_vars_restart_close",*) 'Close restart file (ATMOS_PHY_MP) '
431 
432  call file_cartesc_close( restart_fid ) ! [IN]
433 
434  restart_fid = -1
435  endif
436 
437  return
438  end subroutine atmos_phy_mp_vars_restart_close
439 
440  !-----------------------------------------------------------------------------
443  use scale_file_cartesc, only: &
445  implicit none
446  !---------------------------------------------------------------------------
447 
448  if ( restart_fid /= -1 ) then
449 
450  call file_cartesc_def_var( restart_fid, var_name(1), var_desc(1), var_unit(1), 'XY', atmos_phy_mp_restart_out_dtype, &
451  var_id(1) )
452  call file_cartesc_def_var( restart_fid, var_name(2), var_desc(2), var_unit(2), 'XY', atmos_phy_mp_restart_out_dtype, &
453  var_id(2) )
454  endif
455 
456  return
457  end subroutine atmos_phy_mp_vars_restart_def_var
458 
459  !-----------------------------------------------------------------------------
462  use scale_statistics, only: &
464  statistics_total
465  use scale_atmos_grid_cartesc_real, only: &
468  use scale_file_cartesc, only: &
469  file_cartesc_write_var
470  implicit none
471  !---------------------------------------------------------------------------
472 
473  if ( restart_fid /= -1 ) then
474 
476 
477  if ( statistics_checktotal ) then
478  call statistics_total( ia, is, ie, ja, js, je, &
479  atmos_phy_mp_sflx_rain(:,:), var_name(1), & ! (in)
480  atmos_grid_cartesc_real_area(:,:), & ! (in)
482  call statistics_total( ia, is, ie, ja, js, je, &
483  atmos_phy_mp_sflx_snow(:,:), var_name(2), & ! (in)
484  atmos_grid_cartesc_real_area(:,:), & ! (in)
486  endif
487 
488  call file_cartesc_write_var( restart_fid, var_id(1), atmos_phy_mp_sflx_rain(:,:), &
489  var_name(1), 'XY' ) ! [IN]
490  call file_cartesc_write_var( restart_fid, var_id(2), atmos_phy_mp_sflx_snow(:,:), &
491  var_name(2), 'XY' ) ! [IN]
492 
493  endif
494 
495  return
496  end subroutine atmos_phy_mp_vars_restart_write
497 
498  !-----------------------------------------------------------------------------
499  subroutine atmos_phy_mp_vars_history( &
500  DENS, TEMP, QTRC )
502  n_hyd
503  use scale_file_history, only: &
504  file_history_query, &
505  file_history_put
506  use mod_atmos_admin, only: &
508  implicit none
509 
510  real(RP), intent(in) :: DENS(ka,ia,ja)
511  real(RP), intent(in) :: TEMP(ka,ia,ja)
512  real(RP), intent(in) :: QTRC(ka,ia,ja,qa)
513 
514  real(RP) :: WORK (ka,ia,ja,n_hyd)
515  logical :: do_put
516  integer :: ih
517  !---------------------------------------------------------------------------
518 
519  if ( hist_cldfrac_id > 0 ) then
520  call file_history_query( hist_cldfrac_id, do_put )
521 
522  if ( do_put ) then
524  dens(:,:,:), temp(:,:,:), qtrc(:,:,:,:), & ! [IN]
525  cldfrac=work(:,:,:,1) ) ! [OUT]
526  call file_history_put( hist_cldfrac_id, work(:,:,:,1) )
527  end if
528  end if
529 
530  if ( hist_re ) then
531  do ih = 1, n_hyd
532  if ( hist_re_id(ih) > 0 ) then
533  call file_history_query( hist_re_id(ih), do_put )
534  if ( do_put ) then
536  dens(:,:,:), temp(:,:,:), qtrc(:,:,:,:), & ! [IN]
537  re=work(:,:,:,:) ) ! [OUT]
538  exit
539  end if
540  end if
541  end do
542  if ( do_put ) then
543  do ih = 1, n_hyd
544  if ( hist_re_id(ih) > 0 ) then
545  call file_history_query( hist_re_id(ih), do_put )
546  if ( do_put ) call file_history_put( hist_re_id(ih), work(:,:,:,ih) )
547  end if
548  end do
549  end if
550  end if
551 
552  if ( hist_qe ) then
553  do ih = 1, n_hyd
554  if ( hist_qe_id(ih) > 0 ) then
555  call file_history_query( hist_qe_id(ih), do_put )
556  if ( do_put ) then
558  dens(:,:,:), temp(:,:,:), qtrc(:,:,:,:), & ! [IN]
559  qe=work(:,:,:,:) ) ! [OUT]
560  exit
561  end if
562  end if
563  end do
564  if ( do_put ) then
565  do ih = 1, n_hyd
566  if ( hist_qe_id(ih) > 0 ) then
567  call file_history_query( hist_qe_id(ih), do_put )
568  if( do_put ) call file_history_put( hist_qe_id(ih), work(:,:,:,ih) )
569  end if
570  end do
571  end if
572  end if
573 
574  if ( hist_ne ) then
575  do ih = 1, n_hyd
576  if ( hist_ne_id(ih) > 0 ) then
577  call file_history_query( hist_ne_id(ih), do_put )
578  if ( do_put ) then
580  dens(:,:,:), temp(:,:,:), qtrc(:,:,:,:), & ! [IN]
581  ne=work(:,:,:,:) ) ! [OUT]
582  exit
583  end if
584  end if
585  end do
586  if ( do_put ) then
587  do ih = 1, n_hyd
588  if ( hist_ne_id(ih) > 0 ) then
589  call file_history_query( hist_ne_id(ih), do_put )
590  if( do_put ) call file_history_put( hist_ne_id(ih), work(:,:,:,ih) )
591  end if
592  end do
593  end if
594  end if
595 
596  return
597  end subroutine atmos_phy_mp_vars_history
598 
600  DENS, TEMP, QTRC, &
601  CLDFRAC, Re, Qe, Ne )
603  n_hyd, &
604  i_hc, &
605  i_hr, &
606  i_hi, &
607  i_hs, &
608  i_hg, &
609  i_hh
610  use scale_atmos_phy_mp_kessler, only: &
614  use scale_atmos_phy_mp_tomita08, only: &
618  use scale_atmos_phy_mp_sn14, only: &
623  use scale_atmos_phy_mp_suzuki10, only: &
628  use mod_atmos_admin, only: &
630  implicit none
631 
632  real(RP), intent(in) :: DENS(ka,ia,ja)
633  real(RP), intent(in) :: TEMP(ka,ia,ja)
634  real(RP), intent(in) :: QTRC(ka,ia,ja,qa)
635  real(RP), intent(out), optional :: CLDFRAC(ka,ia,ja)
636  real(RP), intent(out), optional :: Re (ka,ia,ja,n_hyd)
637  real(RP), intent(out), optional :: Qe (ka,ia,ja,n_hyd)
638  real(RP), intent(out), optional :: Ne (ka,ia,ja,n_hyd)
639 
640  integer :: k, i, j, ih
641 
642  if ( present(cldfrac) ) then
643  if ( .not. diag_cldfrac ) then
644  select case ( atmos_phy_mp_type )
645  case ( 'KESSLER' )
647  ka, ks, ke, ia, is, ie, ja, js, je, &
648  qtrc(:,:,:,qs_mp+1:qe_mp), atmos_phy_mp_cldfrac_thleshold, & ! [IN]
649  atmos_phy_mp_cldfrac(:,:,:) ) ! [OUT]
650  case ( 'TOMITA08' )
652  ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
653  qtrc(:,:,:,qs_mp+1:qe_mp), atmos_phy_mp_cldfrac_thleshold, & ! [IN]
654  atmos_phy_mp_cldfrac(:,:,:) ) ! [OUT]
655  case ( 'SN14' )
657  ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
658  qtrc(:,:,:,qs_mp+1:qe_mp), atmos_phy_mp_cldfrac_thleshold, & ! [IN]
659  atmos_phy_mp_cldfrac(:,:,:) ) ! [OUT]
660  case ( 'SUZUKI10' )
662  ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
663  qtrc(:,:,:,qs_mp+1:qe_mp), atmos_phy_mp_cldfrac_thleshold, & ! [IN]
664  atmos_phy_mp_cldfrac(:,:,:) ) ! [OUT]
665  case default
666 !OCL XFILL
667  atmos_phy_mp_cldfrac(:,:,:) = 0.0_rp
668  end select
669  diag_cldfrac = .true.
670  end if
671 !OCL XFILL
672  do j = jsb, jeb
673  do i = isb, ieb
674  do k = ks, ke
675  cldfrac(k,i,j) = atmos_phy_mp_cldfrac(k,i,j)
676  end do
677  end do
678  end do
679  end if
680 
681  if ( present(re) ) then
682  if ( .not. diag_re ) then
683  select case ( atmos_phy_mp_type )
684  case ( 'KESSLER' )
686  ka, ks, ke, ia, is, ie, ja, js, je, &
687  dens(:,:,:), temp(:,:,:), qtrc(:,:,:,qs_mp+1:qe_mp), & ! [IN]
688  atmos_phy_mp_re(:,:,:,:) ) ! [OUT]
689  case ( 'TOMITA08' )
691  ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
692  dens(:,:,:), temp(:,:,:), qtrc(:,:,:,qs_mp+1:qe_mp), & ! [IN]
693  atmos_phy_mp_re(:,:,:,:) ) ! [OUT]
694  case ( 'SN14' )
696  ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
697  dens(:,:,:), temp(:,:,:), qtrc(:,:,:,qs_mp+1:qe_mp), & ! [IN]
698  atmos_phy_mp_re(:,:,:,:) ) ! [OUT]
699  case ( 'SUZUKI10' )
701  ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
702  dens(:,:,:), temp(:,:,:), qtrc(:,:,:,qs_mp+1:qe_mp), & ! [IN]
703  atmos_phy_mp_re(:,:,:,:) ) ! [OUT]
704  case default
705 !OCL XFILL
706  atmos_phy_mp_re(:,:,:,:) = 0.0_rp
707  end select
708  diag_re = .true.
709  end if
710 !OCL XFILL
711  do ih = 1, n_hyd
712  do j = jsb, jeb
713  do i = isb, ieb
714  do k = ks, ke
715  re(k,i,j,ih) = atmos_phy_mp_re(k,i,j,ih)
716  end do
717  end do
718  end do
719  end do
720  end if
721 
722  if ( present(qe) ) then
723  if ( .not. diag_qe ) then
724  select case ( atmos_phy_mp_type )
725  case ( 'KESSLER' )
727  ka, ks, ke, ia, is, ie, ja, js, je, &
728  qtrc(:,:,:,qs_mp+1:qe_mp), & ! [IN]
729  atmos_phy_mp_qe(:,:,:,:) ) ! [OUT]
730  case ( 'TOMITA08' )
732  ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
733  qtrc(:,:,:,qs_mp+1:qe_mp), & ! [IN]
734  atmos_phy_mp_qe(:,:,:,:) ) ! [OUT]
735  case ( 'SN14' )
737  ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
738  qtrc(:,:,:,qs_mp+1:qe_mp), & ! [IN]
739  atmos_phy_mp_qe(:,:,:,:) ) ! [OUT]
740  case ( 'SUZUKI10' )
742  ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
743  qtrc(:,:,:,qs_mp+1:qe_mp), & ! [IN]
744  atmos_phy_mp_qe(:,:,:,:) ) ! [OUT]
745  case default
746 !OCL XFILL
747  atmos_phy_mp_qe(:,:,:,:) = 0.0_rp
748  end select
749  diag_qe = .true.
750  end if
751 !OCL XFILL
752  do ih = 1, n_hyd
753  do j = jsb, jeb
754  do i = isb, ieb
755  do k = ks, ke
756  qe(k,i,j,ih) = atmos_phy_mp_qe(k,i,j,ih)
757  end do
758  end do
759  end do
760  end do
761  end if
762 
763  if ( present(ne) ) then
764  if ( .not. diag_ne ) then
765  select case ( atmos_phy_mp_type )
766  case ( 'KESSLER', 'TOMITA08' )
767  ! do nothing
768  case ( 'SN14' )
770  ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
771  qtrc(:,:,:,qs_mp+1:qe_mp), & ! [IN]
772  atmos_phy_mp_ne(:,:,:,:) ) ! [OUT]
773  case ( 'SUZUKI10' )
775  ka, ks, ke, ia, isb, ieb, ja, jsb, jeb, &
776  dens(:,:,:), qtrc(:,:,:,qs_mp+1:qe_mp), & ! [IN]
777  atmos_phy_mp_ne(:,:,:,:) ) ! [OUT]
778  end select
779  diag_ne = .true.
780  end if
781 !OCL XFILL
782  do ih = 1, n_hyd
783  do j = jsb, jeb
784  do i = isb, ieb
785  do k = ks, ke
786  ne(k,i,j,ih) = atmos_phy_mp_ne(k,i,j,ih)
787  end do
788  end do
789  end do
790  end do
791  end if
792 
793  return
794  end subroutine atmos_phy_mp_vars_get_diagnostic
795 
797  diag_cldfrac = .false.
798  diag_re = .false.
799  diag_qe = .false.
800  diag_ne = .false.
801 
802  return
804 
805 end module mod_atmos_phy_mp_vars
module ATMOS admin
subroutine, public atmos_phy_mp_kessler_effective_radius(KA, KS, KE, IA, IS, IE, JA, JS, JE, DENS0, TEMP0, QTRC0, Re)
Calculate Effective Radius.
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_mp_rhoq_t
character(len=h_short), dimension(n_hyd), parameter, public hyd_name
module ATMOSPHERE / Physics Cloud Microphysics
logical, public atmos_phy_mp_restart_in_aggregate
Switch to use aggregate file.
subroutine, public atmos_phy_mp_vars_get_diagnostic(DENS, TEMP, QTRC, CLDFRAC, Re, Qe, Ne)
subroutine, public atmos_phy_mp_vars_restart_enddef
Exit netCDF define mode.
integer, public ia
of whole cells: x, local, with HALO
module Atmosphere / Physics Cloud Microphysics
integer, parameter, public i_hs
snow
character(len=h_long), public atmos_phy_mp_restart_in_basename
Basename of the input file.
subroutine, public atmos_phy_mp_sn14_cloud_fraction(KA, KS, KE, IA, IS, IE, JA, JS, JE, QTRC, mask_criterion, cldfrac)
ATMOS_PHY_MP_sn14_cloud_fraction Calculate Cloud Fraction.
integer, parameter, public i_hr
liquid water rain
integer, parameter, public i_hi
ice water cloud
subroutine, public atmos_phy_mp_suzuki10_qtrc2qhyd(KA, KS, KE, IA, IS, IE, JA, JS, JE, QTRC0, Qe)
Calculate mass ratio of each category.
logical, public atmos_phy_mp_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
subroutine, public atmos_phy_mp_vars_restart_def_var
Define variables in restart file.
integer, public qa
integer, public ja
of whole cells: y, local, with HALO
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
subroutine, public file_history_reg(name, desc, unit, itemid, standard_name, ndims, dim_type, cell_measures, fill_halo)
Register/Append variable to history file.
integer, parameter, public i_hh
hail
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_momz_t
logical, public statistics_checktotal
calc&report variable totals to logfile?
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_rain
subroutine, public atmos_phy_mp_sn14_qtrc2nhyd(KA, KS, KE, IA, IS, IE, JA, JS, JE, QTRC0, Ne)
Calculate number concentration of each category.
subroutine, public atmos_phy_mp_tomita08_effective_radius(KA, KS, KE, IA, IS, IE, JA, JS, JE, DENS0, TEMP0, QTRC0, Re)
Calculate Effective Radius.
real(rp), public const_undef
Definition: scale_const.F90:41
subroutine, public atmos_phy_mp_sn14_qtrc2qhyd(KA, KS, KE, IA, IS, IE, JA, JS, JE, QTRC0, Qe)
ATMOS_PHY_MP_sn14_qtrc2qhyd Calculate mass ratio of each category.
module COMMUNICATION
subroutine, public atmos_phy_mp_tomita08_qtrc2qhyd(KA, KS, KE, IA, IS, IE, JA, JS, JE, QTRC, Qe)
Calculate mass ratio of each category.
integer, public is
start point of inner domain: x, local
module file
Definition: scale_file.F90:15
character(len=h_mid), public atmos_phy_mp_restart_out_title
title of the output file
integer, public ie
end point of inner domain: x, local
subroutine, public file_cartesc_create(basename, title, datatype, fid, date, subsec, haszcoord, append, aggregate, single)
Create/open a netCDF file.
module TRACER
subroutine, public atmos_phy_mp_suzuki10_effective_radius(KA, KS, KE, IA, IS, IE, JA, JS, JE, DENS0, TEMP0, QTRC0, Re)
Calculate Effective Radius.
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_rhot_t
module atmosphere / hydrometeor
module atmosphere / physics / microphysics / Kessler
subroutine, public time_gettimelabel(timelabel)
generate time label
Definition: scale_time.F90:94
character(len=h_long), public atmos_phy_mp_restart_out_basename
Basename of the output file.
module atmosphere / grid / cartesC index
integer, public ke
end point of inner domain: z, local
subroutine, public atmos_phy_mp_vars_reset_diagnostics
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_dens_t
module PROCESS
Definition: scale_prc.F90:11
subroutine, public atmos_phy_mp_vars_restart_create
Create restart file.
integer, public je
end point of inner domain: y, local
logical, public atmos_phy_mp_restart_out_aggregate
Switch to use aggregate file.
subroutine, public atmos_phy_mp_suzuki10_cloud_fraction(KA, KS, KE, IA, IS, IE, JA, JS, JE, QTRC0, mask_criterion, cldfrac)
Calculate Cloud Fraction.
subroutine, public file_cartesc_enddef(fid)
Exit netCDF file define mode.
module TIME
Definition: scale_time.F90:16
subroutine, public atmos_phy_mp_kessler_cloud_fraction(KA, KS, KE, IA, IS, IE, JA, JS, JE, QTRC, mask_criterion, cldfrac)
Calculate Cloud Fraction.
integer, public ks
start point of inner domain: z, local
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_rhoh
logical, public atmos_phy_mp_restart_output
output restart file?
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
subroutine, public atmos_phy_mp_vars_fillhalo
HALO Communication.
module CONSTANT
Definition: scale_const.F90:11
integer, parameter, public i_hc
liquid water cloud
integer, public js
start point of inner domain: y, local
character(len=h_short), public atmos_phy_mp_restart_out_dtype
REAL4 or REAL8.
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.
character(len=h_short), public atmos_phy_mp_type
subroutine, public atmos_phy_mp_suzuki10_qtrc2nhyd(KA, KS, KE, IA, IS, IE, JA, JS, JE, DENS, QTRC0, Ne)
Calculate number concentration of each category.
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_evaporate
subroutine, public atmos_phy_mp_vars_restart_open
Open restart file for read.
logical function, public file_get_aggregate(fid)
real(rp), public atmos_phy_mp_cldfrac_thleshold
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_snow
subroutine, public atmos_phy_mp_vars_setup
Setup.
module profiler
Definition: scale_prof.F90:11
subroutine, public atmos_phy_mp_vars_restart_write
Write restart.
subroutine, public atmos_phy_mp_vars_restart_read
Read restart.
subroutine, public atmos_phy_mp_sn14_effective_radius(KA, KS, KE, IA, IS, IE, JA, JS, JE, DENS0, TEMP0, QTRC0, Re)
ATMOS_PHY_MP_sn14_effective_radius Calculate Effective Radius.
subroutine, public atmos_phy_mp_vars_restart_close
Close restart file.
module Atmosphere GRID CartesC Real(real space)
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_area
horizontal area ( xy, normal z) [m2]
module PRECISION
module file / cartesianC
integer, public ka
of whole cells: z, local, with HALO
module Statistics
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_rhov_t
subroutine, public atmos_phy_mp_vars_history(DENS, TEMP, QTRC)
module STDIO
Definition: scale_io.F90:10
character(len=h_short), dimension(n_hyd), parameter, public num_name
subroutine, public file_cartesc_flush(fid)
Flush all pending requests to a netCDF file (PnetCDF only)
integer, parameter, public n_hyd
character(len=h_mid), dimension(n_hyd), parameter, public hyd_desc
module atmosphere / physics / microphysics / Tomita08
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_rhou_t
module Spectran Bin Microphysics
subroutine, public file_cartesc_open(basename, fid, aggregate)
open a netCDF file for read
integer, parameter, public i_hg
graupel
subroutine, public file_cartesc_close(fid)
Close a netCDF file.
logical, public atmos_phy_mp_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
subroutine, public atmos_phy_mp_tomita08_cloud_fraction(KA, KS, KE, IA, IS, IE, JA, JS, JE, QTRC, mask_criterion, cldfrac)
Calculate Cloud Fraction.
module file_history
real(rp), public atmos_grid_cartesc_real_totarea
total area (xy, local) [m2]
subroutine, public atmos_phy_mp_kessler_qtrc2qhyd(KA, KS, KE, IA, IS, IE, JA, JS, JE, QTRC, Qe)
Calculate mass ratio of each category.