/[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.6 by cnh, Sun Feb 4 14:38:47 2001 UTC revision 1.8 by jmc, Tue Feb 20 15:10:15 2001 UTC
# Line 4  C $Name$ Line 4  C $Name$
4  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
5    
6        SUBROUTINE FORWARD_STEP(        SUBROUTINE FORWARD_STEP(
7       I                    doHalfStep, iLoop,       I                    iLoop,
8       U                    myCurrentTime, myCurrentIter,       U                    myCurrentTime, myCurrentIter,
9       &                    myThid)       &                    myThid)
10  C     /==========================================================\  C     /==========================================================\
# Line 32  C  |    |  |--DYNAMICS Line 32  C  |    |  |--DYNAMICS
32  C /|\   |  |   o Evaluate "forward" terms  C /|\   |  |   o Evaluate "forward" terms
33  C  |    |  |  C  |    |  |
34  C /|\   |  |  C /|\   |  |
 C  |    |  |--DO_THE_MODEL_IO  
 C /|\   |  |   o Write model state  
 C  |    |  |  
 C /|\   |  |  
35  C  |    |  |--SOLVE_FOR_PRESSURE  C  |    |  |--SOLVE_FOR_PRESSURE
36  C /|\   |  |   o Find pressure field to keep flow non-divergent  C /|\   |  |   o Find pressure field to keep flow non-divergent
37  C  |    |  |  C  |    |  |
# Line 48  C  |    |  |--DO_GTERM_BLOCKING_EXCHANGE Line 44  C  |    |  |--DO_GTERM_BLOCKING_EXCHANGE
44  C /|\   |  |   o Update overlap regions  C /|\   |  |   o Update overlap regions
45  C  |    |  |  C  |    |  |
46  C /|\   |  |  C /|\   |  |
47    C  |    |  |--DO_THE_MODEL_IO
48    C /|\   |  |   o Write model state
49    C  |    |  |
50    C /|\   |  |
51  C  |    |  |--WRITE_CHECKPOINT  C  |    |  |--WRITE_CHECKPOINT
52  C /|\   |  |   o Write restart file(s)  C /|\   |  |   o Write restart file(s)
53  C  |    |  C  |    |
# Line 66  C     == Global variables === Line 66  C     == Global variables ===
66  #endif  #endif
67    
68  C     == Routine arguments ==  C     == Routine arguments ==
 C     doHalfStep - If .TRUE. then this is the last half step  
69  C     iLoop         - Invocation count (counter in THE_MAIN_LOOP)  C     iLoop         - Invocation count (counter in THE_MAIN_LOOP)
70  C     myCurrentIter - Iteration counter for this thread  C     myCurrentIter - Iteration counter for this thread
71  C     myCurrentTime - Time counter for this thread  C     myCurrentTime - Time counter for this thread
72  C     myThid - Thread number for this instance of the routine.  C     myThid - Thread number for this instance of the routine.
       LOGICAL doHalfStep  
73        INTEGER iLoop        INTEGER iLoop
74        INTEGER myCurrentIter        INTEGER myCurrentIter
75        _RL     myCurrentTime        _RL     myCurrentTime
# Line 108  C--   Step forward all tiles, filter and Line 106  C--   Step forward all tiles, filter and
106  #endif  #endif
107    
108  #ifdef ALLOW_ZONAL_FILT  #ifdef ALLOW_ZONAL_FILT
109          IF (zonal_filt_lat.LT.90.) THEN
110        CALL ZONAL_FILT_APPLY(        CALL ZONAL_FILT_APPLY(
111       U           gUnm1, gVnm1, gTnm1, gSnm1,       U           gUnm1, gVnm1, gTnm1, gSnm1,
112       I           myThid )       I           myThid )
113          ENDIF
114  #endif  #endif
115    
 C--   Do IO if needed.  
 C     Note:  
 C     =====  
 C     At this point model arrays hold U,V,T,S  at "time-level" N  
 C     and cg2d_x at "time-level" N-1/2 where N = I+timeLevBase-1.  
 C     By convention this is taken to be the model "state".  
       CALL TIMER_START('I/O (WRITE)        [FORWARD_STEP]',myThid)  
       CALL DO_THE_MODEL_IO(  
      &        doHalfStep, myCurrentTime, myCurrentIter, myThid )  
       CALL TIMER_STOP ('I/O (WRITE)        [FORWARD_STEP]',myThid)  
   
   
       IF (.NOT. doHalfStep) THEN  
   
116  C--   Solve elliptic equation(s).  C--   Solve elliptic equation(s).
117  C     Two-dimensional only for conventional hydrostatic or  C     Two-dimensional only for conventional hydrostatic or
118  C     three-dimensional for non-hydrostatic and/or IGW scheme.  C     three-dimensional for non-hydrostatic and/or IGW scheme.
# Line 135  C     three-dimensional for non-hydrosta Line 121  C     three-dimensional for non-hydrosta
121        CALL TIMER_STOP ('SOLVE_FOR_PRESSURE [FORWARD_STEP]',myThid)        CALL TIMER_STOP ('SOLVE_FOR_PRESSURE [FORWARD_STEP]',myThid)
122    
123  C--   Correct divergence in flow field and cycle time-stepping  C--   Correct divergence in flow field and cycle time-stepping
124  C     arrays (for all fields)  C     arrays (for all fields) ; update time-counter
125          myCurrentIter = nIter0 + iLoop
126          myCurrentTime = startTime + deltaTClock * float(iLoop)
127        CALL THE_CORRECTION_STEP(myCurrentTime, myCurrentIter, myThid)        CALL THE_CORRECTION_STEP(myCurrentTime, myCurrentIter, myThid)
128    
129  C--   Do "blocking" sends and receives for tendency "overlap" terms  C--   Do "blocking" sends and receives for tendency "overlap" terms
130  C     CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)  c     CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)
131  C     CALL DO_GTERM_BLOCKING_EXCHANGES( myThid )  c     CALL DO_GTERM_BLOCKING_EXCHANGES( myThid )
132  C     CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)  c     CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)
133    
134  C--   Do "blocking" sends and receives for field "overlap" terms  C--   Do "blocking" sends and receives for field "overlap" terms
135        CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)        CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)
136        CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )        CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )
137        CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)        CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)
138    
139  c     myCurrentIter = myCurrentIter + 1  C--   Do IO if needed.
140  c     myCurrentTime = myCurrentTime + deltaTClock        CALL TIMER_START('I/O (WRITE)        [FORWARD_STEP]',myThid)
141        myCurrentIter = nIter0 + iLoop        CALL DO_THE_MODEL_IO(.FALSE.,
142        myCurrentTime = startTime + deltaTClock * float(iLoop)       &                     myCurrentTime, myCurrentIter, myThid )
143          CALL TIMER_STOP ('I/O (WRITE)        [FORWARD_STEP]',myThid)
144    
145  C--   Save state for restarts  C--   Save state for restarts
146  C     Note:  C     Note:    (jmc: is it still the case after ckp35 ?)
147  C     =====  C     =====
148  C     Because of the ordering of the timestepping code and  C     Because of the ordering of the timestepping code and
149  C     tendency term code at end of loop model arrays hold  C     tendency term code at end of loop model arrays hold
# Line 171  C     at time level 1 Line 160  C     at time level 1
160       &        .FALSE., myCurrentTime, myCurrentIter, myThid )       &        .FALSE., myCurrentTime, myCurrentIter, myThid )
161        CALL TIMER_STOP ('I/O (WRITE)        [FORWARD_STEP]',myThid)        CALL TIMER_STOP ('I/O (WRITE)        [FORWARD_STEP]',myThid)
162    
       ENDIF  
163    
164        RETURN        RETURN
165        END        END

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.22