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

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

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

revision 1.75 by adcroft, Fri Aug 3 19:06:11 2001 UTC revision 1.76 by heimbach, Mon Aug 13 18:05:26 2001 UTC
# Line 58  C     myThid - Thread number for this in Line 58  C     myThid - Thread number for this in
58        INTEGER myThid        INTEGER myThid
59    
60  C     == Local variables  C     == Local variables
 C     xA, yA                 - Per block temporaries holding face areas  
 C     uTrans, vTrans, rTrans - Per block temporaries holding flow  
 C                              transport  
 C                              o uTrans: Zonal transport  
 C                              o vTrans: Meridional transport  
 C                              o rTrans: Vertical transport  
61  C     maskUp                   o maskUp: land/water mask for W points  C     maskUp                   o maskUp: land/water mask for W points
62  C     fVer[STUV]               o fVer: Vertical flux term - note fVer  C     fVer[STUV]               o fVer: Vertical flux term - note fVer
63  C                                      is "pipelined" in the vertical  C                                      is "pipelined" in the vertical
# Line 77  C                      In p coords phiHy Line 71  C                      In p coords phiHy
71  C                      surface height anomaly.  C                      surface height anomaly.
72  C     phiSurfX, - gradient of Surface potentiel (Pressure/rho, ocean)  C     phiSurfX, - gradient of Surface potentiel (Pressure/rho, ocean)
73  C     phiSurfY             or geopotentiel (atmos) in X and Y direction  C     phiSurfY             or geopotentiel (atmos) in X and Y direction
 C     KappaRT,       - Total diffusion in vertical for T and S.  
 C     KappaRS          (background + spatially varying, isopycnal term).  
74  C     iMin, iMax     - Ranges and sub-block indices on which calculations  C     iMin, iMax     - Ranges and sub-block indices on which calculations
75  C     jMin, jMax       are applied.  C     jMin, jMax       are applied.
76  C     bi, bj  C     bi, bj
# Line 86  C     k, kup,        - Index for layer a Line 78  C     k, kup,        - Index for layer a
78  C     kDown, km1       are switched with layer to be the appropriate  C     kDown, km1       are switched with layer to be the appropriate
79  C                      index into fVerTerm.  C                      index into fVerTerm.
80  C     tauAB - Adams-Bashforth timestepping weight: 0=forward ; 1/2=Adams-Bashf.  C     tauAB - Adams-Bashforth timestepping weight: 0=forward ; 1/2=Adams-Bashf.
       _RS xA      (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
       _RS yA      (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
       _RL uTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
       _RL vTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
       _RL rTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
81        _RS maskUp  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS maskUp  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
       _RL fVerT   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)  
       _RL fVerS   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)  
       _RL fVerTr1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)  
82        _RL fVerU   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)        _RL fVerU   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
83        _RL fVerV   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)        _RL fVerV   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
84        _RL phiHyd  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL phiHyd  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
# Line 102  C     tauAB - Adams-Bashforth timesteppi Line 86  C     tauAB - Adams-Bashforth timesteppi
86        _RL rhok    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL rhok    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
87        _RL phiSurfX(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL phiSurfX(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
88        _RL phiSurfY(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL phiSurfY(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
       _RL KappaRT (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)  
       _RL KappaRS (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)  
89        _RL KappaRU (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)        _RL KappaRU (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
90        _RL KappaRV (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)        _RL KappaRV (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
91        _RL sigmaX  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL sigmaX  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
# Line 170  C         (1 + dt * K * d_zz) theta[n] = Line 152  C         (1 + dt * K * d_zz) theta[n] =
152  C         (1 + dt * K * d_zz) salt[n] = salt*  C         (1 + dt * K * d_zz) salt[n] = salt*
153  C---  C---
154    
155    C--   Set up work arrays with valid (i.e. not NaN) values
156    C     These inital values do not alter the numerical results. They
157    C     just ensure that all memory references are to valid floating
158    C     point numbers. This prevents spurious hardware signals due to
159    C     uninitialised but inert locations.
160          DO j=1-OLy,sNy+OLy
161           DO i=1-OLx,sNx+OLx
162            DO k=1,Nr
163             phiHyd(i,j,k)  = 0. _d 0
164             KappaRU(i,j,k) = 0. _d 0
165             KappaRV(i,j,k) = 0. _d 0
166             sigmaX(i,j,k) = 0. _d 0
167             sigmaY(i,j,k) = 0. _d 0
168             sigmaR(i,j,k) = 0. _d 0
169            ENDDO
170            rhoKM1 (i,j) = 0. _d 0
171            rhok   (i,j) = 0. _d 0
172            phiSurfX(i,j) = 0. _d 0
173            phiSurfY(i,j) = 0. _d 0
174           ENDDO
175          ENDDO
176    
177    #ifdef ALLOW_AUTODIFF_TAMC
178    C--   HPF directive to help TAMC
179    CHPF$ INDEPENDENT
180    #endif /* ALLOW_AUTODIFF_TAMC */
181    
182        DO bj=myByLo(myThid),myByHi(myThid)        DO bj=myByLo(myThid),myByHi(myThid)
183    
184    #ifdef ALLOW_AUTODIFF_TAMC
185    C--    HPF directive to help TAMC
186    CHPF$  INDEPENDENT, NEW (fVerU,fVerV
187    CHPF$&                  ,phiHyd
188    CHPF$&                  ,KappaRU,KappaRV
189    CHPF$&                  )
190    #endif /* ALLOW_AUTODIFF_TAMC */
191    
192         DO bi=myBxLo(myThid),myBxHi(myThid)         DO bi=myBxLo(myThid),myBxHi(myThid)
193  Ccs-  
194    #ifdef ALLOW_AUTODIFF_TAMC
195              act1 = bi - myBxLo(myThid)
196              max1 = myBxHi(myThid) - myBxLo(myThid) + 1
197    
198              act2 = bj - myByLo(myThid)
199              max2 = myByHi(myThid) - myByLo(myThid) + 1
200    
201              act3 = myThid - 1
202              max3 = nTx*nTy
203    
204              act4 = ikey_dynamics - 1
205    
206              ikey = (act1 + 1) + act2*max1
207         &                      + act3*max1*max2
208         &                      + act4*max1*max2*max3
209    #endif /* ALLOW_AUTODIFF_TAMC */
210    
211    C--     Set up work arrays that need valid initial values
212            DO j=1-OLy,sNy+OLy
213             DO i=1-OLx,sNx+OLx
214              fVerU  (i,j,1) = 0. _d 0
215              fVerU  (i,j,2) = 0. _d 0
216              fVerV  (i,j,1) = 0. _d 0
217              fVerV  (i,j,2) = 0. _d 0
218             ENDDO
219            ENDDO
220    
221  C--     Start computation of dynamics  C--     Start computation of dynamics
222          iMin = 1-OLx+2          iMin = 1-OLx+2
# Line 180  C--     Start computation of dynamics Line 224  C--     Start computation of dynamics
224          jMin = 1-OLy+2          jMin = 1-OLy+2
225          jMax = sNy+OLy-1          jMax = sNy+OLy-1
226    
227    #ifdef ALLOW_AUTODIFF_TAMC
228    CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte
229    CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte
230    CADJ STORE wvel (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte
231    #endif /* ALLOW_AUTODIFF_TAMC */
232    
233  C--     Explicit part of the Surface Potentiel Gradient (add in TIMESTEP)  C--     Explicit part of the Surface Potentiel Gradient (add in TIMESTEP)
234  C       (note: this loop will be replaced by CALL CALC_GRAD_ETA)  C       (note: this loop will be replaced by CALL CALC_GRAD_ETA)
235          IF (implicSurfPress.NE.1.) THEN          IF (implicSurfPress.NE.1.) THEN
# Line 201  C--       kDown  Cycles through 2,1 to p Line 251  C--       kDown  Cycles through 2,1 to p
251            kup  = 1+MOD(k+1,2)            kup  = 1+MOD(k+1,2)
252            kDown= 1+MOD(k,2)            kDown= 1+MOD(k,2)
253    
254    #ifdef ALLOW_AUTODIFF_TAMC
255             kkey = (ikey-1)*Nr + k
256    #endif /* ALLOW_AUTODIFF_TAMC */
257    
258  C--      Integrate hydrostatic balance for phiHyd with BC of  C--      Integrate hydrostatic balance for phiHyd with BC of
259  C        phiHyd(z=0)=0  C        phiHyd(z=0)=0
260  C        distinguishe between Stagger and Non Stagger time stepping  C        distinguishe between Stagger and Non Stagger time stepping
# Line 218  C        distinguishe between Stagger an Line 272  C        distinguishe between Stagger an
272       I        myThid )       I        myThid )
273           ENDIF           ENDIF
274    
 #ifdef ALLOW_AUTODIFF_TAMC  
 CADJ STORE KappaRT(:,:,k)    = comlev1_bibj_k, key=kkey, byte=isbyte  
 CADJ STORE KappaRS(:,:,k)    = comlev1_bibj_k, key=kkey, byte=isbyte  
 #endif /* ALLOW_AUTODIFF_TAMC */  
   
275  #ifdef  INCLUDE_CALC_DIFFUSIVITY_CALL  #ifdef  INCLUDE_CALC_DIFFUSIVITY_CALL
276  C--      Calculate the total vertical diffusivity  C--      Calculate the total vertical diffusivity
277           CALL CALC_DIFFUSIVITY(           CALL CALC_VISCOSITY(
278       I        bi,bj,iMin,iMax,jMin,jMax,k,       I        bi,bj,iMin,iMax,jMin,jMax,k,
279       I        maskUp,       I        maskUp,
280       O        KappaRT,KappaRS,KappaRU,KappaRV,       O        KappaRU,KappaRV,
281       I        myThid)       I        myThid)
282  #endif  #endif
283    

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

  ViewVC Help
Powered by ViewVC 1.1.22