/[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.63 by jmc, Tue Feb 20 15:06:21 2001 UTC revision 1.65.2.2 by jmc, Mon Apr 9 16:08:34 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 59  C                              transport Line 58  C                              transport
58  C                              o uTrans: Zonal transport  C                              o uTrans: Zonal transport
59  C                              o vTrans: Meridional transport  C                              o vTrans: Meridional transport
60  C                              o rTrans: Vertical transport  C                              o rTrans: Vertical transport
61  C     maskC,maskUp             o maskC: land/water mask for tracer cells  C     maskUp                   o maskUp: land/water mask for W points
 C                              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
64  C                                      so we need an fVer for each  C                                      so we need an fVer for each
# Line 68  C                                      v Line 66  C                                      v
66  C     rhoK, rhoKM1   - Density at current level, and level above  C     rhoK, rhoKM1   - Density at current level, and level above
67  C     phiHyd         - Hydrostatic part of the potential phiHydi.  C     phiHyd         - Hydrostatic part of the potential phiHydi.
68  C                      In z coords phiHydiHyd is the hydrostatic  C                      In z coords phiHydiHyd is the hydrostatic
69  C                      pressure anomaly  C                      Potential (=pressure/rho0) anomaly
70  C                      In p coords phiHydiHyd is the geopotential  C                      In p coords phiHydiHyd is the geopotential
71  C                      surface height  C                      surface height anomaly.
 C                      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
74  C     KappaRT,       - Total diffusion in vertical for T and S.  C     KappaRT,       - Total diffusion in vertical for T and S.
# Line 82  C     bi, bj Line 79  C     bi, bj
79  C     k, kup,        - Index for layer above and below. kup and kDown  C     k, kup,        - Index for layer above and below. kup and kDown
80  C     kDown, km1       are switched with layer to be the appropriate  C     kDown, km1       are switched with layer to be the appropriate
81  C                      index into fVerTerm.  C                      index into fVerTerm.
82    C     tauAB - Adams-Bashforth timestepping weight: 0=forward ; 1/2=Adams-Bashf.
83        _RS xA      (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS xA      (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
84        _RS yA      (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS yA      (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
85        _RL uTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL uTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
86        _RL vTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL vTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
87        _RL rTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL rTrans  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
       _RS maskC   (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
88        _RS maskUp  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS maskUp  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
89        _RL fVerT   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)        _RL fVerT   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
90        _RL fVerS   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)        _RL fVerS   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
# Line 105  C                      index into fVerTe Line 102  C                      index into fVerTe
102        _RL sigmaX  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL sigmaX  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
103        _RL sigmaY  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL sigmaY  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
104        _RL sigmaR  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL sigmaR  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
105          _RL tauAB
106    
107  C This is currently used by IVDC and Diagnostics  C This is currently used by IVDC and Diagnostics
108        _RL ConvectCount (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL ConvectCount (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
# Line 201  C     uninitialised but inert locations. Line 199  C     uninitialised but inert locations.
199          ENDDO          ENDDO
200          rhoKM1 (i,j) = 0. _d 0          rhoKM1 (i,j) = 0. _d 0
201          rhok   (i,j) = 0. _d 0          rhok   (i,j) = 0. _d 0
         maskC  (i,j) = 0. _d 0  
202          phiSurfX(i,j) = 0. _d 0          phiSurfX(i,j) = 0. _d 0
203          phiSurfY(i,j) = 0. _d 0          phiSurfY(i,j) = 0. _d 0
204         ENDDO         ENDDO
# Line 218  CHPF$ INDEPENDENT Line 215  CHPF$ INDEPENDENT
215  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
216  C--    HPF directive to help TAMC  C--    HPF directive to help TAMC
217  CHPF$  INDEPENDENT, NEW (rTrans,fVerT,fVerS,fVerU,fVerV  CHPF$  INDEPENDENT, NEW (rTrans,fVerT,fVerS,fVerU,fVerV
218  CHPF$&                  ,phiHyd,utrans,vtrans,maskc,xA,yA  CHPF$&                  ,phiHyd,utrans,vtrans,xA,yA
219  CHPF$&                  ,KappaRT,KappaRS,KappaRU,KappaRV  CHPF$&                  ,KappaRT,KappaRS,KappaRU,KappaRV
220  CHPF$&                  )  CHPF$&                  )
221  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
# Line 422  CADJ STORE KappaRS(:,:,:)    = comlev1_b Line 419  CADJ STORE KappaRS(:,:,:)    = comlev1_b
419    
420  C--      Get temporary terms used by tendency routines  C--      Get temporary terms used by tendency routines
421           CALL CALC_COMMON_FACTORS (           CALL CALC_COMMON_FACTORS (
422       I        bi,bj,iMin,iMax,jMin,jMax,k,km1,kup,kDown,       I        bi,bj,iMin,iMax,jMin,jMax,k,
423       O        xA,yA,uTrans,vTrans,rTrans,maskC,maskUp,       O        xA,yA,uTrans,vTrans,rTrans,maskUp,
424       I        myThid)       I        myThid)
425    
426  #ifdef  INCLUDE_CALC_DIFFUSIVITY_CALL  #ifdef  INCLUDE_CALC_DIFFUSIVITY_CALL
427  C--      Calculate the total vertical diffusivity  C--      Calculate the total vertical diffusivity
428           CALL CALC_DIFFUSIVITY(           CALL CALC_DIFFUSIVITY(
429       I        bi,bj,iMin,iMax,jMin,jMax,k,       I        bi,bj,iMin,iMax,jMin,jMax,k,
430       I        maskC,maskup,       I        maskUp,
431       O        KappaRT,KappaRS,KappaRU,KappaRV,       O        KappaRT,KappaRS,KappaRU,KappaRV,
432       I        myThid)       I        myThid)
433  #endif  #endif
# Line 440  C        and step forward storing result Line 437  C        and step forward storing result
437           IF ( tempStepping ) THEN           IF ( tempStepping ) THEN
438             CALL CALC_GT(             CALL CALC_GT(
439       I         bi,bj,iMin,iMax,jMin,jMax, k,km1,kup,kDown,       I         bi,bj,iMin,iMax,jMin,jMax, k,km1,kup,kDown,
440       I         xA,yA,uTrans,vTrans,rTrans,maskUp,maskC,       I         xA,yA,uTrans,vTrans,rTrans,maskUp,
441       I         KappaRT,       I         KappaRT,
442       U         fVerT,       U         fVerT,
443       I         myTime, myThid)       I         myTime, myThid)
444               tauAB = 0.5d0 + abEps
445             CALL TIMESTEP_TRACER(             CALL TIMESTEP_TRACER(
446       I         bi,bj,iMin,iMax,jMin,jMax,k,       I         bi,bj,iMin,iMax,jMin,jMax,k,tauAB,
447       I         theta, gT,       I         theta, gT,
448       U         gTnm1,       U         gTnm1,
449       I         myIter, myThid)       I         myIter, myThid)
# Line 453  C        and step forward storing result Line 451  C        and step forward storing result
451           IF ( saltStepping ) THEN           IF ( saltStepping ) THEN
452             CALL CALC_GS(             CALL CALC_GS(
453       I         bi,bj,iMin,iMax,jMin,jMax, k,km1,kup,kDown,       I         bi,bj,iMin,iMax,jMin,jMax, k,km1,kup,kDown,
454       I         xA,yA,uTrans,vTrans,rTrans,maskUp,maskC,       I         xA,yA,uTrans,vTrans,rTrans,maskUp,
455       I         KappaRS,       I         KappaRS,
456       U         fVerS,       U         fVerS,
457       I         myTime, myThid)       I         myTime, myThid)
458               tauAB = 0.5d0 + abEps
459             CALL TIMESTEP_TRACER(             CALL TIMESTEP_TRACER(
460       I         bi,bj,iMin,iMax,jMin,jMax,k,       I         bi,bj,iMin,iMax,jMin,jMax,k,tauAB,
461       I         salt, gS,       I         salt, gS,
462       U         gSnm1,       U         gSnm1,
463       I         myIter, myThid)       I         myIter, myThid)
# Line 533  C--     Start computation of dynamics Line 532  C--     Start computation of dynamics
532          jMin = 1-OLy+2          jMin = 1-OLy+2
533          jMax = sNy+OLy-1          jMax = sNy+OLy-1
534    
535  C--     Explicit part of the Surface Pressure Gradient (add in TIMESTEP)  C--     Explicit part of the Surface Potentiel Gradient (add in TIMESTEP)
536  C       (note: this loop will be replaced by CALL CALC_GRAD_ETA)  C       (note: this loop will be replaced by CALL CALC_GRAD_ETA)
537          IF (implicSurfPress.NE.1.) THEN          IF (implicSurfPress.NE.1.) THEN
538            DO j=jMin,jMax            CALL CALC_GRAD_PHI_SURF(
539              DO i=iMin,iMax       I         bi,bj,iMin,iMax,jMin,jMax,
540                phiSurfX(i,j) = _recip_dxC(i,j,bi,bj)*gBaro       I         etaN,
541       &           *(cg2d_x(i,j,bi,bj)-cg2d_x(i-1,j,bi,bj))       O         phiSurfX,phiSurfY,
542                phiSurfY(i,j) = _recip_dyC(i,j,bi,bj)*gBaro       I         myThid )                        
      &           *(cg2d_x(i,j,bi,bj)-cg2d_x(i,j-1,bi,bj))  
             ENDDO  
           ENDDO  
543          ENDIF          ENDIF
544    
545  C--     Start of dynamics loop  C--     Start of dynamics loop
# Line 670  c         CALL WRITE_FLD_XYZ_RL('PH.',su Line 666  c         CALL WRITE_FLD_XYZ_RL('PH.',su
666  c       ENDIF  c       ENDIF
667  Cjmc(end)  Cjmc(end)
668    
669  #ifdef INCLUDE_DIAGNOSTICS_INTERFACE_CODE  #ifdef ALLOW_TIMEAVE
670          IF (taveFreq.GT.0.) THEN          IF (taveFreq.GT.0.) THEN
671           DO K=1,Nr            CALL TIMEAVE_CUMULATE(phiHydtave, phiHyd, Nr,
672            CALL TIMEAVER_1FLD_XYZ(phiHyd, phiHydtave,       I                              deltaTclock, bi, bj, myThid)
      I                              deltaTclock, bi, bj, K, myThid)  
673            IF (ivdc_kappa.NE.0.) THEN            IF (ivdc_kappa.NE.0.) THEN
674              CALL TIMEAVER_1FLD_XYZ(ConvectCount, ConvectCountTave,              CALL TIMEAVE_CUMULATE(ConvectCountTave, ConvectCount, Nr,
675       I                              deltaTclock, bi, bj, K, myThid)       I                              deltaTclock, bi, bj, myThid)
676            ENDIF            ENDIF
          ENDDO  
677          ENDIF          ENDIF
678  #endif /* INCLUDE_DIAGNOSTICS_INTERFACE_CODE */  #endif /* ALLOW_TIMEAVE */
679    
680         ENDDO         ENDDO
681        ENDDO        ENDDO

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.65.2.2

  ViewVC Help
Powered by ViewVC 1.1.22