/[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.61 by jmc, Wed Feb 7 21:48:02 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 ALLOW_TIMEAVE
43    #include "TIMEAVE_STATV.h"
44    #endif
45    
46  C     == Routine arguments ==  C     == Routine arguments ==
47  C     myTime - Current time in simulation  C     myTime - Current time in simulation
48  C     myIter - Current iteration number in simulation  C     myIter - Current iteration number in simulation
# Line 68  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 92  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 100  C                      index into fVerTe Line 105  C                      index into fVerTe
105        _RL sigmaY  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL sigmaY  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
106        _RL sigmaR  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL sigmaR  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
107    
108  C This is currently also used by IVDC and Diagnostics  C This is currently used by IVDC and Diagnostics
 C #ifdef INCLUDE_CONVECT_CALL  
109        _RL ConvectCount (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL ConvectCount (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
 C #endif  
110    
111        INTEGER iMin, iMax        INTEGER iMin, iMax
112        INTEGER jMin, jMax        INTEGER jMin, jMax
# Line 111  C #endif Line 114  C #endif
114        INTEGER i, j        INTEGER i, j
115        INTEGER k, km1, kup, kDown        INTEGER k, km1, kup, kDown
116    
117    Cjmc : add for phiHyd output <- but not working if multi tile per CPU
118    c     CHARACTER*(MAX_LEN_MBUF) suff
119    c     LOGICAL  DIFFERENT_MULTIPLE
120    c     EXTERNAL DIFFERENT_MULTIPLE
121    Cjmc(end)
122    
123  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
124        INTEGER    isbyte        INTEGER    isbyte
125        PARAMETER( isbyte = 4 )        PARAMETER( isbyte = 4 )
# Line 192  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 248  C--     Set up work arrays that need val Line 259  C--     Set up work arrays that need val
259          DO k=1,Nr          DO k=1,Nr
260           DO j=1-OLy,sNy+OLy           DO j=1-OLy,sNy+OLy
261            DO i=1-OLx,sNx+OLx            DO i=1-OLx,sNx+OLx
262  #ifdef INCLUDE_CONVECT_CALL  C This is currently also used by IVDC and Diagnostics
263             ConvectCount(i,j,k) = 0.             ConvectCount(i,j,k) = 0.
 #endif  
264             KappaRT(i,j,k) = 0. _d 0             KappaRT(i,j,k) = 0. _d 0
265             KappaRS(i,j,k) = 0. _d 0             KappaRS(i,j,k) = 0. _d 0
266            ENDDO            ENDDO
# Line 316  c ==> should use sigmaR !!! Line 326  c ==> should use sigmaR !!!
326       I        rhoKm1, rhoK,       I        rhoKm1, rhoK,
327       U        ConvectCount, KappaRT, KappaRS,       U        ConvectCount, KappaRT, KappaRS,
328       I        myTime, myIter, myThid)       I        myTime, myIter, myThid)
329            END IF            ENDIF
330    
331  C--     end of diagnostic k loop (Nr:1)  C--     end of diagnostic k loop (Nr:1)
332          ENDDO          ENDDO
# Line 482  CPatrick? What about this one? Line 492  CPatrick? What about this one?
492  C--     Implicit diffusion  C--     Implicit diffusion
493          IF (implicitDiffusion) THEN          IF (implicitDiffusion) THEN
494    
495            IF (tempStepping) THEN           IF (tempStepping) THEN
496  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
497              idkey = iikey + 1              idkey = iikey + 1
498  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
# Line 516  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 529  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 560  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 638  C--      Apply open boundary conditions Line 661  C--      Apply open boundary conditions
661  C--     End If implicitViscosity.AND.momStepping  C--     End If implicitViscosity.AND.momStepping
662          ENDIF          ENDIF
663    
664    Cjmc : add for phiHyd output <- but not working if multi tile per CPU
665    c       IF ( DIFFERENT_MULTIPLE(dumpFreq,myTime+deltaTClock,myTime)
666    c    &  .AND. buoyancyRelation .eq. 'ATMOSPHERIC' ) THEN
667    c         WRITE(suff,'(I10.10)') myIter+1
668    c         CALL WRITE_FLD_XYZ_RL('PH.',suff,phiHyd,myIter+1,myThid)
669    c       ENDIF
670    Cjmc(end)
671    
672    #ifdef ALLOW_TIMEAVE
673            IF (taveFreq.GT.0.) THEN
674              CALL TIMEAVE_CUMULATE(phiHydtave, phiHyd, Nr,
675         I                              deltaTclock, bi, bj, myThid)
676              IF (ivdc_kappa.NE.0.) THEN
677                CALL TIMEAVE_CUMULATE(ConvectCountTave, ConvectCount, Nr,
678         I                              deltaTclock, bi, bj, myThid)
679              ENDIF
680            ENDIF
681    #endif /* ALLOW_TIMEAVE */
682    
683         ENDDO         ENDDO
684        ENDDO        ENDDO
685    

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

  ViewVC Help
Powered by ViewVC 1.1.22