SCALE-RM
Functions/Subroutines | Variables
mod_atmos_phy_mp_vars Module Reference

module Atmosphere / Physics Cloud Microphysics More...

Functions/Subroutines

subroutine, public atmos_phy_mp_vars_setup
 Setup. More...
 
subroutine, public atmos_phy_mp_vars_fillhalo
 HALO Communication. More...
 
subroutine, public atmos_phy_mp_vars_restart_read
 Read restart. More...
 
subroutine, public atmos_phy_mp_vars_restart_write
 Write restart. More...
 

Variables

logical, public atmos_phy_mp_restart_output = .false.
 output restart file? More...
 
character(len=h_long), public atmos_phy_mp_restart_in_basename = ''
 basename of the restart file More...
 
character(len=h_long), public atmos_phy_mp_restart_out_basename = ''
 basename of the output file More...
 
character(len=h_mid), public atmos_phy_mp_restart_out_title = 'ATMOS_PHY_MP restart'
 title of the output file More...
 
character(len=h_mid), public atmos_phy_mp_restart_out_dtype = 'DEFAULT'
 REAL4 or REAL8. More...
 
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_dens_t
 
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_momz_t
 
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_momx_t
 
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_momy_t
 
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_rhot_t
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_mp_rhoq_t
 
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_evaporate
 
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_rain
 
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_snow
 

Detailed Description

module Atmosphere / Physics Cloud Microphysics

Description
Container for mod_atmos_phy_mp
Author
Team SCALE
History
  • 2014-05-04 (H.Yashiro) [new]
  • 2015-09-08 (Y.Sato) [add] Add ATMOS_PHY_MP_EVAPORATE
NAMELIST
  • PARAM_ATMOS_PHY_MP_VARS
    nametypedefault valuecomment
    ATMOS_PHY_MP_RESTART_IN_BASENAME character(len=H_LONG) '' basename of the restart file
    ATMOS_PHY_MP_RESTART_OUTPUT logical .false. output restart file?
    ATMOS_PHY_MP_RESTART_OUT_BASENAME character(len=H_LONG) '' basename of the output file
    ATMOS_PHY_MP_RESTART_OUT_TITLE character(len=H_MID) 'ATMOS_PHY_MP restart' title of the output file
    ATMOS_PHY_MP_RESTART_OUT_DTYPE character(len=H_MID) 'DEFAULT' REAL4 or REAL8

History Output
No history output

Function/Subroutine Documentation

◆ atmos_phy_mp_vars_setup()

subroutine, public mod_atmos_phy_mp_vars::atmos_phy_mp_vars_setup ( )

Setup.

Definition at line 87 of file mod_atmos_phy_mp_vars.f90.

References atmos_phy_mp_dens_t, atmos_phy_mp_evaporate, atmos_phy_mp_momx_t, atmos_phy_mp_momy_t, atmos_phy_mp_momz_t, atmos_phy_mp_restart_in_basename, atmos_phy_mp_restart_out_basename, atmos_phy_mp_restart_out_dtype, atmos_phy_mp_restart_out_title, atmos_phy_mp_restart_output, atmos_phy_mp_rhoq_t, atmos_phy_mp_rhot_t, atmos_phy_mp_sflx_rain, atmos_phy_mp_sflx_snow, scale_const::const_undef, scale_grid_index::ia, scale_stdio::io_fid_conf, scale_stdio::io_fid_log, scale_stdio::io_l, scale_stdio::io_lnml, scale_grid_index::ja, scale_grid_index::ka, scale_process::prc_mpistop(), and scale_tracer::qa.

Referenced by mod_atmos_vars::atmos_vars_setup().

87  use scale_process, only: &
89  use scale_const, only: &
90  undef => const_undef
91  implicit none
92 
93  namelist / param_atmos_phy_mp_vars / &
94  atmos_phy_mp_restart_in_basename, &
95  atmos_phy_mp_restart_output, &
96  atmos_phy_mp_restart_out_basename, &
97  atmos_phy_mp_restart_out_title, &
98  atmos_phy_mp_restart_out_dtype
99 
100  integer :: ierr
101  integer :: iv
102  !---------------------------------------------------------------------------
103 
104  if( io_l ) write(io_fid_log,*)
105  if( io_l ) write(io_fid_log,*) '++++++ Module[VARS] / Categ[ATMOS PHY_MP] / Origin[SCALE-RM]'
106 
107  allocate( atmos_phy_mp_dens_t(ka,ia,ja) )
108  allocate( atmos_phy_mp_momz_t(ka,ia,ja) )
109  allocate( atmos_phy_mp_momx_t(ka,ia,ja) )
110  allocate( atmos_phy_mp_momy_t(ka,ia,ja) )
111  allocate( atmos_phy_mp_rhot_t(ka,ia,ja) )
112  allocate( atmos_phy_mp_rhoq_t(ka,ia,ja,qa) )
113  allocate( atmos_phy_mp_evaporate(ka,ia,ja) )
114  ! tentative approach
115  atmos_phy_mp_dens_t(:,:,:) = 0.0_rp
116  atmos_phy_mp_momz_t(:,:,:) = 0.0_rp
117  atmos_phy_mp_momx_t(:,:,:) = 0.0_rp
118  atmos_phy_mp_momy_t(:,:,:) = 0.0_rp
119  atmos_phy_mp_rhot_t(:,:,:) = 0.0_rp
120  atmos_phy_mp_rhoq_t(:,:,:,:) = 0.0_rp
121  atmos_phy_mp_evaporate(:,:,:) = 0.0_rp
122 
123  allocate( atmos_phy_mp_sflx_rain(ia,ja) )
124  allocate( atmos_phy_mp_sflx_snow(ia,ja) )
125  atmos_phy_mp_sflx_rain(:,:) = undef
126  atmos_phy_mp_sflx_snow(:,:) = undef
127 
128  !--- read namelist
129  rewind(io_fid_conf)
130  read(io_fid_conf,nml=param_atmos_phy_mp_vars,iostat=ierr)
131  if( ierr < 0 ) then !--- missing
132  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
133  elseif( ierr > 0 ) then !--- fatal error
134  write(*,*) 'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_MP_VARS. Check!'
135  call prc_mpistop
136  endif
137  if( io_lnml ) write(io_fid_log,nml=param_atmos_phy_mp_vars)
138 
139  if( io_l ) write(io_fid_log,*)
140  if( io_l ) write(io_fid_log,*) '*** [ATMOS_PHY_MP] prognostic/diagnostic variables'
141  if( io_l ) write(io_fid_log,'(1x,A,A15,A,A32,3(A))') &
142  '*** |','VARNAME ','|', 'DESCRIPTION ','[', 'UNIT ',']'
143  do iv = 1, vmax
144  if( io_l ) write(io_fid_log,'(1x,A,i3,A,A15,A,A32,3(A))') &
145  '*** NO.',iv,'|',var_name(iv),'|',var_desc(iv),'[',var_unit(iv),']'
146  enddo
147 
148  if( io_l ) write(io_fid_log,*)
149  if ( atmos_phy_mp_restart_in_basename /= '' ) then
150  if( io_l ) write(io_fid_log,*) '*** Restart input? : ', trim(atmos_phy_mp_restart_in_basename)
151  else
152  if( io_l ) write(io_fid_log,*) '*** Restart input? : NO'
153  endif
154  if ( atmos_phy_mp_restart_output &
155  .AND. atmos_phy_mp_restart_out_basename /= '' ) then
156  if( io_l ) write(io_fid_log,*) '*** Restart output? : ', trim(atmos_phy_mp_restart_out_basename)
157  else
158  if( io_l ) write(io_fid_log,*) '*** Restart output? : NO'
159  atmos_phy_mp_restart_output = .false.
160  endif
161 
162  return
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_mp_rhoq_t
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_momy_t
subroutine, public prc_mpistop
Abort MPI.
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:59
integer, public qa
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_momz_t
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_rain
real(rp), public const_undef
Definition: scale_const.F90:43
integer, public ia
of x whole cells (local, with HALO)
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_rhot_t
integer, public ka
of z whole cells (local, with HALO)
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_dens_t
module PROCESS
module CONSTANT
Definition: scale_const.F90:14
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_evaporate
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_snow
logical, public io_lnml
output log or not? (for namelist, this process)
Definition: scale_stdio.F90:60
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_momx_t
integer, public ja
of y whole cells (local, with HALO)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_mp_vars_fillhalo()

subroutine, public mod_atmos_phy_mp_vars::atmos_phy_mp_vars_fillhalo ( )

HALO Communication.

Definition at line 168 of file mod_atmos_phy_mp_vars.f90.

References atmos_phy_mp_sflx_rain, and atmos_phy_mp_sflx_snow.

Referenced by atmos_phy_mp_vars_restart_read(), and atmos_phy_mp_vars_restart_write().

168  use scale_comm, only: &
169  comm_vars8, &
170  comm_wait
171  implicit none
172  !---------------------------------------------------------------------------
173 
174  call comm_vars8( atmos_phy_mp_sflx_rain(:,:), 1 )
175  call comm_vars8( atmos_phy_mp_sflx_snow(:,:), 2 )
176  call comm_wait ( atmos_phy_mp_sflx_rain(:,:), 1 )
177  call comm_wait ( atmos_phy_mp_sflx_snow(:,:), 2 )
178 
179  return
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_rain
module COMMUNICATION
Definition: scale_comm.F90:23
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_snow
Here is the caller graph for this function:

◆ atmos_phy_mp_vars_restart_read()

subroutine, public mod_atmos_phy_mp_vars::atmos_phy_mp_vars_restart_read ( )

Read restart.

Definition at line 185 of file mod_atmos_phy_mp_vars.f90.

References atmos_phy_mp_restart_in_basename, atmos_phy_mp_sflx_rain, atmos_phy_mp_sflx_snow, atmos_phy_mp_vars_fillhalo(), scale_stdio::io_fid_log, and scale_stdio::io_l.

Referenced by mod_atmos_vars::atmos_vars_restart_read().

185  use scale_fileio, only: &
186  fileio_read
187  use scale_rm_statistics, only: &
188  stat_total
189  implicit none
190 
191  real(RP) :: total
192  !---------------------------------------------------------------------------
193 
194  if( io_l ) write(io_fid_log,*)
195  if( io_l ) write(io_fid_log,*) '*** Input restart file (ATMOS_PHY_MP) ***'
196 
197  if ( atmos_phy_mp_restart_in_basename /= '' ) then
198  if( io_l ) write(io_fid_log,*) '*** basename: ', trim(atmos_phy_mp_restart_in_basename)
199 
200  call fileio_read( atmos_phy_mp_sflx_rain(:,:), & ! [OUT]
201  atmos_phy_mp_restart_in_basename, var_name(1), 'XY', step=1 ) ! [IN]
202  call fileio_read( atmos_phy_mp_sflx_snow(:,:), & ! [OUT]
203  atmos_phy_mp_restart_in_basename, var_name(2), 'XY', step=1 ) ! [IN]
204 
205  call atmos_phy_mp_vars_fillhalo
206 
207  call stat_total( total, atmos_phy_mp_sflx_rain(:,:), var_name(1) )
208  call stat_total( total, atmos_phy_mp_sflx_snow(:,:), var_name(2) )
209  else
210  if( io_l ) write(io_fid_log,*) '*** restart file for ATMOS_PHY_MP is not specified.'
211  endif
212 
213  return
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:59
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_rain
module FILE I/O (netcdf)
module Statistics
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_snow
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_mp_vars_restart_write()

subroutine, public mod_atmos_phy_mp_vars::atmos_phy_mp_vars_restart_write ( )

Write restart.

Definition at line 219 of file mod_atmos_phy_mp_vars.f90.

References atmos_phy_mp_restart_out_basename, atmos_phy_mp_restart_out_dtype, atmos_phy_mp_restart_out_title, atmos_phy_mp_sflx_rain, atmos_phy_mp_sflx_snow, atmos_phy_mp_vars_fillhalo(), scale_stdio::io_fid_log, scale_stdio::io_l, and scale_time::time_gettimelabel().

Referenced by mod_atmos_vars::atmos_vars_restart_write().

219  use scale_time, only: &
221  use scale_fileio, only: &
222  fileio_write
223  use scale_rm_statistics, only: &
224  stat_total
225  implicit none
226 
227  character(len=20) :: timelabel
228  character(len=H_LONG) :: basename
229 
230  real(RP) :: total
231  !---------------------------------------------------------------------------
232 
233  if ( atmos_phy_mp_restart_out_basename /= '' ) then
234 
235  call time_gettimelabel( timelabel )
236  write(basename,'(A,A,A)') trim(atmos_phy_mp_restart_out_basename), '_', trim(timelabel)
237 
238  if( io_l ) write(io_fid_log,*)
239  if( io_l ) write(io_fid_log,*) '*** Output restart file (ATMOS_PHY_MP) ***'
240  if( io_l ) write(io_fid_log,*) '*** basename: ', trim(basename)
241 
242  call atmos_phy_mp_vars_fillhalo
243 
244  call stat_total( total, atmos_phy_mp_sflx_rain(:,:), var_name(1) )
245  call stat_total( total, atmos_phy_mp_sflx_snow(:,:), var_name(1) )
246 
247  call fileio_write( atmos_phy_mp_sflx_rain(:,:), basename, atmos_phy_mp_restart_out_title, & ! [IN]
248  var_name(1), var_desc(1), var_unit(1), 'XY', atmos_phy_mp_restart_out_dtype ) ! [IN]
249  call fileio_write( atmos_phy_mp_sflx_snow(:,:), basename, atmos_phy_mp_restart_out_title, & ! [IN]
250  var_name(2), var_desc(2), var_unit(2), 'XY', atmos_phy_mp_restart_out_dtype ) ! [IN]
251 
252  endif
253 
254  return
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:59
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_rain
module FILE I/O (netcdf)
module Statistics
subroutine, public time_gettimelabel(timelabel)
generate time label
Definition: scale_time.F90:90
module TIME
Definition: scale_time.F90:15
real(rp), dimension(:,:), allocatable, public atmos_phy_mp_sflx_snow
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ atmos_phy_mp_restart_output

logical, public mod_atmos_phy_mp_vars::atmos_phy_mp_restart_output = .false.

output restart file?

Definition at line 41 of file mod_atmos_phy_mp_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), and atmos_phy_mp_vars_setup().

41  logical, public :: atmos_phy_mp_restart_output = .false.

◆ atmos_phy_mp_restart_in_basename

character(len=h_long), public mod_atmos_phy_mp_vars::atmos_phy_mp_restart_in_basename = ''

basename of the restart file

Definition at line 43 of file mod_atmos_phy_mp_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_mp_vars_restart_read(), and atmos_phy_mp_vars_setup().

43  character(len=H_LONG), public :: atmos_phy_mp_restart_in_basename = ''

◆ atmos_phy_mp_restart_out_basename

character(len=h_long), public mod_atmos_phy_mp_vars::atmos_phy_mp_restart_out_basename = ''

basename of the output file

Definition at line 44 of file mod_atmos_phy_mp_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_mp_vars_restart_write(), and atmos_phy_mp_vars_setup().

44  character(len=H_LONG), public :: atmos_phy_mp_restart_out_basename = ''

◆ atmos_phy_mp_restart_out_title

character(len=h_mid), public mod_atmos_phy_mp_vars::atmos_phy_mp_restart_out_title = 'ATMOS_PHY_MP restart'

title of the output file

Definition at line 45 of file mod_atmos_phy_mp_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_mp_vars_restart_write(), and atmos_phy_mp_vars_setup().

45  character(len=H_MID), public :: atmos_phy_mp_restart_out_title = 'ATMOS_PHY_MP restart'

◆ atmos_phy_mp_restart_out_dtype

character(len=h_mid), public mod_atmos_phy_mp_vars::atmos_phy_mp_restart_out_dtype = 'DEFAULT'

REAL4 or REAL8.

Definition at line 46 of file mod_atmos_phy_mp_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_mp_vars_restart_write(), and atmos_phy_mp_vars_setup().

46  character(len=H_MID), public :: atmos_phy_mp_restart_out_dtype = 'DEFAULT'

◆ atmos_phy_mp_dens_t

real(rp), dimension(:,:,:), allocatable, public mod_atmos_phy_mp_vars::atmos_phy_mp_dens_t

Definition at line 48 of file mod_atmos_phy_mp_vars.f90.

Referenced by mod_atmos_phy_mp_driver::atmos_phy_mp_driver(), and atmos_phy_mp_vars_setup().

48  real(RP), public, allocatable :: atmos_phy_mp_dens_t(:,:,:) ! tendency DENS [kg/m3/s]
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_dens_t

◆ atmos_phy_mp_momz_t

real(rp), dimension(:,:,:), allocatable, public mod_atmos_phy_mp_vars::atmos_phy_mp_momz_t

Definition at line 49 of file mod_atmos_phy_mp_vars.f90.

Referenced by mod_atmos_phy_mp_driver::atmos_phy_mp_driver(), and atmos_phy_mp_vars_setup().

49  real(RP), public, allocatable :: atmos_phy_mp_momz_t(:,:,:) ! tendency MOMZ [kg/m2/s2]
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_momz_t

◆ atmos_phy_mp_momx_t

real(rp), dimension(:,:,:), allocatable, public mod_atmos_phy_mp_vars::atmos_phy_mp_momx_t

Definition at line 50 of file mod_atmos_phy_mp_vars.f90.

Referenced by mod_atmos_phy_mp_driver::atmos_phy_mp_driver(), and atmos_phy_mp_vars_setup().

50  real(RP), public, allocatable :: atmos_phy_mp_momx_t(:,:,:) ! tendency MOMX [kg/m2/s2]
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_momx_t

◆ atmos_phy_mp_momy_t

real(rp), dimension(:,:,:), allocatable, public mod_atmos_phy_mp_vars::atmos_phy_mp_momy_t

Definition at line 51 of file mod_atmos_phy_mp_vars.f90.

Referenced by mod_atmos_phy_mp_driver::atmos_phy_mp_driver(), and atmos_phy_mp_vars_setup().

51  real(RP), public, allocatable :: atmos_phy_mp_momy_t(:,:,:) ! tendency MOMY [kg/m2/s2]
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_momy_t

◆ atmos_phy_mp_rhot_t

real(rp), dimension(:,:,:), allocatable, public mod_atmos_phy_mp_vars::atmos_phy_mp_rhot_t

Definition at line 52 of file mod_atmos_phy_mp_vars.f90.

Referenced by mod_atmos_phy_mp_driver::atmos_phy_mp_driver(), and atmos_phy_mp_vars_setup().

52  real(RP), public, allocatable :: atmos_phy_mp_rhot_t(:,:,:) ! tendency RHOT [K*kg/m3/s]
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_rhot_t

◆ atmos_phy_mp_rhoq_t

real(rp), dimension(:,:,:,:), allocatable, public mod_atmos_phy_mp_vars::atmos_phy_mp_rhoq_t

Definition at line 53 of file mod_atmos_phy_mp_vars.f90.

Referenced by mod_atmos_phy_mp_driver::atmos_phy_mp_driver(), and atmos_phy_mp_vars_setup().

53  real(RP), public, allocatable :: atmos_phy_mp_rhoq_t(:,:,:,:) ! tendency rho*QTRC [kg/kg/s]
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_mp_rhoq_t

◆ atmos_phy_mp_evaporate

real(rp), dimension(:,:,:), allocatable, public mod_atmos_phy_mp_vars::atmos_phy_mp_evaporate

Definition at line 55 of file mod_atmos_phy_mp_vars.f90.

Referenced by mod_atmos_phy_ae_driver::atmos_phy_ae_driver(), mod_atmos_phy_mp_driver::atmos_phy_mp_driver(), and atmos_phy_mp_vars_setup().

55  real(RP), public, allocatable :: atmos_phy_mp_evaporate(:,:,:) ! number concentration of evaporated cloud [/m3]
real(rp), dimension(:,:,:), allocatable, public atmos_phy_mp_evaporate

◆ atmos_phy_mp_sflx_rain

real(rp), dimension(:,:), allocatable, public mod_atmos_phy_mp_vars::atmos_phy_mp_sflx_rain

◆ atmos_phy_mp_sflx_snow

real(rp), dimension(:,:), allocatable, public mod_atmos_phy_mp_vars::atmos_phy_mp_sflx_snow