/[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.62 by jmc, Wed Feb 14 22:51:27 2001 UTC revision 1.64 by jmc, Tue Mar 6 16:59:44 2001 UTC
# Line 26  C     \================================= Line 26  C     \=================================
26  C     == Global variables ===  C     == Global variables ===
27  #include "SIZE.h"  #include "SIZE.h"
28  #include "EEPARAMS.h"  #include "EEPARAMS.h"
 #include "CG2D.h"  
29  #include "PARAMS.h"  #include "PARAMS.h"
30  #include "DYNVARS.h"  #include "DYNVARS.h"
31  #include "GRID.h"  #include "GRID.h"
# Line 40  C     == Global variables === Line 39  C     == Global variables ===
39  # include "KPP.h"  # include "KPP.h"
40  #endif  #endif
41    
42  #ifdef INCLUDE_DIAGNOSTICS_INTERFACE_CODE  #ifdef ALLOW_TIMEAVE
43  #include "AVER.h"  #include "TIMEAVE_STATV.h"
44  #endif  #endif
45    
46  C     == Routine arguments ==  C     == Routine arguments ==
# Line 72  C                      pressure anomaly Line 71  C                      pressure anomaly
71  C                      In p coords phiHydiHyd is the geopotential  C                      In p coords phiHydiHyd is the geopotential
72  C                      surface height  C                      surface height
73  C                      anomaly.  C                      anomaly.
74  C     etaSurfX,      - Holds surface elevation gradient in X and Y.  C     phiSurfX, - gradient of Surface potentiel (Pressure/rho, ocean)
75  C     etaSurfY  C     phiSurfY             or geopotentiel (atmos) in X and Y direction
76  C     KappaRT,       - Total diffusion in vertical for T and S.  C     KappaRT,       - Total diffusion in vertical for T and S.
77  C     KappaRS          (background + spatially varying, isopycnal term).  C     KappaRS          (background + spatially varying, isopycnal term).
78  C     iMin, iMax     - Ranges and sub-block indices on which calculations  C     iMin, iMax     - Ranges and sub-block indices on which calculations
# Line 96  C                      index into fVerTe Line 95  C                      index into fVerTe
95        _RL phiHyd  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL phiHyd  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
96        _RL rhokm1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL rhokm1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
97        _RL rhok    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL rhok    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
98          _RL phiSurfX(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
99          _RL phiSurfY(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
100        _RL KappaRT (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)        _RL KappaRT (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
101        _RL KappaRS (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)        _RL KappaRS (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
102        _RL KappaRU (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)        _RL KappaRU (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
# Line 200  C     uninitialised but inert locations. Line 201  C     uninitialised but inert locations.
201          rhoKM1 (i,j) = 0. _d 0          rhoKM1 (i,j) = 0. _d 0
202          rhok   (i,j) = 0. _d 0          rhok   (i,j) = 0. _d 0
203          maskC  (i,j) = 0. _d 0          maskC  (i,j) = 0. _d 0
204            phiSurfX(i,j) = 0. _d 0
205            phiSurfY(i,j) = 0. _d 0
206         ENDDO         ENDDO
207        ENDDO        ENDDO
208    
# Line 523  C--      Apply open boundary conditions Line 526  C--      Apply open boundary conditions
526  C--     End If implicitDiffusion  C--     End If implicitDiffusion
527          ENDIF          ENDIF
528    
529    C--     Start computation of dynamics
530            iMin = 1-OLx+2
531            iMax = sNx+OLx-1
532            jMin = 1-OLy+2
533            jMax = sNy+OLy-1
534    
535    C--     Explicit part of the Surface Pressure Gradient (add in TIMESTEP)
536    C       (note: this loop will be replaced by CALL CALC_GRAD_ETA)
537            IF (implicSurfPress.NE.1.) THEN
538              DO j=jMin,jMax
539                DO i=iMin,iMax
540                  phiSurfX(i,j) = _recip_dxC(i,j,bi,bj)*gBaro
541         &           *(etaN(i,j,bi,bj)-etaN(i-1,j,bi,bj))
542                  phiSurfY(i,j) = _recip_dyC(i,j,bi,bj)*gBaro
543         &           *(etaN(i,j,bi,bj)-etaN(i,j-1,bi,bj))
544                ENDDO
545              ENDDO
546            ENDIF
547    
548  C--     Start of dynamics loop  C--     Start of dynamics loop
549          DO k=1,Nr          DO k=1,Nr
# Line 536  C--       kDown  Cycles through 2,1 to p Line 556  C--       kDown  Cycles through 2,1 to p
556            kup  = 1+MOD(k+1,2)            kup  = 1+MOD(k+1,2)
557            kDown= 1+MOD(k,2)            kDown= 1+MOD(k,2)
558    
           iMin = 1-OLx+2  
           iMax = sNx+OLx-1  
           jMin = 1-OLy+2  
           jMax = sNy+OLy-1  
   
559  C--      Integrate hydrostatic balance for phiHyd with BC of  C--      Integrate hydrostatic balance for phiHyd with BC of
560  C        phiHyd(z=0)=0  C        phiHyd(z=0)=0
561  C        distinguishe between Stagger and Non Stagger time stepping  C        distinguishe between Stagger and Non Stagger time stepping
# Line 567  C        and step forward storing the re Line 582  C        and step forward storing the re
582       U         fVerU, fVerV,       U         fVerU, fVerV,
583       I         myTime, myThid)       I         myTime, myThid)
584             CALL TIMESTEP(             CALL TIMESTEP(
585       I         bi,bj,iMin,iMax,jMin,jMax,k,phiHyd,       I         bi,bj,iMin,iMax,jMin,jMax,k,
586         I         phiHyd, phiSurfX, phiSurfY,
587       I         myIter, myThid)       I         myIter, myThid)
588    
589  #ifdef   ALLOW_OBCS  #ifdef   ALLOW_OBCS
# Line 653  c         CALL WRITE_FLD_XYZ_RL('PH.',su Line 669  c         CALL WRITE_FLD_XYZ_RL('PH.',su
669  c       ENDIF  c       ENDIF
670  Cjmc(end)  Cjmc(end)
671    
672  #ifdef INCLUDE_DIAGNOSTICS_INTERFACE_CODE  #ifdef ALLOW_TIMEAVE
673          IF (taveFreq.GT.0.) THEN          IF (taveFreq.GT.0.) THEN
674           DO K=1,Nr            CALL TIMEAVE_CUMULATE(phiHydtave, phiHyd, Nr,
675            CALL TIMEAVER_1FLD_XYZ(phiHyd, phiHydtave,       I                              deltaTclock, bi, bj, myThid)
      I                              deltaTclock, bi, bj, K, myThid)  
676            IF (ivdc_kappa.NE.0.) THEN            IF (ivdc_kappa.NE.0.) THEN
677              CALL TIMEAVER_1FLD_XYZ(ConvectCount, ConvectCountTave,              CALL TIMEAVE_CUMULATE(ConvectCountTave, ConvectCount, Nr,
678       I                              deltaTclock, bi, bj, K, myThid)       I                              deltaTclock, bi, bj, myThid)
679            ENDIF            ENDIF
          ENDDO  
680          ENDIF          ENDIF
681  #endif /* INCLUDE_DIAGNOSTICS_INTERFACE_CODE */  #endif /* ALLOW_TIMEAVE */
682    
683         ENDDO         ENDDO
684        ENDDO        ENDDO

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.64

  ViewVC Help
Powered by ViewVC 1.1.22