SCALE-RM
Functions/Subroutines | Variables
mod_atmos_phy_ae_vars Module Reference

module ATMOSPHERE / Physics Aerosol Microphysics More...

Functions/Subroutines

subroutine, public atmos_phy_ae_vars_setup
 Setup. More...
 
subroutine, public atmos_phy_ae_vars_fillhalo
 HALO Communication. More...
 
subroutine, public atmos_phy_ae_vars_restart_read
 Read restart. More...
 
subroutine, public atmos_phy_ae_vars_restart_write
 Write restart. More...
 
subroutine, public atmos_phy_ae_vars_restart_create
 Create restart file. More...
 
subroutine, public atmos_phy_ae_vars_restart_enddef
 Exit netCDF define mode. More...
 
subroutine, public atmos_phy_ae_vars_restart_close
 Close restart file. More...
 
subroutine, public atmos_phy_ae_vars_restart_def_var
 Write restart. More...
 
subroutine, public atmos_phy_ae_vars_restart_write_var
 Write restart. More...
 

Variables

logical, public atmos_phy_ae_restart_output = .false.
 output restart file? More...
 
character(len=h_long), public atmos_phy_ae_restart_in_basename = ''
 basename of the restart file More...
 
character(len=h_long), public atmos_phy_ae_restart_out_basename = ''
 basename of the output file More...
 
character(len=h_mid), public atmos_phy_ae_restart_out_title = 'ATMOS_PHY_AE restart'
 title of the output file More...
 
character(len=h_mid), public atmos_phy_ae_restart_out_dtype = 'DEFAULT'
 REAL4 or REAL8. More...
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_ae_rhoq_t
 
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ae_ccn
 
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ae_ccn_t
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_ae_emit
 

Detailed Description

module ATMOSPHERE / Physics Aerosol Microphysics

Description
Container for mod_atmos_phy_ae
Author
Team SCALE
History
  • 2014-05-04 (H.Yashiro) [new]
NAMELIST
  • PARAM_ATMOS_PHY_AE_VARS
    nametypedefault valuecomment
    ATMOS_PHY_AE_RESTART_IN_BASENAME character(len=H_LONG) '' basename of the restart file
    ATMOS_PHY_AE_RESTART_OUTPUT logical .false. output restart file?
    ATMOS_PHY_AE_RESTART_OUT_BASENAME character(len=H_LONG) '' basename of the output file
    ATMOS_PHY_AE_RESTART_OUT_TITLE character(len=H_MID) 'ATMOS_PHY_AE restart' title of the output file
    ATMOS_PHY_AE_RESTART_OUT_DTYPE character(len=H_MID) 'DEFAULT' REAL4 or REAL8

History Output
No history output

Function/Subroutine Documentation

◆ atmos_phy_ae_vars_setup()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_setup ( )

Setup.

Definition at line 84 of file mod_atmos_phy_ae_vars.f90.

References atmos_phy_ae_ccn, atmos_phy_ae_ccn_t, atmos_phy_ae_emit, atmos_phy_ae_restart_in_basename, atmos_phy_ae_restart_out_basename, atmos_phy_ae_restart_out_dtype, atmos_phy_ae_restart_out_title, atmos_phy_ae_restart_output, atmos_phy_ae_rhoq_t, 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(), scale_tracer::qa, and scale_tracer::qa_ae.

Referenced by mod_atmos_vars::atmos_vars_setup().

84  use scale_process, only: &
86  use scale_const, only: &
87  undef => const_undef
88  implicit none
89 
90  namelist / param_atmos_phy_ae_vars / &
91  atmos_phy_ae_restart_in_basename, &
92  atmos_phy_ae_restart_output, &
93  atmos_phy_ae_restart_out_basename, &
94  atmos_phy_ae_restart_out_title, &
95  atmos_phy_ae_restart_out_dtype
96 
97  integer :: ierr
98  integer :: iv
99  !---------------------------------------------------------------------------
100 
101  if( io_l ) write(io_fid_log,*)
102  if( io_l ) write(io_fid_log,*) '++++++ Module[VARS] / Categ[ATMOS PHY_AE] / Origin[SCALE-RM]'
103 
104  allocate( atmos_phy_ae_rhoq_t(ka,ia,ja,qa) )
105  atmos_phy_ae_rhoq_t(:,:,:, :) = undef
106 
107  allocate( atmos_phy_ae_ccn(ka,ia,ja) )
108  atmos_phy_ae_ccn(:,:,:) = undef
109 
110  allocate( atmos_phy_ae_ccn_t(ka,ia,ja) )
111  atmos_phy_ae_ccn_t(:,:,:) = undef
112 
113  allocate( atmos_phy_ae_emit(ka,ia,ja,qa_ae) )
114  atmos_phy_ae_emit(:,:,:,:) = 0.0_rp
115 
116  !--- read namelist
117  rewind(io_fid_conf)
118  read(io_fid_conf,nml=param_atmos_phy_ae_vars,iostat=ierr)
119  if( ierr < 0 ) then !--- missing
120  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
121  elseif( ierr > 0 ) then !--- fatal error
122  write(*,*) 'xxx Not appropriate names in namelist PARAM_ATMOS_PHY_AE_VARS. Check!'
123  call prc_mpistop
124  endif
125  if( io_lnml ) write(io_fid_log,nml=param_atmos_phy_ae_vars)
126 
127  if( io_l ) write(io_fid_log,*)
128  if( io_l ) write(io_fid_log,*) '*** [ATMOS_PHY_AE] prognostic/diagnostic variables'
129  if( io_l ) write(io_fid_log,'(1x,A,A15,A,A32,3(A))') &
130  '*** |','VARNAME ','|', 'DESCRIPTION ','[', 'UNIT ',']'
131  do iv = 1, vmax
132  if( io_l ) write(io_fid_log,'(1x,A,i3,A,A15,A,A32,3(A))') &
133  '*** NO.',iv,'|',var_name(iv),'|',var_desc(iv),'[',var_unit(iv),']'
134  enddo
135 
136  if( io_l ) write(io_fid_log,*)
137  if ( atmos_phy_ae_restart_in_basename /= '' ) then
138  if( io_l ) write(io_fid_log,*) '*** Restart input? : ', trim(atmos_phy_ae_restart_in_basename)
139  else
140  if( io_l ) write(io_fid_log,*) '*** Restart input? : NO'
141  endif
142  if ( atmos_phy_ae_restart_output &
143  .AND. atmos_phy_ae_restart_out_basename /= '' ) then
144  if( io_l ) write(io_fid_log,*) '*** Restart output? : ', trim(atmos_phy_ae_restart_out_basename)
145  else
146  if( io_l ) write(io_fid_log,*) '*** Restart output? : NO'
147  atmos_phy_ae_restart_output = .false.
148  endif
149 
150  return
subroutine, public prc_mpistop
Abort MPI.
real(rp), public const_undef
Definition: scale_const.F90:43
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_ae_emit
module PROCESS
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_ae_rhoq_t
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ae_ccn
module CONSTANT
Definition: scale_const.F90:14
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ae_ccn_t
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_fillhalo()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_fillhalo ( )

HALO Communication.

Definition at line 156 of file mod_atmos_phy_ae_vars.f90.

References atmos_phy_ae_ccn, scale_grid_index::ie, scale_grid_index::is, scale_grid_index::je, scale_grid_index::js, scale_grid_index::ka, scale_grid_index::ke, and scale_grid_index::ks.

Referenced by atmos_phy_ae_vars_restart_read().

156  use scale_comm, only: &
157  comm_vars8, &
158  comm_wait
159  implicit none
160 
161  integer :: i, j
162  !---------------------------------------------------------------------------
163 
164  do j = js, je
165  do i = is, ie
166  atmos_phy_ae_ccn( 1:ks-1,i,j) = atmos_phy_ae_ccn(ks,i,j)
167  atmos_phy_ae_ccn(ke+1:ka, i,j) = atmos_phy_ae_ccn(ke,i,j)
168  enddo
169  enddo
170 
171  call comm_vars8( atmos_phy_ae_ccn(:,:,:), 1 )
172  call comm_wait ( atmos_phy_ae_ccn(:,:,:), 1 )
173 
174  return
module COMMUNICATION
Definition: scale_comm.F90:23
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ae_ccn
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_read()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_read ( )

Read restart.

Definition at line 180 of file mod_atmos_phy_ae_vars.f90.

References atmos_phy_ae_ccn, atmos_phy_ae_restart_in_basename, atmos_phy_ae_vars_fillhalo(), scale_stdio::io_fid_log, and scale_stdio::io_l.

Referenced by mod_atmos_vars::atmos_vars_restart_read().

180  use scale_fileio, only: &
181  fileio_read
182  use scale_rm_statistics, only: &
183  stat_total
184  implicit none
185 
186  real(RP) :: total
187  !---------------------------------------------------------------------------
188 
189  if( io_l ) write(io_fid_log,*)
190  if( io_l ) write(io_fid_log,*) '*** Input restart file (ATMOS_PHY_AE) ***'
191 
192  if ( atmos_phy_ae_restart_in_basename /= '' ) then
193  if( io_l ) write(io_fid_log,*) '*** basename: ', trim(atmos_phy_ae_restart_in_basename)
194 
195  call fileio_read( atmos_phy_ae_ccn(:,:,:), & ! [OUT]
196  atmos_phy_ae_restart_in_basename, var_name(1), 'ZXY', step=1 ) ! [IN]
197 
198  call atmos_phy_ae_vars_fillhalo
199 
200  call stat_total( total, atmos_phy_ae_ccn(:,:,:), var_name(1) )
201  else
202  if( io_l ) write(io_fid_log,*) '*** restart file for ATMOS_PHY_AE is not specified.'
203  endif
204 
205  return
module FILE I/O (netcdf)
module Statistics
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ae_ccn
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_write()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_write ( )

Write restart.

Definition at line 211 of file mod_atmos_phy_ae_vars.f90.

References atmos_phy_ae_ccn, atmos_phy_ae_restart_out_basename, atmos_phy_ae_restart_out_dtype, atmos_phy_ae_restart_out_title, scale_stdio::io_fid_log, scale_stdio::io_l, and scale_time::time_gettimelabel().

Referenced by mod_atmos_vars::atmos_vars_restart_write().

211  use scale_time, only: &
213  use scale_fileio, only: &
214  fileio_write
215  implicit none
216 
217  character(len=20) :: timelabel
218  character(len=H_LONG) :: basename
219  !---------------------------------------------------------------------------
220 
221  if ( atmos_phy_ae_restart_out_basename /= '' ) then
222 
223  call time_gettimelabel( timelabel )
224  write(basename,'(A,A,A)') trim(atmos_phy_ae_restart_out_basename), '_', trim(timelabel)
225 
226  if( io_l ) write(io_fid_log,*)
227  if( io_l ) write(io_fid_log,*) '*** Output restart file (ATMOS_PHY_AE) ***'
228  if( io_l ) write(io_fid_log,*) '*** basename: ', trim(basename)
229 
230  call fileio_write( atmos_phy_ae_ccn(:,:,:), basename, atmos_phy_ae_restart_out_title, & ! [IN]
231  var_name(1), var_desc(1), var_unit(1), 'ZXY', atmos_phy_ae_restart_out_dtype ) ! [IN]
232 
233  endif
234 
235  return
module FILE I/O (netcdf)
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_ae_ccn
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_create()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_create ( )

Create restart file.

Definition at line 241 of file mod_atmos_phy_ae_vars.f90.

References atmos_phy_ae_restart_out_basename, atmos_phy_ae_restart_out_dtype, atmos_phy_ae_restart_out_title, scale_fileio::fileio_create(), scale_stdio::io_fid_log, scale_stdio::io_l, and scale_time::time_gettimelabel().

Referenced by mod_atmos_vars::atmos_vars_restart_create().

241  use scale_time, only: &
243  use scale_fileio, only: &
245  implicit none
246 
247  character(len=20) :: timelabel
248  character(len=H_LONG) :: basename
249  !---------------------------------------------------------------------------
250 
251  if ( atmos_phy_ae_restart_out_basename /= '' ) then
252 
253  call time_gettimelabel( timelabel )
254  write(basename,'(A,A,A)') trim(atmos_phy_ae_restart_out_basename), '_', trim(timelabel)
255 
256  if( io_l ) write(io_fid_log,*)
257  if( io_l ) write(io_fid_log,*) '*** Output restart file (ATMOS_PHY_AE) ***'
258  if( io_l ) write(io_fid_log,*) '*** basename: ', trim(basename)
259 
260  call fileio_create(restart_fid, basename, atmos_phy_ae_restart_out_title, & ! [IN]
261  atmos_phy_ae_restart_out_dtype ) ! [IN]
262 
263  endif
264 
265  return
module FILE I/O (netcdf)
subroutine, public time_gettimelabel(timelabel)
generate time label
Definition: scale_time.F90:90
subroutine, public fileio_create(fid, basename, title, datatype, date, subsec, append, nozcoord)
Create/open a netCDF file.
module TIME
Definition: scale_time.F90:15
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_enddef()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_enddef ( )

Exit netCDF define mode.

Definition at line 271 of file mod_atmos_phy_ae_vars.f90.

References scale_fileio::fileio_enddef().

Referenced by mod_atmos_vars::atmos_vars_restart_enddef().

271  use scale_fileio, only: &
273  implicit none
274 
275  if ( restart_fid .NE. -1 ) then
276  call fileio_enddef( restart_fid ) ! [IN]
277  endif
278 
279  return
module FILE I/O (netcdf)
subroutine, public fileio_enddef(fid)
Exit netCDF file define mode.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_close()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_close ( )

Close restart file.

Definition at line 285 of file mod_atmos_phy_ae_vars.f90.

References scale_fileio::fileio_close().

Referenced by mod_atmos_vars::atmos_vars_restart_close().

285  use scale_fileio, only: &
287  implicit none
288 
289  if ( restart_fid .NE. -1 ) then
290  call fileio_close( restart_fid ) ! [IN]
291  restart_fid = -1
292  endif
293 
294  return
module FILE I/O (netcdf)
subroutine, public fileio_close(fid)
Close a netCDF file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_def_var()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_def_var ( )

Write restart.

Definition at line 300 of file mod_atmos_phy_ae_vars.f90.

References atmos_phy_ae_restart_out_dtype, and scale_fileio::fileio_def_var().

Referenced by mod_atmos_vars::atmos_vars_restart_def_var().

300  use scale_fileio, only: &
302  implicit none
303 
304  !---------------------------------------------------------------------------
305 
306  if ( restart_fid .NE. -1 ) then
307  call fileio_def_var( restart_fid, var_id(1), var_name(1), var_desc(1), var_unit(1), &
308  'ZXY', atmos_phy_ae_restart_out_dtype ) ! [IN]
309  endif
310 
311  return
module FILE I/O (netcdf)
subroutine, public fileio_def_var(fid, vid, varname, desc, unit, axistype, datatype, timeintv)
Define a variable to file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ae_vars_restart_write_var()

subroutine, public mod_atmos_phy_ae_vars::atmos_phy_ae_vars_restart_write_var ( )

Write restart.

Definition at line 317 of file mod_atmos_phy_ae_vars.f90.

References atmos_phy_ae_ccn.

Referenced by mod_atmos_vars::atmos_vars_restart_write_var().

317  use scale_fileio, only: &
318  fileio_write_var
319  implicit none
320 
321  !---------------------------------------------------------------------------
322 
323  if ( restart_fid .NE. -1 ) then
324  call fileio_write_var( restart_fid, var_id(1), atmos_phy_ae_ccn(:,:,:), &
325  var_name(1), 'ZXY' ) ! [IN]
326  endif
327 
328  return
module FILE I/O (netcdf)
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ae_ccn
Here is the caller graph for this function:

Variable Documentation

◆ atmos_phy_ae_restart_output

logical, public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_output = .false.

output restart file?

Definition at line 46 of file mod_atmos_phy_ae_vars.f90.

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

46  logical, public :: atmos_phy_ae_restart_output = .false.

◆ atmos_phy_ae_restart_in_basename

character(len=h_long), public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_in_basename = ''

basename of the restart file

Definition at line 48 of file mod_atmos_phy_ae_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ae_vars_restart_read(), and atmos_phy_ae_vars_setup().

48  character(len=H_LONG), public :: atmos_phy_ae_restart_in_basename = ''

◆ atmos_phy_ae_restart_out_basename

character(len=h_long), public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_out_basename = ''

basename of the output file

Definition at line 49 of file mod_atmos_phy_ae_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ae_vars_restart_create(), atmos_phy_ae_vars_restart_write(), and atmos_phy_ae_vars_setup().

49  character(len=H_LONG), public :: atmos_phy_ae_restart_out_basename = ''

◆ atmos_phy_ae_restart_out_title

character(len=h_mid), public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_out_title = 'ATMOS_PHY_AE restart'

title of the output file

Definition at line 50 of file mod_atmos_phy_ae_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ae_vars_restart_create(), atmos_phy_ae_vars_restart_write(), and atmos_phy_ae_vars_setup().

50  character(len=H_MID), public :: atmos_phy_ae_restart_out_title = 'ATMOS_PHY_AE restart'

◆ atmos_phy_ae_restart_out_dtype

character(len=h_mid), public mod_atmos_phy_ae_vars::atmos_phy_ae_restart_out_dtype = 'DEFAULT'

REAL4 or REAL8.

Definition at line 51 of file mod_atmos_phy_ae_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ae_vars_restart_create(), atmos_phy_ae_vars_restart_def_var(), atmos_phy_ae_vars_restart_write(), and atmos_phy_ae_vars_setup().

51  character(len=H_MID), public :: atmos_phy_ae_restart_out_dtype = 'DEFAULT'

◆ atmos_phy_ae_rhoq_t

real(rp), dimension(:,:,:,:), allocatable, public mod_atmos_phy_ae_vars::atmos_phy_ae_rhoq_t

Definition at line 53 of file mod_atmos_phy_ae_vars.f90.

Referenced by mod_atmos_phy_ae_driver::atmos_phy_ae_driver(), and atmos_phy_ae_vars_setup().

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

◆ atmos_phy_ae_ccn

real(rp), dimension(:,:,:), allocatable, public mod_atmos_phy_ae_vars::atmos_phy_ae_ccn

Definition at line 55 of file mod_atmos_phy_ae_vars.f90.

Referenced by mod_atmos_phy_ae_driver::atmos_phy_ae_driver(), atmos_phy_ae_vars_fillhalo(), atmos_phy_ae_vars_restart_read(), atmos_phy_ae_vars_restart_write(), atmos_phy_ae_vars_restart_write_var(), and atmos_phy_ae_vars_setup().

55  real(RP), public, allocatable :: atmos_phy_ae_ccn(:,:,:) ! cloud condensation nuclei [/m3]
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ae_ccn

◆ atmos_phy_ae_ccn_t

real(rp), dimension(:,:,:), allocatable, public mod_atmos_phy_ae_vars::atmos_phy_ae_ccn_t

Definition at line 56 of file mod_atmos_phy_ae_vars.f90.

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

56  real(RP), public, allocatable :: atmos_phy_ae_ccn_t(:,:,:) ! tendency CCN [/m3/s]
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ae_ccn_t

◆ atmos_phy_ae_emit

real(rp), dimension(:,:,:,:), allocatable, public mod_atmos_phy_ae_vars::atmos_phy_ae_emit

Definition at line 57 of file mod_atmos_phy_ae_vars.f90.

Referenced by mod_atmos_phy_ae_driver::atmos_phy_ae_driver(), and atmos_phy_ae_vars_setup().

57  real(RP), public, allocatable :: atmos_phy_ae_emit(:,:,:,:) ! emission of aerosol and gas
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_ae_emit