SCALE-RM
mod_admin_restart.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
9 !-------------------------------------------------------------------------------
10 #include "scalelib.h"
12  !-----------------------------------------------------------------------------
13  !
14  !++ used modules
15  !
16  use scale_precision
17  use scale_io
18  use scale_prof
19  !-----------------------------------------------------------------------------
20  implicit none
21  private
22  !-----------------------------------------------------------------------------
23  !
24  !++ Public procedure
25  !
26  public :: admin_restart_setup
27  public :: admin_restart_write
28  public :: admin_restart_read
29 
30  !-----------------------------------------------------------------------------
31  !
32  !++ Public parameters & variables
33  !
34  !-----------------------------------------------------------------------------
35  !
36  !++ Private procedure
37  !
38  !-----------------------------------------------------------------------------
39  !
40  !++ Private parameters & variables
41  !
42  logical, public :: restart_output = .false.
43 
44  character(len=H_LONG), public :: restart_in_basename = ''
45  logical, public :: restart_in_aggregate
46  logical, public :: restart_in_postfix_timelabel = .false.
47  character(len=H_LONG), public :: restart_out_basename = ''
48  logical, public :: restart_out_aggregate
49  logical, public :: restart_out_postfix_timelabel = .true.
50  character(len=H_MID), public :: restart_out_title = ''
51  character(len=H_SHORT), public :: restart_out_dtype = 'DEFAULT'
52 
53  !-----------------------------------------------------------------------------
54 contains
55  !-----------------------------------------------------------------------------
57  subroutine admin_restart_setup
58  use scale_prc, only: &
59  prc_abort
60  use scale_file, only: &
62  use mod_atmos_vars, only: &
72  use mod_atmos_dyn_vars, only: &
82  use mod_atmos_phy_mp_vars, only: &
92  use mod_atmos_phy_ae_vars, only: &
102  use mod_atmos_phy_ch_vars, only: &
112  use mod_atmos_phy_rd_vars, only: &
122  use mod_atmos_phy_sf_vars, only: &
132  use mod_atmos_phy_tb_vars, only: &
142  use mod_atmos_phy_cp_vars, only: &
152  use mod_ocean_vars, only: &
162  use mod_land_vars, only: &
172  use mod_urban_vars, only: &
182  implicit none
183 
184  namelist / param_restart / &
185  restart_output, &
194 
195  integer :: ierr
196  !---------------------------------------------------------------------------
197 
198  log_newline
199  log_info("ADMIN_restart_setup",*) 'Setup'
200 
203 
204  !--- read namelist
205  rewind(io_fid_conf)
206  read(io_fid_conf,nml=param_restart,iostat=ierr)
207  if( ierr < 0 ) then !--- missing
208  log_info("ADMIN_restart_setup",*) 'Not found namelist. Default used.'
209  elseif( ierr > 0 ) then !--- fatal error
210  log_error("ADMIN_restart_setup",*) 'Not appropriate names in namelist PARAM_RESTART. Check!'
211  call prc_abort
212  endif
213  log_nml(param_restart)
214 
215  !--- set default output switch
228 
229  !--- set default input filename
230  if ( restart_in_basename /= '' ) then
243  endif
244 
257 
270 
271  !--- set default output filename
272  if ( restart_out_basename /= '' ) then
285  endif
286 
299 
312 
313  !--- set default output title
314  if ( restart_out_title /= '' ) then
327  endif
328 
329  !--- set default output data type
330  if ( restart_out_dtype /= '' ) then
343  endif
344 
345  return
346  end subroutine admin_restart_setup
347 
348  !-----------------------------------------------------------------------------
350  subroutine admin_restart_write
351  use scale_landuse, only: &
353  use mod_admin_time, only: &
358  use mod_atmos_vars, only: &
365  use mod_ocean_vars, only: &
372  use mod_land_vars, only: &
379  use mod_urban_vars, only: &
386  implicit none
387  !---------------------------------------------------------------------------
388 
389  ! restart files can be different for different models
390 
391  ! cread restart netCDF file(s)
396 
397  ! define metadata (dimensions, variables, attributes) in netCDF file
402 
403  ! exit define mode
408 
409  ! write variabes to netCDF file
414 
415  ! clode the restart file
420 
421  ! output landuse data actually used in the simulation
422  call landuse_write
423 
424  return
425  end subroutine admin_restart_write
426 
427  !-----------------------------------------------------------------------------
429  subroutine admin_restart_read
430  use mod_atmos_admin, only: &
431  atmos_do
432  use mod_ocean_admin, only: &
433  ocean_do
434  use mod_land_admin, only: &
435  land_do
436  use mod_urban_admin, only: &
437  urban_do
438  use mod_ocean_vars, only: &
442  use mod_land_vars, only: &
446  use mod_urban_vars, only: &
450  use mod_atmos_vars, only: &
454  implicit none
455 
456  ! restart files can be different for different models
457 
458  ! open restart netCDF file
461  if ( land_do ) call land_vars_restart_open
463 
464  ! read restart data
467  if ( land_do ) call land_vars_restart_read
469 
470  ! clode the restart file
473  if ( land_do ) call land_vars_restart_close
475 
476  end subroutine admin_restart_read
477 
478 end module mod_admin_restart
logical, public atmos_phy_ae_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
module ATMOS admin
logical, public atmos_dyn_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
logical, public atmos_phy_sf_restart_out_aggregate
Switch to use aggregate file.
module Land admin
logical, public atmos_phy_rd_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
character(len=h_long), public atmos_phy_ae_restart_in_basename
Basename of the input file.
logical, public land_restart_out_aggregate
Switch to use aggregate file.
subroutine, public atmos_vars_restart_open
Open restart file for reading atmospheric variables.
character(len=h_mid), public atmos_phy_ch_restart_out_title
title of the output file
module Atmosphere / Physics Cumulus
subroutine, public land_vars_restart_close
Close restart file.
character(len=h_mid), public atmos_phy_cp_restart_out_title
title of the output file
logical, public land_restart_output
Output restart file?
character(len=h_long), public atmos_phy_sf_restart_out_basename
Basename of the output file.
character(len=h_long), public atmos_phy_cp_restart_in_basename
Basename of the input file.
logical, public atmos_phy_mp_restart_in_aggregate
Switch to use aggregate file.
character(len=h_short), public atmos_dyn_restart_out_dtype
REAL4 or REAL8.
subroutine, public ocean_vars_restart_open
Open ocean restart file for read.
character(len=h_long), public atmos_dyn_restart_in_basename
Basename of the input file.
subroutine, public atmos_vars_restart_close
Close restart file.
logical, public atmos_phy_sf_restart_in_aggregate
Switch to use aggregate file.
character(len=h_long), public atmos_phy_rd_restart_in_basename
Basename of the input file.
subroutine, public urban_vars_restart_create
Create urban restart file.
module Atmosphere / Physics Cloud Microphysics
logical, public atmos_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
logical, public file_aggregate
Definition: scale_file.F90:171
character(len=h_mid), public atmos_phy_rd_restart_out_title
title of the output file
character(len=h_long), public atmos_phy_mp_restart_in_basename
Basename of the input file.
module Atmosphere / Dynamics
subroutine, public ocean_vars_restart_write
Write ocean variables to restart file.
logical, public atmos_phy_cp_restart_output
output restart file?
subroutine, public urban_vars_restart_enddef
Exit netCDF define mode.
logical, public atmos_phy_ae_restart_output
output restart file?
logical, public ocean_do
module ATMOSPHERIC Variables
subroutine, public urban_vars_restart_read
Read urban restart.
logical, public atmos_phy_cp_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
character(len=h_long), public atmos_phy_cp_restart_out_basename
Basename of the output file.
subroutine, public atmos_vars_restart_write
Write restart of atmospheric variables.
character(len=h_short), public ocean_restart_out_dtype
REAL4 or REAL8.
logical, public atmos_phy_mp_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
logical, public time_doatmos_restart
execute atmosphere restart output in this step?
character(len=h_short), public atmos_restart_out_dtype
REAL4 or REAL8.
logical, public time_doocean_restart
execute ocean restart output in this step?
logical, public restart_out_postfix_timelabel
Add timelabel to the basename of output file?
logical, public atmos_phy_ae_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
subroutine, public ocean_vars_restart_def_var
Define ocean variables in restart file.
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
logical, public urban_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
logical, public atmos_phy_cp_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
subroutine, public land_vars_restart_enddef
Exit netCDF define mode.
logical, public atmos_phy_tb_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
character(len=h_mid), public atmos_phy_tb_restart_out_title
title of the output file
character(len=h_long), public land_restart_in_basename
Basename of the input file.
logical, public atmos_restart_in_aggregate
Switch to use aggregate file.
character(len=h_short), public land_restart_out_dtype
REAL4 or REAL8.
module URBAN Variables
logical, public atmos_dyn_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
subroutine, public ocean_vars_restart_enddef
Exit netCDF define mode.
character(len=h_mid), public atmos_dyn_restart_out_title
title of the output file
logical, public atmos_phy_ch_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
character(len=h_short), public atmos_phy_cp_restart_out_dtype
REAL4 or REAL8.
logical, public atmos_dyn_restart_in_aggregate
Switch to use aggregate file.
logical, public atmos_phy_rd_restart_in_aggregate
Switch to use aggregate file.
character(len=h_short), public urban_restart_out_dtype
REAL4 or REAL8.
logical, public restart_output
Output restart file?
subroutine, public land_vars_restart_create
Create land restart file.
logical, public atmos_restart_output
Output restart file?
subroutine, public ocean_vars_restart_create
Create ocean restart file.
module Atmosphere / Physics Radiation
subroutine, public urban_vars_restart_write
Write urban restart.
subroutine, public land_vars_restart_read
Read land restart.
character(len=h_long), public atmos_phy_rd_restart_out_basename
Basename of the output file.
character(len=h_long), public atmos_phy_tb_restart_in_basename
Basename of the input file.
module file
Definition: scale_file.F90:15
module ATMOSPHERIC Surface Variables
subroutine, public urban_vars_restart_close
Close restart file.
character(len=h_mid), public atmos_phy_mp_restart_out_title
title of the output file
logical, public atmos_phy_rd_restart_out_aggregate
Switch to use aggregate file.
character(len=h_long), public urban_restart_out_basename
Basename of the output file.
subroutine, public admin_restart_setup
Setup.
logical, public atmos_phy_tb_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
logical, public atmos_phy_tb_restart_out_aggregate
Switch to use aggregate file.
module LANDUSE
logical, public atmos_phy_ch_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
character(len=h_long), public atmos_phy_mp_restart_out_basename
Basename of the output file.
logical, public atmos_phy_cp_restart_in_aggregate
Switch to use aggregate file.
logical, public atmos_dyn_restart_output
output restart file?
logical, public land_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
logical, public atmos_phy_cp_restart_out_aggregate
Switch to use aggregate file.
logical, public ocean_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
logical, public atmos_phy_ch_restart_output
output restart file?
character(len=h_long), public land_restart_out_basename
Basename of the output file.
module PROCESS
Definition: scale_prc.F90:11
character(len=h_short), public atmos_phy_ch_restart_out_dtype
REAL4 or REAL8.
logical, public atmos_phy_mp_restart_out_aggregate
Switch to use aggregate file.
character(len=h_long), public atmos_phy_ch_restart_out_basename
Basename of the output file.
logical, public atmos_do
subroutine, public landuse_write
Write landuse data.
subroutine, public land_vars_restart_def_var
Define land variables in restart file.
character(len=h_long), public atmos_phy_sf_restart_in_basename
Basename of the input file.
logical, public ocean_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
character(len=h_short), public atmos_phy_sf_restart_out_dtype
REAL4 or REAL8.
logical, public land_restart_in_aggregate
Switch to use aggregate file.
logical, public atmos_restart_out_aggregate
Switch to use aggregate file.
character(len=h_mid), public atmos_phy_sf_restart_out_title
title of the output file
logical, public atmos_phy_tb_restart_in_aggregate
Switch to use aggregate file.
module Ocean admin
logical, public atmos_phy_rd_restart_output
output restart file?
character(len=h_mid), public atmos_phy_ae_restart_out_title
title of the output file
logical, public urban_restart_out_aggregate
Switch to use aggregate file.
logical, public atmos_phy_mp_restart_output
output restart file?
character(len=h_long), public restart_out_basename
Basename of the output file.
module Atmosphere / Physics Turbulence
logical, public atmos_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
subroutine, public ocean_vars_restart_read
Read ocean restart.
logical, public restart_in_aggregate
Switch to use aggregate file.
module LAND Variables
logical, public atmos_phy_sf_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
module administrator for restart
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
character(len=h_short), public atmos_phy_ae_restart_out_dtype
REAL4 or REAL8.
logical, public atmos_phy_ae_restart_out_aggregate
Switch to use aggregate file.
character(len=h_short), public atmos_phy_mp_restart_out_dtype
REAL4 or REAL8.
character(len=h_short), public atmos_phy_rd_restart_out_dtype
REAL4 or REAL8.
logical, public time_dourban_restart
execute urban restart output in this step?
logical, public urban_restart_output
Output restart file?
module Atmosphere / Physics Chemistry
logical, public land_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
subroutine, public atmos_vars_restart_create
Create atmospheric restart file.
subroutine, public admin_restart_write
Write data to restart files.
subroutine, public atmos_vars_restart_enddef
Exit netCDF define mode.
module profiler
Definition: scale_prof.F90:11
character(len=h_mid), public land_restart_out_title
Title of the output file.
character(len=h_mid), public atmos_restart_out_title
Title of the output file.
subroutine, public urban_vars_restart_open
Open urban restart file for read.
character(len=h_long), public atmos_phy_tb_restart_out_basename
Basename of the output file.
logical, public urban_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
logical, public urban_restart_in_aggregate
Switch to use aggregate file.
logical, public restart_in_postfix_timelabel
Add timelabel to the basename of input file?
logical, public atmos_phy_tb_restart_output
output restart file?
character(len=h_long), public atmos_restart_in_basename
Basename of the input file.
character(len=h_long), public restart_in_basename
Basename of the input file.
module PRECISION
character(len=h_long), public atmos_restart_out_basename
Basename of the output file.
logical, public atmos_phy_sf_restart_in_postfix_timelabel
Add timelabel to the basename of input file?
logical, public atmos_phy_ch_restart_in_aggregate
Switch to use aggregate file.
character(len=h_long), public ocean_restart_in_basename
Basename of the input file.
logical, public time_doland_restart
execute land restart output in this step?
character(len=h_short), public restart_out_dtype
REAL4 or REAL8.
module ADMIN TIME
subroutine, public urban_vars_restart_def_var
Define urban variables in restart file.
character(len=h_mid), public restart_out_title
Title of the output file.
subroutine, public land_vars_restart_open
Open land restart file for read.
character(len=h_long), public ocean_restart_out_basename
Basename of the output file.
subroutine, public atmos_vars_restart_def_var
Define atmospheric variables in restart file.
module STDIO
Definition: scale_io.F90:10
logical, public ocean_restart_in_aggregate
Switch to use aggregate file.
logical, public restart_out_aggregate
Switch to use aggregate file.
logical, public ocean_restart_output
Output restart file?
subroutine, public ocean_vars_restart_close
Close restart file.
subroutine, public land_vars_restart_write
Write land variables to restart file.
logical, public atmos_dyn_restart_out_aggregate
Switch to use aggregate file.
character(len=h_short), public atmos_phy_tb_restart_out_dtype
REAL4 or REAL8.
character(len=h_long), public atmos_phy_ae_restart_out_basename
Basename of the output file.
module Urban admin
logical, public urban_do
module ATMOSPHERE / Physics Aerosol Microphysics
module OCEAN Variables
logical, public land_do
logical, public atmos_phy_mp_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
logical, public atmos_phy_ae_restart_in_aggregate
Switch to use aggregate file.
subroutine, public atmos_vars_restart_read
Read restart of atmospheric variables.
subroutine, public admin_restart_read
Read from restart files.
character(len=h_long), public urban_restart_in_basename
Basename of the input file.
logical, public atmos_phy_ch_restart_out_aggregate
Switch to use aggregate file.
character(len=h_long), public atmos_phy_ch_restart_in_basename
Basename of the input file.
character(len=h_mid), public ocean_restart_out_title
Title of the output file.
logical, public atmos_phy_rd_restart_out_postfix_timelabel
Add timelabel to the basename of output file?
character(len=h_mid), public urban_restart_out_title
Title of the output file.
logical, public ocean_restart_out_aggregate
Switch to use aggregate file.
character(len=h_long), public atmos_dyn_restart_out_basename
Basename of the output file.
logical, public atmos_phy_sf_restart_output
output restart file?