86   integer,                
private, 
parameter :: vmax = 2
    87   integer,                
private, 
parameter :: i_sflx_rain = 1
    88   integer,                
private, 
parameter :: i_sflx_snow = 2
    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  
    96   data var_name / 
'SFLX_rain', &
    98   data var_desc / 
'precipitation flux (liquid)', &
    99                   'precipitation flux (solid)'   /
   100   data var_unit / 
'kg/m2/s', &
   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
   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(:)
   142     namelist / param_atmos_phy_mp_vars / &
   158     log_info(
"ATMOS_PHY_MP_vars_setup",*) 
'Setup'   185     read(
io_fid_conf,nml=param_atmos_phy_mp_vars,iostat=ierr)
   187        log_info(
"ATMOS_PHY_MP_vars_setup",*) 
'Not found namelist. Default used.'   188     elseif( ierr > 0 ) 
then    189        log_error(
"ATMOS_PHY_MP_vars_setup",*) 
'Not appropriate names in namelist PARAM_ATMOS_PHY_MP_VARS. Check!'   192     log_nml(param_atmos_phy_mp_vars)
   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        ', 
']'   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),
']'   209        log_info(
"ATMOS_PHY_MP_vars_setup",*) 
'Restart input?  : NO'   216        log_info(
"ATMOS_PHY_MP_vars_setup",*) 
'Restart output? : NO'   222     allocate( atmos_phy_mp_cldfrac(
ka,
ia,
ja) )
   227     atmos_phy_mp_cldfrac(:,:,:) = undef
   229     atmos_phy_mp_re(:,:,:,:) = undef
   231     atmos_phy_mp_qe(:,:,:,:) = undef
   232     atmos_phy_mp_ne(:,:,:,:) = undef
   233     diag_cldfrac = .false.
   239     allocate( hist_re_id(
n_hyd) )
   240     allocate( hist_qe_id(
n_hyd) )
   241     allocate( hist_ne_id(
n_hyd) )
   243     call file_history_reg( 
'CLDFRAC', 
'cloud fraction', 
'1', hist_cldfrac_id, fill_halo=.true., dim_type=
'ZXY' )
   248        if( hist_re_id(ih) > 0 ) hist_re = .true.
   254        if( hist_qe_id(ih) > 0 ) hist_qe = .true.
   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.
   292     character(len=19)     :: timelabel
   293     character(len=H_LONG) :: basename
   297     log_info(
"ATMOS_PHY_MP_vars_restart_open",*) 
'Open restart file (ATMOS_PHY_MP) '   308        log_info(
"ATMOS_PHY_MP_vars_restart_open",*) 
'basename: ', trim(basename)
   312        log_info(
"ATMOS_PHY_MP_vars_restart_open",*) 
'restart file for ATMOS_PHY_MP is not specified.'   336     if ( restart_fid /= -1 ) 
then   338        log_info(
"ATMOS_PHY_MP_vars_restart_read",*) 
'Read from restart file (ATMOS_PHY_MP) '   340        call file_cartesc_read( restart_fid, var_name(1), 
'XY', & 
   343        call file_cartesc_read( restart_fid, var_name(2), 
'XY', & 
   363        log_info(
"ATMOS_PHY_MP_vars_restart_read",*) 
'invalid restart file ID for ATMOS_PHY_MP.'   378     character(len=19)     :: timelabel
   379     character(len=H_LONG) :: basename
   385        log_info(
"ATMOS_PHY_MP_vars_restart_create",*) 
'Create restart file (ATMOS_PHY_AE) '   394        log_info(
"ATMOS_PHY_MP_vars_restart_create",*) 
'basename: ', trim(basename)
   413     if ( restart_fid /= -1 ) 
then   428     if ( restart_fid /= -1 ) 
then   430        log_info(
"ATMOS_PHY_MP_vars_restart_close",*) 
'Close restart file (ATMOS_PHY_MP) '   448     if ( restart_fid /= -1 ) 
then   469        file_cartesc_write_var
   473     if ( restart_fid /= -1 ) 
then   504        file_history_query, &
   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)
   519     if ( hist_cldfrac_id > 0 ) 
then   520        call file_history_query( hist_cldfrac_id, do_put )
   524                dens(:,:,:), temp(:,:,:), qtrc(:,:,:,:), & 
   525                cldfrac=work(:,:,:,1)                    ) 
   526           call file_history_put( hist_cldfrac_id, work(:,:,:,1) )
   532           if ( hist_re_id(ih) > 0 ) 
then   533              call file_history_query( hist_re_id(ih), do_put )
   536                      dens(:,:,:), temp(:,:,:), qtrc(:,:,:,:), & 
   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) )
   554           if ( hist_qe_id(ih) > 0 ) 
then   555              call file_history_query( hist_qe_id(ih), do_put )
   558                      dens(:,:,:), temp(:,:,:), qtrc(:,:,:,:), & 
   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) )
   576           if ( hist_ne_id(ih) > 0 ) 
then   577              call file_history_query( hist_ne_id(ih), do_put )
   580                      dens(:,:,:), temp(:,:,:), qtrc(:,:,:,:), & 
   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) )
   601        CLDFRAC, Re, Qe, Ne )
   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)
   640     integer :: k, i, j, ih
   642     if ( 
present(cldfrac) ) 
then   643        if ( .not. diag_cldfrac ) 
then   649                   atmos_phy_mp_cldfrac(:,:,:)                                ) 
   654                   atmos_phy_mp_cldfrac(:,:,:)                                ) 
   659                   atmos_phy_mp_cldfrac(:,:,:)                                ) 
   664                   atmos_phy_mp_cldfrac(:,:,:)                                ) 
   667              atmos_phy_mp_cldfrac(:,:,:) = 0.0_rp
   669           diag_cldfrac = .true.
   675           cldfrac(k,i,j) = atmos_phy_mp_cldfrac(k,i,j)
   681     if ( 
present(re) ) 
then   682        if ( .not. diag_re ) 
then   687                   dens(:,:,:), temp(:,:,:), qtrc(:,:,:,
qs_mp+1:
qe_mp), & 
   688                   atmos_phy_mp_re(:,:,:,:)                             ) 
   692                   dens(:,:,:), temp(:,:,:), qtrc(:,:,:,
qs_mp+1:
qe_mp), & 
   693                   atmos_phy_mp_re(:,:,:,:)                             ) 
   697                   dens(:,:,:), temp(:,:,:), qtrc(:,:,:,
qs_mp+1:
qe_mp), & 
   698                   atmos_phy_mp_re(:,:,:,:)                             ) 
   702                   dens(:,:,:), temp(:,:,:), qtrc(:,:,:,
qs_mp+1:
qe_mp), & 
   703                   atmos_phy_mp_re(:,:,:,:)                             ) 
   706              atmos_phy_mp_re(:,:,:,:) = 0.0_rp
   715           re(k,i,j,ih) = atmos_phy_mp_re(k,i,j,ih)
   722     if ( 
present(qe) ) 
then   723        if ( .not. diag_qe ) 
then   729                   atmos_phy_mp_qe(:,:,:,:)   ) 
   734                   atmos_phy_mp_qe(:,:,:,:)   ) 
   739                   atmos_phy_mp_qe(:,:,:,:)   ) 
   744                   atmos_phy_mp_qe(:,:,:,:)   ) 
   747              atmos_phy_mp_qe(:,:,:,:) = 0.0_rp
   756           qe(k,i,j,ih) = atmos_phy_mp_qe(k,i,j,ih)
   763     if ( 
present(ne) ) 
then   764        if ( .not. diag_ne ) 
then   766           case ( 
'KESSLER', 
'TOMITA08' )
   772                   atmos_phy_mp_ne(:,:,:,:)   ) 
   777                   atmos_phy_mp_ne(:,:,:,:)                ) 
   786           ne(k,i,j,ih) = atmos_phy_mp_ne(k,i,j,ih)
   797     diag_cldfrac = .false.
 
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 ja
of whole cells: y, local, with HALO
integer, public io_fid_conf
Config file ID. 
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
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. 
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 
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. 
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 
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
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. 
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. 
subroutine, public atmos_phy_mp_vars_fillhalo
HALO Communication. 
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. 
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] 
integer, public ka
of whole cells: z, local, with HALO
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_rhov_t
subroutine, public atmos_phy_mp_vars_history(DENS, TEMP, QTRC)
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. 
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.