/[MITgcm]/MITgcm/model/src/forward_step.F
ViewVC logotype

Contents of /MITgcm/model/src/forward_step.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.91 - (show annotations) (download)
Tue Apr 6 00:31:54 2004 UTC (20 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint53, checkpoint52m_post, checkpoint53a_post, checkpoint52n_post, checkpoint53b_pre
Changes since 1.90: +10 -9 lines
include FFIELDS.h not needed ;

1 C $Header: /u/gcmpack/MITgcm/model/src/forward_step.F,v 1.90 2004/03/30 18:26:09 molod Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 cswdptr -- add --
8 #ifdef ALLOW_GCHEM
9 # include "GCHEM_OPTIONS.h"
10 #endif
11 cswdptr -- end add ---
12
13 CBOP
14 C !ROUTINE: FORWARD_STEP
15 C !INTERFACE:
16 SUBROUTINE FORWARD_STEP( iloop, myTime, myIter, myThid )
17
18 C !DESCRIPTION: \bv
19 C *==================================================================
20 C | SUBROUTINE forward_step
21 C | o Run the ocean model and, optionally, evaluate a cost function.
22 C *==================================================================
23 C |
24 C | THE_MAIN_LOOP is the toplevel routine for the Tangent Linear and
25 C | Adjoint Model Compiler (TAMC). For this purpose the initialization
26 C | of the model was split into two parts. Those parameters that do
27 C | not depend on a specific model run are set in INITIALISE_FIXED,
28 C | whereas those that do depend on the specific realization are
29 C | initialized in INITIALISE_VARIA.
30 C |
31 C *==================================================================
32 C \ev
33
34 C !USES:
35 IMPLICIT NONE
36 C == Global variables ==
37 #include "SIZE.h"
38 #include "EEPARAMS.h"
39 #include "PARAMS.h"
40 #include "DYNVARS.h"
41
42 #ifdef ALLOW_SHAP_FILT
43 # include "SHAP_FILT.h"
44 #endif
45 #ifdef ALLOW_ZONAL_FILT
46 # include "ZONAL_FILT.h"
47 #endif
48
49 #ifdef ALLOW_AUTODIFF_TAMC
50 # include "FFIELDS.h"
51
52 # ifdef ALLOW_NONHYDROSTATIC
53 # include "CG3D.h"
54 # endif
55
56 # include "tamc.h"
57 # include "ctrl.h"
58 # include "ctrl_dummy.h"
59 # include "cost.h"
60 # include "EOS.h"
61 # ifdef ALLOW_EXF
62 # include "exf_fields.h"
63 # include "exf_clim_fields.h"
64 # ifdef ALLOW_BULKFORMULAE
65 # include "exf_constants.h"
66 # endif
67 # endif
68 # ifdef ALLOW_OBCS
69 # include "OBCS.h"
70 # endif
71 # ifdef ALLOW_PTRACERS
72 # include "PTRACERS.h"
73 # endif
74 # ifdef ALLOW_CD_CODE
75 # include "CD_CODE_VARS.h"
76 # endif
77 #endif /* ALLOW_AUTODIFF_TAMC */
78
79 C !LOCAL VARIABLES:
80 C == Routine arguments ==
81 C note: under the multi-threaded model myiter and
82 C mytime are local variables passed around as routine
83 C arguments. Although this is fiddly it saves the need to
84 C impose additional synchronisation points when they are
85 C updated.
86 C myiter - iteration counter for this thread
87 C mytime - time counter for this thread
88 C mythid - thread number for this instance of the routine.
89 integer iloop
90 integer mythid
91 integer myiter
92 _RL mytime
93
94 integer i,L
95 CEOP
96
97 #ifdef ALLOW_DEBUG
98 IF ( debugLevel .GE. debLevB )
99 & CALL DEBUG_ENTER('FORWARD_STEP',myThid)
100 #endif
101
102 #ifdef ALLOW_AUTODIFF_TAMC
103 C-- Reset the model iteration counter and the model time.
104 myiter = nIter0 + (iloop-1)
105 mytime = startTime + float(iloop-1)*deltaTclock
106 #endif
107
108 #if (defined (ALLOW_AUTODIFF_TAMC) && defined (ALLOW_AUTODIFF_MONITOR))
109 C Include call to a dummy routine. Its adjoint will be
110 C called at the proper place in the adjoint code.
111 C The adjoint routine will print out adjoint values
112 C if requested. The location of the call is important,
113 C it has to be after the adjoint of the exchanges
114 C (DO_GTERM_BLOCKING_EXCHANGES).
115 CALL DUMMY_IN_STEPPING( myTime, myIter, myThid )
116 cph I've commented this line since it may conflict with MITgcm's adjoint
117 cph However, need to check whether that's still consistent
118 cph with the ecco-branch (it should).
119 cph CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )
120 #endif
121
122 #ifdef EXACT_CONSERV
123 IF (exactConserv) THEN
124 C-- Update etaH(n+1) :
125 CALL TIMER_START('UPDATE_ETAH [FORWARD_STEP]',mythid)
126 CALL UPDATE_ETAH( myTime, myIter, myThid )
127 CALL TIMER_STOP ('UPDATE_ETAH [FORWARD_STEP]',mythid)
128 ENDIF
129 #endif /* EXACT_CONSERV */
130
131 #ifdef NONLIN_FRSURF
132 IF ( select_rStar.NE.0 ) THEN
133 C-- r* : compute the future level thickness according to etaH(n+1)
134 CALL TIMER_START('CALC_R_STAR [FORWARD_STEP]',mythid)
135 CALL CALC_R_STAR(etaH, myTime, myIter, myThid )
136 CALL TIMER_STOP ('CALC_R_STAR [FORWARD_STEP]',mythid)
137 ELSEIF ( nonlinFreeSurf.GT.0) THEN
138 C-- compute the future surface level thickness according to etaH(n+1)
139 CALL TIMER_START('CALC_SURF_DR [FORWARD_STEP]',mythid)
140 CALL CALC_SURF_DR(etaH, myTime, myIter, myThid )
141 CALL TIMER_STOP ('CALC_SURF_DR [FORWARD_STEP]',mythid)
142 ENDIF
143 #endif /* NONLIN_FRSURF */
144
145 #ifdef ALLOW_AUTODIFF_TAMC
146 c**************************************
147 #include "checkpoint_lev1_directives.h"
148 c**************************************
149 #endif
150
151 C-- Call external forcing package
152 #ifdef ALLOW_BULK_FORCE
153 IF ( useBulkForce ) THEN
154 #ifdef ALLOW_DEBUG
155 IF ( debugLevel .GE. debLevB )
156 & CALL DEBUG_CALL('BULKF_FIELDS_LOAD',myThid)
157 #endif
158 CALL TIMER_START('BULKF_FORCING [FORWARD_STEP]',mythid)
159 C- load all forcing fields at current time
160 CALL BULKF_FIELDS_LOAD( myTime, myIter, myThid )
161 C- calculate qnet and empmr (and wind stress)
162 CALL BULKF_FORCING( myTime, myIter, myThid )
163 CALL TIMER_STOP ('BULKF_FORCING [FORWARD_STEP]',mythid)
164 ELSE
165 #endif /* ALLOW_BULK_FORCE */
166
167 # ifdef ALLOW_EXF
168 # ifdef ALLOW_DEBUG
169 IF ( debugLevel .GE. debLevB )
170 & CALL DEBUG_CALL('EXF_GETFORCING',myThid)
171 # endif
172 CALL TIMER_START('EXF_GETFORCING [FORWARD_STEP]',mythid)
173 CALL EXF_GETFORCING( mytime, myiter, mythid )
174 CALL TIMER_STOP ('EXF_GETFORCING [FORWARD_STEP]',mythid)
175 # else /* ALLOW_EXF undef */
176 cph The following IF-statement creates an additional dependency
177 cph for the forcing fields requiring additional storing.
178 cph Therefore, the IF-statement will be put between CPP-OPTIONS,
179 cph assuming that ALLOW_SEAICE has not yet been differentiated.
180 # ifdef ALLOW_SEAICE
181 IF ( .NOT. useSEAICE ) THEN
182 # endif
183 #ifdef ALLOW_DEBUG
184 IF ( debugLevel .GE. debLevB )
185 & CALL DEBUG_CALL('EXTERNAL_FIELDS_LOAD',myThid)
186 #endif
187 CALL TIMER_START('EXTERNAL_FIELDS_LOAD[FORWARD_STEP]',mythid)
188 CALL EXTERNAL_FIELDS_LOAD( mytime, myiter, mythid )
189 CALL TIMER_STOP ('EXTERNAL_FIELDS_LOAD[FORWARD_STEP]',mythid)
190 # ifdef ALLOW_SEAICE
191 ENDIF
192 # endif
193 # endif /* ALLOW_EXF */
194 #ifdef ALLOW_BULK_FORCE
195 C-- end of if/else block useBulfforce --
196 ENDIF
197 #endif /* ALLOW_BULK_FORCE */
198
199 #ifdef ALLOW_AUTODIFF
200 c-- Add control vector for forcing and parameter fields
201 if ( myiter .EQ. nIter0 )
202 & CALL CTRL_MAP_FORCING (mythid)
203 #endif
204
205 #ifdef ALLOW_THSICE
206 IF ( useThSIce .AND. buoyancyRelation(1:7) .EQ. 'OCEANIC' ) THEN
207 #ifdef ALLOW_DEBUG
208 IF ( debugLevel .GE. debLevB )
209 & CALL DEBUG_CALL('THSICE_MAIN',myThid)
210 #endif
211 C-- Step forward Therm.Sea-Ice variables
212 C and modify forcing terms including effects from ice
213 CALL TIMER_START('THSICE_MAIN [FORWARD_STEP]', myThid)
214 CALL THSICE_MAIN( myTime, myIter, myThid )
215 CALL TIMER_STOP( 'THSICE_MAIN [FORWARD_STEP]', myThid)
216 ENDIF
217 #endif /* ALLOW_THSICE */
218
219 # ifdef ALLOW_SEAICE
220 C-- Call sea ice model to compute forcing/external data fields. In
221 C addition to computing prognostic sea-ice variables and diagnosing the
222 C forcing/external data fields that drive the ocean model, SEAICE_MODEL
223 C also sets theta to the freezing point under sea-ice. The implied
224 C surface heat flux is then stored in variable surfaceTendencyTice,
225 C which is needed by KPP package (kpp_calc.F and kpp_transport_t.F)
226 C to diagnose surface buoyancy fluxes and for the non-local transport
227 C term. Because this call precedes model thermodynamics, temperature
228 C under sea-ice may not be "exactly" at the freezing point by the time
229 C theta is dumped or time-averaged.
230 IF ( useSEAICE ) THEN
231 #ifdef ALLOW_DEBUG
232 IF ( debugLevel .GE. debLevB )
233 & CALL DEBUG_CALL('SEAICE_MODEL',myThid)
234 #endif
235 CALL TIMER_START('SEAICE_MODEL [FORWARD_STEP]',myThid)
236 CALL SEAICE_MODEL( myTime, myIter, myThid )
237 CALL TIMER_STOP ('SEAICE_MODEL [FORWARD_STEP]',myThid)
238 ENDIF
239 # endif /* ALLOW_SEAICE */
240
241 C-- Freeze water at the surface
242 #ifdef ALLOW_AUTODIFF_TAMC
243 CADJ STORE theta = comlev1, key = ikey_dynamics
244 #endif
245 IF ( allowFreezing .AND. .NOT. useSEAICE
246 & .AND. .NOT. useThSIce ) THEN
247 CALL FREEZE_SURFACE( myTime, myIter, myThid )
248 ENDIF
249
250 #ifdef ALLOW_AUTODIFF_TAMC
251 # ifdef ALLOW_PTRACERS
252 cph this replaces _bibj storing of ptracer within thermodynamics
253 CADJ STORE ptracer = comlev1, key = ikey_dynamics
254 # endif
255 #endif
256
257 #ifdef ALLOW_PTRACERS
258 # ifdef ALLOW_GCHEM
259 CALL GCHEM_FIELDS_LOAD( mytime, myiter, mythid )
260 # endif
261 #endif
262
263 #ifdef COMPONENT_MODULE
264 IF ( useCoupler ) THEN
265 C Post coupling data that I export.
266 C Read in coupling data that I import.
267 CALL TIMER_START('CPL_EXPORT-IMPORT [FORWARD_STEP]',myThid)
268 CALL CPL_EXPORT_MY_DATA( myIter, myTime, myThid )
269 CALL CPL_IMPORT_EXTERNAL_DATA( myIter, myTime, myThid )
270 CALL TIMER_STOP ('CPL_EXPORT-IMPORT [FORWARD_STEP]',myThid)
271 ENDIF
272 #endif /* COMPONENT_MODULE */
273
274 #ifdef COMPONENT_MODULE
275 # ifndef ALLOW_AIM
276 C jmc: don't know precisely where to put this call. leave it here for now.
277 IF ( useCoupler ) THEN
278 CALL OCN_APPLY_IMPORT( myTime, myIter, myThid )
279 ENDIF
280 # endif
281 #endif /* COMPONENT_MODULE */
282
283 C-- Step forward fields and calculate time tendency terms.
284
285 C AMM
286 #ifdef ALLOW_FIZHI
287 if( useFIZHI) then
288 CALL TIMER_START('FIZHI [FORWARD_STEP]',mythid)
289 CALL UPDATE_OCEAN_EXPORTS ( myTime, myIter, myThid )
290 CALL UPDATE_EARTH_EXPORTS ( myTime, myIter, myThid )
291 CALL UPDATE_CHEMISTRY_EXPORTS ( myTime, myIter, myThid )
292 CALL FIZHI_WRAPPER ( myTime, myIter, myThid )
293 CALL STEP_FIZHI_FG ( myTime, myIter, myThid, deltaTtracer )
294 CALL TIMER_STOP ('FIZHI [FORWARD_STEP]',mythid)
295 endif
296 #endif
297 C AMM
298
299 #ifdef ALLOW_DEBUG
300 IF ( debugLevel .GE. debLevB )
301 & CALL DEBUG_CALL('THERMODYNAMICS',myThid)
302 #endif
303 CALL TIMER_START('THERMODYNAMICS [FORWARD_STEP]',mythid)
304 CALL THERMODYNAMICS( myTime, myIter, myThid )
305 CALL TIMER_STOP ('THERMODYNAMICS [FORWARD_STEP]',mythid)
306
307 C-- do exchanges (needed for DYNAMICS) when using stagger time-step :
308 #ifdef ALLOW_DEBUG
309 IF ( debugLevel .GE. debLevB )
310 & CALL DEBUG_CALL('DO_STAGGER_FIELDS_EXCH.',myThid)
311 #endif
312 CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)
313 CALL DO_STAGGER_FIELDS_EXCHANGES( myTime, myIter, myThid )
314 CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)
315
316 #ifdef ALLOW_SHAP_FILT
317 IF (useSHAP_FILT .AND.
318 & staggerTimeStep .AND. shap_filt_TrStagg ) THEN
319 #ifdef ALLOW_DEBUG
320 IF ( debugLevel .GE. debLevB )
321 & CALL DEBUG_CALL('SHAP_FILT_APPLY_TS',myThid)
322 #endif
323 CALL TIMER_START('SHAP_FILT [FORWARD_STEP]',myThid)
324 CALL SHAP_FILT_APPLY_TS(gT,gS,myTime+deltaT,myIter+1,myThid)
325 CALL TIMER_STOP ('SHAP_FILT [FORWARD_STEP]',myThid)
326 ENDIF
327 #endif
328
329 #ifdef ALLOW_ZONAL_FILT
330 IF (useZONAL_FILT .AND.
331 & staggerTimeStep .AND. zonal_filt_TrStagg ) THEN
332 #ifdef ALLOW_DEBUG
333 IF ( debugLevel .GE. debLevB )
334 & CALL DEBUG_CALL('ZONAL_FILT_APPLY_TS',myThid)
335 #endif
336 CALL TIMER_START('ZONAL_FILT_APPLY [FORWARD_STEP]',myThid)
337 CALL ZONAL_FILT_APPLY_TS( gT, gS, myThid )
338 CALL TIMER_STOP ('ZONAL_FILT_APPLY [FORWARD_STEP]',myThid)
339 ENDIF
340 #endif
341
342 C-- Step forward fields and calculate time tendency terms.
343 #ifndef ALLOW_AUTODIFF_TAMC
344 IF ( momStepping ) THEN
345 #endif
346 #ifdef ALLOW_DEBUG
347 IF ( debugLevel .GE. debLevB )
348 & CALL DEBUG_CALL('DYNAMICS',myThid)
349 #endif
350 CALL TIMER_START('DYNAMICS [FORWARD_STEP]',mythid)
351 CALL DYNAMICS( myTime, myIter, myThid )
352 CALL TIMER_STOP ('DYNAMICS [FORWARD_STEP]',mythid)
353 #ifndef ALLOW_AUTODIFF_TAMC
354 ENDIF
355 #endif
356
357 #ifdef ALLOW_NONHYDROSTATIC
358 C-- Step forward W field in N-H algorithm
359 IF ( momStepping .AND. nonHydrostatic ) THEN
360 #ifdef ALLOW_DEBUG
361 IF ( debugLevel .GE. debLevB )
362 & CALL DEBUG_CALL('CALC_GW',myThid)
363 #endif
364 CALL TIMER_START('CALC_GW [FORWARD_STEP]',myThid)
365 CALL CALC_GW(myThid)
366 CALL TIMER_STOP ('CALC_GW [FORWARD_STEP]',myThid)
367 ENDIF
368 #endif
369
370 #ifdef NONLIN_FRSURF
371 C-- update hfacC,W,S and recip_hFac according to etaH(n+1) :
372 IF ( nonlinFreeSurf.GT.0) THEN
373 IF ( select_rStar.GT.0 ) THEN
374 CALL TIMER_START('UPDATE_R_STAR [FORWARD_STEP]',myThid)
375 CALL UPDATE_R_STAR( myTime, myIter, myThid )
376 CALL TIMER_STOP ('UPDATE_R_STAR [FORWARD_STEP]',myThid)
377 ELSE
378 CALL TIMER_START('UPDATE_SURF_DR [FORWARD_STEP]',myThid)
379 CALL UPDATE_SURF_DR( myTime, myIter, myThid )
380 CALL TIMER_STOP ('UPDATE_SURF_DR [FORWARD_STEP]',myThid)
381 ENDIF
382 ENDIF
383 C- update also CG2D matrix (and preconditioner)
384 IF ( momStepping .AND. nonlinFreeSurf.GT.2 ) THEN
385 CALL TIMER_START('UPDATE_CG2D [FORWARD_STEP]',myThid)
386 CALL UPDATE_CG2D( myTime, myIter, myThid )
387 CALL TIMER_STOP ('UPDATE_CG2D [FORWARD_STEP]',myThid)
388 ENDIF
389 #endif
390
391 C-- Apply Filters to u*,v* before SOLVE_FOR_PRESSURE
392 #ifdef ALLOW_SHAP_FILT
393 IF (useSHAP_FILT .AND. shap_filt_uvStar) THEN
394 CALL TIMER_START('SHAP_FILT [FORWARD_STEP]',myThid)
395 IF (implicDiv2Dflow.LT.1.) THEN
396 C-- Explicit+Implicit part of the Barotropic Flow Divergence
397 C => Filtering of uVel,vVel is necessary
398 CALL SHAP_FILT_APPLY_UV( uVel,vVel,
399 & myTime+deltaT, myIter+1, myThid )
400 ENDIF
401 CALL SHAP_FILT_APPLY_UV( gU,gV,myTime+deltaT,myIter+1,myThid)
402 CALL TIMER_STOP ('SHAP_FILT [FORWARD_STEP]',myThid)
403 ENDIF
404 #endif
405 #ifdef ALLOW_ZONAL_FILT
406 IF (useZONAL_FILT .AND. zonal_filt_uvStar) THEN
407 CALL TIMER_START('ZONAL_FILT_APPLY [FORWARD_STEP]',myThid)
408 IF (implicDiv2Dflow.LT.1.) THEN
409 C-- Explicit+Implicit part of the Barotropic Flow Divergence
410 C => Filtering of uVel,vVel is necessary
411 CALL ZONAL_FILT_APPLY_UV( uVel, vVel, myThid )
412 ENDIF
413 CALL ZONAL_FILT_APPLY_UV( gU, gV, myThid )
414 CALL TIMER_STOP ('ZONAL_FILT_APPLY [FORWARD_STEP]',myThid)
415 ENDIF
416 #endif
417
418 C-- Solve elliptic equation(s).
419 C Two-dimensional only for conventional hydrostatic or
420 C three-dimensional for non-hydrostatic and/or IGW scheme.
421 IF ( momStepping ) THEN
422 CALL TIMER_START('SOLVE_FOR_PRESSURE [FORWARD_STEP]',myThid)
423 CALL SOLVE_FOR_PRESSURE(myTime, myIter, myThid)
424 CALL TIMER_STOP ('SOLVE_FOR_PRESSURE [FORWARD_STEP]',myThid)
425 ENDIF
426
427 #ifdef ALLOW_AUTODIFF_TAMC
428 cph This is needed because convective_adjustment calls
429 cph find_rho which may use pressure()
430 CADJ STORE totphihyd = comlev1, key = ikey_dynamics
431 #endif
432 C-- Correct divergence in flow field and cycle time-stepping
433 C arrays (for all fields) ; update time-counter
434 myIter = nIter0 + iLoop
435 myTime = startTime + deltaTClock * float(iLoop)
436 CALL TIMER_START('THE_CORRECTION_STEP [FORWARD_STEP]',myThid)
437 CALL THE_CORRECTION_STEP(myTime, myIter, myThid)
438 CALL TIMER_STOP ('THE_CORRECTION_STEP [FORWARD_STEP]',myThid)
439
440 C-- Do "blocking" sends and receives for tendency "overlap" terms
441 c CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)
442 c CALL DO_GTERM_BLOCKING_EXCHANGES( myThid )
443 c CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)
444
445 C-- Do "blocking" sends and receives for field "overlap" terms
446 CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)
447 CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )
448 CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)
449
450 cswdptr -- add for seperate timestepping of chemical/biological/forcing
451 cswdptr of ptracers ---
452 #ifdef ALLOW_GCHEM
453 ceh3 This is broken -- this ifdef should not be visible!
454 #ifdef PTRACERS_SEPARATE_FORCING
455 ceh3 needs an IF ( use GCHEM ) THEN
456 call GCHEM_FORCING_SEP( myTime,myIter,myThid )
457 #endif /* PTRACERS_SEPARATE_FORCING */
458 #endif /* ALLOW_GCHEM */
459 cswdptr -- end add ---
460
461 C AMM
462 #ifdef ALLOW_GRIDALT
463 if (useGRIDALT) then
464 CALL GRIDALT_UPDATE(myThid)
465 endif
466 #endif
467 C AMM
468
469 C AMM
470 #ifdef ALLOW_FIZHI
471 if( useFIZHI) then
472 CALL TIMER_START('FIZHI [FORWARD_STEP]',mythid)
473 CALL STEP_FIZHI_CORR ( myTime, myIter, myThid )
474 CALL TIMER_STOP('FIZHI [FORWARD_STEP]',mythid)
475 endif
476 #endif
477 C AMM
478
479 #ifdef ALLOW_FLT
480 C-- Calculate float trajectories
481 IF (useFLT) THEN
482 CALL TIMER_START('FLOATS [FORWARD_STEP]',myThid)
483 CALL FLT_MAIN(myIter,myTime, myThid)
484 CALL TIMER_STOP ('FLOATS [FORWARD_STEP]',myThid)
485 ENDIF
486 #endif
487
488 #ifdef ALLOW_MONITOR
489 C-- Check status of solution (statistics, cfl, etc...)
490 CALL TIMER_START('MONITOR [FORWARD_STEP]',myThid)
491 CALL MONITOR( myIter, myTime, myThid )
492 CALL TIMER_STOP ('MONITOR [FORWARD_STEP]',myThid)
493 #endif /* ALLOW_MONITOR */
494
495 C AMM -- Diagnostics package
496 #ifdef ALLOW_DIAGNOSTICS
497
498 if(usediagnostics)then
499 call diagnostics_fill_state(myThid)
500 endif
501
502 # ifdef ALLOW_PTRACERS
503 if(useptracers)then
504 call diagnostics_fill_ptracers(myThid)
505 endif
506 # endif
507
508 #endif
509 C AMM
510
511 C-- Do IO if needed.
512 CALL TIMER_START('DO_THE_MODEL_IO [FORWARD_STEP]',myThid)
513 CALL DO_THE_MODEL_IO( myTime, myIter, myThid )
514 CALL TIMER_STOP ('DO_THE_MODEL_IO [FORWARD_STEP]',myThid)
515
516 C-- Save state for restarts
517 C Note: (jmc: is it still the case after ckp35 ?)
518 C =====
519 C Because of the ordering of the timestepping code and
520 C tendency term code at end of loop model arrays hold
521 C U,V,T,S at "time-level" N but gu, gv, gs, gt, guNM1,...
522 C at "time-level" N+1/2 (guNM1 at "time-level" N+1/2 is
523 C gu at "time-level" N-1/2) and etaN at "time-level" N+1/2.
524 C where N = I+timeLevBase-1
525 C Thus a checkpoint contains U.0000000000, GU.0000000001 and
526 C etaN.0000000001 in the indexing scheme used for the model
527 C "state" files. This example is referred to as a checkpoint
528 C at time level 1
529 CALL TIMER_START('WRITE_CHECKPOINT [FORWARD_STEP]',myThid)
530 CALL PACKAGES_WRITE_PICKUP(
531 I .FALSE., myTime, myIter, myThid )
532 CALL WRITE_CHECKPOINT(
533 I .FALSE., myTime, myIter, myThid )
534 CALL TIMER_STOP ('WRITE_CHECKPOINT [FORWARD_STEP]',myThid)
535
536 #ifdef ALLOW_DEBUG
537 IF ( debugLevel .GE. debLevB )
538 & CALL DEBUG_LEAVE('FORWARD_STEP',myThid)
539 #endif
540
541 RETURN
542 END

  ViewVC Help
Powered by ViewVC 1.1.22