/[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.10 by jmc, Tue Mar 6 16:51:02 2001 UTC revision 1.76 by jmc, Sun Nov 23 01:28:05 2003 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
4    #include "PACKAGES_CONFIG.h"
5  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
6    
7        SUBROUTINE FORWARD_STEP(  cswdptr -- add --
8       I                    iLoop,  #ifdef ALLOW_GCHEM
9       U                    myCurrentTime, myCurrentIter,  # include "GCHEM_OPTIONS.h"
10       &                    myThid)  #endif
11  C     /==========================================================\  cswdptr -- end add ---
12  C     | SUBROUTINE FORWARD_STEP                                  |  
13  C     | o Does one instance of the model time stepping           |  CBOP
14  C     |   The time stepping loop in THE_MAIN_LOOP() calls        |  C     !ROUTINE: FORWARD_STEP
15  C     |   this routine                                           |  C     !INTERFACE:
16  C     |==========================================================|        SUBROUTINE FORWARD_STEP( iloop, myTime, myIter, myThid )
17  C     \==========================================================/  
18        IMPLICIT NONE  C     !DESCRIPTION: \bv
19  C  C     *==================================================================
20  C     Call Tree  C     | SUBROUTINE forward_step
21  C     =========  C     | o Run the ocean model and, optionally, evaluate a cost function.
22  C      C     *==================================================================
23  C      THE_MAIN_LOOP()  C     |
24  C       |  C     | THE_MAIN_LOOP is the toplevel routine for the Tangent Linear and
25  C  ==>  | ** Time stepping loop starts here **  C     | Adjoint Model Compiler (TAMC). For this purpose the initialization
26  C  |    |  C     | of the model was split into two parts. Those parameters that do
27  C /|\   |-FORWARD_STEP  C     | not depend on a specific model run are set in INITIALISE_FIXED,  
28  C  |    |  |  C     | whereas those that do depend on the specific realization are
29  C /|\   |  |--LOAD_EXTERNAL_DATA  C     | initialized in INITIALISE_VARIA.  
30  C  |    |  |   o Load and/or set time dependent forcing fields  C     |
31  C /|\   |  |  C     *==================================================================
32  C  |    |  |--DYNAMICS  C     \ev
 C /|\   |  |   o Evaluate "forward" terms  
 C  |    |  |  
 C /|\   |  |  
 C  |    |  |--SOLVE_FOR_PRESSURE  
 C /|\   |  |   o Find pressure field to keep flow non-divergent  
 C  |    |  |  
 C /|\   |  |  
 C  |    |  |--THE_CORRECTION_STEP  
 C /|\   |  |   o Correct flow field with pressure gradient  
 C  |    |  |     and cycle time-stepping arrays (for all fields)  
 C /|\   |  |  
 C  |    |  |--DO_GTERM_BLOCKING_EXCHANGES  
 C /|\   |  |   o Update overlap regions  
 C  |    |  |  
 C /|\   |  |  
 C  |    |  |--DO_THE_MODEL_IO  
 C /|\   |  |   o Write model state  
 C  |    |  |  
 C /|\   |  |  
 C  |    |  |--WRITE_CHECKPOINT  
 C /|\   |  |   o Write restart file(s)  
 C  |    |  
 C /|\   |  
 C  |<== | ** Time stepping loop finishes here **  
 C  
33    
34  C     == Global variables ===  C     !USES:
35          IMPLICIT NONE
36    C     == Global variables ==
37  #include "SIZE.h"  #include "SIZE.h"
38  #include "EEPARAMS.h"  #include "EEPARAMS.h"
39  #include "PARAMS.h"  #include "PARAMS.h"
40  #include "DYNVARS.h"  #include "DYNVARS.h"
41    #include "FFIELDS.h"
42    
43  #ifdef ALLOW_NONHYDROSTATIC  #ifdef ALLOW_NONHYDROSTATIC
44  #include "CG3D.h"  #include "CG3D.h"
45  #endif  #endif
46    
47    #ifdef ALLOW_SHAP_FILT
48    #include "SHAP_FILT.h"
49    #endif
50    #ifdef ALLOW_ZONAL_FILT
51    #include "ZONAL_FILT.h"
52    #endif
53    
54    #ifdef ALLOW_AUTODIFF_TAMC
55    # include "tamc.h"
56    # include "ctrl.h"
57    # include "ctrl_dummy.h"
58    # include "cost.h"
59    # include "EOS.h"
60    # ifdef ALLOW_EXF
61    #  include "exf_fields.h"
62    #  ifdef ALLOW_BULKFORMULAE
63    #   include "exf_constants.h"
64    #  endif
65    # endif
66    # ifdef ALLOW_OBCS
67    #  include "OBCS.h"
68    # endif
69    # ifdef ALLOW_PTRACERS
70    #  include "PTRACERS.h"
71    # endif
72    #endif /* ALLOW_AUTODIFF_TAMC */
73    
74    C     !LOCAL VARIABLES:
75  C     == Routine arguments ==  C     == Routine arguments ==
76  C     iLoop         - Invocation count (counter in THE_MAIN_LOOP)  C     note: under the multi-threaded model myiter and
77  C     myCurrentIter - Iteration counter for this thread  C           mytime are local variables passed around as routine
78  C     myCurrentTime - Time counter for this thread  C           arguments. Although this is fiddly it saves the need to
79  C     myThid - Thread number for this instance of the routine.  C           impose additional synchronisation points when they are
80        INTEGER iLoop  C           updated.
81        INTEGER myCurrentIter  C     myiter - iteration counter for this thread
82        _RL     myCurrentTime  C     mytime - time counter for this thread
83        INTEGER myThid    C     mythid - thread number for this instance of the routine.
84          integer iloop
85  C     == Local variables ==        integer mythid
86          integer myiter
87  C--   Load forcing/external data fields        _RL     mytime
88        CALL TIMER_START('I/O (READ)         [FORWARD_STEP]',myThid)  #ifdef ALLOW_BULK_FORCE
89        CALL EXTERNAL_FIELDS_LOAD( myCurrentTime, myCurrentIter, myThid )        INTEGER bi,bj
90        CALL TIMER_STOP ('I/O (READ)         [FORWARD_STEP]',myThid)  #endif
91    
92  C--   Step forward fields and calculate time tendency terms  CEOP
93        CALL TIMER_START('DYNAMICS           [FORWARD_STEP]',myThid)  
94        CALL DYNAMICS( myCurrentTime, myCurrentIter, myThid )  #ifdef ALLOW_DEBUG
95        CALL TIMER_STOP ('DYNAMICS           [FORWARD_STEP]',myThid)        IF ( debugLevel .GE. debLevB )
96         &    CALL DEBUG_ENTER('FORWARD_STEP',myThid)
97    #endif
98    
99    #ifdef ALLOW_AUTODIFF_TAMC
100    C--   Reset the model iteration counter and the model time.
101          myiter = nIter0 + (iloop-1)
102          mytime = startTime + float(iloop-1)*deltaTclock
103    #endif
104    
105    #if (defined (ALLOW_AUTODIFF_TAMC) && defined (ALLOW_AUTODIFF_MONITOR))
106    C     Include call to a dummy routine. Its adjoint will be
107    C     called at the proper place in the adjoint code.
108    C     The adjoint routine will print out adjoint values
109    C     if requested. The location of the call is important,
110    C     it has to be after the adjoint of the exchanges
111    C     (DO_GTERM_BLOCKING_EXCHANGES).
112          CALL DUMMY_IN_STEPPING( myTime, myIter, myThid )
113    cph   I've commented this line since it may conflict with MITgcm's adjoint
114    cph   However, need to check whether that's still consistent
115    cph   with the ecco-branch (it should).
116    cph      CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )
117    #endif
118    
119    #ifdef EXACT_CONSERV
120          IF (exactConserv) THEN
121    C--   Update etaH(n+1) :
122             CALL TIMER_START('UPDATE_ETAH        [FORWARD_STEP]',mythid)
123             CALL UPDATE_ETAH( myTime, myIter, myThid )
124             CALL TIMER_STOP ('UPDATE_ETAH        [FORWARD_STEP]',mythid)
125          ENDIF
126    #endif /* EXACT_CONSERV */
127    
128    #ifdef NONLIN_FRSURF
129          IF ( select_rStar.NE.0 ) THEN
130    C--   r* : compute the future level thickness according to etaH(n+1)
131              CALL TIMER_START('CALC_R_STAR       [FORWARD_STEP]',mythid)
132              CALL CALC_R_STAR(etaH, myTime, myIter, myThid )
133              CALL TIMER_STOP ('CALC_R_STAR       [FORWARD_STEP]',mythid)
134          ELSEIF ( nonlinFreeSurf.GT.0) THEN
135    C--   compute the future surface level thickness according to etaH(n+1)
136              CALL TIMER_START('CALC_SURF_DR      [FORWARD_STEP]',mythid)
137              CALL CALC_SURF_DR(etaH, myTime, myIter, myThid )
138              CALL TIMER_STOP ('CALC_SURF_DR      [FORWARD_STEP]',mythid)
139          ENDIF
140    #endif /* NONLIN_FRSURF */
141    
142    #ifdef ALLOW_AUTODIFF_TAMC
143    c**************************************
144    #include "checkpoint_lev1_directives.h"
145    c**************************************
146    #endif
147    
148    C--   Call external forcing package
149    #ifdef ALLOW_BULK_FORCE
150          IF ( useBulkForce ) THEN
151    #ifdef ALLOW_DEBUG
152           IF ( debugLevel .GE. debLevB )
153         &    CALL DEBUG_CALL('BULKF_FIELDS_LOAD',myThid)
154    #endif
155           CALL TIMER_START('BULKF_FORCING      [FORWARD_STEP]',mythid)
156    C-    load all forcing fields at current time
157           CALL BULKF_FIELDS_LOAD( myTime, myIter, myThid )
158    C-    calculate qnet and empmr (and wind stress)
159           CALL BULKF_FORCING( myTime, myIter, myThid )
160           CALL TIMER_STOP ('BULKF_FORCING      [FORWARD_STEP]',mythid)
161          ELSE
162    #endif /* ALLOW_BULK_FORCE */
163    
164    # ifdef ALLOW_EXF
165    #  ifdef ALLOW_DEBUG
166          IF ( debugLevel .GE. debLevB )
167         &    CALL DEBUG_CALL('EXF_GETFORCING',myThid)
168    #  endif
169          CALL TIMER_START('EXF_GETFORCING     [FORWARD_STEP]',mythid)
170          CALL EXF_GETFORCING( mytime, myiter, mythid )
171          CALL TIMER_STOP ('EXF_GETFORCING     [FORWARD_STEP]',mythid)
172    # else /* ALLOW_EXF undef */
173    cph The following IF-statement creates an additional dependency
174    cph for the forcing fields requiring additional storing.
175    cph Therefore, the IF-statement will be put between CPP-OPTIONS,
176    cph assuming that ALLOW_SEAICE has not yet been differentiated.
177    #  ifdef ALLOW_SEAICE
178          IF ( .NOT. useSEAICE ) THEN
179    #  endif
180    #ifdef ALLOW_DEBUG
181           IF ( debugLevel .GE. debLevB )
182         &    CALL DEBUG_CALL('EXTERNAL_FIELDS_LOAD',myThid)
183    #endif
184           CALL TIMER_START('EXTERNAL_FIELDS_LOAD[FORWARD_STEP]',mythid)
185           CALL EXTERNAL_FIELDS_LOAD( mytime, myiter, mythid )
186           CALL TIMER_STOP ('EXTERNAL_FIELDS_LOAD[FORWARD_STEP]',mythid)
187    #  ifdef ALLOW_SEAICE
188          ENDIF
189    #  endif
190    # endif /* ALLOW_EXF */
191    #ifdef ALLOW_BULK_FORCE
192    C--   end of if/else block useBulfforce --
193          ENDIF
194    #endif /* ALLOW_BULK_FORCE */
195    
196    #ifdef ALLOW_AUTODIFF
197    c--   Add control vector for forcing and parameter fields
198          if ( myiter .EQ. nIter0 )
199         &     CALL CTRL_MAP_FORCING (mythid)
200    #endif
201    
202    #ifdef ALLOW_THSICE
203          IF (useThSIce) THEN
204    #ifdef ALLOW_DEBUG
205            IF ( debugLevel .GE. debLevB )
206         &    CALL DEBUG_CALL('THSICE_MAIN',myThid)
207    #endif
208    C--     Step forward Therm.Sea-Ice variables
209    C       and modify forcing terms including effects from ice
210            CALL TIMER_START('THSICE_MAIN        [FORWARD_STEP]', myThid)
211            CALL THSICE_MAIN( myTime, myIter, myThid )
212            CALL TIMER_STOP( 'THSICE_MAIN        [FORWARD_STEP]', myThid)
213          ENDIF
214    #endif /* ALLOW_THSICE */
215    
216    # ifdef ALLOW_SEAICE
217    C--   Call sea ice model to compute forcing/external data fields.  In
218    C     addition to computing prognostic sea-ice variables and diagnosing the
219    C     forcing/external data fields that drive the ocean model, SEAICE_MODEL
220    C     also sets theta to the freezing point under sea-ice.  The implied
221    C     surface heat flux is then stored in variable surfaceTendencyTice,
222    C     which is needed by KPP package (kpp_calc.F and kpp_transport_t.F)
223    C     to diagnose surface buoyancy fluxes and for the non-local transport
224    C     term.  Because this call precedes model thermodynamics, temperature
225    C     under sea-ice may not be "exactly" at the freezing point by the time
226    C     theta is dumped or time-averaged.
227          IF ( useSEAICE ) THEN
228    #ifdef ALLOW_DEBUG
229             IF ( debugLevel .GE. debLevB )
230         &    CALL DEBUG_CALL('SEAICE_MODEL',myThid)
231    #endif
232             CALL TIMER_START('SEAICE_MODEL       [FORWARD_STEP]',myThid)
233             CALL SEAICE_MODEL( myTime, myIter, myThid )
234             CALL TIMER_STOP ('SEAICE_MODEL       [FORWARD_STEP]',myThid)
235          ENDIF
236    # endif /* ALLOW_SEAICE */
237    
238    C--   Freeze water at the surface
239    #ifdef ALLOW_AUTODIFF_TAMC
240    CADJ STORE theta = comlev1, key = ikey_dynamics
241    #endif
242          IF ( allowFreezing .AND. .NOT. useSEAICE
243         &                   .AND. .NOT. useThSIce ) THEN
244            CALL FREEZE_SURFACE(  myTime, myIter, myThid )
245          ENDIF
246    
247    #ifdef ALLOW_AUTODIFF_TAMC
248    # ifdef ALLOW_PTRACERS
249    cph this replaces _bibj storing of ptracer within thermodynamics
250    CADJ STORE ptracer  = comlev1, key = ikey_dynamics
251    # endif
252    #endif
253    
254    #ifdef ALLOW_PTRACERS
255    # ifdef ALLOW_GCHEM
256             CALL GCHEM_FIELDS_LOAD( mytime, myiter, mythid )
257    # endif
258    #endif
259    
260    C--     Step forward fields and calculate time tendency terms.
261    #ifdef ALLOW_DEBUG
262          IF ( debugLevel .GE. debLevB )
263         &    CALL DEBUG_CALL('THERMODYNAMICS',myThid)
264    #endif
265            CALL TIMER_START('THERMODYNAMICS      [FORWARD_STEP]',mythid)
266            CALL THERMODYNAMICS( myTime, myIter, myThid )
267            CALL TIMER_STOP ('THERMODYNAMICS      [FORWARD_STEP]',mythid)
268    
269    C--   do exchanges (needed for DYNAMICS) when using stagger time-step :
270    #ifdef ALLOW_DEBUG
271          IF ( debugLevel .GE. debLevB )
272         &    CALL DEBUG_CALL('DO_STAGGER_FIELDS_EXCH.',myThid)
273    #endif
274            CALL TIMER_START('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
275            CALL DO_STAGGER_FIELDS_EXCHANGES( myTime, myIter, myThid )
276            CALL TIMER_STOP ('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
277    
278    #ifdef ALLOW_SHAP_FILT
279          IF (useSHAP_FILT .AND.
280         &     staggerTimeStep .AND. shap_filt_TrStagg ) THEN
281    #ifdef ALLOW_DEBUG
282            IF ( debugLevel .GE. debLevB )
283         &    CALL DEBUG_CALL('SHAP_FILT_APPLY_TS',myThid)
284    #endif
285            CALL TIMER_START('SHAP_FILT           [FORWARD_STEP]',myThid)
286            CALL SHAP_FILT_APPLY_TS(gT,gS,myTime+deltaT,myIter+1,myThid)
287            CALL TIMER_STOP ('SHAP_FILT           [FORWARD_STEP]',myThid)
288          ENDIF
289    #endif
290    #ifdef ALLOW_ZONAL_FILT
291          IF (useZONAL_FILT .AND.
292         &     staggerTimeStep .AND. zonal_filt_TrStagg ) THEN
293    #ifdef ALLOW_DEBUG
294            IF ( debugLevel .GE. debLevB )
295         &    CALL DEBUG_CALL('ZONAL_FILT_APPLY_TS',myThid)
296    #endif
297            CALL TIMER_START('ZONAL_FILT_APPLY    [FORWARD_STEP]',myThid)
298            CALL ZONAL_FILT_APPLY_TS( gT, gS, myThid )
299            CALL TIMER_STOP ('ZONAL_FILT_APPLY    [FORWARD_STEP]',myThid)
300          ENDIF
301    #endif  
302    
303    C--   Step forward fields and calculate time tendency terms.
304    #ifndef ALLOW_AUTODIFF_TAMC
305          IF ( momStepping ) THEN
306    #endif
307    #ifdef ALLOW_DEBUG
308            IF ( debugLevel .GE. debLevB )
309         &    CALL DEBUG_CALL('DYNAMICS',myThid)
310    #endif
311            CALL TIMER_START('DYNAMICS            [FORWARD_STEP]',mythid)
312            CALL DYNAMICS( myTime, myIter, myThid )
313            CALL TIMER_STOP ('DYNAMICS            [FORWARD_STEP]',mythid)
314    #ifndef ALLOW_AUTODIFF_TAMC
315          ENDIF
316    #endif
317    
318  #ifdef ALLOW_NONHYDROSTATIC  #ifdef ALLOW_NONHYDROSTATIC
319  C--   Step forward W field in N-H algorithm  C--   Step forward W field in N-H algorithm
320        IF ( nonHydrostatic ) THEN        IF ( momStepping .AND. nonHydrostatic ) THEN
321         CALL TIMER_START('CALC_GW            [FORWARD_STEP]',myThid)  #ifdef ALLOW_DEBUG
322         CALL CALC_GW( myThid)            IF ( debugLevel .GE. debLevB )
323         CALL TIMER_STOP ('CALC_GW            [FORWARD_STEP]',myThid)       &     CALL DEBUG_CALL('CALC_GW',myThid)
324    #endif
325             CALL TIMER_START('CALC_GW          [FORWARD_STEP]',myThid)
326             CALL CALC_GW(myThid)
327             CALL TIMER_STOP ('CALC_GW          [FORWARD_STEP]',myThid)
328          ENDIF
329    #endif
330    
331    #ifdef NONLIN_FRSURF
332    C--   update hfacC,W,S and recip_hFac according to etaH(n+1) :
333          IF ( nonlinFreeSurf.GT.0) THEN
334           IF ( select_rStar.GT.0 ) THEN
335            CALL TIMER_START('UPDATE_R_STAR      [FORWARD_STEP]',myThid)
336            CALL UPDATE_R_STAR( myTime, myIter, myThid )
337            CALL TIMER_STOP ('UPDATE_R_STAR      [FORWARD_STEP]',myThid)
338           ELSE
339            CALL TIMER_START('UPDATE_SURF_DR     [FORWARD_STEP]',myThid)
340            CALL UPDATE_SURF_DR( myTime, myIter, myThid )
341            CALL TIMER_STOP ('UPDATE_SURF_DR     [FORWARD_STEP]',myThid)
342           ENDIF
343          ENDIF
344    C-    update also CG2D matrix (and preconditioner)
345          IF ( momStepping .AND. nonlinFreeSurf.GT.2 ) THEN
346            CALL TIMER_START('UPDATE_CG2D        [FORWARD_STEP]',myThid)
347            CALL UPDATE_CG2D( myTime, myIter, myThid )
348            CALL TIMER_STOP ('UPDATE_CG2D        [FORWARD_STEP]',myThid)
349        ENDIF        ENDIF
350  #endif  #endif
351    
352    C--   Apply Filters to u*,v* before SOLVE_FOR_PRESSURE
353  #ifdef ALLOW_SHAP_FILT  #ifdef ALLOW_SHAP_FILT
354  C--   Step forward all tiles, filter and exchange.        IF (useSHAP_FILT .AND. shap_filt_uvStar) THEN
355        CALL TIMER_START('SHAP_FILT          [FORWARD_STEP]',myThid)          CALL TIMER_START('SHAP_FILT           [FORWARD_STEP]',myThid)
356        CALL SHAP_FILT_APPLY(          IF (implicDiv2Dflow.LT.1.) THEN
      I                     gUnm1, gVnm1, gTnm1, gSnm1,  
      I                     myCurrentTime, myCurrentIter, myThid )  
       IF (implicDiv2Dflow.LT.1.) THEN  
357  C--   Explicit+Implicit part of the Barotropic Flow Divergence  C--   Explicit+Implicit part of the Barotropic Flow Divergence
358  C      => Filtering of uVel,vVel is necessary  C      => Filtering of uVel,vVel is necessary
359           CALL SHAP_FILT_UV( uVel, vVel, myCurrentTime, myThid )            CALL SHAP_FILT_APPLY_UV( uVel,vVel,
360         &                             myTime+deltaT, myIter+1, myThid )
361            ENDIF
362            CALL SHAP_FILT_APPLY_UV( gU,gV,myTime+deltaT,myIter+1,myThid)
363            CALL TIMER_STOP ('SHAP_FILT           [FORWARD_STEP]',myThid)
364        ENDIF        ENDIF
       CALL TIMER_STOP ('SHAP_FILT          [FORWARD_STEP]',myThid)  
365  #endif  #endif
   
366  #ifdef ALLOW_ZONAL_FILT  #ifdef ALLOW_ZONAL_FILT
367        IF (zonal_filt_lat.LT.90.) THEN        IF (useZONAL_FILT .AND. zonal_filt_uvStar) THEN
368        CALL ZONAL_FILT_APPLY(          CALL TIMER_START('ZONAL_FILT_APPLY    [FORWARD_STEP]',myThid)
369       U           gUnm1, gVnm1, gTnm1, gSnm1,          IF (implicDiv2Dflow.LT.1.) THEN
370       I           myThid )  C--   Explicit+Implicit part of the Barotropic Flow Divergence
371    C      => Filtering of uVel,vVel is necessary
372              CALL ZONAL_FILT_APPLY_UV( uVel, vVel, myThid )
373            ENDIF
374            CALL ZONAL_FILT_APPLY_UV( gU, gV, myThid )
375            CALL TIMER_STOP ('ZONAL_FILT_APPLY    [FORWARD_STEP]',myThid)
376        ENDIF        ENDIF
377  #endif  #endif  
378    
379  C--   Solve elliptic equation(s).  C--   Solve elliptic equation(s).
380  C     Two-dimensional only for conventional hydrostatic or  C     Two-dimensional only for conventional hydrostatic or
381  C     three-dimensional for non-hydrostatic and/or IGW scheme.  C     three-dimensional for non-hydrostatic and/or IGW scheme.
382        CALL TIMER_START('SOLVE_FOR_PRESSURE [FORWARD_STEP]',myThid)        IF ( momStepping ) THEN
383        CALL SOLVE_FOR_PRESSURE( myThid )        CALL TIMER_START('SOLVE_FOR_PRESSURE  [FORWARD_STEP]',myThid)
384        CALL TIMER_STOP ('SOLVE_FOR_PRESSURE [FORWARD_STEP]',myThid)        CALL SOLVE_FOR_PRESSURE(myTime, myIter, myThid)
385          CALL TIMER_STOP ('SOLVE_FOR_PRESSURE  [FORWARD_STEP]',myThid)
386          ENDIF
387    
388    #ifdef ALLOW_AUTODIFF_TAMC
389    cph This is needed because convective_adjustment calls
390    cph find_rho which may use pressure()
391    CADJ STORE totphihyd  = comlev1, key = ikey_dynamics
392    #endif
393  C--   Correct divergence in flow field and cycle time-stepping  C--   Correct divergence in flow field and cycle time-stepping
394  C     arrays (for all fields) ; update time-counter  C     arrays (for all fields) ; update time-counter
395        myCurrentIter = nIter0 + iLoop        myIter = nIter0 + iLoop
396        myCurrentTime = startTime + deltaTClock * float(iLoop)        myTime = startTime + deltaTClock * float(iLoop)
397        CALL THE_CORRECTION_STEP(myCurrentTime, myCurrentIter, myThid)        CALL TIMER_START('THE_CORRECTION_STEP [FORWARD_STEP]',myThid)
398          CALL THE_CORRECTION_STEP(myTime, myIter, myThid)
399          CALL TIMER_STOP ('THE_CORRECTION_STEP [FORWARD_STEP]',myThid)
400    
401  C--   Do "blocking" sends and receives for tendency "overlap" terms  C--   Do "blocking" sends and receives for tendency "overlap" terms
402  c     CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)  c     CALL TIMER_START('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
403  c     CALL DO_GTERM_BLOCKING_EXCHANGES( myThid )  c     CALL DO_GTERM_BLOCKING_EXCHANGES( myThid )
404  c     CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)  c     CALL TIMER_STOP ('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
405    
406  C--   Do "blocking" sends and receives for field "overlap" terms  C--   Do "blocking" sends and receives for field "overlap" terms
407        CALL TIMER_START('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)        CALL TIMER_START('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
408        CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )        CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )
409        CALL TIMER_STOP ('BLOCKING_EXCHANGES [FORWARD_STEP]',myThid)        CALL TIMER_STOP ('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
410    
411    cswdptr -- add for seperate timestepping of chemical/biological/forcing
412    cswdptr    of ptracers ---
413    #ifdef ALLOW_GCHEM
414    ceh3 This is broken -- this ifdef should not be visible!
415    #ifdef PTRACERS_SEPARATE_FORCING
416    ceh3 needs an IF ( use GCHEM ) THEN
417            call GCHEM_FORCING_SEP( myTime,myIter,myThid )
418    #endif /* PTRACERS_SEPARATE_FORCING */
419    #endif /* ALLOW_GCHEM */
420    cswdptr -- end add ---
421    
422    
423    #ifdef ALLOW_FLT
424    C--   Calculate float trajectories
425          IF (useFLT) THEN
426            CALL TIMER_START('FLOATS            [FORWARD_STEP]',myThid)
427            CALL FLT_MAIN(myIter,myTime, myThid)
428            CALL TIMER_STOP ('FLOATS            [FORWARD_STEP]',myThid)
429          ENDIF
430    #endif
431    
432    #ifdef ALLOW_MONITOR
433    C--   Check status of solution (statistics, cfl, etc...)
434          CALL TIMER_START('MONITOR             [FORWARD_STEP]',myThid)
435          CALL MONITOR( myIter, myTime, myThid )
436          CALL TIMER_STOP ('MONITOR             [FORWARD_STEP]',myThid)
437    #endif /* ALLOW_MONITOR */
438    
439  C--   Do IO if needed.  C--   Do IO if needed.
440        CALL TIMER_START('I/O (WRITE)        [FORWARD_STEP]',myThid)        CALL TIMER_START('DO_THE_MODEL_IO     [FORWARD_STEP]',myThid)
441        CALL DO_THE_MODEL_IO(.FALSE.,        CALL DO_THE_MODEL_IO( myTime, myIter, myThid )
442       &                     myCurrentTime, myCurrentIter, myThid )        CALL TIMER_STOP ('DO_THE_MODEL_IO     [FORWARD_STEP]',myThid)
       CALL TIMER_STOP ('I/O (WRITE)        [FORWARD_STEP]',myThid)  
443    
444  C--   Save state for restarts  C--   Save state for restarts
445  C     Note:    (jmc: is it still the case after ckp35 ?)  C     Note:    (jmc: is it still the case after ckp35 ?)
# Line 159  C     Thus a checkpoint contains U.00000 Line 454  C     Thus a checkpoint contains U.00000
454  C     etaN.0000000001 in the indexing scheme used for the model  C     etaN.0000000001 in the indexing scheme used for the model
455  C     "state" files. This example is referred to as a checkpoint  C     "state" files. This example is referred to as a checkpoint
456  C     at time level 1  C     at time level 1
457        CALL TIMER_START('I/O (WRITE)        [FORWARD_STEP]',myThid)        CALL TIMER_START('WRITE_CHECKPOINT    [FORWARD_STEP]',myThid)
458        CALL WRITE_CHECKPOINT(        CALL WRITE_CHECKPOINT(
459       &        .FALSE., myCurrentTime, myCurrentIter, myThid )       &        .FALSE., myTime, myIter, myThid )
460        CALL TIMER_STOP ('I/O (WRITE)        [FORWARD_STEP]',myThid)        CALL TIMER_STOP ('WRITE_CHECKPOINT    [FORWARD_STEP]',myThid)
461    
462    #ifdef ALLOW_DEBUG
463          IF ( debugLevel .GE. debLevB )
464         &    CALL DEBUG_LEAVE('FORWARD_STEP',myThid)
465    #endif
466    
       RETURN  
467        END        END

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.76

  ViewVC Help
Powered by ViewVC 1.1.22