SCALE-RM
Functions/Subroutines
mod_rm_driver Module Reference

module SCALE-RM (a main routine of regional model) More...

Functions/Subroutines

subroutine, public scalerm (comm_world, intercomm_parent, intercomm_child, cnf_fname)
 Setup. More...
 
subroutine resume_state
 

Detailed Description

module SCALE-RM (a main routine of regional model)

Description
SCALE: Scalable Computing by Advanced Library and Environment Limited area model for regional weather, regional climate, and large-Eddy Simulation (LES)
Author
Team SCALE
History
  • 2014-12-12 (R.Yoshida) [mod] from program of scalerm

Function/Subroutine Documentation

◆ scalerm()

subroutine, public mod_rm_driver::scalerm ( integer, intent(in)  comm_world,
integer, intent(in)  intercomm_parent,
integer, intent(in)  intercomm_child,
character(len=*), intent(in)  cnf_fname 
)

Setup.

Definition at line 64 of file mod_rm_driver.f90.

References mod_admin_restart::admin_restart_setup(), mod_admin_restart::admin_restart_write(), mod_admin_time::admin_time_advance(), mod_admin_time::admin_time_checkstate(), mod_admin_time::admin_time_setup(), mod_atmos_admin::atmos_admin_setup(), mod_atmos_admin::atmos_do, mod_atmos_driver::atmos_driver(), mod_atmos_driver::atmos_driver_config(), mod_atmos_driver::atmos_driver_finalize(), mod_atmos_driver::atmos_driver_setup(), scale_atmos_hydrometeor::atmos_hydrometeor_setup(), scale_atmos_hydrostatic::atmos_hydrostatic_setup(), mod_atmos_vars::atmos_restart_check, scale_atmos_saturation::atmos_saturation_setup(), scale_atmos_thermodyn::atmos_thermodyn_setup(), mod_atmos_vars::atmos_vars_restart_check(), mod_atmos_vars::atmos_vars_setup(), scale_bulkflux::bulkflux_setup(), scale_calendar::calendar_setup(), scale_comm::comm_cleanup(), scale_comm::comm_setup(), scale_const::const_setup(), mod_cpl_admin::cpl_admin_setup(), mod_cpl_vars::cpl_vars_setup(), scale_grid::dx, scale_grid::dy, scale_external_input::extin_setup(), gtool_file::filecloseall(), scale_fileio::fileio_cleanup(), scale_fileio::fileio_setup(), scale_grid_index::grid_index_setup(), scale_grid::grid_setup(), scale_gridtrans::gtrans_setup(), scale_history::hist_setup(), scale_history::hist_write(), scale_interpolation::interp_setup(), scale_stdio::io_fid_conf, scale_stdio::io_fid_log, scale_stdio::io_fid_nml, scale_stdio::io_l, scale_stdio::io_log_setup(), scale_stdio::io_nml, scale_stdio::io_setup(), mod_land_admin::land_admin_setup(), mod_land_admin::land_do, mod_land_driver::land_driver(), mod_land_driver::land_driver_setup(), scale_land_grid_index::land_grid_index_setup(), scale_land_grid::land_grid_setup(), mod_land_vars::land_vars_setup(), scale_landuse::landuse_setup(), dc_log::loginit(), scale_monitor::monit_finalize(), scale_monitor::monit_setup(), scale_monitor::monit_write(), scale_grid_nest::nest_setup(), mod_ocean_admin::ocean_admin_setup(), mod_ocean_admin::ocean_do, mod_ocean_driver::ocean_driver(), mod_ocean_driver::ocean_driver_setup(), mod_ocean_vars::ocean_vars_setup(), scale_process::prc_local_setup(), scale_rm_process::prc_setup(), scale_prof::prof_rapend(), scale_prof::prof_rapreport(), scale_prof::prof_rapstart(), scale_prof::prof_setprefx(), scale_prof::prof_setup(), scale_random::random_setup(), scale_grid_real::real_setup(), resume_state(), scale_roughness::roughness_setup(), scale_rm_statistics::stat_setup(), mod_admin_time::time_doatmos_step, mod_admin_time::time_doend, mod_admin_time::time_doland_step, mod_admin_time::time_doocean_step, mod_admin_time::time_doresume, mod_admin_time::time_dourban_step, scale_topography::topo_setup(), mod_urban_admin::urban_admin_setup(), mod_urban_admin::urban_do, mod_urban_driver::urban_driver(), mod_urban_driver::urban_driver_setup(), scale_urban_grid_index::urban_grid_index_setup(), scale_urban_grid::urban_grid_setup(), mod_urban_vars::urban_vars_setup(), mod_user::user_config(), mod_user::user_setup(), and mod_user::user_step().

Referenced by scalerm_launcher().

64  use scale_process, only: &
66  use scale_rm_process, only: &
67  prc_setup
68  use scale_const, only: &
70  use scale_calendar, only: &
72  use scale_random, only: &
74  use scale_grid_index, only: &
76  use scale_grid, only: &
77  grid_setup, &
78  dx, &
79  dy
80  use scale_grid_nest, only: &
82  use scale_land_grid_index, only: &
84  use scale_land_grid, only: &
86  use scale_urban_grid_index, only: &
88  use scale_urban_grid, only: &
90  use scale_fileio, only: &
91  fileio_setup, &
93  use scale_comm, only: &
94  comm_setup , &
96  use scale_topography, only: &
98  use scale_landuse, only: &
100  use scale_grid_real, only: &
101  real_setup
102  use scale_gridtrans, only: &
104  use scale_interpolation, only: &
106  use scale_rm_statistics, only: &
107  stat_setup
108  use scale_history, only: &
109  hist_setup, &
110  hist_write
111  use scale_monitor, only: &
112  monit_setup, &
113  monit_write, &
115  use scale_external_input, only: &
117  use scale_atmos_hydrostatic, only: &
119  use scale_atmos_thermodyn, only: &
121  use scale_atmos_hydrometeor, only: &
123  use scale_atmos_saturation, only: &
125  use scale_bulkflux, only: &
127  use scale_roughness, only: &
129 
130  use mod_atmos_driver, only: &
132  use mod_admin_restart, only: &
135  use mod_admin_time, only: &
143  time_doresume, &
144  time_doend
145  use mod_atmos_admin, only: &
147  atmos_do
148  use mod_atmos_vars, only: &
150  atmos_sw_check => atmos_restart_check, &
152  use mod_atmos_driver, only: &
154  atmos_driver, &
156  use mod_ocean_admin, only: &
158  ocean_do
159  use mod_ocean_vars, only: &
161  use mod_ocean_driver, only: &
164  use mod_land_admin, only: &
166  land_do
167  use mod_land_vars, only: &
169  use mod_land_driver, only: &
172  use mod_urban_admin, only: &
174  urban_do
175  use mod_urban_vars, only: &
177  use mod_urban_driver, only: &
180  use mod_cpl_admin, only: &
182  use mod_cpl_vars, only: &
184  use mod_user, only: &
185  user_config, &
186  user_setup, &
187  user_step
188  implicit none
189 
190  integer, intent(in) :: comm_world
191  integer, intent(in) :: intercomm_parent
192  integer, intent(in) :: intercomm_child
193  character(len=*), intent(in) :: cnf_fname
194 
195  integer :: myrank
196  logical :: ismaster
197  !---------------------------------------------------------------------------
198 
199  !########## Initial setup ##########
200 
201  ! setup standard I/O
202  call io_setup( modelname, .true., cnf_fname )
203 
204  ! setup MPI
205  call prc_local_setup( comm_world, & ! [IN]
206  myrank, & ! [OUT]
207  ismaster ) ! [OUT]
208 
209  ! setup Log
210  call io_log_setup( myrank, ismaster )
211  call loginit( io_fid_conf, &
212  io_fid_log, io_l, &
213  io_fid_nml, io_nml )
214 
215  ! setup process
216  call prc_setup
217 
218  ! setup PROF
219  call prof_setup
220 
221 
222  ! profiler start
223  call prof_setprefx('INIT')
224  call prof_rapstart('Initialize', 0)
225 
226 
227  ! setup constants
228  call const_setup
229 
230  ! setup calendar
231  call calendar_setup
232 
233  ! setup random number
234  call random_setup
235 
236  ! setup horizontal/vertical grid coordinates (cartesian,idealized)
237  call grid_index_setup
238  call grid_setup
239 
241  call land_grid_setup
242 
244  call urban_grid_setup
245 
246  ! setup submodel administrator
247  call atmos_admin_setup
248  call ocean_admin_setup
249  call land_admin_setup
250  call urban_admin_setup
251  call cpl_admin_setup
252 
253  ! setup tracer index
255  call atmos_driver_config
256  call user_config
257 
258  ! setup file I/O
259  call fileio_setup
260 
261  ! setup mpi communication
262  call comm_setup
263 
264  ! setup topography
265  call topo_setup
266  ! setup land use category index/fraction
267  call landuse_setup
268  ! setup grid coordinates (real world)
269  call real_setup
270 
271  ! setup grid transfer metrics (uses in ATMOS_dynamics)
272  call gtrans_setup
273  ! setup Z-ZS interpolation factor (uses in History)
274  call interp_setup
275 
276  ! setup restart
278  ! setup time
279  call admin_time_setup( setup_timeintegration = .true. )
280  ! setup statistics
281  call stat_setup
282  ! setup history I/O
283  call hist_setup
284  ! setup monitor I/O
285  call monit_setup
286  ! setup external in
287  call extin_setup( 'RM' )
288 
289  ! setup nesting grid
290  call nest_setup ( intercomm_parent, intercomm_child )
291 
292  ! setup common tools
296 
297  call bulkflux_setup( sqrt(dx**2+dy**2) )
298  call roughness_setup
299 
300  ! setup variable container
301  call atmos_vars_setup
302  call ocean_vars_setup
303  call land_vars_setup
304  call urban_vars_setup
305  call cpl_vars_setup
306 
307  ! setup submodel driver
308  call atmos_driver_setup
309  call ocean_driver_setup
310  call land_driver_setup
311  call urban_driver_setup
312 
313  call user_setup
314 
315  call prof_rapend('Initialize', 0)
316 
317  !########## main ##########
318 
319 #ifdef FIPP
320  call fipp_start
321 #endif
322 #ifdef PAPI
323  call prof_papi_rapstart
324 #endif
325 
326  if( io_l ) write(io_fid_log,*)
327  if( io_l ) write(io_fid_log,*) '++++++ START TIMESTEP ++++++'
328  call prof_setprefx('MAIN')
329  call prof_rapstart('Main_Loop', 0)
330 
331  do
332 
333  ! report current time
335 
336  if ( time_doresume ) then
337  ! resume state from restart files
338  call resume_state
339 
340  ! history&monitor file output
341  call monit_write('MAIN')
342  call hist_write ! if needed
343  end if
344 
345 
346  ! time advance
347  call admin_time_advance
348 
349  ! user-defined procedure
350  call user_step
351 
352  ! change to next state
353  if( ocean_do .AND. time_doocean_step ) call ocean_driver
354  if( land_do .AND. time_doland_step ) call land_driver
355  if( urban_do .AND. time_dourban_step ) call urban_driver
356  if( atmos_do .AND. time_doatmos_step ) call atmos_driver
357 
358  ! history&monitor file output
359  call monit_write('MAIN')
360  call hist_write
361 
362  ! restart output
364 
365  if( time_doend ) exit
366 
367  if( io_l ) call flush(io_fid_log)
368 
369  enddo
370 
371  call prof_rapend('Main_Loop', 0)
372 
373  if( io_l ) write(io_fid_log,*) '++++++ END TIMESTEP ++++++'
374  if( io_l ) write(io_fid_log,*)
375 
376 
377  call prof_setprefx('FIN')
378 
379  call prof_rapstart('All', 1)
380 
382 
383 #ifdef FIPP
384  call fipp_stop
385 #endif
386 #ifdef PAPI
387  call prof_papi_rapstop
388 #endif
389 
390  !########## Finalize ##########
391 
392  ! check data
393  if( atmos_sw_check ) call atmos_vars_restart_check
394 
395  call prof_rapstart('Monit', 2)
396  call monit_finalize
397  call prof_rapend ('Monit', 2)
398 
399  call prof_rapstart('File', 2)
400  ! clean up resource allocated for I/O
401  call fileio_cleanup
402 
403  call comm_cleanup
404 
405  call filecloseall
406  call prof_rapend ('File', 2)
407 
408  call prof_rapend ('All', 1)
409 
410  call prof_rapreport
411 #ifdef PAPI
412  call prof_papi_rapreport
413 #endif
414 
415  return
module ATMOS admin
module Land admin
subroutine, public nest_setup(inter_parent, inter_child)
Setup.
subroutine, public monit_finalize
Close file.
subroutine, public interp_setup
Setup.
real(rp), public dy
length in the main region [m]: y
module ATMOSPHERE / Saturation adjustment
logical, public time_dourban_step
execute urban component in this step?
subroutine, public atmos_saturation_setup
Setup.
subroutine, public urban_grid_index_setup
Setup.
logical, public time_doend
finish program in this step?
subroutine, public ocean_driver_setup
Setup.
module GRID (nesting system)
subroutine, public user_step
User step.
Definition: mod_user.f90:148
real(rp), public dx
length in the main region [m]: x
module URBAN driver
module USER
Definition: mod_user.f90:14
subroutine, public landuse_setup
Setup.
subroutine, public random_setup
Setup.
subroutine, public roughness_setup
subroutine, public prc_setup
Setup Processor topology.
logical, public ocean_do
subroutine, public land_vars_setup
Setup.
module ATMOSPHERIC Variables
subroutine, public fileio_setup
Setup.
subroutine, public grid_index_setup
Setup.
subroutine, public extin_setup(model)
Setup.
module GRID (cartesian) for land
subroutine, public atmos_driver_config
Config.
module URBAN Variables
module FILE I/O (netcdf)
subroutine, public land_admin_setup
Setup.
module Statistics
module grid index
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
logical, public time_doocean_step
execute ocean component in this step?
subroutine, public calendar_setup
Setup.
module GRID (real space)
module LANDUSE
logical, public time_doresume
resume in this step?
subroutine, public land_driver_setup
Setup.
module OCEAN driver
subroutine, public cpl_vars_setup
Setup.
subroutine, public hist_write
Flush history buffer to file.
module COUPLER Variables
module MONITOR
subroutine, public urban_driver
Urban step.
subroutine, public atmos_vars_setup
Setup.
module ATMOSPHERE driver
subroutine, public const_setup
Setup.
logical, public atmos_do
subroutine, public comm_cleanup
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 atmos_thermodyn_setup
Setup.
subroutine, public atmos_driver_setup
Setup.
subroutine, public ocean_driver
Ocean step.
module LAND Variables
module administrator for restart
subroutine, public urban_vars_setup
Setup.
subroutine, public urban_driver_setup
Setup.
module CONSTANT
Definition: scale_const.F90:14
module EXTERNAL INPUT
subroutine, public gtrans_setup
Setup.
subroutine, public ocean_admin_setup
Setup.
module GRID (cartesian)
subroutine, public fileio_cleanup
deallocate buffers
module RM PROCESS
subroutine, public hist_setup
Setup.
subroutine, public admin_restart_write
Write data to restart files.
subroutine, public land_grid_index_setup
Setup.
subroutine, public monit_write(memo)
Flush monitor buffer to formatted file.
logical, public atmos_restart_check
Check value consistency?
module Surface bulk flux
subroutine, public atmos_hydrometeor_setup
Setup.
module ATMOSPHERE / Thermodynamics
subroutine, public admin_time_advance
Advance the time & evaluate restart & stop.
subroutine, public atmos_driver_finalize
Finalize.
subroutine, public cpl_admin_setup
Setup.
subroutine, public user_config
Config before setup of other components.
Definition: mod_user.f90:56
logical, public time_doatmos_step
execute atmosphere component in this step?
subroutine, public monit_setup
Setup.
subroutine, public atmos_admin_setup
Setup.
subroutine, public ocean_vars_setup
Setup.
module HISTORY
module TOPOGRAPHY
module ADMIN TIME
module CALENDAR
subroutine, public atmos_driver
advance atmospheric state
module land grid index
subroutine, public prc_local_setup(comm, myrank, ismaster)
Setup MPI.
module Surface roughness length
subroutine, public comm_setup
Setup.
Definition: scale_comm.F90:165
subroutine, public urban_admin_setup
Setup.
subroutine, public user_setup
Setup before setup of other components.
Definition: mod_user.f90:85
subroutine, public bulkflux_setup(dx)
module RANDOM
module Coupler admin
subroutine, public atmos_vars_restart_check
Check and compare between last data and sample data.
module Urban admin
logical, public urban_do
module LAND driver
logical, public time_doland_step
execute land component in this step?
module OCEAN Variables
logical, public land_do
subroutine, public atmos_hydrostatic_setup
Setup.
module INTERPOLATION
subroutine, public grid_setup
Setup.
subroutine, public admin_time_checkstate
Evaluate component execution.
module urban grid index
subroutine, public land_driver
Land step.
Here is the caller graph for this function:

◆ resume_state()

subroutine mod_rm_driver::resume_state ( )

Definition at line 420 of file mod_rm_driver.f90.

References mod_admin_restart::admin_restart_read(), mod_atmos_admin::atmos_do, mod_atmos_driver::atmos_driver_resume1(), mod_atmos_driver::atmos_driver_resume2(), mod_atmos_driver::atmos_surface_set(), mod_atmos_vars::atmos_vars_diagnostics(), mod_atmos_vars::atmos_vars_history_setpres(), mod_atmos_vars::atmos_vars_restart_read(), mod_land_admin::land_do, mod_land_driver::land_driver_resume(), mod_land_driver::land_surface_set(), mod_land_vars::land_vars_restart_read(), mod_ocean_admin::ocean_do, mod_ocean_driver::ocean_driver_resume(), mod_ocean_driver::ocean_surface_set(), mod_ocean_vars::ocean_vars_restart_read(), mod_urban_admin::urban_do, mod_urban_driver::urban_driver_resume(), mod_urban_driver::urban_surface_set(), mod_urban_vars::urban_vars_restart_read(), mod_user::user_resume(), and mod_user::user_resume0().

Referenced by scalerm().

420  use mod_atmos_driver, only: &
424  use mod_ocean_driver, only: &
427  use mod_land_driver, only: &
430  use mod_urban_driver, only: &
433  use mod_atmos_vars, only: &
437  use mod_ocean_vars, only: &
439  use mod_land_vars, only: &
441  use mod_urban_vars, only: &
443  use mod_user, only: &
444  user_resume0, &
446  use mod_atmos_admin, only: &
447  atmos_do
448  use mod_ocean_admin, only: &
449  ocean_do
450  use mod_land_admin, only: &
451  land_do
452  use mod_urban_admin, only: &
453  urban_do
454  use mod_admin_restart, only: &
456  implicit none
457  !---------------------------------------------------------------------------
458 
459  ! read restart data
460  call admin_restart_read
461 
462  ! setup user-defined procedure before setup of other components
463  call user_resume0
464 
465  if ( atmos_do ) then
466  ! calc diagnostics
469  endif
470 
471  ! setup surface condition
472  if( atmos_do ) call atmos_surface_set( countup=.false. )
473  if( ocean_do ) call ocean_surface_set( countup=.false. )
474  if( land_do ) call land_surface_set ( countup=.false. )
475  if( urban_do ) call urban_surface_set( countup=.false. )
476 
477  ! setup submodel driver
478  if( atmos_do ) call atmos_driver_resume1
479  if( ocean_do ) call ocean_driver_resume
480  if( land_do ) call land_driver_resume
481  if( urban_do ) call urban_driver_resume
482  if( atmos_do ) call atmos_driver_resume2
483 
484  ! setup user-defined procedure
485  call user_resume
486 
487  return
module ATMOS admin
module Land admin
subroutine, public atmos_surface_set(countup)
Set surface boundary condition.
module URBAN driver
module USER
Definition: mod_user.f90:14
logical, public ocean_do
module ATMOSPHERIC Variables
subroutine, public urban_vars_restart_read
Read urban restart.
module URBAN Variables
subroutine, public urban_surface_set(countup)
Set surface boundary to other model.
subroutine, public land_vars_restart_read
Read land restart.
subroutine, public land_driver_resume
Resume.
module OCEAN driver
subroutine, public ocean_surface_set(countup)
Put surface boundary to other model.
module ATMOSPHERE driver
logical, public atmos_do
subroutine, public ocean_driver_resume
Resume.
subroutine, public atmos_driver_resume1
Resume.
subroutine, public urban_driver_resume
Resume.
module Ocean admin
subroutine, public ocean_vars_restart_read
Read ocean restart.
module LAND Variables
module administrator for restart
subroutine, public user_resume
Resuming operation.
Definition: mod_user.f90:133
subroutine, public atmos_vars_history_setpres
Set pressure for history output.
subroutine, public user_resume0
Resuming operation, before calculating tendency.
Definition: mod_user.f90:118
module Urban admin
logical, public urban_do
subroutine, public atmos_driver_resume2
Setup.
module LAND driver
subroutine, public land_surface_set(countup)
Put surface boundary to other model.
module OCEAN Variables
logical, public land_do
subroutine, public atmos_vars_restart_read
Read restart of atmospheric variables.
subroutine, public admin_restart_read
Read from restart files.
subroutine, public atmos_vars_diagnostics
Calc diagnostic variables.
Here is the call graph for this function:
Here is the caller graph for this function: