/[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.108 by mlosch, Fri Nov 19 01:33:31 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 227  CADJ STORE ptracer  = comlev1, key = ike Line 235  CADJ STORE ptracer  = comlev1, key = ike
235    
236  #ifdef ALLOW_PTRACERS  #ifdef ALLOW_PTRACERS
237  # ifdef ALLOW_GCHEM  # ifdef ALLOW_GCHEM
238            IF ( useGCHEM ) THEN
239           CALL GCHEM_FIELDS_LOAD( mytime, myiter, mythid )           CALL GCHEM_FIELDS_LOAD( mytime, myiter, mythid )
240            ENDIF
241  # endif  # endif
242  #endif  #endif
243    
# Line 264  C--     Step forward fields and calculat Line 274  C--     Step forward fields and calculat
274         CALL DO_ATMOSPHERIC_PHYS( myTime, myIter, myThid )         CALL DO_ATMOSPHERIC_PHYS( myTime, myIter, myThid )
275         CALL TIMER_STOP ('DO_ATMOSPHERIC_PHYS [FORWARD_STEP]',mythid)         CALL TIMER_STOP ('DO_ATMOSPHERIC_PHYS [FORWARD_STEP]',mythid)
276    
277    #ifdef ALLOW_AUTODIFF_TAMC
278    CADJ STORE theta              = comlev1, key = ikey_dynamics
279    CADJ STORE salt               = comlev1, key = ikey_dynamics
280    CADJ STORE totphihyd          = comlev1, key = ikey_dynamics
281    CADJ STORE surfaceforcingtice = comlev1, key = ikey_dynamics
282    # ifdef ALLOW_KPP
283    CADJ STORE uvel               = comlev1, key = ikey_dynamics
284    CADJ STORE vvel               = comlev1, key = ikey_dynamics
285    # endif
286    # ifdef EXACT_CONSERV
287    CADJ STORE empmr              = comlev1, key = ikey_dynamics
288    CADJ STORE pmepr              = comlev1, key = ikey_dynamics
289    # endif
290    #endif /* ALLOW_AUTODIFF_TAMC */
291    
292  #ifndef ALLOW_OFFLINE  #ifndef ALLOW_OFFLINE
293  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
294         IF ( debugLevel .GE. debLevB )         IF ( debugLevel .GE. debLevB )
# Line 274  C--     Step forward fields and calculat Line 299  C--     Step forward fields and calculat
299         CALL TIMER_STOP ('DO_OCEANIC_PHYS     [FORWARD_STEP]',mythid)         CALL TIMER_STOP ('DO_OCEANIC_PHYS     [FORWARD_STEP]',mythid)
300  #endif  #endif
301    
302    #ifdef ALLOW_AUTODIFF_TAMC
303    cph needed to be moved here from do_oceanic_physics
304    cph to be visible down the road
305    c
306    CADJ STORE surfaceForcingS    = comlev1, key = ikey_dynamics
307    CADJ STORE surfaceForcingT    = comlev1, key = ikey_dynamics
308    CADJ STORE surfaceForcingTice = comlev1, key = ikey_dynamics
309    ctest(
310    CADJ STORE IVDConvCount       = comlev1, key = ikey_dynamics
311    ctest)
312    # ifdef ALLOW_PTRACERS
313    CADJ STORE surfaceForcingPtr  = comlev1, key = ikey_dynamics
314    # endif
315    c
316    # ifdef ALLOW_GMREDI
317    CADJ STORE Kwx                = comlev1, key = ikey_dynamics
318    CADJ STORE Kwy                = comlev1, key = ikey_dynamics
319    CADJ STORE Kwz                = comlev1, key = ikey_dynamics
320    #  ifdef GM_BOLUS_ADVEC
321    CADJ STORE GM_PsiX            = comlev1, key = ikey_dynamics
322    CADJ STORE GM_PsiY            = comlev1, key = ikey_dynamics
323    #  endif
324    # endif
325    c
326    # ifdef ALLOW_KPP
327    CADJ STORE KPPghat            = comlev1, key = ikey_dynamics
328    CADJ STORE KPPfrac            = comlev1, key = ikey_dynamics
329    CADJ STORE KPPdiffKzS         = comlev1, key = ikey_dynamics
330    CADJ STORE KPPdiffKzT         = comlev1, key = ikey_dynamics
331    # endif
332    #endif /* ALLOW_AUTODIFF_TAMC */
333    
334        IF ( .NOT.staggerTimeStep ) THEN        IF ( .NOT.staggerTimeStep ) THEN
335  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
336          IF ( debugLevel .GE. debLevB )          IF ( debugLevel .GE. debLevB )
# Line 461  C--   Cycle time-stepping Tracers arrays Line 518  C--   Cycle time-stepping Tracers arrays
518          CALL TRACERS_CORRECTION_STEP(myTime, myIter, myThid)          CALL TRACERS_CORRECTION_STEP(myTime, myIter, myThid)
519          CALL TIMER_STOP ('TS_CORRECTION_STEP  [FORWARD_STEP]',myThid)          CALL TIMER_STOP ('TS_CORRECTION_STEP  [FORWARD_STEP]',myThid)
520    
521    cswdptr -- add for seperate timestepping of chemical/biological/forcing
522    cswdptr    of ptracers ---
523    #ifdef ALLOW_GCHEM
524    ceh3 This is broken -- this ifdef should not be visible!
525    #ifdef PTRACERS_SEPARATE_FORCING
526            IF ( useGCHEM ) THEN
527             CALL GCHEM_FORCING_SEP( myTime,myIter,myThid )
528            ENDIF  
529    #endif /* PTRACERS_SEPARATE_FORCING */
530    #endif /* ALLOW_GCHEM */
531    cswdptr -- end add ---
532    
533  C--   Do "blocking" sends and receives for tendency "overlap" terms  C--   Do "blocking" sends and receives for tendency "overlap" terms
534  c     CALL TIMER_START('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)  c     CALL TIMER_START('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
535  c     CALL DO_GTERM_BLOCKING_EXCHANGES( myThid )  c     CALL DO_GTERM_BLOCKING_EXCHANGES( myThid )
# Line 471  C--   Do "blocking" sends and receives f Line 540  C--   Do "blocking" sends and receives f
540        CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )        CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )
541        CALL TIMER_STOP ('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)        CALL TIMER_STOP ('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
542    
 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 ---  
543    
544  C AMM  C AMM
545  #ifdef ALLOW_GRIDALT  #ifdef ALLOW_GRIDALT
# Line 526  C--   Check status of solution (statisti Line 585  C--   Check status of solution (statisti
585  #ifdef ALLOW_COST  #ifdef ALLOW_COST
586  C--     compare model with data and compute cost function  C--     compare model with data and compute cost function
587  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  
588        CALL TIMER_START('COST_TILE           [FORWARD_STEP]',myThid)        CALL TIMER_START('COST_TILE           [FORWARD_STEP]',myThid)
589        CALL COST_TILE  ( mytime, myiter, myThid )        CALL COST_TILE  ( mytime, myiter, myThid )
590        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.108

  ViewVC Help
Powered by ViewVC 1.1.22