4 |
#include "PACKAGES_CONFIG.h" |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
6 |
|
|
|
#ifdef ALLOW_GCHEM |
|
|
# include "GCHEM_OPTIONS.h" |
|
|
#endif |
|
7 |
#ifdef ALLOW_OFFLINE |
#ifdef ALLOW_OFFLINE |
8 |
# include "OFFLINE_OPTIONS.h" |
# include "OFFLINE_OPTIONS.h" |
9 |
#endif |
#endif |
10 |
|
#ifdef ALLOW_GMREDI |
11 |
|
# include "GMREDI_OPTIONS.h" |
12 |
|
#endif |
13 |
|
|
14 |
CBOP |
CBOP |
15 |
C !ROUTINE: FORWARD_STEP |
C !ROUTINE: FORWARD_STEP |
40 |
#include "PARAMS.h" |
#include "PARAMS.h" |
41 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
42 |
|
|
43 |
|
#ifdef ALLOW_MNC |
44 |
|
#include "MNC_PARAMS.h" |
45 |
|
EXTERNAL DIFFERENT_MULTIPLE |
46 |
|
LOGICAL DIFFERENT_MULTIPLE |
47 |
|
#endif |
48 |
|
|
49 |
|
#ifdef HAVE_SIGREG |
50 |
|
#include "SIGREG.h" |
51 |
|
#endif |
52 |
|
|
53 |
#ifdef ALLOW_SHAP_FILT |
#ifdef ALLOW_SHAP_FILT |
54 |
# include "SHAP_FILT.h" |
# include "SHAP_FILT.h" |
55 |
#endif |
#endif |
63 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
64 |
# include "FFIELDS.h" |
# include "FFIELDS.h" |
65 |
|
|
|
# ifdef ALLOW_NONHYDROSTATIC |
|
|
# include "CG3D.h" |
|
|
# endif |
|
|
|
|
66 |
# include "tamc.h" |
# include "tamc.h" |
67 |
# include "ctrl.h" |
# include "ctrl.h" |
68 |
# include "ctrl_dummy.h" |
# include "ctrl_dummy.h" |
91 |
# ifdef EXACT_CONSERV |
# ifdef EXACT_CONSERV |
92 |
# include "SURFACE.h" |
# include "SURFACE.h" |
93 |
# endif |
# endif |
94 |
|
# ifdef ALLOW_KPP |
95 |
|
# include "KPP.h" |
96 |
|
# endif |
97 |
|
# ifdef ALLOW_GMREDI |
98 |
|
# include "GMREDI.h" |
99 |
|
# endif |
100 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
101 |
|
|
102 |
C !LOCAL VARIABLES: |
C !LOCAL VARIABLES: |
115 |
_RL myTime |
_RL myTime |
116 |
|
|
117 |
C == Local variables == |
C == Local variables == |
118 |
|
#ifdef COMPONENT_MODULE |
119 |
INTEGER myItP1 |
INTEGER myItP1 |
120 |
|
#endif |
121 |
CEOP |
CEOP |
122 |
|
|
123 |
#ifdef ALLOW_DEBUG |
#ifdef ALLOW_DEBUG |
127 |
|
|
128 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
129 |
C-- Reset the model iteration counter and the model time. |
C-- Reset the model iteration counter and the model time. |
130 |
myiter = nIter0 + (iloop-1) |
myIter = nIter0 + (iloop-1) |
131 |
mytime = startTime + float(iloop-1)*deltaTclock |
myTime = startTime + float(iloop-1)*deltaTclock |
|
#endif |
|
|
|
|
|
#if (defined (ALLOW_AUTODIFF_TAMC) && defined (ALLOW_AUTODIFF_MONITOR)) |
|
|
C Include call to a dummy routine. Its adjoint will be |
|
|
C called at the proper place in the adjoint code. |
|
|
C The adjoint routine will print out adjoint values |
|
|
C if requested. The location of the call is important, |
|
|
C it has to be after the adjoint of the exchanges |
|
|
C (DO_GTERM_BLOCKING_EXCHANGES). |
|
|
CALL DUMMY_IN_STEPPING( myTime, myIter, myThid ) |
|
|
cph I've commented this line since it may conflict with MITgcm's adjoint |
|
|
cph However, need to check whether that's still consistent |
|
|
cph with the ecco-branch (it should). |
|
|
cph CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid ) |
|
132 |
#endif |
#endif |
133 |
|
|
134 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
137 |
c************************************** |
c************************************** |
138 |
#endif |
#endif |
139 |
|
|
140 |
|
C-- Switch on/off diagnostics for snap-shot output: |
141 |
|
#ifdef ALLOW_DIAGNOSTICS |
142 |
|
IF ( useDiagnostics ) THEN |
143 |
|
CALL DIAGNOSTICS_SWITCH_ONOFF( myTime, myIter, myThid ) |
144 |
|
ENDIF |
145 |
|
#endif |
146 |
|
|
147 |
|
C-- State-variables diagnostics |
148 |
|
IF ( usediagnostics ) THEN |
149 |
|
CALL TIMER_START('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
150 |
|
CALL DO_STATEVARS_DIAGS( myTime, 0, myIter, myThid ) |
151 |
|
CALL TIMER_STOP ('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
152 |
|
ENDIF |
153 |
|
|
154 |
C-- Call external forcing package |
C-- Call external forcing package |
155 |
#ifdef ALLOW_BULK_FORCE |
#ifdef ALLOW_BULK_FORCE |
156 |
IF ( useBulkForce ) THEN |
IF ( useBulkForce ) THEN |
205 |
& CALL CTRL_MAP_FORCING (mythid) |
& CALL CTRL_MAP_FORCING (mythid) |
206 |
#endif |
#endif |
207 |
|
|
208 |
|
#if (defined (ALLOW_AUTODIFF_TAMC) && defined (ALLOW_AUTODIFF_MONITOR)) |
209 |
|
C Include call to a dummy routine. Its adjoint will be |
210 |
|
C called at the proper place in the adjoint code. |
211 |
|
C The adjoint routine will print out adjoint values |
212 |
|
C if requested. The location of the call is important, |
213 |
|
C it has to be after the adjoint of the exchanges |
214 |
|
C (DO_GTERM_BLOCKING_EXCHANGES). |
215 |
|
CALL DUMMY_IN_STEPPING( myTime, myIter, myThid ) |
216 |
|
cph I've commented this line since it may conflict with MITgcm's adjoint |
217 |
|
cph However, need to check whether that's still consistent |
218 |
|
cph with the ecco-branch (it should). |
219 |
|
cph CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid ) |
220 |
|
#endif |
221 |
|
|
222 |
# ifdef ALLOW_SEAICE |
# ifdef ALLOW_SEAICE |
223 |
C-- Call sea ice model to compute forcing/external data fields. In |
C-- Call sea ice model to compute forcing/external data fields. In |
224 |
C addition to computing prognostic sea-ice variables and diagnosing the |
C addition to computing prognostic sea-ice variables and diagnosing the |
254 |
|
|
255 |
#ifdef ALLOW_PTRACERS |
#ifdef ALLOW_PTRACERS |
256 |
# ifdef ALLOW_GCHEM |
# ifdef ALLOW_GCHEM |
257 |
|
IF ( useGCHEM ) THEN |
258 |
|
#ifdef ALLOW_DEBUG |
259 |
|
IF ( debugLevel .GE. debLevB ) |
260 |
|
& CALL DEBUG_CALL('GCHEM_FIELDS_LOAD',myThid) |
261 |
|
#endif /* ALLOW_DEBUG */ |
262 |
CALL GCHEM_FIELDS_LOAD( mytime, myiter, mythid ) |
CALL GCHEM_FIELDS_LOAD( mytime, myiter, mythid ) |
263 |
|
ENDIF |
264 |
# endif |
# endif |
265 |
#endif |
#endif |
266 |
|
|
297 |
CALL DO_ATMOSPHERIC_PHYS( myTime, myIter, myThid ) |
CALL DO_ATMOSPHERIC_PHYS( myTime, myIter, myThid ) |
298 |
CALL TIMER_STOP ('DO_ATMOSPHERIC_PHYS [FORWARD_STEP]',mythid) |
CALL TIMER_STOP ('DO_ATMOSPHERIC_PHYS [FORWARD_STEP]',mythid) |
299 |
|
|
300 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
301 |
|
CADJ STORE theta = comlev1, key = ikey_dynamics |
302 |
|
CADJ STORE salt = comlev1, key = ikey_dynamics |
303 |
|
CADJ STORE totphihyd = comlev1, key = ikey_dynamics |
304 |
|
CADJ STORE surfaceforcingtice = comlev1, key = ikey_dynamics |
305 |
|
# ifdef ALLOW_KPP |
306 |
|
CADJ STORE uvel = comlev1, key = ikey_dynamics |
307 |
|
CADJ STORE vvel = comlev1, key = ikey_dynamics |
308 |
|
# endif |
309 |
|
# ifdef EXACT_CONSERV |
310 |
|
CADJ STORE empmr = comlev1, key = ikey_dynamics |
311 |
|
CADJ STORE pmepr = comlev1, key = ikey_dynamics |
312 |
|
# endif |
313 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
314 |
|
|
315 |
#ifndef ALLOW_OFFLINE |
#ifndef ALLOW_OFFLINE |
316 |
#ifdef ALLOW_DEBUG |
#ifdef ALLOW_DEBUG |
317 |
IF ( debugLevel .GE. debLevB ) |
IF ( debugLevel .GE. debLevB ) |
322 |
CALL TIMER_STOP ('DO_OCEANIC_PHYS [FORWARD_STEP]',mythid) |
CALL TIMER_STOP ('DO_OCEANIC_PHYS [FORWARD_STEP]',mythid) |
323 |
#endif |
#endif |
324 |
|
|
325 |
|
#ifdef ALLOW_GCHEM |
326 |
|
C GCHEM package is an interface for any bio-geochemical or |
327 |
|
C ecosystem model you would like to include. |
328 |
|
C If GCHEM_SEPARATE_FORCING is not defined, you are |
329 |
|
C responsible for computing tendency terms for passive |
330 |
|
C tracers and storing them on a 3DxNumPtracers-array called |
331 |
|
C gchemTendency in GCHEM_CALC_TENDENCY. This tendency is then added |
332 |
|
C to gPtr in ptracers_forcing later-on. |
333 |
|
C If GCHEM_SEPARATE_FORCING is defined, you are reponsible for |
334 |
|
C UPDATING ptracers directly in GCHEM_FORCING_SEP. This amounts |
335 |
|
C to a completely separate time step that you have to implement |
336 |
|
C yourself (Eulerian seems to be fine in most cases). |
337 |
|
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
338 |
|
C CAVEAT: Up to now, when GCHEM is turned on the field ptracerForcingSurf, |
339 |
|
C which is needed for KPP is not set properly. ptracerForcingSurf must |
340 |
|
C be treated differently depending on whether GCHEM_SEPARATE_FORCING |
341 |
|
C is define or not. TBD. |
342 |
|
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
343 |
|
IF ( useGCHEM ) THEN |
344 |
|
#ifdef ALLOW_DEBUG |
345 |
|
IF ( debugLevel .GE. debLevB ) |
346 |
|
& CALL DEBUG_CALL('GCHEM_CALC_TENDENCY',myThid) |
347 |
|
#endif |
348 |
|
CALL TIMER_START('GCHEM_CALC_TENDENCY [FORWARD_STEP]',myThid) |
349 |
|
CALL GCHEM_CALC_TENDENCY( myTime, myIter, myThid ) |
350 |
|
CALL TIMER_STOP ('GCHEM_CALC_TENDENCY [FORWARD_STEP]',myThid) |
351 |
|
ENDIF |
352 |
|
#endif /* ALLOW_GCHEM */ |
353 |
|
|
354 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
355 |
|
cph needed to be moved here from do_oceanic_physics |
356 |
|
cph to be visible down the road |
357 |
|
c |
358 |
|
CADJ STORE surfaceForcingS = comlev1, key = ikey_dynamics |
359 |
|
CADJ STORE surfaceForcingT = comlev1, key = ikey_dynamics |
360 |
|
CADJ STORE surfaceForcingTice = comlev1, key = ikey_dynamics |
361 |
|
ctest( |
362 |
|
CADJ STORE IVDConvCount = comlev1, key = ikey_dynamics |
363 |
|
ctest) |
364 |
|
# ifdef ALLOW_PTRACERS |
365 |
|
CADJ STORE surfaceForcingPtr = comlev1, key = ikey_dynamics |
366 |
|
# endif |
367 |
|
c |
368 |
|
# ifdef ALLOW_GMREDI |
369 |
|
CADJ STORE Kwx = comlev1, key = ikey_dynamics |
370 |
|
CADJ STORE Kwy = comlev1, key = ikey_dynamics |
371 |
|
CADJ STORE Kwz = comlev1, key = ikey_dynamics |
372 |
|
# ifdef GM_BOLUS_ADVEC |
373 |
|
CADJ STORE GM_PsiX = comlev1, key = ikey_dynamics |
374 |
|
CADJ STORE GM_PsiY = comlev1, key = ikey_dynamics |
375 |
|
# endif |
376 |
|
# endif |
377 |
|
c |
378 |
|
# ifdef ALLOW_KPP |
379 |
|
CADJ STORE KPPghat = comlev1, key = ikey_dynamics |
380 |
|
CADJ STORE KPPfrac = comlev1, key = ikey_dynamics |
381 |
|
CADJ STORE KPPdiffKzS = comlev1, key = ikey_dynamics |
382 |
|
CADJ STORE KPPdiffKzT = comlev1, key = ikey_dynamics |
383 |
|
# endif |
384 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
385 |
|
|
386 |
IF ( .NOT.staggerTimeStep ) THEN |
IF ( .NOT.staggerTimeStep ) THEN |
387 |
#ifdef ALLOW_DEBUG |
#ifdef ALLOW_DEBUG |
388 |
IF ( debugLevel .GE. debLevB ) |
IF ( debugLevel .GE. debLevB ) |
428 |
#endif |
#endif |
429 |
#endif |
#endif |
430 |
|
|
|
#ifdef ALLOW_NONHYDROSTATIC |
|
|
C-- Step forward W field in N-H algorithm |
|
|
IF ( momStepping .AND. nonHydrostatic ) THEN |
|
|
#ifdef ALLOW_DEBUG |
|
|
IF ( debugLevel .GE. debLevB ) |
|
|
& CALL DEBUG_CALL('CALC_GW',myThid) |
|
|
#endif |
|
|
CALL TIMER_START('CALC_GW [FORWARD_STEP]',myThid) |
|
|
CALL CALC_GW(myThid) |
|
|
CALL TIMER_STOP ('CALC_GW [FORWARD_STEP]',myThid) |
|
|
ENDIF |
|
|
#endif |
|
|
|
|
431 |
C-- Update time-counter |
C-- Update time-counter |
432 |
myIter = nIter0 + iLoop |
myIter = nIter0 + iLoop |
433 |
myTime = startTime + deltaTClock * float(iLoop) |
myTime = startTime + deltaTClock * float(iLoop) |
434 |
|
|
435 |
|
#ifdef ALLOW_MNC |
436 |
|
C Update the default next iter for MNC |
437 |
|
IF ( useMNC ) THEN |
438 |
|
CALL MNC_CW_CITER_SETG( 1, 1, -1, myIter , myThid ) |
439 |
|
|
440 |
|
C TODO: Logic should be added here so that users can specify, on |
441 |
|
C a per-citer-group basis, when it is time to update the |
442 |
|
C "current" (and not just the "next") iteration |
443 |
|
|
444 |
|
C TODO: the following is just a temporary band-aid (mostly, for |
445 |
|
C Baylor) until someone writes a routine that better handles time |
446 |
|
C boundaries such as weeks, months, years, etc. |
447 |
|
IF ( mnc_filefreq .GT. 0 ) THEN |
448 |
|
IF (DIFFERENT_MULTIPLE(mnc_filefreq,myTime,deltaTClock)) |
449 |
|
& THEN |
450 |
|
CALL MNC_CW_CITER_SETG( 1, 1, myIter, -1 , myThid ) |
451 |
|
ENDIF |
452 |
|
ENDIF |
453 |
|
ENDIF |
454 |
|
#endif |
455 |
|
|
456 |
C-- Update geometric factors: |
C-- Update geometric factors: |
457 |
#ifdef NONLIN_FRSURF |
#ifdef NONLIN_FRSURF |
458 |
C- update hfacC,W,S and recip_hFac according to etaH(n+1) : |
C- update hfacC,W,S and recip_hFac according to etaH(n+1) : |
478 |
C-- Apply Filters to u*,v* before SOLVE_FOR_PRESSURE |
C-- Apply Filters to u*,v* before SOLVE_FOR_PRESSURE |
479 |
#ifdef ALLOW_SHAP_FILT |
#ifdef ALLOW_SHAP_FILT |
480 |
IF (useSHAP_FILT .AND. shap_filt_uvStar) THEN |
IF (useSHAP_FILT .AND. shap_filt_uvStar) THEN |
481 |
CALL TIMER_START('SHAP_FILT [FORWARD_STEP]',myThid) |
CALL TIMER_START('SHAP_FILT_UV [FORWARD_STEP]',myThid) |
482 |
IF (implicDiv2Dflow.LT.1.) THEN |
IF (implicDiv2Dflow.LT.1.) THEN |
483 |
C-- Explicit+Implicit part of the Barotropic Flow Divergence |
C-- Explicit+Implicit part of the Barotropic Flow Divergence |
484 |
C => Filtering of uVel,vVel is necessary |
C => Filtering of uVel,vVel is necessary |
486 |
& myTime, myIter, myThid ) |
& myTime, myIter, myThid ) |
487 |
ENDIF |
ENDIF |
488 |
CALL SHAP_FILT_APPLY_UV( gU,gV,myTime,myIter,myThid) |
CALL SHAP_FILT_APPLY_UV( gU,gV,myTime,myIter,myThid) |
489 |
CALL TIMER_STOP ('SHAP_FILT [FORWARD_STEP]',myThid) |
CALL TIMER_STOP ('SHAP_FILT_UV [FORWARD_STEP]',myThid) |
490 |
ENDIF |
ENDIF |
491 |
#endif |
#endif |
492 |
#ifdef ALLOW_ZONAL_FILT |
#ifdef ALLOW_ZONAL_FILT |
493 |
IF (useZONAL_FILT .AND. zonal_filt_uvStar) THEN |
IF (useZONAL_FILT .AND. zonal_filt_uvStar) THEN |
494 |
CALL TIMER_START('ZONAL_FILT_APPLY [FORWARD_STEP]',myThid) |
CALL TIMER_START('ZONAL_FILT_UV [FORWARD_STEP]',myThid) |
495 |
IF (implicDiv2Dflow.LT.1.) THEN |
IF (implicDiv2Dflow.LT.1.) THEN |
496 |
C-- Explicit+Implicit part of the Barotropic Flow Divergence |
C-- Explicit+Implicit part of the Barotropic Flow Divergence |
497 |
C => Filtering of uVel,vVel is necessary |
C => Filtering of uVel,vVel is necessary |
498 |
CALL ZONAL_FILT_APPLY_UV( uVel, vVel, myThid ) |
CALL ZONAL_FILT_APPLY_UV( uVel, vVel, myThid ) |
499 |
ENDIF |
ENDIF |
500 |
CALL ZONAL_FILT_APPLY_UV( gU, gV, myThid ) |
CALL ZONAL_FILT_APPLY_UV( gU, gV, myThid ) |
501 |
CALL TIMER_STOP ('ZONAL_FILT_APPLY [FORWARD_STEP]',myThid) |
CALL TIMER_STOP ('ZONAL_FILT_UV [FORWARD_STEP]',myThid) |
502 |
ENDIF |
ENDIF |
503 |
#endif |
#endif |
504 |
|
|
516 |
C-- Correct divergence in flow field and cycle time-stepping momentum |
C-- Correct divergence in flow field and cycle time-stepping momentum |
517 |
c IF ( momStepping ) THEN |
c IF ( momStepping ) THEN |
518 |
#ifndef ALLOW_OFFLINE |
#ifndef ALLOW_OFFLINE |
519 |
CALL TIMER_START('UV_CORRECTION_STEP [FORWARD_STEP]',myThid) |
CALL TIMER_START('MOM_CORRECTION_STEP [FORWARD_STEP]',myThid) |
520 |
CALL MOMENTUM_CORRECTION_STEP(myTime, myIter, myThid) |
CALL MOMENTUM_CORRECTION_STEP(myTime, myIter, myThid) |
521 |
CALL TIMER_STOP ('UV_CORRECTION_STEP [FORWARD_STEP]',myThid) |
CALL TIMER_STOP ('MOM_CORRECTION_STEP [FORWARD_STEP]',myThid) |
522 |
#endif |
#endif |
523 |
c ENDIF |
c ENDIF |
524 |
|
|
525 |
#ifdef EXACT_CONSERV |
#ifdef EXACT_CONSERV |
526 |
IF (exactConserv) THEN |
IF (exactConserv) THEN |
527 |
C-- Update etaH(n+1) : |
C-- Update etaH(n+1) : |
528 |
CALL TIMER_START('UPDATE_ETAH [FORWARD_STEP]',mythid) |
CALL TIMER_START('UPDATE_ETAH [FORWARD_STEP]',mythid) |
529 |
CALL UPDATE_ETAH( myTime, myIter, myThid ) |
CALL UPDATE_ETAH( myTime, myIter, myThid ) |
530 |
CALL TIMER_STOP ('UPDATE_ETAH [FORWARD_STEP]',mythid) |
CALL TIMER_STOP ('UPDATE_ETAH [FORWARD_STEP]',mythid) |
531 |
ENDIF |
ENDIF |
532 |
#endif /* EXACT_CONSERV */ |
#endif /* EXACT_CONSERV */ |
533 |
|
|
556 |
CALL DO_STAGGER_FIELDS_EXCHANGES( myTime, myIter, myThid ) |
CALL DO_STAGGER_FIELDS_EXCHANGES( myTime, myIter, myThid ) |
557 |
CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
558 |
|
|
559 |
|
C-- State-variables diagnostics |
560 |
|
IF ( usediagnostics ) THEN |
561 |
|
CALL TIMER_START('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
562 |
|
CALL DO_STATEVARS_DIAGS( myTime, 1, myIter, myThid ) |
563 |
|
CALL TIMER_STOP ('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
564 |
|
ENDIF |
565 |
|
|
566 |
#ifdef ALLOW_DEBUG |
#ifdef ALLOW_DEBUG |
567 |
IF ( debugLevel .GE. debLevB ) |
IF ( debugLevel .GE. debLevB ) |
568 |
& CALL DEBUG_CALL('THERMODYNAMICS',myThid) |
& CALL DEBUG_CALL('THERMODYNAMICS',myThid) |
581 |
CADJ STORE totphihyd = comlev1, key = ikey_dynamics |
CADJ STORE totphihyd = comlev1, key = ikey_dynamics |
582 |
#endif |
#endif |
583 |
C-- Cycle time-stepping Tracers arrays (T,S,+pTracers) |
C-- Cycle time-stepping Tracers arrays (T,S,+pTracers) |
584 |
CALL TIMER_START('TS_CORRECTION_STEP [FORWARD_STEP]',myThid) |
CALL TIMER_START('TRC_CORRECTION_STEP [FORWARD_STEP]',myThid) |
585 |
CALL TRACERS_CORRECTION_STEP(myTime, myIter, myThid) |
CALL TRACERS_CORRECTION_STEP(myTime, myIter, myThid) |
586 |
CALL TIMER_STOP ('TS_CORRECTION_STEP [FORWARD_STEP]',myThid) |
CALL TIMER_STOP ('TRC_CORRECTION_STEP [FORWARD_STEP]',myThid) |
587 |
|
|
588 |
|
#ifdef ALLOW_GCHEM |
589 |
|
C Add separate timestepping of chemical/biological/forcing |
590 |
|
C of ptracers here in GCHEM_FORCING_SEP |
591 |
|
IF ( useGCHEM ) THEN |
592 |
|
#ifdef ALLOW_DEBUG |
593 |
|
IF ( debugLevel .GE. debLevB ) |
594 |
|
& CALL DEBUG_CALL('GCHEM_FORCING_SEP',myThid) |
595 |
|
#endif /* ALLOW_DEBUG */ |
596 |
|
CALL TIMER_START('GCHEM_FORCING_SEP [FORWARD_STEP]',myThid) |
597 |
|
CALL GCHEM_FORCING_SEP( myTime,myIter,myThid ) |
598 |
|
CALL TIMER_STOP ('GCHEM_FORCING_SEP [FORWARD_STEP]',myThid) |
599 |
|
ENDIF |
600 |
|
#endif /* ALLOW_GCHEM */ |
601 |
|
|
602 |
C-- Do "blocking" sends and receives for tendency "overlap" terms |
C-- Do "blocking" sends and receives for tendency "overlap" terms |
603 |
c CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
c CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
609 |
CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid ) |
CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid ) |
610 |
CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid) |
611 |
|
|
|
cswdptr -- add for seperate timestepping of chemical/biological/forcing |
|
|
cswdptr of ptracers --- |
|
|
#ifdef ALLOW_GCHEM |
|
|
ceh3 This is broken -- this ifdef should not be visible! |
|
|
#ifdef PTRACERS_SEPARATE_FORCING |
|
|
ceh3 needs an IF ( use GCHEM ) THEN |
|
|
call GCHEM_FORCING_SEP( myTime,myIter,myThid ) |
|
|
#endif /* PTRACERS_SEPARATE_FORCING */ |
|
|
#endif /* ALLOW_GCHEM */ |
|
|
cswdptr -- end add --- |
|
612 |
|
|
613 |
C AMM |
C AMM |
614 |
#ifdef ALLOW_GRIDALT |
#ifdef ALLOW_GRIDALT |
637 |
ENDIF |
ENDIF |
638 |
#endif |
#endif |
639 |
|
|
640 |
C-- State-variables statistics (time-aver, diagnostics ...) |
C-- State-variables time-averaging |
641 |
CALL TIMER_START('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
CALL TIMER_START('DO_STATEVARS_TAVE [FORWARD_STEP]',myThid) |
642 |
CALL DO_STATEVARS_DIAGS( myTime, myIter, myThid ) |
CALL DO_STATEVARS_TAVE( myTime, myIter, myThid ) |
643 |
CALL TIMER_STOP ('DO_STATEVARS_DIAGS [FORWARD_STEP]',myThid) |
CALL TIMER_STOP ('DO_STATEVARS_TAVE [FORWARD_STEP]',myThid) |
644 |
|
|
645 |
#ifndef ALLOW_OFFLINE |
#ifndef ALLOW_OFFLINE |
646 |
#ifdef ALLOW_MONITOR |
#ifdef ALLOW_MONITOR |
654 |
#ifdef ALLOW_COST |
#ifdef ALLOW_COST |
655 |
C-- compare model with data and compute cost function |
C-- compare model with data and compute cost function |
656 |
C-- this is done after exchanges to allow interpolation |
C-- this is done after exchanges to allow interpolation |
|
ceh3 perhaps needs an IF ( useCOST ) THEN |
|
|
CADJ STORE theta, uvel, vvel = comlev1, key = ikey_dynamics |
|
657 |
CALL TIMER_START('COST_TILE [FORWARD_STEP]',myThid) |
CALL TIMER_START('COST_TILE [FORWARD_STEP]',myThid) |
658 |
CALL COST_TILE ( mytime, myiter, myThid ) |
CALL COST_TILE ( mytime, myiter, myThid ) |
659 |
CALL TIMER_STOP ('COST_TILE [FORWARD_STEP]',myThid) |
CALL TIMER_STOP ('COST_TILE [FORWARD_STEP]',myThid) |
670 |
CALL TIMER_STOP ('DO_THE_MODEL_IO [FORWARD_STEP]',myThid) |
CALL TIMER_STOP ('DO_THE_MODEL_IO [FORWARD_STEP]',myThid) |
671 |
#endif |
#endif |
672 |
|
|
673 |
|
#ifdef HAVE_SIGREG |
674 |
|
IF ( useSIGREG ) THEN |
675 |
|
IF ( i_got_signal .GT. 0 ) THEN |
676 |
|
CALL PACKAGES_WRITE_PICKUP( |
677 |
|
I .TRUE., myTime, myIter, myThid ) |
678 |
|
#ifndef ALLOW_OFFLINE |
679 |
|
CALL WRITE_CHECKPOINT( |
680 |
|
I .TRUE., myTime, myIter, myThid ) |
681 |
|
#endif |
682 |
|
STOP 'Checkpoint completed -- killed by signal handler' |
683 |
|
ENDIF |
684 |
|
ENDIF |
685 |
|
#endif |
686 |
|
|
687 |
C-- Save state for restarts |
C-- Save state for restarts |
688 |
CALL TIMER_START('WRITE_CHECKPOINT [FORWARD_STEP]',myThid) |
CALL TIMER_START('WRITE_CHECKPOINT [FORWARD_STEP]',myThid) |
689 |
CALL PACKAGES_WRITE_PICKUP( |
CALL PACKAGES_WRITE_PICKUP( |