1 | MODULE step |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE step *** |
---|
4 | !! Time-stepping : manager of the ocean, tracer and ice time stepping |
---|
5 | !!====================================================================== |
---|
6 | !! History : OPA ! 1991-03 (G. Madec) Original code |
---|
7 | !! - ! 1991-11 (G. Madec) |
---|
8 | !! - ! 1992-06 (M. Imbard) add a first output record |
---|
9 | !! - ! 1996-04 (G. Madec) introduction of dynspg |
---|
10 | !! - ! 1996-04 (M.A. Foujols) introduction of passive tracer |
---|
11 | !! 8.0 ! 1997-06 (G. Madec) new architecture of call |
---|
12 | !! 8.2 ! 1997-06 (G. Madec, M. Imbard, G. Roullet) free surface |
---|
13 | !! - ! 1999-02 (G. Madec, N. Grima) hpg implicit |
---|
14 | !! - ! 2000-07 (J-M Molines, M. Imbard) Open Bondary Conditions |
---|
15 | !! NEMO 1.0 ! 2002-06 (G. Madec) free form, suppress macro-tasking |
---|
16 | !! - ! 2004-08 (C. Talandier) New trends organization |
---|
17 | !! - ! 2005-01 (C. Ethe) Add the KPP closure scheme |
---|
18 | !! - ! 2005-11 (G. Madec) Reorganisation of tra and dyn calls |
---|
19 | !! - ! 2006-01 (L. Debreu, C. Mazauric) Agrif implementation |
---|
20 | !! - ! 2006-07 (S. Masson) restart using iom |
---|
21 | !! 3.2 ! 2009-02 (G. Madec, R. Benshila) reintroduicing z*-coordinate |
---|
22 | !! - ! 2009-06 (S. Masson, G. Madec) TKE restart compatible with key_cpl |
---|
23 | !! 3.3 ! 2010-05 (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface |
---|
24 | !! - ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase + merge TRC-TRA |
---|
25 | !! ! 2011-05 (S. Pickles) dCSE NEMO optimisations - z index first |
---|
26 | !!---------------------------------------------------------------------- |
---|
27 | |
---|
28 | !!---------------------------------------------------------------------- |
---|
29 | !! stp : OPA system time-stepping |
---|
30 | !!---------------------------------------------------------------------- |
---|
31 | USE step_oce ! time stepping definition modules |
---|
32 | #if defined key_top |
---|
33 | USE trcstp ! passive tracer time-stepping (trc_stp routine) |
---|
34 | #endif |
---|
35 | #if defined key_agrif |
---|
36 | USE agrif_opa_sponge ! Momemtum and tracers sponges |
---|
37 | #endif |
---|
38 | USE asminc ! assimilation increments (tra_asm_inc, dyn_asm_inc routines) |
---|
39 | USE timing, ONLY: timing_start, timing_stop, timing_reset, timing_disable |
---|
40 | USE arpdebugging, ONLY: dump_array |
---|
41 | IMPLICIT NONE |
---|
42 | PRIVATE |
---|
43 | |
---|
44 | PUBLIC stp ! called by opa.F90 |
---|
45 | |
---|
46 | !! * Control permutation of array indices |
---|
47 | !! DCSE_NEMO: warning! dom_oce and zdf_oce public variables are made available |
---|
48 | !! through the use of step_oce |
---|
49 | # include "dom_oce_ftrans.h90" |
---|
50 | # include "zdf_oce_ftrans.h90" |
---|
51 | |
---|
52 | !! * Substitutions |
---|
53 | # include "domzgr_substitute.h90" |
---|
54 | # include "zdfddm_substitute.h90" |
---|
55 | !!---------------------------------------------------------------------- |
---|
56 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
57 | !! $Id$ |
---|
58 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
59 | !!---------------------------------------------------------------------- |
---|
60 | CONTAINS |
---|
61 | |
---|
62 | #if defined key_agrif |
---|
63 | SUBROUTINE stp( ) |
---|
64 | INTEGER :: kstp ! ocean time-step index |
---|
65 | #else |
---|
66 | SUBROUTINE stp( kstp ) |
---|
67 | INTEGER, INTENT(in) :: kstp ! ocean time-step index |
---|
68 | #endif |
---|
69 | !!---------------------------------------------------------------------- |
---|
70 | !! *** ROUTINE stp *** |
---|
71 | !! |
---|
72 | !! ** Purpose : - Time stepping of OPA (momentum and active tracer eqs.) |
---|
73 | !! - Time stepping of LIM (dynamic and thermodynamic eqs.) |
---|
74 | !! - Tme stepping of TRC (passive tracer eqs.) |
---|
75 | !! |
---|
76 | !! ** Method : -1- Update forcings and data |
---|
77 | !! -2- Update ocean physics |
---|
78 | !! -3- Compute the t and s trends |
---|
79 | !! -4- Update t and s |
---|
80 | !! -5- Compute the momentum trends |
---|
81 | !! -6- Update the horizontal velocity |
---|
82 | !! -7- Compute the diagnostics variables (rd,N2, div,cur,w) |
---|
83 | !! -8- Outputs and diagnostics |
---|
84 | !!---------------------------------------------------------------------- |
---|
85 | INTEGER :: jk ! dummy loop indice |
---|
86 | INTEGER :: indic ! error indicator if < 0 |
---|
87 | #if defined key_z_first |
---|
88 | INTEGER :: ji, jj ! dummy loop indices |
---|
89 | #endif |
---|
90 | INTEGER, PARAMETER :: DUMP_LEVEL = 26 ! ARPDBG - level to dump to disk |
---|
91 | !! --------------------------------------------------------------------- |
---|
92 | CALL timing_start('Step') |
---|
93 | |
---|
94 | ! IF(kstp==1)CALL dump_array(kstp,'tmask_i_stp',tmask_i, & |
---|
95 | ! withHalos=.TRUE.) |
---|
96 | |
---|
97 | #if defined key_agrif |
---|
98 | kstp = nit000 + Agrif_Nb_Step() |
---|
99 | ! IF ( Agrif_Root() .and. lwp) Write(*,*) '---' |
---|
100 | ! IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp |
---|
101 | # if defined key_iomput |
---|
102 | IF( Agrif_Nbstepint() == 0 ) CALL iom_swap |
---|
103 | # endif |
---|
104 | #endif |
---|
105 | indic = 0 ! reset to no error condition |
---|
106 | IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) |
---|
107 | CALL iom_setkt( kstp ) ! say to iom that we are at time step kstp |
---|
108 | |
---|
109 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
110 | ! Update data, open boundaries, surface boundary condition (including sea-ice) |
---|
111 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
112 | CALL timing_start('Boundaries') |
---|
113 | IF( lk_dtatem ) CALL dta_tem( kstp ) ! update 3D temperature data |
---|
114 | IF( lk_dtasal ) CALL dta_sal( kstp ) ! update 3D salinity data |
---|
115 | CALL sbc ( kstp ) ! Sea Boundary Condition (including sea-ice) |
---|
116 | IF( lk_obc ) CALL obc_dta( kstp ) ! update dynamic and tracer data at open boundaries |
---|
117 | IF( lk_obc ) CALL obc_rad( kstp ) ! compute phase velocities at open boundaries |
---|
118 | IF( lk_bdy ) CALL bdy_dta_frs( kstp ) ! update dynamic and tracer data for FRS conditions (BDY) |
---|
119 | ! ARP - no 'section' arg here so the time taken |
---|
120 | ! in this region (which can involve IO) is |
---|
121 | ! subtracted from the time |
---|
122 | ! taken to do the whole step. |
---|
123 | CALL timing_stop('Boundaries') |
---|
124 | |
---|
125 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
126 | ! Ocean dynamics : ssh, wn, hdiv, rot ! |
---|
127 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
128 | CALL timing_start('Ocean Dyn.') |
---|
129 | CALL ssh_wzv( kstp ) ! after ssh & vertical velocity |
---|
130 | CALL timing_stop('Ocean Dyn.','section') |
---|
131 | |
---|
132 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
133 | ! Ocean physics update (ua, va, ta, sa used as workspace) |
---|
134 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
135 | CALL timing_start('Ocean Phys.') |
---|
136 | CALL bn2( tsb, rn2b ) ! before Brunt-Vaisala frequency |
---|
137 | CALL bn2( tsn, rn2 ) ! now Brunt-Vaisala frequency |
---|
138 | CALL timing_stop('Ocean Phys.','section') |
---|
139 | ! |
---|
140 | ! VERTICAL PHYSICS |
---|
141 | CALL timing_start('Vert. Phys.') |
---|
142 | CALL zdf_bfr( kstp ) ! bottom friction |
---|
143 | |
---|
144 | ! ! Vertical eddy viscosity and diffusivity coefficients |
---|
145 | IF( lk_zdfric ) CALL zdf_ric( kstp ) ! Richardson number dependent Kz |
---|
146 | IF( lk_zdftke ) CALL zdf_tke( kstp ) ! TKE closure scheme for Kz |
---|
147 | IF( lk_zdfgls ) CALL zdf_gls( kstp ) ! GLS closure scheme for Kz |
---|
148 | IF( lk_zdfkpp ) CALL zdf_kpp( kstp ) ! KPP closure scheme for Kz |
---|
149 | IF( lk_zdfcst ) THEN ! Constant Kz (reset avt, avm[uv] to the background value) |
---|
150 | avt (:,:,:) = rn_avt0 * tmask(:,:,:) |
---|
151 | avmu(:,:,:) = rn_avm0 * umask(:,:,:) |
---|
152 | avmv(:,:,:) = rn_avm0 * vmask(:,:,:) |
---|
153 | ENDIF |
---|
154 | IF( ln_rnf_mouth ) THEN ! increase diffusivity at rivers mouths |
---|
155 | #if defined key_z_first |
---|
156 | DO ji = 1, jpi |
---|
157 | DO jj = 1, jpj |
---|
158 | DO jk = 2, nkrnf |
---|
159 | avt(ji,jj,jk) = avt(ji,jj,jk) + 2.e0 * rn_avt_rnf * rnfmsk(ji,jj) * tmask(ji,jj,jk) |
---|
160 | END DO |
---|
161 | END DO |
---|
162 | END DO |
---|
163 | #else |
---|
164 | DO jk = 2, nkrnf |
---|
165 | avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:) * tmask(:,:,jk) |
---|
166 | END DO |
---|
167 | #endif |
---|
168 | ENDIF |
---|
169 | IF( ln_zdfevd ) CALL zdf_evd( kstp ) ! enhanced vertical eddy diffusivity |
---|
170 | |
---|
171 | IF( lk_zdftmx ) CALL zdf_tmx( kstp ) ! tidal vertical mixing |
---|
172 | |
---|
173 | IF( lk_zdfddm .AND. .NOT. lk_zdfkpp ) & |
---|
174 | & CALL zdf_ddm( kstp ) ! double diffusive mixing |
---|
175 | |
---|
176 | CALL zdf_mxl( kstp ) ! mixed layer depth |
---|
177 | |
---|
178 | ! write TKE or GLS information in the restart file |
---|
179 | IF( lrst_oce .AND. lk_zdftke ) CALL tke_rst( kstp, 'WRITE' ) |
---|
180 | IF( lrst_oce .AND. lk_zdfgls ) CALL gls_rst( kstp, 'WRITE' ) |
---|
181 | |
---|
182 | CALL timing_stop('Vert. Phys.','section') |
---|
183 | ! |
---|
184 | ! LATERAL PHYSICS |
---|
185 | ! |
---|
186 | CALL timing_start('Lateral Phys.') |
---|
187 | ! |
---|
188 | IF( lk_ldfslp ) THEN ! slope of lateral mixing |
---|
189 | CALL eos( tsb, rhd ) ! before in situ density |
---|
190 | IF( ln_zps ) CALL zps_hde( kstp, jpts, tsb, gtsu, gtsv, & ! Partial steps: before horizontal gradient |
---|
191 | & rhd, gru , grv ) ! of t, s, rd at the last ocean level |
---|
192 | IF( ln_traldf_grif ) THEN ! before slope for Griffies operator |
---|
193 | CALL ldf_slp_grif( kstp ) |
---|
194 | ELSE |
---|
195 | CALL ldf_slp( kstp, rhd, rn2b ) ! before slope for Madec operator |
---|
196 | ENDIF |
---|
197 | ENDIF |
---|
198 | #if defined key_traldf_c2d |
---|
199 | IF( lk_traldf_eiv ) CALL ldf_eiv( kstp ) ! eddy induced velocity coefficient |
---|
200 | #endif |
---|
201 | CALL timing_stop('Lateral Phys.','section') |
---|
202 | |
---|
203 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
204 | ! diagnostics and outputs (ua, va, ta, sa used as workspace) |
---|
205 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
206 | CALL timing_start('Diagnostics') |
---|
207 | IF( lk_floats ) CALL flo_stp( kstp ) ! drifting Floats |
---|
208 | IF( lk_diahth ) CALL dia_hth( kstp ) ! Thermocline depth (20 degres isotherm depth) |
---|
209 | IF( lk_diafwb ) CALL dia_fwb( kstp ) ! Fresh water budget diagnostics |
---|
210 | IF( ln_diaptr ) CALL dia_ptr( kstp ) ! Poleward TRansports diagnostics |
---|
211 | IF( lk_diaar5 ) CALL dia_ar5( kstp ) ! ar5 diag |
---|
212 | CALL dia_wri( kstp ) ! ocean model: outputs |
---|
213 | CALL timing_stop('Diagnostics','section') |
---|
214 | |
---|
215 | #if defined key_top |
---|
216 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
217 | ! Passive Tracer Model |
---|
218 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
219 | CALL trc_stp( kstp ) ! time-stepping |
---|
220 | #endif |
---|
221 | |
---|
222 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
223 | ! Active tracers (ua, va used as workspace) |
---|
224 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
225 | CALL timing_start('Active tracers') |
---|
226 | |
---|
227 | tsa(:,:,:,:) = 0.e0 ! set tracer trends to zero |
---|
228 | |
---|
229 | IF( ln_asmiau .AND. & |
---|
230 | & ln_trainc ) CALL tra_asm_inc( kstp ) ! apply tracer assimilation increment |
---|
231 | CALL tra_sbc ( kstp ) ! surface boundary condition |
---|
232 | IF( ln_traqsr ) CALL tra_qsr ( kstp ) ! penetrative solar radiation qsr |
---|
233 | IF( ln_trabbc ) CALL tra_bbc ( kstp ) ! bottom heat flux |
---|
234 | IF( lk_trabbl ) CALL tra_bbl ( kstp ) ! advective (and/or diffusive) bottom boundary layer scheme |
---|
235 | IF( lk_tradmp ) CALL tra_dmp ( kstp ) ! internal damping trends |
---|
236 | CALL tra_adv ( kstp ) ! horizontal & vertical advection |
---|
237 | IF( lk_zdfkpp ) CALL tra_kpp ( kstp ) ! KPP non-local tracer fluxes |
---|
238 | CALL tra_ldf ( kstp ) ! lateral mixing |
---|
239 | #if defined key_agrif |
---|
240 | CALL tra_unswap |
---|
241 | IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_tra ! tracers sponge |
---|
242 | CALL tra_swap |
---|
243 | #endif |
---|
244 | CALL tra_zdf ( kstp ) ! vertical mixing and after tracer fields |
---|
245 | |
---|
246 | IF( ln_dynhpg_imp ) THEN ! semi-implicit hpg (time stepping then eos) |
---|
247 | IF( ln_zdfnpc ) CALL tra_npc( kstp ) ! update after fields by non-penetrative convection |
---|
248 | CALL tra_nxt( kstp ) ! tracer fields at next time step |
---|
249 | CALL eos ( tsa, rhd, rhop ) ! Time-filtered in situ density for hpg computation |
---|
250 | IF( ln_zps ) CALL zps_hde( kstp, jpts, tsa, gtsu, gtsv, & ! zps: time filtered hor. derivative |
---|
251 | & rhd, gru , grv ) ! of t, s, rd at the last ocean level |
---|
252 | |
---|
253 | ELSE ! centered hpg (eos then time stepping) |
---|
254 | CALL eos ( tsn, rhd, rhop ) ! now in situ density for hpg computation |
---|
255 | IF( ln_zps ) CALL zps_hde( kstp, jpts, tsn, gtsu, gtsv, & ! zps: now hor. derivative |
---|
256 | & rhd, gru , grv ) ! of t, s, rd at the last ocean level |
---|
257 | IF( ln_zdfnpc ) CALL tra_npc( kstp ) ! update after fields by non-penetrative convection |
---|
258 | CALL tra_nxt( kstp ) ! tracer fields at next time step |
---|
259 | ENDIF |
---|
260 | CALL tra_unswap ! udate T & S 3D arrays (to be suppressed) |
---|
261 | CALL timing_stop('Active tracers','section') |
---|
262 | |
---|
263 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
264 | ! Dynamics (ta, sa used as workspace) |
---|
265 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
266 | CALL timing_start('Dynamics') |
---|
267 | |
---|
268 | ua(:,:,:) = 0.e0 ! set dynamics trends to zero |
---|
269 | va(:,:,:) = 0.e0 |
---|
270 | |
---|
271 | IF( ln_asmiau .AND. & |
---|
272 | & ln_dyninc ) CALL dyn_asm_inc( kstp ) ! apply dynamics assimilation increment |
---|
273 | |
---|
274 | !CALL timing_start('dyn_adv') |
---|
275 | CALL dyn_adv( kstp ) ! advection (vector or flux form) |
---|
276 | !CALL timing_stop('dyn_adv','section') |
---|
277 | |
---|
278 | ! CALL dump_array(kstp,'ua_pre_vor',ua(:,:,DUMP_LEVEL), & |
---|
279 | ! withHalos=.TRUE.,atStep=1) |
---|
280 | |
---|
281 | !CALL timing_start('dyn_vor') |
---|
282 | CALL dyn_vor( kstp ) ! vorticity term including Coriolis |
---|
283 | !CALL timing_stop('dyn_vor','section') |
---|
284 | |
---|
285 | ! CALL dump_array(kstp,'ua_pre_ldf',ua(:,:,DUMP_LEVEL), & |
---|
286 | ! withHalos=.TRUE.,atStep=1) |
---|
287 | |
---|
288 | !CALL timing_start('dyn_ldf') |
---|
289 | CALL dyn_ldf( kstp ) ! lateral mixing |
---|
290 | !CALL timing_stop('dyn_ldf','section') |
---|
291 | |
---|
292 | #if defined key_agrif |
---|
293 | IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_dyn ! momemtum sponge |
---|
294 | #endif |
---|
295 | !CALL dump_array(kstp,'ua_pre_hpg',ua(:,:,DUMP_LEVEL), & |
---|
296 | ! withHalos=.TRUE.) |
---|
297 | |
---|
298 | !CALL timing_start('dyn_hpg') |
---|
299 | CALL dyn_hpg( kstp ) ! horizontal gradient of Hydrostatic pressure |
---|
300 | !CALL timing_stop('dyn_hpg','section') |
---|
301 | |
---|
302 | !CALL dump_array(kstp,'ua_pre_bfr',ua(:,:,26), & |
---|
303 | ! withHalos=.TRUE.) |
---|
304 | |
---|
305 | !CALL timing_start('dyn_bfr') |
---|
306 | CALL dyn_bfr( kstp ) ! bottom friction |
---|
307 | !CALL timing_stop('dyn_bfr','section') |
---|
308 | |
---|
309 | ! CALL dump_array(kstp,'ua_pre_zdf',ua(:,:,DUMP_LEVEL), & |
---|
310 | ! withHalos=.TRUE.,atStep=1) |
---|
311 | |
---|
312 | !CALL timing_start('dyn_zdf') |
---|
313 | CALL dyn_zdf( kstp ) ! vertical diffusion |
---|
314 | !CALL timing_stop('dyn_zdf','section') |
---|
315 | |
---|
316 | ! CALL dump_array(kstp,'ua_pre_spg',ua(:,:,DUMP_LEVEL), & |
---|
317 | ! withHalos=.TRUE.,atStep=1) |
---|
318 | |
---|
319 | !CALL timing_start('dyn_spg') |
---|
320 | CALL dyn_spg( kstp, indic ) ! surface pressure gradient |
---|
321 | !CALL timing_stop('dyn_spg','section') |
---|
322 | ! CALL dump_array(kstp,'ua_spg',ua(:,:,DUMP_LEVEL), & |
---|
323 | ! withHalos=.TRUE.,atStep=1) |
---|
324 | |
---|
325 | !CALL timing_start('dyn_nxt') |
---|
326 | CALL dyn_nxt( kstp ) ! lateral velocity at next time step |
---|
327 | !CALL timing_stop('dyn_nxt','section') |
---|
328 | |
---|
329 | !CALL timing_stop('dyn_nxt','section') |
---|
330 | |
---|
331 | !CALL timing_start('ssh_nxt') |
---|
332 | CALL ssh_nxt( kstp ) ! sea surface height at next time step |
---|
333 | !CALL timing_stop('ssh_nxt','section') |
---|
334 | |
---|
335 | IF( ln_diahsb ) CALL dia_hsb( kstp ) ! - ML - global conservation diagnostics |
---|
336 | IF( lk_diaobs ) CALL dia_obs( kstp ) ! obs-minus-model (assimilation) diagnostics |
---|
337 | ! ! (call after dynamics update) |
---|
338 | CALL timing_stop('Dynamics','section') |
---|
339 | |
---|
340 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
341 | ! Control and restarts |
---|
342 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
343 | CALL timing_start('Control') |
---|
344 | |
---|
345 | !IF(kstp==1)CALL dump_array(kstp,'tmask_i_ctl',tmask_i, & |
---|
346 | ! withHalos=.TRUE.) |
---|
347 | |
---|
348 | CALL stp_ctl( kstp, indic ) |
---|
349 | IF( indic < 0 ) THEN |
---|
350 | CALL ctl_stop( 'step: indic < 0' ) |
---|
351 | CALL dia_wri_state( 'output.abort', kstp ) |
---|
352 | ENDIF |
---|
353 | IF( kstp == nit000 ) CALL iom_close( numror ) ! close input ocean restart file |
---|
354 | IF( lrst_oce ) CALL rst_write ( kstp ) ! write output ocean restart file |
---|
355 | IF( lk_obc ) CALL obc_rst_write( kstp ) ! write open boundary restart file |
---|
356 | ! ARP - no 'section' arg here so the time taken |
---|
357 | ! in this region (which can involve IO) is |
---|
358 | ! subtracted from the time |
---|
359 | ! taken to do the whole step. |
---|
360 | CALL timing_stop('Control') |
---|
361 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
362 | ! Trends (ua, va, ta, sa used as workspace) |
---|
363 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
364 | IF( nstop == 0 ) THEN |
---|
365 | IF( lk_trddyn ) CALL trd_dwr( kstp ) ! trends: dynamics |
---|
366 | IF( lk_trdtra ) CALL trd_twr( kstp ) ! trends: active tracers |
---|
367 | IF( lk_trdmld ) CALL trd_mld( kstp ) ! trends: Mixed-layer |
---|
368 | IF( lk_trdvor ) CALL trd_vor( kstp ) ! trends: vorticity budget |
---|
369 | ENDIF |
---|
370 | |
---|
371 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
372 | ! Coupled mode |
---|
373 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
374 | IF( lk_cpl ) CALL sbc_cpl_snd( kstp ) ! coupled mode : field exchanges |
---|
375 | ! |
---|
376 | CALL timing_stop('Step', 'section') |
---|
377 | |
---|
378 | ! |
---|
379 | IF( kstp == nit000 ) CALL timing_reset ! Exclude first step from timing |
---|
380 | IF( kstp == (nitend-2) ) CALL timing_disable() ! Turn off timing two steps from end to avoid the IO |
---|
381 | ! |
---|
382 | |
---|
383 | END SUBROUTINE stp |
---|
384 | |
---|
385 | !!====================================================================== |
---|
386 | END MODULE step |
---|