SCALE-RM
Functions/Subroutines | Variables
mod_atmos_dyn_vars Module Reference

module Atmosphere / Dynamics More...

Functions/Subroutines

subroutine, public atmos_dyn_vars_setup
 Setup. More...
 
subroutine, public atmos_dyn_vars_fillhalo
 HALO Communication. More...
 
subroutine, public atmos_dyn_vars_restart_read
 Read restart. More...
 
subroutine, public atmos_dyn_vars_restart_write
 Write restart. More...
 

Variables

logical, public atmos_dyn_restart_output = .false.
 output restart file? More...
 
character(len=h_long), public atmos_dyn_restart_in_basename = ''
 basename of the restart file More...
 
character(len=h_long), public atmos_dyn_restart_out_basename = ''
 basename of the output file More...
 
character(len=h_mid), public atmos_dyn_restart_out_title = 'ATMOS_DYN restart'
 title of the output file More...
 
character(len=h_mid), public atmos_dyn_restart_out_dtype = 'DEFAULT'
 REAL4 or REAL8. More...
 
real(rp), dimension(:,:,:,:), allocatable, public prog
 

Detailed Description

module Atmosphere / Dynamics

Description
Container for mod_atmos_dyn
Author
Team SCALE
History
  • 2014-05-04 (H.Yashiro) [new]
NAMELIST
  • PARAM_ATMOS_DYN_VARS
    nametypedefault valuecomment
    ATMOS_DYN_RESTART_IN_BASENAME character(len=H_LONG) '' basename of the restart file
    ATMOS_DYN_RESTART_OUTPUT logical .false. output restart file?
    ATMOS_DYN_RESTART_OUT_BASENAME character(len=H_LONG) '' basename of the output file
    ATMOS_DYN_RESTART_OUT_TITLE character(len=H_MID) 'ATMOS_DYN restart' title of the output file
    ATMOS_DYN_RESTART_OUT_DTYPE character(len=H_MID) 'DEFAULT' REAL4 or REAL8

History Output
No history output

Function/Subroutine Documentation

◆ atmos_dyn_vars_setup()

subroutine, public mod_atmos_dyn_vars::atmos_dyn_vars_setup ( )

Setup.

Definition at line 69 of file mod_atmos_dyn_vars.f90.

References atmos_dyn_restart_in_basename, atmos_dyn_restart_out_basename, atmos_dyn_restart_out_dtype, atmos_dyn_restart_out_title, atmos_dyn_restart_output, scale_atmos_dyn_tstep_short::atmos_dyn_tstep_short_regist(), mod_atmos_admin::atmos_dyn_type, 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 prog.

Referenced by mod_atmos_vars::atmos_vars_setup().

69  use scale_process, only: &
71  use scale_const, only: &
72  undef => const_undef
73  use mod_atmos_admin, only: &
75  use scale_atmos_dyn_tstep_short, only: &
77  implicit none
78 
79  namelist / param_atmos_dyn_vars / &
80  atmos_dyn_restart_in_basename, &
81  atmos_dyn_restart_output, &
82  atmos_dyn_restart_out_basename, &
83  atmos_dyn_restart_out_title, &
84  atmos_dyn_restart_out_dtype
85 
86  integer :: ierr
87  integer :: iv
88  !---------------------------------------------------------------------------
89 
90  if( io_l ) write(io_fid_log,*)
91  if( io_l ) write(io_fid_log,*) '++++++ Module[VARS] / Categ[ATMOS DYN] / Origin[SCALE-RM]'
92 
93  !--- read namelist
94  rewind(io_fid_conf)
95  read(io_fid_conf,nml=param_atmos_dyn_vars,iostat=ierr)
96  if( ierr < 0 ) then !--- missing
97  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
98  elseif( ierr > 0 ) then !--- fatal error
99  write(*,*) 'xxx Not appropriate names in namelist PARAM_ATMOS_DYN_VARS. Check!'
100  call prc_mpistop
101  endif
102  if( io_lnml ) write(io_fid_log,nml=param_atmos_dyn_vars)
103 
105  va, & ! [OUT]
106  var_name, & ! [OUT]
107  var_desc, & ! [OUT]
108  var_unit ) ! [OUT]
109 
110  if ( va > 0 ) then ! additional prognostic variables
111 
112  if ( va > vmax ) then
113  write(*,*) 'xxx number of the prognostic variables is exceed the limit', va, ' > ', vmax
114  call prc_mpistop
115  endif
116  allocate( prog(ka,ia,ja,va) )
117  prog(:,:,:,:) = undef
118 
119  if( io_l ) write(io_fid_log,*)
120  if( io_l ) write(io_fid_log,*) '*** [ATMOS_DYN] prognostic/diagnostic variables'
121  if( io_l ) write(io_fid_log,'(1x,A,A15,A,A32,3(A))') &
122  '*** |','VARNAME ','|', 'DESCRIPTION ','[', 'UNIT ',']'
123  do iv = 1, va
124  if( io_l ) write(io_fid_log,'(1x,A,i3,A,A15,A,A32,3(A))') &
125  '*** NO.',iv,'|',var_name(iv),'|',var_desc(iv),'[',var_unit(iv),']'
126  enddo
127 
128  if( io_l ) write(io_fid_log,*)
129 
130  if ( atmos_dyn_restart_in_basename /= '' ) then
131  if( io_l ) write(io_fid_log,*) '*** Restart input? : ', trim(atmos_dyn_restart_in_basename)
132  else
133  if( io_l ) write(io_fid_log,*) '*** Restart input? : NO'
134  endif
135 
136  if ( atmos_dyn_restart_output &
137  .AND. atmos_dyn_restart_out_basename /= '' ) then
138  if( io_l ) write(io_fid_log,*) '*** Restart output? : ', trim(atmos_dyn_restart_out_basename)
139  else
140  if( io_l ) write(io_fid_log,*) '*** Restart output? : NO'
141  atmos_dyn_restart_output = .false.
142  endif
143 
144  else ! no additional prognostic variables
145 
146  allocate( prog(ka,ia,ja,1) ) ! for safety
147  prog(:,:,:,:) = undef
148  atmos_dyn_restart_output = .false.
149 
150  endif
151 
152  return
module ATMOS admin
subroutine, public prc_mpistop
Abort MPI.
integer, public va
Definition: scale_index.F90:38
module Atmosphere / Dynamical scheme
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:59
real(rp), public const_undef
Definition: scale_const.F90:43
integer, public ia
of x whole cells (local, with HALO)
integer, public ka
of z whole cells (local, with HALO)
module PROCESS
subroutine, public atmos_dyn_tstep_short_regist(ATMOS_DYN_TYPE, VA_out, VAR_NAME, VAR_DESC, VAR_UNIT)
Register.
real(rp), dimension(:,:,:,:), allocatable, public prog
module CONSTANT
Definition: scale_const.F90:14
logical, public io_lnml
output log or not? (for namelist, this process)
Definition: scale_stdio.F90:60
character(len=h_short), public atmos_dyn_type
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
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_dyn_vars_fillhalo()

subroutine, public mod_atmos_dyn_vars::atmos_dyn_vars_fillhalo ( )

HALO Communication.

Definition at line 158 of file mod_atmos_dyn_vars.f90.

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

Referenced by atmos_dyn_vars_restart_read().

158  use scale_comm, only: &
159  comm_vars8, &
160  comm_wait
161  implicit none
162 
163  integer :: i, j, iv
164  !---------------------------------------------------------------------------
165 
166  do iv = 1, va
167  do j = js, je
168  do i = is, ie
169  prog( 1:ks-1,i,j,iv) = prog(ks,i,j,iv)
170  prog(ke+1:ka, i,j,iv) = prog(ke,i,j,iv)
171  enddo
172  enddo
173 
174  call comm_vars8( prog(:,:,:,iv), iv )
175  enddo
176 
177  do iv = 1, va
178  call comm_wait ( prog(:,:,:,iv), iv )
179  enddo
180 
181  return
integer, public is
start point of inner domain: x, local
integer, public je
end point of inner domain: y, local
integer, public va
Definition: scale_index.F90:38
integer, public ke
end point of inner domain: z, local
integer, public ka
of z whole cells (local, with HALO)
module COMMUNICATION
Definition: scale_comm.F90:23
integer, public js
start point of inner domain: y, local
real(rp), dimension(:,:,:,:), allocatable, public prog
integer, public ks
start point of inner domain: z, local
integer, public ie
end point of inner domain: x, local
Here is the caller graph for this function:

◆ atmos_dyn_vars_restart_read()

subroutine, public mod_atmos_dyn_vars::atmos_dyn_vars_restart_read ( )

Read restart.

Definition at line 187 of file mod_atmos_dyn_vars.f90.

References atmos_dyn_restart_in_basename, atmos_dyn_vars_fillhalo(), scale_stdio::io_fid_log, scale_stdio::io_l, and prog.

Referenced by mod_atmos_vars::atmos_vars_restart_read().

187  use scale_fileio, only: &
188  fileio_read
189  use scale_rm_statistics, only: &
190  stat_total
191  implicit none
192 
193  real(RP) :: total
194  integer :: iv
195  !---------------------------------------------------------------------------
196 
197  if( io_l ) write(io_fid_log,*)
198  if( io_l ) write(io_fid_log,*) '*** Input restart file (ATMOS_DYN) ***'
199 
200  if ( atmos_dyn_restart_in_basename /= '' ) then
201  if( io_l ) write(io_fid_log,*) '*** basename: ', trim(atmos_dyn_restart_in_basename)
202 
203  do iv = 1, va
204  call fileio_read( prog(:,:,:,iv), & ! [OUT]
205  atmos_dyn_restart_in_basename, var_name(iv), 'ZXY', step=1 ) ! [IN]
206 
207  enddo
208 
209  call atmos_dyn_vars_fillhalo
210 
211  do iv = 1, va
212  call stat_total( total, prog(:,:,:,iv), var_name(iv) )
213  enddo
214  else
215  if( io_l ) write(io_fid_log,*) '*** restart file for ATMOS_DYN is not specified.'
216  endif
217 
218  return
integer, public va
Definition: scale_index.F90:38
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:59
module FILE I/O (netcdf)
module Statistics
real(rp), dimension(:,:,:,:), allocatable, public prog
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_dyn_vars_restart_write()

subroutine, public mod_atmos_dyn_vars::atmos_dyn_vars_restart_write ( )

Write restart.

Definition at line 224 of file mod_atmos_dyn_vars.f90.

References atmos_dyn_restart_out_basename, atmos_dyn_restart_out_dtype, atmos_dyn_restart_out_title, scale_stdio::io_fid_log, scale_stdio::io_l, prog, and scale_time::time_gettimelabel().

Referenced by mod_atmos_vars::atmos_vars_restart_write().

224  use scale_time, only: &
226  use scale_fileio, only: &
227  fileio_write
228  implicit none
229 
230  character(len=20) :: timelabel
231  character(len=H_LONG) :: basename
232  integer :: iv
233  !---------------------------------------------------------------------------
234 
235  if ( atmos_dyn_restart_out_basename /= '' ) then
236 
237  call time_gettimelabel( timelabel )
238  write(basename,'(A,A,A)') trim(atmos_dyn_restart_out_basename), '_', trim(timelabel)
239 
240  if( io_l ) write(io_fid_log,*)
241  if( io_l ) write(io_fid_log,*) '*** Output restart file (ATMOS_DYN) ***'
242  if( io_l ) write(io_fid_log,*) '*** basename: ', trim(basename)
243 
244  do iv = 1, va
245  call fileio_write( prog(:,:,:,iv), basename, atmos_dyn_restart_out_title, & ! [IN]
246  var_name(iv), var_desc(iv), var_unit(iv), 'ZXY', atmos_dyn_restart_out_dtype ) ! [IN]
247  enddo
248 
249  endif
250 
251  return
integer, public va
Definition: scale_index.F90:38
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:59
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 prog
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_dyn_restart_output

logical, public mod_atmos_dyn_vars::atmos_dyn_restart_output = .false.

output restart file?

Definition at line 40 of file mod_atmos_dyn_vars.f90.

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

40  logical, public :: atmos_dyn_restart_output = .false.

◆ atmos_dyn_restart_in_basename

character(len=h_long), public mod_atmos_dyn_vars::atmos_dyn_restart_in_basename = ''

basename of the restart file

Definition at line 42 of file mod_atmos_dyn_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_dyn_vars_restart_read(), and atmos_dyn_vars_setup().

42  character(len=H_LONG), public :: atmos_dyn_restart_in_basename = ''

◆ atmos_dyn_restart_out_basename

character(len=h_long), public mod_atmos_dyn_vars::atmos_dyn_restart_out_basename = ''

basename of the output file

Definition at line 43 of file mod_atmos_dyn_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_dyn_vars_restart_write(), and atmos_dyn_vars_setup().

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

◆ atmos_dyn_restart_out_title

character(len=h_mid), public mod_atmos_dyn_vars::atmos_dyn_restart_out_title = 'ATMOS_DYN restart'

title of the output file

Definition at line 44 of file mod_atmos_dyn_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_dyn_vars_restart_write(), and atmos_dyn_vars_setup().

44  character(len=H_MID), public :: atmos_dyn_restart_out_title = 'ATMOS_DYN restart'

◆ atmos_dyn_restart_out_dtype

character(len=h_mid), public mod_atmos_dyn_vars::atmos_dyn_restart_out_dtype = 'DEFAULT'

REAL4 or REAL8.

Definition at line 45 of file mod_atmos_dyn_vars.f90.

Referenced by mod_admin_restart::admin_restart_setup(), atmos_dyn_vars_restart_write(), and atmos_dyn_vars_setup().

45  character(len=H_MID), public :: atmos_dyn_restart_out_dtype = 'DEFAULT'

◆ prog

real(rp), dimension(:,:,:,:), allocatable, public mod_atmos_dyn_vars::prog