/[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.143 by gforget, Mon Oct 26 21:48:43 2009 UTC revision 1.146 by jmc, Fri May 14 23:21:02 2010 UTC
# Line 15  C     !INTERFACE: Line 15  C     !INTERFACE:
15        SUBROUTINE DYNAMICS(myTime, myIter, myThid)        SUBROUTINE DYNAMICS(myTime, myIter, myThid)
16  C     !DESCRIPTION: \bv  C     !DESCRIPTION: \bv
17  C     *==========================================================*  C     *==========================================================*
18  C     | SUBROUTINE DYNAMICS                                        C     | SUBROUTINE DYNAMICS
19  C     | o Controlling routine for the explicit part of the model    C     | o Controlling routine for the explicit part of the model
20  C     |   dynamics.                                                C     |   dynamics.
21  C     *==========================================================*  C     *==========================================================*
22  C     | This routine evaluates the "dynamics" terms for each        C     | This routine evaluates the "dynamics" terms for each
23  C     | block of ocean in turn. Because the blocks of ocean have    C     | block of ocean in turn. Because the blocks of ocean have
24  C     | overlap regions they are independent of one another.        C     | overlap regions they are independent of one another.
25  C     | If terms involving lateral integrals are needed in this    C     | If terms involving lateral integrals are needed in this
26  C     | routine care will be needed. Similarly finite-difference    C     | routine care will be needed. Similarly finite-difference
27  C     | operations with stencils wider than the overlap region      C     | operations with stencils wider than the overlap region
28  C     | require special consideration.                              C     | require special consideration.
29  C     | The algorithm...  C     | The algorithm...
30  C     |  C     |
31  C     | "Correction Step"  C     | "Correction Step"
# Line 146  C     myThid :: Thread number for this i Line 146  C     myThid :: Thread number for this i
146        INTEGER myIter        INTEGER myIter
147        INTEGER myThid        INTEGER myThid
148    
149    C     !FUNCTIONS:
150    #ifdef ALLOW_DIAGNOSTICS
151          LOGICAL  DIAGNOSTICS_IS_ON
152          EXTERNAL DIAGNOSTICS_IS_ON
153    #endif
154    
155  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
156  C     == Local variables  C     == Local variables
157  C     fVer[UV]               o fVer: Vertical flux term - note fVer  C     fVer[UV]               o fVer: Vertical flux term - note fVer
# Line 168  C     iMin, iMax     - Ranges and sub-bl Line 174  C     iMin, iMax     - Ranges and sub-bl
174  C     jMin, jMax       are applied.  C     jMin, jMax       are applied.
175  C     bi, bj  C     bi, bj
176  C     k, kup,        - Index for layer above and below. kup and kDown  C     k, kup,        - Index for layer above and below. kup and kDown
177  C     kDown, km1       are switched with layer to be the appropriate  C     kDown, km1       are switched with layer to be the appropriate
178  C                      index into fVerTerm.  C                      index into fVerTerm.
179        _RL fVerU   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)        _RL fVerU   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
180        _RL fVerV   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)        _RL fVerV   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
# Line 190  C                      index into fVerTe Line 196  C                      index into fVerTe
196        INTEGER k, km1, kp1, kup, kDown        INTEGER k, km1, kp1, kup, kDown
197    
198  #ifdef ALLOW_DIAGNOSTICS  #ifdef ALLOW_DIAGNOSTICS
199          LOGICAL dPhiHydDiagIsOn
200        _RL tmpFac        _RL tmpFac
201  #endif /* ALLOW_DIAGNOSTICS */  #endif /* ALLOW_DIAGNOSTICS */
202    
# Line 244  CEOP Line 251  CEOP
251       &   CALL DEBUG_ENTER( 'DYNAMICS', myThid )       &   CALL DEBUG_ENTER( 'DYNAMICS', myThid )
252  #endif  #endif
253    
254    #ifdef ALLOW_DIAGNOSTICS
255          dPhiHydDiagIsOn = .FALSE.
256          IF ( useDiagnostics )
257         &  dPhiHydDiagIsOn = DIAGNOSTICS_IS_ON( 'Um_dPHdx', myThid )
258         &               .OR. DIAGNOSTICS_IS_ON( 'Vm_dPHdy', myThid )
259    #endif
260    
261  C-- Call to routine for calculation of  C-- Call to routine for calculation of
262  C   Eliassen-Palm-flux-forced U-tendency,  C   Eliassen-Palm-flux-forced U-tendency,
263  C   if desired:  C   if desired:
# Line 310  cph) Line 324  cph)
324            fVerV  (i,j,2) = 0. _d 0            fVerV  (i,j,2) = 0. _d 0
325            phiHydF (i,j)  = 0. _d 0            phiHydF (i,j)  = 0. _d 0
326            phiHydC (i,j)  = 0. _d 0            phiHydC (i,j)  = 0. _d 0
327    #ifndef INCLUDE_PHIHYD_CALCULATION_CODE
328            dPhiHydX(i,j)  = 0. _d 0            dPhiHydX(i,j)  = 0. _d 0
329            dPhiHydY(i,j)  = 0. _d 0            dPhiHydY(i,j)  = 0. _d 0
330    #endif
331            phiSurfX(i,j)  = 0. _d 0            phiSurfX(i,j)  = 0. _d 0
332            phiSurfY(i,j)  = 0. _d 0            phiSurfY(i,j)  = 0. _d 0
333            guDissip(i,j)  = 0. _d 0            guDissip(i,j)  = 0. _d 0
# Line 395  C--       kDown  Cycles through 2,1 to p Line 411  C--       kDown  Cycles through 2,1 to p
411            kup  = 1+MOD(k+1,2)            kup  = 1+MOD(k+1,2)
412            kDown= 1+MOD(k,2)            kDown= 1+MOD(k,2)
413    
414  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
415           kkey = (idynkey-1)*Nr + k           kkey = (idynkey-1)*Nr + k
416  c  c
417  CADJ STORE totphihyd (:,:,k,bi,bj)  CADJ STORE totphihyd (:,:,k,bi,bj)
# Line 451  CADJ &     = comlev1_bibj_k, key=kkey, b Line 467  CADJ &     = comlev1_bibj_k, key=kkey, b
467  # endif  # endif
468  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
469    
470  C--      Integrate hydrostatic balance for phiHyd with BC of  C--      Integrate hydrostatic balance for phiHyd with BC of
471  C        phiHyd(z=0)=0  C        phiHyd(z=0)=0
472           IF ( implicitIntGravWave ) THEN           IF ( implicitIntGravWave ) THEN
473             CALL CALC_PHI_HYD(             CALL CALC_PHI_HYD(
# Line 468  C        phiHyd(z=0)=0 Line 484  C        phiHyd(z=0)=0
484       O        phiHydC, dPhiHydX, dPhiHydY,       O        phiHydC, dPhiHydX, dPhiHydY,
485       I        myTime, myIter, myThid )       I        myTime, myIter, myThid )
486           ENDIF           ENDIF
487    #ifdef ALLOW_DIAGNOSTICS
488             IF ( dPhiHydDiagIsOn ) THEN
489               tmpFac = -1. _d 0
490               CALL DIAGNOSTICS_SCALE_FILL( dPhiHydX, tmpFac, 1,
491         &                           'Um_dPHdx', k, 1, 2, bi, bj, myThid )
492               CALL DIAGNOSTICS_SCALE_FILL( dPhiHydY, tmpFac, 1,
493         &                           'Vm_dPHdy', k, 1, 2, bi, bj, myThid )
494             ENDIF
495    #endif /* ALLOW_DIAGNOSTICS */
496    
497  C--      Calculate accelerations in the momentum equations (gU, gV, ...)  C--      Calculate accelerations in the momentum equations (gU, gV, ...)
498  C        and step forward storing the result in gU, gV, etc...  C        and step forward storing the result in gU, gV, etc...
# Line 497  C Line 522  C
522             ELSE             ELSE
523  #ifdef ALLOW_MOM_VECINV  #ifdef ALLOW_MOM_VECINV
524  C  C
525  # ifdef ALLOW_AUTODIFF_TAMC  # ifdef ALLOW_AUTODIFF_TAMC
526  #  ifdef NONLIN_FRSURF  #  ifdef NONLIN_FRSURF
527  CADJ STORE fVerU(:,:,:)  CADJ STORE fVerU(:,:,:)
528  CADJ &     = comlev1_bibj_k, key=kkey, byte=isbyte  CADJ &     = comlev1_bibj_k, key=kkey, byte=isbyte
# Line 632  Cml( Line 657  Cml(
657  C     In order to compare the variance of phiHydLow of a p/z-coordinate  C     In order to compare the variance of phiHydLow of a p/z-coordinate
658  C     run with etaH of a z/p-coordinate run the drift of phiHydLow  C     run with etaH of a z/p-coordinate run the drift of phiHydLow
659  C     has to be removed by something like the following subroutine:  C     has to be removed by something like the following subroutine:
660  C      CALL REMOVE_MEAN_RL( 1, phiHydLow, maskH, maskH, rA, drF,  C      CALL REMOVE_MEAN_RL( 1, phiHydLow, maskInC, maskInC, rA, drF,
661  C     &                'phiHydLow', myTime, myThid )  C     &                     'phiHydLow', myTime, myThid )
662  Cml)  Cml)
663    
664  #ifdef ALLOW_DIAGNOSTICS  #ifdef ALLOW_DIAGNOSTICS
# Line 674  Cml) Line 699  Cml)
699  #endif  #endif
700    
701  #ifdef DYNAMICS_GUGV_EXCH_CHECK  #ifdef DYNAMICS_GUGV_EXCH_CHECK
702  C- jmc: For safety checking only: This Exchange here should not change  C- jmc: For safety checking only: This Exchange here should not change
703  C       the solution. If solution changes, it means something is wrong,  C       the solution. If solution changes, it means something is wrong,
704  C       but it does not mean that it is less wrong with this exchange.  C       but it does not mean that it is less wrong with this exchange.
705        IF ( debugLevel .GT. debLevB ) THEN        IF ( debugLevel .GT. debLevB ) THEN
706         CALL EXCH_UV_XYZ_RL(gU,gV,.TRUE.,myThid)         CALL EXCH_UV_XYZ_RL(gU,gV,.TRUE.,myThid)

Legend:
Removed from v.1.143  
changed lines
  Added in v.1.146

  ViewVC Help
Powered by ViewVC 1.1.22