77
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
97
98
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
106 call prc_local_setup( comm_world, &
107 myrank, &
108 ismaster )
109
110
111 call io_log_setup( myrank, ismaster )
112
113 call initialize
114
115
116
117
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
134
136
137 call restart_read
138
139 call file_monitor_meshfield_write('MAIN', time_nowstep)
140 call file_history_meshfield_write
141 end if
142
143
144
146 call file_history_set_nowdate( time_nowdate, time_nowsubsec, time_nowstep )
147
148
149
150
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
158 if ( atmos%IsActivated() ) call atmos%vars%Monitor()
159 call restart_write
160 call file_monitor_meshfield_write('MAIN', time_nowstep)
161
162
163
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
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
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
201 call finalize
202
203 return
subroutine, public time_manager_advance()
subroutine, public time_manager_checkstate()
logical, public time_doend
logical, public time_doresume