/[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.164 by jahn, Thu Mar 21 18:15:44 2013 UTC revision 1.165 by jmc, Sat Aug 3 01:38:17 2013 UTC
# Line 78  C     == Global variables === Line 78  C     == Global variables ===
78  #include "SIZE.h"  #include "SIZE.h"
79  #include "EEPARAMS.h"  #include "EEPARAMS.h"
80  #include "PARAMS.h"  #include "PARAMS.h"
81    #include "GRID.h"
82  #include "DYNVARS.h"  #include "DYNVARS.h"
83  #ifdef ALLOW_CD_CODE  #ifdef ALLOW_CD_CODE
84  #include "CD_CODE_VARS.h"  # include "CD_CODE_VARS.h"
85  #endif  #endif
 #include "GRID.h"  
86  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
87  # include "tamc.h"  # include "tamc.h"
88  # include "tamc_keys.h"  # include "tamc_keys.h"
# Line 96  C     == Global variables === Line 96  C     == Global variables ===
96  #  include "PTRACERS_FIELDS.h"  #  include "PTRACERS_FIELDS.h"
97  # endif  # endif
98  # ifdef ALLOW_OBCS  # ifdef ALLOW_OBCS
99  #include "OBCS_PARAMS.h"  #  include "OBCS_PARAMS.h"
100  #  include "OBCS_FIELDS.h"  #  include "OBCS_FIELDS.h"
101  #  ifdef ALLOW_PTRACERS  #  ifdef ALLOW_PTRACERS
102  #   include "OBCS_PTRACERS.h"  #   include "OBCS_PTRACERS.h"
# Line 167  C     phiSurfX,  ::  gradient of Surface Line 167  C     phiSurfX,  ::  gradient of Surface
167  C     phiSurfY             or geopotential (atmos) in X and Y direction  C     phiSurfY             or geopotential (atmos) in X and Y direction
168  C     guDissip   :: dissipation tendency (all explicit terms), u component  C     guDissip   :: dissipation tendency (all explicit terms), u component
169  C     gvDissip   :: dissipation tendency (all explicit terms), v component  C     gvDissip   :: dissipation tendency (all explicit terms), v component
170  C     KappaRU    :: vertical viscosity  C     KappaRU    :: vertical viscosity for velocity U-component
171  C     KappaRV    :: vertical viscosity  C     KappaRV    :: vertical viscosity for velocity V-component
172  C     iMin, iMax :: Ranges and sub-block indices on which calculations  C     iMin, iMax :: Ranges and sub-block indices on which calculations
173  C     jMin, jMax    are applied.  C     jMin, jMax    are applied.
174  C     bi, bj     :: tile indices  C     bi, bj     :: tile indices
# Line 200  C                   are switched with k Line 200  C                   are switched with k
200        _RL tmpFac        _RL tmpFac
201  #endif /* ALLOW_DIAGNOSTICS */  #endif /* ALLOW_DIAGNOSTICS */
202    
   
203  C---    The algorithm...  C---    The algorithm...
204  C  C
205  C       "Correction Step"  C       "Correction Step"
# Line 257  CEOP Line 256  CEOP
256       &               .OR. DIAGNOSTICS_IS_ON( 'Vm_dPHdy', myThid )       &               .OR. DIAGNOSTICS_IS_ON( 'Vm_dPHdy', myThid )
257  #endif  #endif
258    
259  C-- Call to routine for calculation of  C-- Call to routine for calculation of Eliassen-Palm-flux-forced
260  C   Eliassen-Palm-flux-forced U-tendency,  C    U-tendency, if desired:
 C   if desired:  
261  #ifdef INCLUDE_EP_FORCING_CODE  #ifdef INCLUDE_EP_FORCING_CODE
262        CALL CALC_EP_FORCING(myThid)        CALL CALC_EP_FORCING(myThid)
263  #endif  #endif
# Line 308  C     uninitialised but inert locations. Line 306  C     uninitialised but inert locations.
306          DO k=1,Nr          DO k=1,Nr
307           DO j=1-OLy,sNy+OLy           DO j=1-OLy,sNy+OLy
308            DO i=1-OLx,sNx+OLx            DO i=1-OLx,sNx+OLx
            KappaRU(i,j,k) = 0. _d 0  
            KappaRV(i,j,k) = 0. _d 0  
309  cph(  cph(
310  c--   need some re-initialisation here to break dependencies  c--   need some re-initialisation here to break dependencies
311  cph)  cph)
# Line 380  CADJ &                 = comlev1_bibj, k Line 376  CADJ &                 = comlev1_bibj, k
376  #endif /* ALLOW_KPP */  #endif /* ALLOW_KPP */
377  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
378    
379  #ifdef  INCLUDE_CALC_DIFFUSIVITY_CALL  #if (defined INCLUDE_CALC_DIFFUSIVITY_CALL) && !(defined ALLOW_AUTODIFF)
380            IF ( .NOT.momViscosity ) THEN
381    #endif /* INCLUDE_CALC_DIFFUSIVITY_CALL and not ALLOW_AUTODIFF */
382              DO k=1,Nr
383               DO j=1-OLy,sNy+OLy
384                DO i=1-OLx,sNx+OLx
385                 KappaRU(i,j,k) = 0. _d 0
386                 KappaRV(i,j,k) = 0. _d 0
387                ENDDO
388               ENDDO
389              ENDDO
390    #ifdef INCLUDE_CALC_DIFFUSIVITY_CALL
391  C--     Calculate the total vertical viscosity  C--     Calculate the total vertical viscosity
392          CALL CALC_VISCOSITY(  #ifdef ALLOW_AUTODIFF
393            IF ( momViscosity ) THEN
394    #else
395            ELSE
396    #endif
397              CALL CALC_VISCOSITY(
398       I            bi,bj, iMin,iMax,jMin,jMax,       I            bi,bj, iMin,iMax,jMin,jMax,
399       O            KappaRU, KappaRV,       O            KappaRU, KappaRV,
400       I            myThid )       I            myThid )
401  #else          ENDIF
402          DO k=1,Nr  #endif /* INCLUDE_CALC_DIFFUSIVITY_CALL */
          DO j=1-OLy,sNy+OLy  
           DO i=1-OLx,sNx+OLx  
            KappaRU(i,j,k) = 0. _d 0  
            KappaRV(i,j,k) = 0. _d 0  
           ENDDO  
          ENDDO  
         ENDDO  
 #endif  
403    
404  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
405  CADJ STORE KappaRU(:,:,:)  CADJ STORE KappaRU(:,:,:)
# Line 407  CADJ &     = comlev1_bibj, key=idynkey, Line 411  CADJ &     = comlev1_bibj, key=idynkey,
411  #ifdef ALLOW_OBCS  #ifdef ALLOW_OBCS
412  C--   For Stevens boundary conditions velocities need to be extrapolated  C--   For Stevens boundary conditions velocities need to be extrapolated
413  C     (copied) to a narrow strip outside the domain  C     (copied) to a narrow strip outside the domain
414           IF ( useOBCS ) THEN          IF ( useOBCS ) THEN
415            CALL OBCS_COPY_UV_N(            CALL OBCS_COPY_UV_N(
416       U         uVel(1-OLx,1-OLy,1,bi,bj),       U         uVel(1-OLx,1-OLy,1,bi,bj),
417       U         vVel(1-OLx,1-OLy,1,bi,bj),       U         vVel(1-OLx,1-OLy,1,bi,bj),
418       I         Nr, bi, bj, myThid )       I         Nr, bi, bj, myThid )
419           ENDIF          ENDIF
420  #endif /* ALLOW_OBCS */  #endif /* ALLOW_OBCS */
421    
422  C--     Start of dynamics loop  C--     Start of dynamics loop
# Line 494  CADJ &     = comlev1_bibj_k, key=kkey, b Line 498  CADJ &     = comlev1_bibj_k, key=kkey, b
498  # endif  # endif
499  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
500    
501  C--      Integrate hydrostatic balance for phiHyd with BC of  C--      Integrate hydrostatic balance for phiHyd with BC of phiHyd(z=0)=0
 C        phiHyd(z=0)=0  
502           IF ( implicitIntGravWave ) THEN           IF ( implicitIntGravWave ) THEN
503             CALL CALC_PHI_HYD(             CALL CALC_PHI_HYD(
504       I        bi,bj,iMin,iMax,jMin,jMax,k,       I        bi,bj,iMin,iMax,jMin,jMax,k,
# Line 561  CADJ &     = comlev1_bibj_k, key=kkey, b Line 564  CADJ &     = comlev1_bibj_k, key=kkey, b
564       I         myTime, myIter, myThid)       I         myTime, myIter, myThid)
565  #endif  #endif
566             ENDIF             ENDIF
567  C  
568             CALL TIMESTEP(             CALL TIMESTEP(
569       I         bi,bj,iMin,iMax,jMin,jMax,k,       I         bi,bj,iMin,iMax,jMin,jMax,k,
570       I         dPhiHydX,dPhiHydY, phiSurfX, phiSurfY,       I         dPhiHydX,dPhiHydY, phiSurfX, phiSurfY,

Legend:
Removed from v.1.164  
changed lines
  Added in v.1.165

  ViewVC Help
Powered by ViewVC 1.1.22