SCALE-RM
Functions/Subroutines | Variables
mod_atmos_phy_ch_vars Module Reference

module Atmosphere / Physics Chemistry More...

Functions/Subroutines

subroutine, public atmos_phy_ch_vars_setup
 Setup. More...
 
subroutine, public atmos_phy_ch_vars_fillhalo
 HALO Communication. More...
 
subroutine, public atmos_phy_ch_vars_restart_read
 Read restart. More...
 
subroutine, public atmos_phy_ch_vars_restart_write
 Write restart. More...
 
subroutine, public atmos_phy_ch_vars_restart_create
 Create restart file. More...
 
subroutine, public atmos_phy_ch_vars_restart_enddef
 Exit netCDF define mode. More...
 
subroutine, public atmos_phy_ch_vars_restart_close
 Close restart file. More...
 
subroutine, public atmos_phy_ch_vars_restart_def_var
 Write restart. More...
 
subroutine, public atmos_phy_ch_vars_restart_write_var
 Write restart. More...
 

Variables

logical, public atmos_phy_ch_restart_output = .false.
 output restart file? More...
 
character(len=h_long), public atmos_phy_ch_restart_in_basename = ''
 basename of the restart file More...
 
character(len=h_long), public atmos_phy_ch_restart_out_basename = ''
 basename of the output file More...
 
character(len=h_mid), public atmos_phy_ch_restart_out_title = 'ATMOS_PHY_CH restart'
 title of the output file More...
 
character(len=h_mid), public atmos_phy_ch_restart_out_dtype = 'DEFAULT'
 REAL4 or REAL8. More...
 
real(rp), dimension(:,:,:,:), allocatable, public atmos_phy_ch_rhoq_t
 
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ch_o3
 

Detailed Description

module Atmosphere / Physics Chemistry

Description
Container for mod_atmos_phy_ch
Author
Team SCALE
History
  • 2014-05-04 (H.Yashiro) [new]
NAMELIST
  • PARAM_ATMOS_PHY_CH_VARS
    nametypedefault valuecomment
    ATMOS_PHY_CH_RESTART_IN_BASENAME character(len=H_LONG) '' basename of the restart file
    ATMOS_PHY_CH_RESTART_OUTPUT logical .false. output restart file?
    ATMOS_PHY_CH_RESTART_OUT_BASENAME character(len=H_LONG) '' basename of the output file
    ATMOS_PHY_CH_RESTART_OUT_TITLE character(len=H_MID) 'ATMOS_PHY_CH restart' title of the output file
    ATMOS_PHY_CH_RESTART_OUT_DTYPE character(len=H_MID) 'DEFAULT' REAL4 or REAL8

History Output
No history output

Function/Subroutine Documentation

◆ atmos_phy_ch_vars_setup()

subroutine, public mod_atmos_phy_ch_vars::atmos_phy_ch_vars_setup ( )

Setup.

Definition at line 83 of file mod_atmos_phy_ch_vars.f90.

References atmos_phy_ch_o3, atmos_phy_ch_restart_in_basename, atmos_phy_ch_restart_out_basename, atmos_phy_ch_restart_out_dtype, atmos_phy_ch_restart_out_title, atmos_phy_ch_restart_output, atmos_phy_ch_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(), and scale_tracer::qa.

Referenced by mod_atmos_vars::atmos_vars_setup().

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

◆ atmos_phy_ch_vars_fillhalo()

subroutine, public mod_atmos_phy_ch_vars::atmos_phy_ch_vars_fillhalo ( )

HALO Communication.

Definition at line 149 of file mod_atmos_phy_ch_vars.f90.

References atmos_phy_ch_o3, 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_ch_vars_restart_read().

149  use scale_comm, only: &
150  comm_vars8, &
151  comm_wait
152  implicit none
153 
154  integer :: i, j
155  !---------------------------------------------------------------------------
156 
157  do j = js, je
158  do i = is, ie
159  atmos_phy_ch_o3( 1:ks-1,i,j) = atmos_phy_ch_o3(ks,i,j)
160  atmos_phy_ch_o3(ke+1:ka, i,j) = atmos_phy_ch_o3(ke,i,j)
161  enddo
162  enddo
163 
164  call comm_vars8( atmos_phy_ch_o3(:,:,:), 1 )
165  call comm_wait ( atmos_phy_ch_o3(:,:,:), 1 )
166 
167  return
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ch_o3
module COMMUNICATION
Definition: scale_comm.F90:23
Here is the caller graph for this function:

◆ atmos_phy_ch_vars_restart_read()

subroutine, public mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_read ( )

Read restart.

Definition at line 173 of file mod_atmos_phy_ch_vars.f90.

References atmos_phy_ch_o3, atmos_phy_ch_restart_in_basename, atmos_phy_ch_vars_fillhalo(), scale_stdio::io_fid_log, and scale_stdio::io_l.

Referenced by mod_atmos_vars::atmos_vars_restart_read().

173  use scale_fileio, only: &
174  fileio_read
175  use scale_rm_statistics, only: &
176  stat_total
177  implicit none
178 
179  real(RP) :: total
180  !---------------------------------------------------------------------------
181 
182  if( io_l ) write(io_fid_log,*)
183  if( io_l ) write(io_fid_log,*) '*** Input restart file (ATMOS_PHY_CH) ***'
184 
185  if ( atmos_phy_ch_restart_in_basename /= '' ) then
186  if( io_l ) write(io_fid_log,*) '*** basename: ', trim(atmos_phy_ch_restart_in_basename)
187 
188  call fileio_read( atmos_phy_ch_o3(:,:,:), & ! [OUT]
189  atmos_phy_ch_restart_in_basename, var_name(1), 'ZXY', step=1 ) ! [IN]
190 
191  call atmos_phy_ch_vars_fillhalo
192 
193  call stat_total( total, atmos_phy_ch_o3(:,:,:), var_name(1) )
194  else
195  if( io_l ) write(io_fid_log,*) '*** restart file for ATMOS_PHY_CH is not specified.'
196  endif
197 
198  return
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ch_o3
module FILE I/O (netcdf)
module Statistics
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ch_vars_restart_write()

subroutine, public mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_write ( )

Write restart.

Definition at line 204 of file mod_atmos_phy_ch_vars.f90.

References atmos_phy_ch_o3, atmos_phy_ch_restart_out_basename, atmos_phy_ch_restart_out_dtype, atmos_phy_ch_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().

204  use scale_time, only: &
206  use scale_fileio, only: &
207  fileio_write
208  implicit none
209 
210  character(len=20) :: timelabel
211  character(len=H_LONG) :: basename
212  !---------------------------------------------------------------------------
213 
214  if ( atmos_phy_ch_restart_out_basename /= '' ) then
215 
216  call time_gettimelabel( timelabel )
217  write(basename,'(A,A,A)') trim(atmos_phy_ch_restart_out_basename), '_', trim(timelabel)
218 
219  if( io_l ) write(io_fid_log,*)
220  if( io_l ) write(io_fid_log,*) '*** Output restart file (ATMOS_PHY_CH) ***'
221  if( io_l ) write(io_fid_log,*) '*** basename: ', trim(basename)
222 
223  call fileio_write( atmos_phy_ch_o3(:,:,:), basename, atmos_phy_ch_restart_out_title, & ! [IN]
224  var_name(1), var_desc(1), var_unit(1), 'ZXY', atmos_phy_ch_restart_out_dtype ) ! [IN]
225 
226  endif
227 
228  return
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ch_o3
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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ atmos_phy_ch_vars_restart_create()

subroutine, public mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_create ( )

Create restart file.

Definition at line 234 of file mod_atmos_phy_ch_vars.f90.

References atmos_phy_ch_restart_out_basename, atmos_phy_ch_restart_out_dtype, atmos_phy_ch_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().

234  use scale_time, only: &
236  use scale_fileio, only: &
238  implicit none
239 
240  character(len=20) :: timelabel
241  character(len=H_LONG) :: basename
242  !---------------------------------------------------------------------------
243 
244  if ( atmos_phy_ch_restart_out_basename /= '' ) then
245 
246  call time_gettimelabel( timelabel )
247  write(basename,'(A,A,A)') trim(atmos_phy_ch_restart_out_basename), '_', trim(timelabel)
248 
249  if( io_l ) write(io_fid_log,*)
250  if( io_l ) write(io_fid_log,*) '*** Output restart file (ATMOS_PHY_CH) ***'
251  if( io_l ) write(io_fid_log,*) '*** basename: ', trim(basename)
252 
253  call fileio_create(restart_fid, basename, atmos_phy_ch_restart_out_title, &
254  atmos_phy_ch_restart_out_dtype )
255 
256  endif
257 
258  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_ch_vars_restart_enddef()

subroutine, public mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_enddef ( )

Exit netCDF define mode.

Definition at line 264 of file mod_atmos_phy_ch_vars.f90.

References scale_fileio::fileio_enddef().

Referenced by mod_atmos_vars::atmos_vars_restart_enddef().

264  use scale_fileio, only: &
266  implicit none
267 
268  if ( restart_fid .NE. -1 ) then
269  call fileio_enddef( restart_fid ) ! [IN]
270  endif
271 
272  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_ch_vars_restart_close()

subroutine, public mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_close ( )

Close restart file.

Definition at line 278 of file mod_atmos_phy_ch_vars.f90.

References scale_fileio::fileio_close().

Referenced by mod_atmos_vars::atmos_vars_restart_close().

278  use scale_fileio, only: &
280  implicit none
281 
282  if ( restart_fid .NE. -1 ) then
283  call fileio_close( restart_fid ) ! [IN]
284  restart_fid = -1
285  endif
286 
287  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_ch_vars_restart_def_var()

subroutine, public mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_def_var ( )

Write restart.

Definition at line 293 of file mod_atmos_phy_ch_vars.f90.

References atmos_phy_ch_restart_out_dtype, and scale_fileio::fileio_def_var().

Referenced by mod_atmos_vars::atmos_vars_restart_def_var().

293  use scale_fileio, only: &
295  implicit none
296 
297  !---------------------------------------------------------------------------
298 
299  if ( restart_fid .NE. -1 ) then
300  call fileio_def_var( restart_fid, var_id(1), var_name(1), var_desc(1), &
301  var_unit(1), 'ZXY', atmos_phy_ch_restart_out_dtype ) ! [IN]
302  endif
303 
304  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_ch_vars_restart_write_var()

subroutine, public mod_atmos_phy_ch_vars::atmos_phy_ch_vars_restart_write_var ( )

Write restart.

Definition at line 310 of file mod_atmos_phy_ch_vars.f90.

References atmos_phy_ch_o3.

Referenced by mod_atmos_vars::atmos_vars_restart_write_var().

310  use scale_fileio, only: &
311  fileio_write_var
312  implicit none
313 
314  !---------------------------------------------------------------------------
315 
316  if ( restart_fid .NE. -1 ) then
317  call fileio_write_var( restart_fid, var_id(1), atmos_phy_ch_o3(:,:,:), &
318  var_name(1), 'ZXY' ) ! [IN]
319  endif
320 
321  return
real(rp), dimension(:,:,:), allocatable, public atmos_phy_ch_o3
module FILE I/O (netcdf)
Here is the caller graph for this function:

Variable Documentation

◆ atmos_phy_ch_restart_output

logical, public mod_atmos_phy_ch_vars::atmos_phy_ch_restart_output = .false.

output restart file?

Definition at line 46 of file mod_atmos_phy_ch_vars.f90.

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

46  logical, public :: atmos_phy_ch_restart_output = .false.

◆ atmos_phy_ch_restart_in_basename

character(len=h_long), public mod_atmos_phy_ch_vars::atmos_phy_ch_restart_in_basename = ''

basename of the restart file

Definition at line 48 of file mod_atmos_phy_ch_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ch_vars_restart_read(), and atmos_phy_ch_vars_setup().

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

◆ atmos_phy_ch_restart_out_basename

character(len=h_long), public mod_atmos_phy_ch_vars::atmos_phy_ch_restart_out_basename = ''

basename of the output file

Definition at line 49 of file mod_atmos_phy_ch_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ch_vars_restart_create(), atmos_phy_ch_vars_restart_write(), and atmos_phy_ch_vars_setup().

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

◆ atmos_phy_ch_restart_out_title

character(len=h_mid), public mod_atmos_phy_ch_vars::atmos_phy_ch_restart_out_title = 'ATMOS_PHY_CH restart'

title of the output file

Definition at line 50 of file mod_atmos_phy_ch_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ch_vars_restart_create(), atmos_phy_ch_vars_restart_write(), and atmos_phy_ch_vars_setup().

50  character(len=H_MID), public :: atmos_phy_ch_restart_out_title = 'ATMOS_PHY_CH restart'

◆ atmos_phy_ch_restart_out_dtype

character(len=h_mid), public mod_atmos_phy_ch_vars::atmos_phy_ch_restart_out_dtype = 'DEFAULT'

REAL4 or REAL8.

Definition at line 51 of file mod_atmos_phy_ch_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_phy_ch_vars_restart_create(), atmos_phy_ch_vars_restart_def_var(), atmos_phy_ch_vars_restart_write(), and atmos_phy_ch_vars_setup().

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

◆ atmos_phy_ch_rhoq_t

real(rp), dimension(:,:,:,:), allocatable, public mod_atmos_phy_ch_vars::atmos_phy_ch_rhoq_t

Definition at line 53 of file mod_atmos_phy_ch_vars.f90.

Referenced by mod_atmos_phy_ch_driver::atmos_phy_ch_driver(), and atmos_phy_ch_vars_setup().

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

◆ atmos_phy_ch_o3

real(rp), dimension(:,:,:), allocatable, public mod_atmos_phy_ch_vars::atmos_phy_ch_o3