/[MITgcm]/MITgcm/model/src/initialise_varia.F
ViewVC logotype

Diff of /MITgcm/model/src/initialise_varia.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.40 by heimbach, Fri Oct 8 17:25:37 2004 UTC revision 1.51 by jmc, Sat Jul 29 21:02:12 2006 UTC
# Line 25  C     \ev Line 25  C     \ev
25  C     !CALLING SEQUENCE:  C     !CALLING SEQUENCE:
26  C     INITIALISE_VARIA  C     INITIALISE_VARIA
27  C       |  C       |
28    C #ifdef ALLOW_AUTODIFF_TAMC
29  C       |-- INI_LINEAR_PHISURF  C       |-- INI_LINEAR_PHISURF
30  C       |  C       |
31  C       |-- INI_CORI  C       |-- INI_CORI
# Line 32  C       | Line 33  C       |
33  C       |-- INI_CG2D  C       |-- INI_CG2D
34  C       |  C       |
35  C       |-- INI_CG3D  C       |-- INI_CG3D
36  C       |  C #endif
37  C       |-- INI_MIXING  C       |-- INI_MIXING
38  C       |  C       |
39  C       |-- INI_DYNVARS  C       |-- INI_DYNVARS
40    C       |-- INI_NH_VARS
41  C       |  C       |
42  C       |-- INI_FIELDS  C       |-- INI_FIELDS
43  C       |  C       |
# Line 82  C     == Routine arguments == Line 84  C     == Routine arguments ==
84    
85  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
86  C     == Local variables ==  C     == Local variables ==
87        INTEGER bi,bj,K,iMin,iMax,jMin,jMax        INTEGER bi,bj,iMin,iMax,jMin,jMax
88  CEOP  CEOP
89    
90    #ifdef ALLOW_DEBUG
91          IF (debugMode) CALL DEBUG_ENTER('INITIALISE_VARIA',myThid)
92    #endif
93    
94  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
95    
96        nIter0 = INT( startTime/deltaTClock )        nIter0 = NINT( (startTime-baseTime)/deltaTClock )
97    
98    C--   Intialize the hFacC for TAF/TAMC
99          CALL INI_HFAC( myThid )
100          CALL INI_DEPTHS( myThid )
101          CALL INI_MASKS_ETC( myThid )
102    
103  C--   Set Bo_surf => define the Linear Relation: Phi_surf(eta)  C--   Set Bo_surf => define the Linear Relation: Phi_surf(eta)
104    # ifdef ALLOW_DEBUG
105          IF (debugMode) CALL DEBUG_CALL('INI_LINEAR_PHISURF',myThid)
106    # endif
107        CALL INI_LINEAR_PHISURF( myThid )        CALL INI_LINEAR_PHISURF( myThid )
108    
109  C--   Set coriolis operators  C--   Set coriolis operators
110    # ifdef ALLOW_DEBUG
111          IF (debugMode) CALL DEBUG_CALL('INI_CORI',myThid)
112    # endif
113        CALL INI_CORI( myThid )        CALL INI_CORI( myThid )
114    
115  C--   Set laplace operators for use in 2D conjugate gradient solver.  C--   Set laplace operators for use in 2D conjugate gradient solver.
116    # ifdef ALLOW_DEBUG
117          IF (debugMode) CALL DEBUG_CALL('INI_CG2D',myThid)
118    # endif
119        CALL INI_CG2D( myThid )        CALL INI_CG2D( myThid )
120    
121  #ifdef ALLOW_NONHYDROSTATIC  #ifdef ALLOW_DEPTH_CONTROL
122    C--   get control parameter depth
123          CALL CTRL_DEPTH_INI( myThid )
124    C--   Re-calculate hFacS/W and some other parameters from hFacC
125          CALL UPDATE_MASKS_ETC( myThid )
126    C--   Update laplace operators for use in 2D conjugate gradient solver.
127          CALL UPDATE_CG2D( startTime, nIter0, myThid )
128    CML      CALL UPDATE_CG2D( myThid )
129    #endif /* ALLOW_DEPTH_CONTROL */
130    
131    # ifdef ALLOW_NONHYDROSTATIC
132  C--   Set laplace operators for use in 3D conjugate gradient solver.  C--   Set laplace operators for use in 3D conjugate gradient solver.
133  ceh3 should add an IF ( useNONHYDROSTATIC ) THEN  ceh3 should add an IF ( useNONHYDROSTATIC ) THEN
134    #  ifdef ALLOW_DEBUG
135          IF (debugMode) CALL DEBUG_CALL('INI_CG3D',myThid)
136    #  endif
137        CALL INI_CG3D( myThid )        CALL INI_CG3D( myThid )
138  #endif  # endif
139    
140  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
141        _BARRIER        _BARRIER
142    
143  C--   Initialise 3-dim. diffusivities  C--   Initialise 3-dim. diffusivities
144    #ifdef ALLOW_DEBUG
145          IF (debugMode) CALL DEBUG_CALL('INI_MIXING',myThid)
146    #endif
147        CALL INI_MIXING( myThid )        CALL INI_MIXING( myThid )
148        _BARRIER        _BARRIER
149    
150    #ifdef ALLOW_TAU_EDDY
151    C--  Initialise eddy diffusivities
152          CALL TAUEDDY_INIT_VARIA( myThid )
153    #endif
154    
155  C--   Initialize DYNVARS arrays (state fields + G terms: Gu,Gv,...) to zero [always]  C--   Initialize DYNVARS arrays (state fields + G terms: Gu,Gv,...) to zero [always]
156    #ifdef ALLOW_DEBUG
157          IF (debugMode) CALL DEBUG_CALL('INI_DYNVARS',myThid)
158    #endif
159        CALL INI_DYNVARS( myThid )        CALL INI_DYNVARS( myThid )
160    
161    C--   Initialize NH_VARS arrays to zero [always]
162    #ifdef ALLOW_NONHYDROSTATIC
163          CALL INI_NH_VARS( myThid )
164    #endif
165    
166  C--   Initialise model fields.  C--   Initialise model fields.
167  C     Starting values of U, V, W, temp., salt. and tendency terms  C     Starting values of U, V, W, temp., salt. and tendency terms
168  C     are set here. Fields are either set to default or read from  C     are set here. Fields are either set to default or read from
169  C     stored files.  C     stored files.
170  #ifndef ALLOW_OFFLINE  #ifdef ALLOW_DEBUG
171        CALL INI_FIELDS( myThid )        IF (debugMode) CALL DEBUG_CALL('INI_FIELDS',myThid)
172  #endif  #endif
173          CALL INI_FIELDS( myThid )
174        _BARRIER        _BARRIER
175    
176  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
# Line 130  C--   Initialise active fields to help T Line 180  C--   Initialise active fields to help T
180  #endif  #endif
181    
182  C--   Initialize variable data for packages  C--   Initialize variable data for packages
183    #ifdef ALLOW_DEBUG
184          IF (debugMode) CALL DEBUG_CALL('PACKAGES_INIT_VARIABLES',myThid)
185    #endif
186        CALL PACKAGES_INIT_VARIABLES( myThid )        CALL PACKAGES_INIT_VARIABLES( myThid )
187    
188  #ifndef ALLOW_AUTODIFF_TAMC  #ifndef ALLOW_AUTODIFF_TAMC
189        IF ( usePickupBeforeC35 ) THEN        IF ( usePickupBeforeC35 ) THEN
190  C-- IMPORTANT : Need to activate the following call to restart from  C-- IMPORTANT : Need to activate the following call to restart from
191  C     a pickup file written by MITgcmUV_checkpoint34 or earlier.  C     a pickup file written by MITgcmUV_checkpoint34 or earlier.
192        IF ( startTime .NE. 0. ) THEN        IF ( startTime .NE. baseTime ) THEN
193    #ifdef ALLOW_DEBUG
194          IF (debugMode) CALL DEBUG_CALL('THE_CORRECTION_STEP',myThid)
195    #endif
196         CALL THE_CORRECTION_STEP(startTime, nIter0, myThid)         CALL THE_CORRECTION_STEP(startTime, nIter0, myThid)
197        ENDIF        ENDIF
198        ENDIF        ENDIF
199  #endif  #endif
200    
201  C--   Initial conditions are convectively adjusted (for historical reasons)  C--   Initial conditions are convectively adjusted (for historical reasons)
202  #ifndef ALLOW_OFFLINE        IF ( startTime .EQ. baseTime .AND. cAdjFreq .NE. 0. ) THEN
203        IF ( startTime .EQ. 0. .AND. cAdjFreq .NE. 0. ) THEN  #ifdef ALLOW_DEBUG
204          IF (debugMode) CALL DEBUG_CALL('CONVECTIVE_ADJUSTMENT_INI',myThid)
205    #endif
206  CADJ loop = parallel  CADJ loop = parallel
207          DO bj = myByLo(myThid), myByHi(myThid)          DO bj = myByLo(myThid), myByHi(myThid)
208  CADJ loop = parallel  CADJ loop = parallel
# Line 159  CADJ loop = parallel Line 217  CADJ loop = parallel
217           ENDDO           ENDDO
218          ENDDO          ENDDO
219          _BARRIER          _BARRIER
220        END IF        ENDIF
 #endif  
221    
222  #ifdef NONLIN_FRSURF  #ifdef NONLIN_FRSURF
223  C--   Compute the surface level thickness <-- function of etaH(n)  C--   Compute the surface level thickness <-- function of etaH(n)
224  C     and modify hFac(C,W,S) accordingly :  C     and modify hFac(C,W,S) accordingly :
225          CALL INI_SURF_DR( myThid )
226          CALL INI_R_STAR( myThid )
227    # ifndef DISABLE_RSTAR_CODE
228        IF ( select_rStar.NE.0 )        IF ( select_rStar.NE.0 )
229       &  CALL CALC_R_STAR(etaH, startTime, -1 , myThid )       &  CALL CALC_R_STAR(etaH, startTime, -1 , myThid )
230    # endif /* DISABLE_RSTAR_CODE */
231        IF (nonlinFreeSurf.GT.0) THEN        IF (nonlinFreeSurf.GT.0) THEN
232         IF ( select_rStar.GT.0 ) THEN         IF ( select_rStar.GT.0 ) THEN
233    # ifndef DISABLE_RSTAR_CODE
234          CALL UPDATE_R_STAR( startTime, nIter0, myThid )          CALL UPDATE_R_STAR( startTime, nIter0, myThid )
235    # endif /* DISABLE_RSTAR_CODE */
236         ELSE         ELSE
237          CALL CALC_SURF_DR(etaH, startTime, -1 , myThid )          CALL CALC_SURF_DR(etaH, startTime, -1 , myThid )
238          CALL UPDATE_SURF_DR( startTime, nIter0, myThid )          CALL UPDATE_SURF_DR( startTime, nIter0, myThid )
# Line 181  C-    update also CG2D matrix (and preco Line 244  C-    update also CG2D matrix (and preco
244        ENDIF        ENDIF
245  #endif /* NONLIN_FRSURF */  #endif /* NONLIN_FRSURF */
246    
247  #ifndef ALLOW_OFFLINE  #ifdef ALLOW_DEBUG
248          IF (debugMode) CALL DEBUG_CALL('INTEGR_CONTINUITY',myThid)
249    #endif
250        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
251         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
252    
253  C--   Integrate continuity vertically for vertical velocity  C--   Integrate continuity vertically for vertical velocity
254          CALL INTEGR_CONTINUITY( bi, bj, uVel, vVel,          CALL INTEGR_CONTINUITY( bi, bj, uVel, vVel,
255       I                          startTime, nIter0, myThid )       I                          startTime, nIter0, myThid )
256    
257         ENDDO         ENDDO
258        ENDDO        ENDDO
 #endif  
259    
260  #ifdef EXACT_CONSERV  #ifdef EXACT_CONSERV
261        IF ( exactConserv ) THEN        IF ( exactConserv ) THEN
262    #ifdef ALLOW_DEBUG
263            IF (debugMode) CALL DEBUG_CALL('UPDATE_ETAH',myThid)
264    #endif
265  C--   Update etaH(n) :  C--   Update etaH(n) :
266           CALL UPDATE_ETAH( startTime, nIter0, myThid )           CALL UPDATE_ETAH( startTime, nIter0, myThid )
267        ENDIF        ENDIF
# Line 202  C--   Update etaH(n) : Line 269  C--   Update etaH(n) :
269    
270  #ifdef NONLIN_FRSURF  #ifdef NONLIN_FRSURF
271        IF ( select_rStar.NE.0 ) THEN        IF ( select_rStar.NE.0 ) THEN
272    #ifndef ALLOW_AUTODIFF_TAMC
273  C--   r* : compute the future level thickness according to etaH(n+1)  C--   r* : compute the future level thickness according to etaH(n+1)
274            CALL CALC_R_STAR(etaH, startTime, nIter0, myThid )            CALL CALC_R_STAR(etaH, startTime, nIter0, myThid )
275    #endif
276        ELSEIF ( nonlinFreeSurf.GT.0) THEN        ELSEIF ( nonlinFreeSurf.GT.0) THEN
277  C--   compute the future surface level thickness according to etaH(n+1)  C--   compute the future surface level thickness according to etaH(n+1)
278            CALL CALC_SURF_DR(etaH, startTime, nIter0, myThid )            CALL CALC_SURF_DR(etaH, startTime, nIter0, myThid )
# Line 226  c      ENDIF Line 295  c      ENDIF
295  c     ENDIF  c     ENDIF
296    
297  #ifdef ALLOW_TIMEAVE  #ifdef ALLOW_TIMEAVE
298    #ifdef ALLOW_DEBUG
299          IF (debugMode) CALL DEBUG_CALL('TIMEAVE_STATVARS',myThid)
300    #endif
301        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
302         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
303    
# Line 233  C--   initialise time-average arrays wit Line 305  C--   initialise time-average arrays wit
305          IF (taveFreq.GT.0.) THEN          IF (taveFreq.GT.0.) THEN
306             CALL TIMEAVE_STATVARS(startTime, nIter0, bi, bj, myThid)             CALL TIMEAVE_STATVARS(startTime, nIter0, bi, bj, myThid)
307          ENDIF          ENDIF
308  cswdptr -- add ---  
309  #ifdef ALLOW_PTRACERS  #ifdef ALLOW_PTRACERS
310  che3 needs an IF ( usePTRACERS ) THEN          IF ( usePTRACERS ) THEN
311             CALL PTRACERS_STATVARS(startTime, nIter0, bi, bj, myThid)  #ifdef ALLOW_DEBUG
312              IF (debugMode) CALL DEBUG_CALL('PTRACERS_STATVARS',myThid)
313  #endif  #endif
314  cswdptr -- end add ---             CALL PTRACERS_STATVARS(startTime, nIter0, bi, bj, myThid)
315            ENDIF
316    #endif /* ALLOW_PTRACERS */
317    
318  C--   end bi,bj loop.  C--   end bi,bj loop.
319         ENDDO         ENDDO
320        ENDDO        ENDDO
321  #endif /* ALLOW_TIMEAVE */  #endif /* ALLOW_TIMEAVE */
322    
 C AMM  
323  #ifdef ALLOW_GRIDALT  #ifdef ALLOW_GRIDALT
324          if (useGRIDALT) then          if (useGRIDALT) then
325           CALL TIMER_START('GRIDALT_UPDATE  [INITIALISE_VARIA]',mythid)           CALL TIMER_START('GRIDALT_UPDATE  [INITIALISE_VARIA]',mythid)
# Line 253  C AMM Line 327  C AMM
327           CALL TIMER_STOP ('GRIDALT_UPDATE  [INITIALISE_VARIA]',mythid)           CALL TIMER_STOP ('GRIDALT_UPDATE  [INITIALISE_VARIA]',mythid)
328          endif          endif
329  #endif  #endif
 C AMM  
330    
331  C--   Fill in overlap regions for wVel :  C--   Fill in overlap regions for wVel :
332  #ifndef ALLOW_OFFLINE        _EXCH_XYZ_R8(wVel,myThid)
       _EXCH_XYZ_R8(wVel,myThid)  
 #endif  
333    
334  C--   Finally summarise the model state  C--   Finally summarise the model state
335    #ifdef ALLOW_DEBUG
336          IF (debugMode) CALL DEBUG_CALL('STATE_SUMMARY',myThid)
337    #endif
338        CALL STATE_SUMMARY( myThid )        CALL STATE_SUMMARY( myThid )
339    
340    #ifdef ALLOW_DEBUG
341          IF (debugMode) CALL DEBUG_LEAVE('INITIALISE_VARIA',myThid)
342    #endif
343    
344    C--   Check barrier synchronization:
345          CALL BAR_CHECK( 4, myThid )
346    
347        RETURN        RETURN
348        END        END

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.51

  ViewVC Help
Powered by ViewVC 1.1.22