FE-Project
Loading...
Searching...
No Matches
mod_dg_driver Module Reference

module SCALE-DG (a main routine of regional/global model) More...

Functions/Subroutines

subroutine, public dg_driver (comm_world, cnf_fname, path, add_path)

Detailed Description

module SCALE-DG (a main routine of regional/global model)

Description
SCALE: Scalable Computing by Advanced Library and Environment SCALE-DG: Regional / global model with atmospheric dynamical core based on DGM
Author
Yuta Kawai, Team SCALE

Function/Subroutine Documentation

◆ dg_driver()

subroutine, public mod_dg_driver::dg_driver ( integer, intent(in) comm_world,
character(len=*), intent(in) cnf_fname,
character(len=*), intent(in) path,
logical, intent(in) add_path )

Definition at line 74 of file mod_dg_driver.F90.

77
78 use scale_time_manager, only: &
80 time_nowdate, time_nowsubsec, time_nowstep, time_nstep, &
82
83 implicit none
84
85 integer, intent(in) :: comm_world
86 character(len=*), intent(in) :: cnf_fname
87 character(len=*), intent(in) :: path
88 logical, intent(in) :: add_path
89
90 integer :: myrank
91 integer :: fpm_counter
92 logical :: ismaster
93 logical :: sign_exit
94 !---------------------------------------------------------------------------
95
96 !########## Initial setup ##########
97
98 ! setup standard I/O
99 if ( add_path .and. path /= "" ) then
100 call io_setup( modelname, trim(path)//cnf_fname, prefix=path )
101 else
102 call io_setup( modelname, trim(path)//cnf_fname )
103 end if
104
105 ! setup MPI
106 call prc_local_setup( comm_world, & ! [IN]
107 myrank, & ! [OUT]
108 ismaster ) ! [OUT]
109
110 ! setup Log
111 call io_log_setup( myrank, ismaster )
112
113 call initialize
114
115 !###########################################################################
116
117 !########## main ##########
118
119#ifdef FIPP
120 call fipp_start
121#endif
122
123 log_newline
124 log_progress(*) 'START TIMESTEP'
125 call prof_setprefx('MAIN')
126 call prof_rapstart('Main_Loop', 0)
127
128 do
129
130 !*******************************************
131
132 ! report current time
134
135 if (time_doresume) then
136 ! set state from restart file
137 call restart_read
138 ! history & monitor file output
139 call file_monitor_meshfield_write('MAIN', time_nowstep)
140 call file_history_meshfield_write
141 end if
142
143 !* Advance time *********************************
144
146 call file_history_set_nowdate( time_nowdate, time_nowsubsec, time_nowstep )
147
148 !* change to next state *************************
149
150 !- USER
151 call user_%update_pre( atmos )
152
153 if ( ocean%IsActivated() .and. ocean%time_manager%do_step ) call ocean%update()
154 if ( atmos%IsActivated() .and. atmos%time_manager%do_step ) call atmos%update()
155 call user_%update( atmos )
156
157 !* restart and monitor output *******************
158 if ( atmos%IsActivated() ) call atmos%vars%Monitor()
159 call restart_write
160 call file_monitor_meshfield_write('MAIN', time_nowstep)
161
162
163 !* calc tendencies and diagnostics *************
164
165 if ( atmos %IsActivated() .and. atmos%time_manager%do_step ) call atmos%calc_tendency( force=.false. )
166 if ( ocean %IsActivated() .and. ocean%time_manager%do_step ) call ocean%calc_tendency( force=.false. )
167 if ( coupler%IsActivated() .and. atmos%time_manager%do_step ) call atmos%calc_tendency_from_sflux(force=.false.)
168 call user_%calc_tendency( atmos )
169
170 !* output history files *************************
171
172 if ( atmos%IsActivated() ) call atmos%vars%History()
173 if ( atmos%dyn_proc%IsActivated() ) call atmos%dyn_proc%dyn_vars%History()
174 if ( atmos%phy_tb_proc%IsActivated() ) call atmos%phy_tb_proc%vars%History()
175 if ( atmos%phy_mp_proc%IsActivated() ) call atmos%phy_mp_proc%vars%History()
176 if ( atmos%phy_sfc_proc%IsActivated() ) call atmos%phy_sfc_proc%vars%History()
177 if ( atmos%phy_rd_proc%IsActivated() ) call atmos%phy_rd_proc%vars%History()
178 if ( atmos%phy_bl_proc%IsActivated() ) call atmos%phy_bl_proc%vars%History()
179 if ( atmos%phy_cp_proc%IsActivated() ) call atmos%phy_cp_proc%vars%History()
180
181 if ( ocean%IsActivated() ) call ocean%vars%History()
182
183 call file_history_meshfield_write
184
185 !*******************************************
186 if (time_doend) exit
187
188 if( io_l ) call flush(io_fid_log)
189 end do
190
191 call prof_rapend('Main_Loop', 0)
192
193 log_progress(*) 'END TIMESTEP'
194 log_newline
195
196#ifdef FIPP
197 call fipp_stop
198#endif
199
200 !########## Finalize ##########
201 call finalize
202
203 return
Module common / time.
subroutine, public time_manager_advance()
subroutine, public time_manager_checkstate()
logical, public time_doresume

References scale_file_history_meshfield::file_history_meshfield_finalize(), scale_file_history_meshfield::file_history_meshfield_write(), scale_file_restart_meshfield::file_restart_meshfield_finalize(), scale_file_restart_meshfield::file_restart_meshfield_setup(), scale_meshfield_statistics::meshfield_statistics_setup(), scale_file_restart_meshfield::restart_file, scale_time_manager::time_doend, scale_time_manager::time_doresume, scale_time_manager::time_manager_advance(), scale_time_manager::time_manager_checkstate(), scale_time_manager::time_manager_final(), scale_time_manager::time_manager_init(), and scale_time_manager::time_manager_report_timeintervals().

Referenced by mod_dg_launcher::launcher().