/[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.116 by molod, Mon May 16 20:22:11 2005 UTC revision 1.125 by edhill, Sat Dec 3 08:30:32 2005 UTC
# Line 40  C     == Global variables == Line 40  C     == Global variables ==
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
# Line 53  C     == Global variables == Line 63  C     == Global variables ==
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"
# Line 109  C     myThid - thread number for this in Line 115  C     myThid - thread number for this in
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
# Line 420  C--   Step forward fields and calculate Line 428  C--   Step forward fields and calculate
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) :
# Line 462  C-    update also CG2D matrix (and preco Line 478  C-    update also CG2D matrix (and preco
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
# Line 470  C      => Filtering of uVel,vVel is nece Line 486  C      => Filtering of uVel,vVel is nece
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    
# Line 500  C     three-dimensional for non-hydrosta Line 516  C     three-dimensional for non-hydrosta
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    
# Line 565  cph find_rho which may use pressure() Line 581  cph find_rho which may use pressure()
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  #ifdef ALLOW_GCHEM
589  C     Add separate timestepping of chemical/biological/forcing  C     Add separate timestepping of chemical/biological/forcing
# Line 654  C--   Do IO if needed. Line 670  C--   Do IO if needed.
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  C AMM  #ifdef HAVE_SIGREG
674  C  Update fizhi timekeeping        IF ( useSIGREG ) THEN
675  C  WARNING: This call MUST remain AFTER do the model io          IF ( i_got_signal .GT. 0 ) THEN
676  C            and BEFORE packages write pickup            CALL PACKAGES_WRITE_PICKUP(
677  #ifdef ALLOW_FIZHI       I         .TRUE., myTime, myIter, myThid )
678        if( useFIZHI) then  #ifndef ALLOW_OFFLINE
679           CALL FIZHI_UPDATE_TIME ( myIter, myThid, deltaTclock )            CALL WRITE_CHECKPOINT(
680        endif       I         .TRUE., myTime, myIter, myThid )  
681    #endif
682              STOP 'Checkpoint completed -- killed by signal handler'
683            ENDIF
684          ENDIF
685  #endif  #endif
 C AMM  
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)

Legend:
Removed from v.1.116  
changed lines
  Added in v.1.125

  ViewVC Help
Powered by ViewVC 1.1.22