/[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.22 by cnh, Wed Sep 26 18:09:15 2001 UTC revision 1.32 by heimbach, Thu May 30 02:32:14 2002 UTC
# Line 37  C     == Global variables == Line 37  C     == Global variables ==
37  #include "CG3D.h"  #include "CG3D.h"
38  #endif  #endif
39    
40    #ifdef ALLOW_SHAP_FILT
41    #include "SHAP_FILT.h"
42    #endif
43    #ifdef ALLOW_ZONAL_FILT
44    #include "ZONAL_FILT.h"
45    #endif
46    
47  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
48  #include "tamc.h"  # include "tamc.h"
49  #include "ctrl.h"  # include "ctrl.h"
50  #include "ctrl_dummy.h"  # include "ctrl_dummy.h"
51  #include "cost.h"  # include "cost.h"
52    # ifdef INCLUDE_EXTERNAL_FORCING_PACKAGE
53    #  include "exf_fields.h"
54    #  ifdef ALLOW_BULKFORMULAE
55    #   include "exf_constants.h"
56    #  endif
57    # endif
58    # ifdef ALLOW_OBCS
59    #  include "OBCS.h"
60    # endif
61  #endif  #endif
62    
63  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
# Line 69  C--     Reset the model iteration counte Line 85  C--     Reset the model iteration counte
85          mytime = startTime + float(iloop-1)*deltaTclock          mytime = startTime + float(iloop-1)*deltaTclock
86  #endif  #endif
87    
88  #ifdef ALLOW_AUTODIFF_TAMC  #if (defined (ALLOW_AUTODIFF_TAMC) && defined (ALLOW_AUTODIFF_MONITOR))
89  C       Include call to a dummy routine. Its adjoint will be  C       Include call to a dummy routine. Its adjoint will be
90  C       called at the proper place in the adjoint code.  C       called at the proper place in the adjoint code.
91  C       The adjoint routine will print out adjoint values  C       The adjoint routine will print out adjoint values
# Line 77  C       if requested. The location of th Line 93  C       if requested. The location of th
93  C       it has to be after the adjoint of the exchanges  C       it has to be after the adjoint of the exchanges
94  C       (DO_GTERM_BLOCKING_EXCHANGES).  C       (DO_GTERM_BLOCKING_EXCHANGES).
95          CALL DUMMY_IN_STEPPING( myTime, myIter, myThid )          CALL DUMMY_IN_STEPPING( myTime, myIter, myThid )
96            CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )
97  #endif  #endif
98    
99  #ifdef EXACT_CONSERV  #ifdef EXACT_CONSERV
# Line 85  C--   Update etaH(n+1) : Line 102  C--   Update etaH(n+1) :
102          DO bj=myByLo(myThid),myByHi(myThid)          DO bj=myByLo(myThid),myByHi(myThid)
103           DO bi=myBxLo(myThid),myBxHi(myThid)           DO bi=myBxLo(myThid),myBxHi(myThid)
104             CALL CALC_EXACT_ETA( .FALSE., bi,bj, uVel,vVel,             CALL CALC_EXACT_ETA( .FALSE., bi,bj, uVel,vVel,
105       I                          startTime, nIter0, myThid )       I                          myTime, myIter, myThid )
106           ENDDO           ENDDO
107          ENDDO          ENDDO
108          IF (implicDiv2Dflow .NE. 1. _d 0 )          IF (implicDiv2Dflow .NE. 1. _d 0 .OR. useOBCS )
109       &     _EXCH_XY_R8(etaH, myThid )       &     _EXCH_XY_R8(etaH, myThid )
110        ENDIF        ENDIF
111  #endif /* EXACT_CONSERV */  #endif /* EXACT_CONSERV */
# Line 106  C--     Load forcing/external data field Line 123  C--     Load forcing/external data field
123  C       NOTE, that although the exf package is part of the  C       NOTE, that although the exf package is part of the
124  C       distribution, it is not currently maintained, i.e.  C       distribution, it is not currently maintained, i.e.
125  C       exf is disabled by default in genmake.  C       exf is disabled by default in genmake.
126    #ifdef ALLOW_AUTODIFF_TAMC
127    c**************************************
128    #include "checkpoint_lev1_directives.h"
129    c**************************************
130    #endif
131          CALL EXF_GETFORCING( mytime, myiter, mythid )          CALL EXF_GETFORCING( mytime, myiter, mythid )
132  #else  #else
133          CALL TIMER_START('EXTERNAL_FIELDS_LOAD[THE_MAIN_LOOP]',mythid)          CALL TIMER_START('EXTERNAL_FIELDS_LOAD[THE_MAIN_LOOP]',mythid)
# Line 118  C--     Step forward fields and calculat Line 140  C--     Step forward fields and calculat
140          CALL THERMODYNAMICS( myTime, myIter, myThid )          CALL THERMODYNAMICS( myTime, myIter, myThid )
141          CALL TIMER_STOP ('THERMODYNAMICS      [THE_MAIN_LOOP]',mythid)          CALL TIMER_STOP ('THERMODYNAMICS      [THE_MAIN_LOOP]',mythid)
142    
143    #ifdef ALLOW_SHAP_FILT
144           IF (useSHAP_FILT .AND.
145         &     staggerTimeStep .AND. shap_filt_TrStagg ) THEN
146            CALL TIMER_START('SHAP_FILT           [THE_MAIN_LOOP]',myThid)
147            CALL SHAP_FILT_APPLY_TS( gT, gS, myTime, myIter, myThid )
148            CALL TIMER_STOP ('SHAP_FILT           [THE_MAIN_LOOP]',myThid)
149           ENDIF
150    #endif
151    #ifdef ALLOW_ZONAL_FILT
152           IF (useZONAL_FILT .AND.
153         &     staggerTimeStep .AND. zonal_filt_TrStagg ) THEN
154            CALL TIMER_START('ZONAL_FILT_APPLY    [THE_MAIN_LOOP]',myThid)
155            CALL ZONAL_FILT_APPLY_TS( gT, gS, myThid )
156            CALL TIMER_STOP ('ZONAL_FILT_APPLY    [THE_MAIN_LOOP]',myThid)
157          ENDIF
158    #endif  
159    
160  C--     Step forward fields and calculate time tendency terms.  C--     Step forward fields and calculate time tendency terms.
161          IF ( momStepping ) THEN          IF ( momStepping ) THEN
162          CALL TIMER_START('DYNAMICS            [THE_MAIN_LOOP]',mythid)          CALL TIMER_START('DYNAMICS            [THE_MAIN_LOOP]',mythid)
# Line 125  C--     Step forward fields and calculat Line 164  C--     Step forward fields and calculat
164          CALL TIMER_STOP ('DYNAMICS            [THE_MAIN_LOOP]',mythid)          CALL TIMER_STOP ('DYNAMICS            [THE_MAIN_LOOP]',mythid)
165          ENDIF          ENDIF
166    
 #ifndef ALLOW_AUTODIFF_TAMC  
167  #ifdef ALLOW_NONHYDROSTATIC  #ifdef ALLOW_NONHYDROSTATIC
168  C--   Step forward W field in N-H algorithm  C--   Step forward W field in N-H algorithm
169          IF ( momStepping .AND. nonHydrostatic ) THEN          IF ( momStepping .AND. nonHydrostatic ) THEN
# Line 134  C--   Step forward W field in N-H algori Line 172  C--   Step forward W field in N-H algori
172            CALL TIMER_STOP ('CALC_GW          [THE_MAIN_LOOP]',myThid)            CALL TIMER_STOP ('CALC_GW          [THE_MAIN_LOOP]',myThid)
173          ENDIF          ENDIF
174  #endif  #endif
 #endif /* ALLOW_AUTODIFF_TAMC */  
175    
176  #ifdef NONLIN_FRSURF  #ifdef NONLIN_FRSURF
177  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 149  C-    update also CG2D matrix (and preco Line 186  C-    update also CG2D matrix (and preco
186        ENDIF        ENDIF
187  #endif  #endif
188    
189  C-- This block has been moved to the_correction_step(). We have  C--   Apply Filters to u*,v* before SOLVE_FOR_PRESSURE
190  C   left this code here to indicate where the filters used to be  #ifdef ALLOW_SHAP_FILT
191  C   in the algorithm before JMC moved them to after the pressure        IF (useSHAP_FILT .AND. shap_filt_uvStar) THEN
192  C   solver.          CALL TIMER_START('SHAP_FILT           [THE_MAIN_LOOP]',myThid)
193  C          CALL SHAP_FILT_APPLY_UV( gUnm1,gVnm1, myTime,myIter,myThid )
194  C#ifdef ALLOW_SHAP_FILT          IF (implicDiv2Dflow.LT.1.) THEN
195  CC--   Step forward all tiles, filter and exchange.  C--   Explicit+Implicit part of the Barotropic Flow Divergence
196  C      CALL TIMER_START('SHAP_FILT           [THE_MAIN_LOOP]',myThid)  C      => Filtering of uVel,vVel is necessary
197  C      CALL SHAP_FILT_APPLY(            CALL SHAP_FILT_APPLY_UV( uVel,vVel, myTime,myIter,myThid )
198  C     I                     gUnm1, gVnm1, gTnm1, gSnm1,          ENDIF
199  C     I                     myTime, myIter, myThid )          CALL TIMER_STOP ('SHAP_FILT           [THE_MAIN_LOOP]',myThid)
200  C      IF (implicDiv2Dflow.LT.1.) THEN        ENDIF
201  CC--   Explicit+Implicit part of the Barotropic Flow Divergence  #endif
202  CC      => Filtering of uVel,vVel is necessary  #ifdef ALLOW_ZONAL_FILT
203  C         CALL SHAP_FILT_UV( uVel, vVel, myTime, myThid )        IF (useZONAL_FILT .AND. zonal_filt_uvStar) THEN
204  C      ENDIF          CALL TIMER_START('ZONAL_FILT_APPLY    [THE_MAIN_LOOP]',myThid)
205  C      CALL TIMER_STOP ('SHAP_FILT           [THE_MAIN_LOOP]',myThid)          CALL ZONAL_FILT_APPLY_UV( gUnm1, gVnm1, myThid )
206  C#endif          IF (implicDiv2Dflow.LT.1.) THEN
207  C  C--   Explicit+Implicit part of the Barotropic Flow Divergence
208  C#ifdef ALLOW_ZONAL_FILT  C      => Filtering of uVel,vVel is necessary
209  C      IF (zonal_filt_lat.LT.90.) THEN            CALL ZONAL_FILT_APPLY_UV( uVel, vVel, myThid )
210  C        CALL TIMER_START('ZONAL_FILT_APPLY    [THE_MAIN_LOOP]',myThid)          ENDIF
211  C        CALL ZONAL_FILT_APPLY(          CALL TIMER_STOP ('ZONAL_FILT_APPLY    [THE_MAIN_LOOP]',myThid)
212  C     U           gUnm1, gVnm1, gTnm1, gSnm1,        ENDIF
213  C     I           myThid )  #endif  
 C        CALL TIMER_STOP ('ZONAL_FILT_APPLY    [THE_MAIN_LOOP]',myThid)  
 C      ENDIF  
 C#endif  
214    
215  C--   Solve elliptic equation(s).  C--   Solve elliptic equation(s).
216  C     Two-dimensional only for conventional hydrostatic or  C     Two-dimensional only for conventional hydrostatic or
217  C     three-dimensional for non-hydrostatic and/or IGW scheme.  C     three-dimensional for non-hydrostatic and/or IGW scheme.
218        IF ( momStepping ) THEN        IF ( momStepping ) THEN
219        CALL TIMER_START('SOLVE_FOR_PRESSURE  [THE_MAIN_LOOP]',myThid)        CALL TIMER_START('SOLVE_FOR_PRESSURE  [THE_MAIN_LOOP]',myThid)
220        CALL SOLVE_FOR_PRESSURE( myThid )        CALL SOLVE_FOR_PRESSURE(myTime, myIter, myThid)
221        CALL TIMER_STOP ('SOLVE_FOR_PRESSURE  [THE_MAIN_LOOP]',myThid)        CALL TIMER_STOP ('SOLVE_FOR_PRESSURE  [THE_MAIN_LOOP]',myThid)
222        ENDIF        ENDIF
223    

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.32

  ViewVC Help
Powered by ViewVC 1.1.22