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

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

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

revision 1.103 by heimbach, Mon Sep 27 18:00:19 2004 UTC revision 1.107 by mlosch, Thu Nov 18 23:31:00 2004 UTC
# Line 10  C $Name$ Line 10  C $Name$
10  #ifdef ALLOW_OFFLINE  #ifdef ALLOW_OFFLINE
11  # include "OFFLINE_OPTIONS.h"  # include "OFFLINE_OPTIONS.h"
12  #endif  #endif
13    #ifdef ALLOW_GMREDI
14    # include "GMREDI_OPTIONS.h"
15    #endif
16    
17  CBOP  CBOP
18  C     !ROUTINE: FORWARD_STEP  C     !ROUTINE: FORWARD_STEP
# Line 86  C     == Global variables == Line 88  C     == Global variables ==
88  # ifdef EXACT_CONSERV  # ifdef EXACT_CONSERV
89  #  include "SURFACE.h"  #  include "SURFACE.h"
90  # endif  # endif
91    # ifdef ALLOW_KPP
92    #  include "KPP.h"
93    # endif
94    # ifdef ALLOW_GMREDI
95    #  include "GMREDI.h"
96    # endif
97  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
98    
99  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
# Line 118  C--   Reset the model iteration counter Line 126  C--   Reset the model iteration counter
126        mytime = startTime + float(iloop-1)*deltaTclock        mytime = startTime + float(iloop-1)*deltaTclock
127  #endif  #endif
128    
 #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 )  
 #endif  
   
129  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
130  c**************************************  c**************************************
131  #include "checkpoint_lev1_directives.h"  #include "checkpoint_lev1_directives.h"
# Line 192  c--   Add control vector for forcing and Line 186  c--   Add control vector for forcing and
186       &     CALL CTRL_MAP_FORCING (mythid)       &     CALL CTRL_MAP_FORCING (mythid)
187  #endif  #endif
188    
189    #if (defined (ALLOW_AUTODIFF_TAMC) && defined (ALLOW_AUTODIFF_MONITOR))
190    C     Include call to a dummy routine. Its adjoint will be
191    C     called at the proper place in the adjoint code.
192    C     The adjoint routine will print out adjoint values
193    C     if requested. The location of the call is important,
194    C     it has to be after the adjoint of the exchanges
195    C     (DO_GTERM_BLOCKING_EXCHANGES).
196          CALL DUMMY_IN_STEPPING( myTime, myIter, myThid )
197    cph   I've commented this line since it may conflict with MITgcm's adjoint
198    cph   However, need to check whether that's still consistent
199    cph   with the ecco-branch (it should).
200    cph      CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )
201    #endif
202    
203  # ifdef ALLOW_SEAICE  # ifdef ALLOW_SEAICE
204  C--   Call sea ice model to compute forcing/external data fields.  In  C--   Call sea ice model to compute forcing/external data fields.  In
205  C     addition to computing prognostic sea-ice variables and diagnosing the  C     addition to computing prognostic sea-ice variables and diagnosing the
# Line 264  C--     Step forward fields and calculat Line 272  C--     Step forward fields and calculat
272         CALL DO_ATMOSPHERIC_PHYS( myTime, myIter, myThid )         CALL DO_ATMOSPHERIC_PHYS( myTime, myIter, myThid )
273         CALL TIMER_STOP ('DO_ATMOSPHERIC_PHYS [FORWARD_STEP]',mythid)         CALL TIMER_STOP ('DO_ATMOSPHERIC_PHYS [FORWARD_STEP]',mythid)
274    
275    #ifdef ALLOW_AUTODIFF_TAMC
276    CADJ STORE theta              = comlev1, key = ikey_dynamics
277    CADJ STORE salt               = comlev1, key = ikey_dynamics
278    CADJ STORE totphihyd          = comlev1, key = ikey_dynamics
279    CADJ STORE surfaceforcingtice = comlev1, key = ikey_dynamics
280    # ifdef ALLOW_KPP
281    CADJ STORE uvel               = comlev1, key = ikey_dynamics
282    CADJ STORE vvel               = comlev1, key = ikey_dynamics
283    # endif
284    # ifdef EXACT_CONSERV
285    CADJ STORE empmr              = comlev1, key = ikey_dynamics
286    CADJ STORE pmepr              = comlev1, key = ikey_dynamics
287    # endif
288    #endif /* ALLOW_AUTODIFF_TAMC */
289    
290  #ifndef ALLOW_OFFLINE  #ifndef ALLOW_OFFLINE
291  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
292         IF ( debugLevel .GE. debLevB )         IF ( debugLevel .GE. debLevB )
# Line 274  C--     Step forward fields and calculat Line 297  C--     Step forward fields and calculat
297         CALL TIMER_STOP ('DO_OCEANIC_PHYS     [FORWARD_STEP]',mythid)         CALL TIMER_STOP ('DO_OCEANIC_PHYS     [FORWARD_STEP]',mythid)
298  #endif  #endif
299    
300    #ifdef ALLOW_AUTODIFF_TAMC
301    cph needed to be moved here from do_oceanic_physics
302    cph to be visible down the road
303    c
304    CADJ STORE surfaceForcingS    = comlev1, key = ikey_dynamics
305    CADJ STORE surfaceForcingT    = comlev1, key = ikey_dynamics
306    CADJ STORE surfaceForcingTice = comlev1, key = ikey_dynamics
307    ctest(
308    CADJ STORE IVDConvCount       = comlev1, key = ikey_dynamics
309    ctest)
310    # ifdef ALLOW_PTRACERS
311    CADJ STORE surfaceForcingPtr  = comlev1, key = ikey_dynamics
312    # endif
313    c
314    # ifdef ALLOW_GMREDI
315    CADJ STORE Kwx                = comlev1, key = ikey_dynamics
316    CADJ STORE Kwy                = comlev1, key = ikey_dynamics
317    CADJ STORE Kwz                = comlev1, key = ikey_dynamics
318    #  ifdef GM_BOLUS_ADVEC
319    CADJ STORE GM_PsiX            = comlev1, key = ikey_dynamics
320    CADJ STORE GM_PsiY            = comlev1, key = ikey_dynamics
321    #  endif
322    # endif
323    c
324    # ifdef ALLOW_KPP
325    CADJ STORE KPPghat            = comlev1, key = ikey_dynamics
326    CADJ STORE KPPfrac            = comlev1, key = ikey_dynamics
327    CADJ STORE KPPdiffKzS         = comlev1, key = ikey_dynamics
328    CADJ STORE KPPdiffKzT         = comlev1, key = ikey_dynamics
329    # endif
330    #endif /* ALLOW_AUTODIFF_TAMC */
331    
332        IF ( .NOT.staggerTimeStep ) THEN        IF ( .NOT.staggerTimeStep ) THEN
333  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
334          IF ( debugLevel .GE. debLevB )          IF ( debugLevel .GE. debLevB )
# Line 461  C--   Cycle time-stepping Tracers arrays Line 516  C--   Cycle time-stepping Tracers arrays
516          CALL TRACERS_CORRECTION_STEP(myTime, myIter, myThid)          CALL TRACERS_CORRECTION_STEP(myTime, myIter, myThid)
517          CALL TIMER_STOP ('TS_CORRECTION_STEP  [FORWARD_STEP]',myThid)          CALL TIMER_STOP ('TS_CORRECTION_STEP  [FORWARD_STEP]',myThid)
518    
 C--   Do "blocking" sends and receives for tendency "overlap" terms  
 c     CALL TIMER_START('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)  
 c     CALL DO_GTERM_BLOCKING_EXCHANGES( myThid )  
 c     CALL TIMER_STOP ('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)  
   
 C--   Do "blocking" sends and receives for field "overlap" terms  
       CALL TIMER_START('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)  
       CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )  
       CALL TIMER_STOP ('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)  
   
519  cswdptr -- add for seperate timestepping of chemical/biological/forcing  cswdptr -- add for seperate timestepping of chemical/biological/forcing
520  cswdptr    of ptracers ---  cswdptr    of ptracers ---
521  #ifdef ALLOW_GCHEM  #ifdef ALLOW_GCHEM
# Line 482  ceh3 needs an IF ( use GCHEM ) THEN Line 527  ceh3 needs an IF ( use GCHEM ) THEN
527  #endif /* ALLOW_GCHEM */  #endif /* ALLOW_GCHEM */
528  cswdptr -- end add ---  cswdptr -- end add ---
529    
530    C--   Do "blocking" sends and receives for tendency "overlap" terms
531    c     CALL TIMER_START('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
532    c     CALL DO_GTERM_BLOCKING_EXCHANGES( myThid )
533    c     CALL TIMER_STOP ('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
534    
535    C--   Do "blocking" sends and receives for field "overlap" terms
536          CALL TIMER_START('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
537          CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )
538          CALL TIMER_STOP ('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
539    
540    
541  C AMM  C AMM
542  #ifdef ALLOW_GRIDALT  #ifdef ALLOW_GRIDALT
543          if (useGRIDALT) then          if (useGRIDALT) then
# Line 526  C--   Check status of solution (statisti Line 582  C--   Check status of solution (statisti
582  #ifdef ALLOW_COST  #ifdef ALLOW_COST
583  C--     compare model with data and compute cost function  C--     compare model with data and compute cost function
584  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  
585        CALL TIMER_START('COST_TILE           [FORWARD_STEP]',myThid)        CALL TIMER_START('COST_TILE           [FORWARD_STEP]',myThid)
586        CALL COST_TILE  ( mytime, myiter, myThid )        CALL COST_TILE  ( mytime, myiter, myThid )
587        CALL TIMER_STOP ('COST_TILE           [FORWARD_STEP]',myThid)        CALL TIMER_STOP ('COST_TILE           [FORWARD_STEP]',myThid)

Legend:
Removed from v.1.103  
changed lines
  Added in v.1.107

  ViewVC Help
Powered by ViewVC 1.1.22