/[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.93 by jmc, Tue Feb 11 04:05:32 2003 UTC revision 1.94 by jmc, Tue Feb 18 15:25:09 2003 UTC
# Line 85  C     == Global variables === Line 85  C     == Global variables ===
85  #  include "KPP.h"  #  include "KPP.h"
86  # endif  # endif
87  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
 #ifdef ALLOW_TIMEAVE  
 #include "TIMEAVE_STATV.h"  
 #endif  
88    
89  C     !CALLING SEQUENCE:  C     !CALLING SEQUENCE:
90  C     DYNAMICS()  C     DYNAMICS()
# Line 98  C      |-- CALC_VISCOSITY Line 95  C      |-- CALC_VISCOSITY
95  C      |  C      |
96  C      |-- CALC_PHI_HYD    C      |-- CALC_PHI_HYD  
97  C      |  C      |
 C      |-- STORE_PRESSURE  
 C      |  
98  C      |-- MOM_FLUXFORM    C      |-- MOM_FLUXFORM  
99  C      |  C      |
100  C      |-- MOM_VECINV      C      |-- MOM_VECINV    
# Line 130  C     fVer[STUV]               o fVer: V Line 125  C     fVer[STUV]               o fVer: V
125  C                                      is "pipelined" in the vertical  C                                      is "pipelined" in the vertical
126  C                                      so we need an fVer for each  C                                      so we need an fVer for each
127  C                                      variable.  C                                      variable.
128  C     rhoK, rhoKM1   - Density at current level, and level above  C     phiHydC    :: hydrostatic potential anomaly at cell center
129  C     phiHyd         - Hydrostatic part of the potential.  C                   In z coords phiHyd is the hydrostatic potential
130  C                      In z coords phiHyd is the hydrostatic  C                      (=pressure/rho0) anomaly
131  C                      Potential (=pressure/rho0) anomaly  C                   In p coords phiHyd is the geopotential height anomaly.
132  C                      In p coords phiHyd is the geopotential  C     phiHydF    :: hydrostatic potential anomaly at middle between 2 centers
133  C                      surface height anomaly.  C     dPhiHydX,Y :: Gradient (X & Y directions) of hydrostatic potential anom.
134  C     dPhiHydX,Y :: Gradient (X & Y directions) of Hydrostatic Potential  C     phiSurfX,  ::  gradient of Surface potential (Pressure/rho, ocean)
 C     phiSurfX, - gradient of Surface potential (Pressure/rho, ocean)  
135  C     phiSurfY             or geopotential (atmos) in X and Y direction  C     phiSurfY             or geopotential (atmos) in X and Y direction
136  C     iMin, iMax     - Ranges and sub-block indices on which calculations  C     iMin, iMax     - Ranges and sub-block indices on which calculations
137  C     jMin, jMax       are applied.  C     jMin, jMax       are applied.
# Line 147  C     kDown, km1       are switched with Line 141  C     kDown, km1       are switched with
141  C                      index into fVerTerm.  C                      index into fVerTerm.
142        _RL fVerU   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)        _RL fVerU   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
143        _RL fVerV   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)        _RL fVerV   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
144        _RL phiHyd  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL phiHydF (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
145          _RL phiHydC (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
146        _RL dPhiHydX(1-Olx:sNx+Olx,1-Oly:sNy+Oly)        _RL dPhiHydX(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
147        _RL dPhiHydY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)        _RL dPhiHydY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
       _RL rhokm1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
       _RL rhok    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
148        _RL phiSurfX(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL phiSurfX(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
149        _RL phiSurfY(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL phiSurfY(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
150        _RL KappaRU (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)        _RL KappaRU (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
# Line 218  C     point numbers. This prevents spuri Line 211  C     point numbers. This prevents spuri
211  C     uninitialised but inert locations.  C     uninitialised but inert locations.
212        DO j=1-OLy,sNy+OLy        DO j=1-OLy,sNy+OLy
213         DO i=1-OLx,sNx+OLx         DO i=1-OLx,sNx+OLx
         rhoKM1 (i,j) = 0. _d 0  
         rhok   (i,j) = 0. _d 0  
214          phiSurfX(i,j) = 0. _d 0          phiSurfX(i,j) = 0. _d 0
215          phiSurfY(i,j) = 0. _d 0          phiSurfY(i,j) = 0. _d 0
216         ENDDO         ENDDO
# Line 242  CHPF$ INDEPENDENT Line 233  CHPF$ INDEPENDENT
233  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
234  C--    HPF directive to help TAMC  C--    HPF directive to help TAMC
235  CHPF$  INDEPENDENT, NEW (fVerU,fVerV  CHPF$  INDEPENDENT, NEW (fVerU,fVerV
236  CHPF$&                  ,phiHyd  CHPF$&                  ,phiHydF
237  CHPF$&                  ,KappaRU,KappaRV  CHPF$&                  ,KappaRU,KappaRV
238  CHPF$&                  )  CHPF$&                  )
239  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
# Line 263  CHPF$&                  ) Line 254  CHPF$&                  )
254  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
255    
256  C--     Set up work arrays that need valid initial values  C--     Set up work arrays that need valid initial values
257          DO j=1-OLy,sNy+OLy          DO k=1,Nr
258           DO i=1-OLx,sNx+OLx           DO j=1-OLy,sNy+OLy
259            DO k=1,Nr            DO i=1-OLx,sNx+OLx
            phiHyd(i,j,k)  = 0. _d 0  
260             KappaRU(i,j,k) = 0. _d 0             KappaRU(i,j,k) = 0. _d 0
261             KappaRV(i,j,k) = 0. _d 0             KappaRV(i,j,k) = 0. _d 0
262            ENDDO            ENDDO
263             ENDDO
264            ENDDO
265            DO j=1-OLy,sNy+OLy
266             DO i=1-OLx,sNx+OLx
267            fVerU  (i,j,1) = 0. _d 0            fVerU  (i,j,1) = 0. _d 0
268            fVerU  (i,j,2) = 0. _d 0            fVerU  (i,j,2) = 0. _d 0
269            fVerV  (i,j,1) = 0. _d 0            fVerV  (i,j,1) = 0. _d 0
270            fVerV  (i,j,2) = 0. _d 0            fVerV  (i,j,2) = 0. _d 0
271              phiHydF (i,j)  = 0. _d 0
272              phiHydC (i,j)  = 0. _d 0
273            dPhiHydX(i,j)  = 0. _d 0            dPhiHydX(i,j)  = 0. _d 0
274            dPhiHydY(i,j)  = 0. _d 0            dPhiHydY(i,j)  = 0. _d 0
275           ENDDO           ENDDO
# Line 344  C        distinguishe between Stagger an Line 340  C        distinguishe between Stagger an
340             CALL CALC_PHI_HYD(             CALL CALC_PHI_HYD(
341       I        bi,bj,iMin,iMax,jMin,jMax,k,       I        bi,bj,iMin,iMax,jMin,jMax,k,
342       I        gT, gS,       I        gT, gS,
343       U        phiHyd,       U        phiHydF,
344       O        dPhiHydX, dPhiHydY,       O        phiHydC, dPhiHydX, dPhiHydY,
345       I        myTime, myIter, myThid )       I        myTime, myIter, myThid )
346           ELSE           ELSE
347             CALL CALC_PHI_HYD(             CALL CALC_PHI_HYD(
348       I        bi,bj,iMin,iMax,jMin,jMax,k,       I        bi,bj,iMin,iMax,jMin,jMax,k,
349       I        theta, salt,       I        theta, salt,
350       U        phiHyd,       U        phiHydF,
351       O        dPhiHydX, dPhiHydY,       O        phiHydC, dPhiHydX, dPhiHydY,
352       I        myTime, myIter, myThid )       I        myTime, myIter, myThid )
353           ENDIF           ENDIF
354    
 C        calculate pressure from phiHyd and store it on common block  
 C        variable pressure  
          CALL STORE_PRESSURE( bi, bj, k, phiHyd, myThid )  
   
355  C--      Calculate accelerations in the momentum equations (gU, gV, ...)  C--      Calculate accelerations in the momentum equations (gU, gV, ...)
356  C        and step forward storing the result in gUnm1, gVnm1, etc...  C        and step forward storing the result in gUnm1, gVnm1, etc...
357           IF ( momStepping ) THEN           IF ( momStepping ) THEN
358  #ifndef DISABLE_MOM_FLUXFORM  #ifndef DISABLE_MOM_FLUXFORM
359             IF (.NOT. vectorInvariantMomentum) CALL MOM_FLUXFORM(             IF (.NOT. vectorInvariantMomentum) CALL MOM_FLUXFORM(
360       I         bi,bj,iMin,iMax,jMin,jMax,k,kup,kDown,       I         bi,bj,iMin,iMax,jMin,jMax,k,kup,kDown,
361       I         phiHyd,dPhiHydX,dPhiHydY,KappaRU,KappaRV,       I         dPhiHydX,dPhiHydY,KappaRU,KappaRV,
362       U         fVerU, fVerV,       U         fVerU, fVerV,
363       I         myTime, myIter, myThid)       I         myTime, myIter, myThid)
364  #endif  #endif
# Line 379  C        and step forward storing the re Line 371  C        and step forward storing the re
371  #endif  #endif
372             CALL TIMESTEP(             CALL TIMESTEP(
373       I         bi,bj,iMin,iMax,jMin,jMax,k,       I         bi,bj,iMin,iMax,jMin,jMax,k,
374       I         phiHyd, dPhiHydX,dPhiHydY, phiSurfX, phiSurfY,       I         dPhiHydX,dPhiHydY, phiSurfX, phiSurfY,
375       I         myIter, myThid)       I         myIter, myThid)
376    
377  #ifdef   ALLOW_OBCS  #ifdef   ALLOW_OBCS
# Line 455  CADJ STORE uVelD(:,:,:,bi,bj) = comlev1_ Line 447  CADJ STORE uVelD(:,:,:,bi,bj) = comlev1_
447  C--     End If implicitViscosity.AND.momStepping  C--     End If implicitViscosity.AND.momStepping
448          ENDIF          ENDIF
449    
 C- jmc: add for diagnostic of phiHyd  
         IF ( DIFFERENT_MULTIPLE(diagFreq,myTime+deltaTClock,myTime)  
      &       .AND. buoyancyRelation .NE. 'OCEANIC' ) THEN  
           CALL WRITE_LOCAL_RL('Ph','I10',Nr,phiHyd,  
      &                         bi,bj,1,myIter+1,myThid)  
         ENDIF  
   
 #ifdef ALLOW_TIMEAVE  
         IF (taveFreq.GT.0.) THEN  
           CALL TIMEAVE_CUMUL_1T(phiHydtave, phiHyd, Nr,  
      I                              deltaTclock, bi, bj, myThid)  
         ENDIF  
 #endif /* ALLOW_TIMEAVE */  
   
450         ENDDO         ENDDO
451        ENDDO        ENDDO
452    

Legend:
Removed from v.1.93  
changed lines
  Added in v.1.94

  ViewVC Help
Powered by ViewVC 1.1.22