SCALE-RM
mod_rm_prep.f90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
17 !-------------------------------------------------------------------------------
19  !-----------------------------------------------------------------------------
20  !
21  !++ used modules
22  !
23  use dc_log, only: &
24  loginit
25  use gtool_file, only: &
27  use scale_precision
28  use scale_stdio
29  use scale_prof
30  !-----------------------------------------------------------------------------
31  implicit none
32  private
33  !-----------------------------------------------------------------------------
34  !
35  !++ included parameters
36  !
37 #include "scale-rm.h"
38  !-----------------------------------------------------------------------------
39  !
40  !++ Public procedure
41  !
42  public :: scalerm_prep
43 
44  !-----------------------------------------------------------------------------
45  !
46  !++ Public parameters & variables
47  !
48  !-----------------------------------------------------------------------------
49  !
50  !++ Private procedure
51  !
52  !-----------------------------------------------------------------------------
53  !
54  !++ Private parameters & variables
55  !
56  character(len=H_MID), private, parameter :: MODELNAME = "SCALE-RM ver. "//version
57 
58  !-----------------------------------------------------------------------------
59 contains
60  !-----------------------------------------------------------------------------
62  subroutine scalerm_prep( &
63  comm_world, &
64  intercomm_parent, &
65  intercomm_child, &
66  cnf_fname )
67  use scale_process, only: &
69  use scale_rm_process, only: &
70  prc_setup
71  use scale_const, only: &
73  use scale_calendar, only: &
75  use scale_random, only: &
77  use scale_grid_index, only: &
79  use scale_grid, only: &
81  use scale_grid_nest, only: &
83  use scale_land_grid_index, only: &
85  use scale_land_grid, only: &
87  use scale_urban_grid_index, only: &
89  use scale_urban_grid, only: &
91  use scale_fileio, only: &
92  fileio_setup, &
94  use scale_comm, only: &
96  use scale_topography, only: &
98  use scale_landuse, only: &
100  use scale_grid_real, only: &
101  real_setup, &
103  use scale_gridtrans, only: &
105  use scale_interpolation, only: &
107  use scale_rm_statistics, only: &
108  stat_setup
109  use scale_history, only: &
110  hist_setup
111  use scale_atmos_hydrostatic, only: &
113  use scale_atmos_thermodyn, only: &
115  use scale_atmos_hydrometeor, only: &
117  use scale_atmos_saturation, only: &
119  use mod_atmos_driver, only: &
121  use mod_admin_restart, only: &
123  use mod_admin_time, only: &
125  use mod_atmos_admin, only: &
127  use mod_atmos_vars, only: &
129  use mod_ocean_admin, only: &
131  use mod_ocean_vars, only: &
133  use mod_land_admin, only: &
135  use mod_land_vars, only: &
137  use mod_urban_admin, only: &
139  use mod_urban_vars, only: &
141  use mod_cpl_admin, only: &
143  use mod_cpl_vars, only: &
145  use mod_convert, only: &
146  convert_setup, &
147  convert
148  use mod_mktopo, only: &
149  mktopo_setup, &
150  mktopo
151  use mod_mkinit, only: &
152  mkinit_setup, &
153  mkinit
154  use mod_user, only: &
156  implicit none
157 
158  integer, intent(in) :: comm_world
159  integer, intent(in) :: intercomm_parent
160  integer, intent(in) :: intercomm_child
161  character(len=*), intent(in) :: cnf_fname
162 
163  integer :: myrank
164  logical :: ismaster
165  !---------------------------------------------------------------------------
166 
167  !########## Initial setup ##########
168 
169  ! setup standard I/O
170  call io_setup( modelname, .true., cnf_fname )
171 
172  ! setup MPI
173  call prc_local_setup( comm_world, & ! [IN]
174  myrank, & ! [OUT]
175  ismaster ) ! [OUT]
176 
177  ! setup Log
178  call io_log_setup( myrank, ismaster )
179  call loginit( io_fid_conf, &
180  io_fid_log, io_l, &
181  io_fid_nml, io_nml )
182 
183  ! setup process
184  call prc_setup
185 
186  ! setup PROF
187  call prof_setup
188 
189 
190  ! profiler start
191  call prof_setprefx('INIT')
192  call prof_rapstart('Initialize', 0)
193 
194 
195  ! setup constants
196  call const_setup
197 
198  ! setup calendar
199  call calendar_setup
200 
201  ! setup random number
202  call random_setup
203 
204  ! setup horizontal/vertical grid coordinates (cartesian,idealized)
205  call grid_index_setup
206  call grid_setup
207 
209  call land_grid_setup
210 
212  call urban_grid_setup
213 
214  ! setup submodel administrator
215  call atmos_admin_setup
216  call ocean_admin_setup
217  call land_admin_setup
218  call urban_admin_setup
219  call cpl_admin_setup
220 
221  ! setup tracer index
224  call user_config
225 
226  ! setup file I/O
227  call fileio_setup
228 
229  ! setup mpi communication
230  call comm_setup
231 
232  ! setup topography
233  call topo_setup
234  ! setup land use category index/fraction
235  call landuse_setup
236  ! setup grid coordinates (real world)
237  call real_setup
238 
239  ! setup grid transfer metrics (uses in ATMOS_dynamics)
240  call gtrans_setup
241  ! setup Z-ZS interpolation factor (uses in History)
242  call interp_setup
243 
244  ! setup restart
246  ! setup time
247  call admin_time_setup( setup_timeintegration = .false. )
248  ! setup statistics
249  call stat_setup
250  ! setup history I/O
251  call hist_setup
252 
253  ! setup nesting grid
254  call nest_setup ( intercomm_parent, intercomm_child )
255 
256 
257  ! setup common tools
261 
262  ! setup variable container
263  call atmos_vars_setup
264  call ocean_vars_setup
265  call land_vars_setup
266  call urban_vars_setup
267  call cpl_vars_setup
268 
269  ! setup preprocess converter
270  call convert_setup
271 
272  ! setup mktopo
273  call mktopo_setup
274 
275  ! setup mkinit
276  call mkinit_setup
277 
278  call prof_rapend('Initialize')
279 
280  !########## main ##########
281 
282  call prof_rapstart('Main_prep')
283 
284  ! execute preprocess
285  call prof_rapstart('Convert')
286  call convert
287  call prof_rapend ('Convert')
288 
289  ! execute mktopo
290  call prof_rapstart('MkTopo')
291  call mktopo
292  call prof_rapend ('MkTopo')
293 
294  ! re-setup
295  call real_update_z
296 
297  ! execute mkinit
298  call prof_rapstart('MkInit')
299  call mkinit
300  call prof_rapend ('MkInit')
301 
302  call prof_rapend('Main_prep')
303 
304  !########## Finalize ##########
305 
306  call prof_rapreport
307 
308  ! setup file I/O
309  call fileio_cleanup
310 
311  call filecloseall
312 
313  return
314  end subroutine scalerm_prep
315 
316 end module mod_rm_prep
module ATMOS admin
subroutine, public mktopo
Driver.
Definition: mod_mktopo.f90:114
module Land admin
subroutine, public nest_setup(inter_parent, inter_child)
Setup.
module GTOOL_FILE
Definition: gtool_file.f90:17
subroutine, public interp_setup
Setup.
subroutine, public prof_setup
Definition: scale_prof.F90:102
module ATMOSPHERE / Saturation adjustment
subroutine, public prof_setprefx(prefxname)
Definition: scale_prof.F90:138
subroutine, public atmos_saturation_setup
Setup.
module DC_Log
Definition: dc_log.f90:14
subroutine, public urban_grid_index_setup
Setup.
module GRID (nesting system)
subroutine, public mktopo_setup
Setup.
Definition: mod_mktopo.f90:70
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:61
module USER
Definition: mod_user.f90:14
subroutine, public landuse_setup
Setup.
subroutine, public random_setup
Setup.
subroutine, public prc_setup
Setup Processor topology.
subroutine, public land_vars_setup
Setup.
module ATMOSPHERIC Variables
subroutine, public fileio_setup
Setup.
subroutine, public convert
Driver.
Definition: mod_convert.f90:97
module STDIO
Definition: scale_stdio.F90:12
module CONVERT driver
Definition: mod_convert.f90:10
subroutine, public mkinit
Driver.
Definition: mod_mkinit.f90:358
subroutine, public grid_index_setup
Setup.
module GRID (cartesian) for land
subroutine, public atmos_driver_config
Config.
subroutine, public filecloseall
module URBAN Variables
subroutine, public io_log_setup(myrank, is_master)
Setup LOG.
module FILE I/O (netcdf)
subroutine, public land_admin_setup
Setup.
subroutine, public convert_setup
Setup.
Definition: mod_convert.f90:51
module Statistics
module grid index
logical, public io_nml
output log or not? (for namelist, this process)
Definition: scale_stdio.F90:62
subroutine, public admin_time_setup(setup_TimeIntegration)
Setup.
subroutine, public admin_restart_setup
Setup.
subroutine, public real_setup
Setup.
subroutine, public topo_setup
Setup.
subroutine, public urban_grid_setup
Setup.
module GRIDTRANS
module GRID (cartesian) for urban
subroutine, public calendar_setup
Setup.
module GRID (real space)
module LANDUSE
subroutine, public cpl_vars_setup
Setup.
module COUPLER Variables
subroutine, public atmos_vars_setup
Setup.
module ATMOSPHERE driver
subroutine, public const_setup
Setup.
subroutine, public io_setup(MODELNAME, call_from_launcher, fname_in)
Setup.
Definition: scale_stdio.F90:88
module COMMUNICATION
Definition: scale_comm.F90:23
module ATMOSPHERE / Hydrostatic barance
subroutine, public stat_setup
Setup.
module PROCESS
module Ocean admin
subroutine, public land_grid_setup
Setup.
subroutine, public scalerm_prep(comm_world, intercomm_parent, intercomm_child, cnf_fname)
Setup.
Definition: mod_rm_prep.f90:67
subroutine, public atmos_thermodyn_setup
Setup.
module LAND Variables
module administrator for restart
subroutine, public urban_vars_setup
Setup.
module CONSTANT
Definition: scale_const.F90:14
subroutine, public gtrans_setup
Setup.
subroutine, public ocean_admin_setup
Setup.
module GRID (cartesian)
subroutine, public real_update_z
Re-setup with updated topography.
subroutine, public prof_rapstart(rapname_base, level)
Start raptime.
Definition: scale_prof.F90:156
module MKTOPO
Definition: mod_mktopo.f90:14
subroutine, public fileio_cleanup
deallocate buffers
module RM PROCESS
subroutine, public hist_setup
Setup.
subroutine, public land_grid_index_setup
Setup.
module profiler
Definition: scale_prof.F90:10
subroutine, public atmos_hydrometeor_setup
Setup.
module ATMOSPHERE / Thermodynamics
subroutine, public cpl_admin_setup
Setup.
subroutine, public user_config
Config before setup of other components.
Definition: mod_user.f90:56
module PRECISION
subroutine, public atmos_admin_setup
Setup.
subroutine, public ocean_vars_setup
Setup.
module SCALE-RM prep
Definition: mod_rm_prep.f90:18
module HISTORY
module TOPOGRAPHY
module ADMIN TIME
module CALENDAR
module land grid index
subroutine, public prc_local_setup(comm, myrank, ismaster)
Setup MPI.
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
subroutine, public comm_setup
Setup.
Definition: scale_comm.F90:165
module INITIAL
Definition: mod_mkinit.f90:31
subroutine, public urban_admin_setup
Setup.
module RANDOM
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
module Coupler admin
subroutine, public prof_rapend(rapname_base, level)
Save raptime.
Definition: scale_prof.F90:204
module Urban admin
subroutine, public mkinit_setup
Setup.
Definition: mod_mkinit.f90:228
module OCEAN Variables
integer, public io_fid_nml
Log file ID (only for output namelist)
Definition: scale_stdio.F90:57
subroutine, public atmos_hydrostatic_setup
Setup.
module INTERPOLATION
subroutine, public grid_setup
Setup.
subroutine, public prof_rapreport
Report raptime.
Definition: scale_prof.F90:246
module urban grid index
subroutine, public loginit(fid_conf, fid_log, master, fid_nml, master_nml)
Definition: dc_log.f90:75