/[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.108 by heimbach, Fri Sep 17 23:02:00 2004 UTC revision 1.122 by jmc, Sat Jul 30 23:39:48 2005 UTC
# Line 30  C     | pressure such that the resulting Line 30  C     | pressure such that the resulting
30  C     | with the free-surface evolution or the rigid-lid:  C     | with the free-surface evolution or the rigid-lid:
31  C     |   U[n] = U* + dt x d/dx P  C     |   U[n] = U* + dt x d/dx P
32  C     |   V[n] = V* + dt x d/dy P  C     |   V[n] = V* + dt x d/dy P
33    C     |   W[n] = W* + dt x d/dz P  (NH mode)
34  C     |  C     |
35  C     | "Calculation of Gs"  C     | "Calculation of Gs"
36  C     | ===================  C     | ===================
# Line 90  C     == Global variables === Line 91  C     == Global variables ===
91  C     !CALLING SEQUENCE:  C     !CALLING SEQUENCE:
92  C     DYNAMICS()  C     DYNAMICS()
93  C      |  C      |
94    C      |-- CALC_EP_FORCING
95    C      |
96  C      |-- CALC_GRAD_PHI_SURF  C      |-- CALC_GRAD_PHI_SURF
97  C      |  C      |
98  C      |-- CALC_VISCOSITY  C      |-- CALC_VISCOSITY
# Line 104  C      |-- TIMESTEP Line 107  C      |-- TIMESTEP
107  C      |  C      |
108  C      |-- OBCS_APPLY_UV  C      |-- OBCS_APPLY_UV
109  C      |  C      |
110    C      |-- MOM_U_IMPLICIT_R      
111    C      |-- MOM_V_IMPLICIT_R      
112    C      |
113  C      |-- IMPLDIFF        C      |-- IMPLDIFF      
114  C      |  C      |
115  C      |-- OBCS_APPLY_UV  C      |-- OBCS_APPLY_UV
116  C      |  C      |
117  C      |-- CALL TIMEAVE_CUMUL_1T  C      |-- CALC_GW
118  C      |-- CALL DEBUG_STATS_RL  C      |
119    C      |-- DIAGNOSTICS_FILL
120    C      |-- DEBUG_STATS_RL
121    
122  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
123  C     == Routine arguments ==  C     == Routine arguments ==
# Line 122  C     myThid - Thread number for this in Line 130  C     myThid - Thread number for this in
130    
131  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
132  C     == Local variables  C     == Local variables
133  C     fVer[STUV]               o fVer: Vertical flux term - note fVer  C     fVer[UV]               o fVer: Vertical flux term - note fVer
134  C                                      is "pipelined" in the vertical  C                                    is "pipelined" in the vertical
135  C                                      so we need an fVer for each  C                                    so we need an fVer for each
136  C                                      variable.  C                                    variable.
137  C     phiHydC    :: hydrostatic potential anomaly at cell center  C     phiHydC    :: hydrostatic potential anomaly at cell center
138  C                   In z coords phiHyd is the hydrostatic potential  C                   In z coords phiHyd is the hydrostatic potential
139  C                      (=pressure/rho0) anomaly  C                      (=pressure/rho0) anomaly
# Line 134  C     phiHydF    :: hydrostatic potentia Line 142  C     phiHydF    :: hydrostatic potentia
142  C     dPhiHydX,Y :: Gradient (X & Y directions) of hydrostatic potential anom.  C     dPhiHydX,Y :: Gradient (X & Y directions) of hydrostatic potential anom.
143  C     phiSurfX,  ::  gradient of Surface potential (Pressure/rho, ocean)  C     phiSurfX,  ::  gradient of Surface potential (Pressure/rho, ocean)
144  C     phiSurfY             or geopotential (atmos) in X and Y direction  C     phiSurfY             or geopotential (atmos) in X and Y direction
145    C     guDissip   :: dissipation tendency (all explicit terms), u component
146    C     gvDissip   :: dissipation tendency (all explicit terms), v component
147  C     iMin, iMax     - Ranges and sub-block indices on which calculations  C     iMin, iMax     - Ranges and sub-block indices on which calculations
148  C     jMin, jMax       are applied.  C     jMin, jMax       are applied.
149  C     bi, bj  C     bi, bj
# Line 148  C                      index into fVerTe Line 158  C                      index into fVerTe
158        _RL dPhiHydY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)        _RL dPhiHydY(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
159        _RL phiSurfX(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL phiSurfX(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
160        _RL phiSurfY(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL phiSurfY(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
161          _RL guDissip(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
162          _RL gvDissip(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
163        _RL KappaRU (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)        _RL KappaRU (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
164        _RL KappaRV (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)        _RL KappaRV (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr)
165    
# Line 157  C                      index into fVerTe Line 169  C                      index into fVerTe
169        INTEGER i, j        INTEGER i, j
170        INTEGER k, km1, kp1, kup, kDown        INTEGER k, km1, kp1, kup, kDown
171    
172        LOGICAL  DIFFERENT_MULTIPLE  #ifdef ALLOW_DIAGNOSTICS
173        EXTERNAL DIFFERENT_MULTIPLE        _RL tmpFac
174    #endif /* ALLOW_DIAGNOSTICS */
175    
176    
177  C---    The algorithm...  C---    The algorithm...
178  C  C
# Line 256  C     uninitialised but inert locations. Line 270  C     uninitialised but inert locations.
270  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
271  cph(  cph(
272  c--   need some re-initialisation here to break dependencies  c--   need some re-initialisation here to break dependencies
 c--   totphihyd is assumed zero from ini_pressure, i.e.  
 c--   avoiding iterate pressure p = integral of (g*rho(p)*dz)  
273  cph)  cph)
274             totPhiHyd(i,j,k,bi,bj) = 0. _d 0             gU(i,j,k,bi,bj) = 0. _d 0
275             gu(i,j,k,bi,bj) = 0. _d 0             gV(i,j,k,bi,bj) = 0. _d 0
            gv(i,j,k,bi,bj) = 0. _d 0  
276  #endif  #endif
277            ENDDO            ENDDO
278           ENDDO           ENDDO
# Line 278  cph) Line 289  cph)
289            dPhiHydY(i,j)  = 0. _d 0            dPhiHydY(i,j)  = 0. _d 0
290            phiSurfX(i,j)  = 0. _d 0            phiSurfX(i,j)  = 0. _d 0
291            phiSurfY(i,j)  = 0. _d 0            phiSurfY(i,j)  = 0. _d 0
292              guDissip(i,j)  = 0. _d 0
293              gvDissip(i,j)  = 0. _d 0
294           ENDDO           ENDDO
295          ENDDO          ENDDO
296    
# Line 366  C        and step forward storing the re Line 379  C        and step forward storing the re
379  #ifdef ALLOW_MOM_FLUXFORM  #ifdef ALLOW_MOM_FLUXFORM
380             IF (.NOT. vectorInvariantMomentum) CALL MOM_FLUXFORM(             IF (.NOT. vectorInvariantMomentum) CALL MOM_FLUXFORM(
381       I         bi,bj,iMin,iMax,jMin,jMax,k,kup,kDown,       I         bi,bj,iMin,iMax,jMin,jMax,k,kup,kDown,
382       I         dPhiHydX,dPhiHydY,KappaRU,KappaRV,       I         KappaRU, KappaRV,
383       U         fVerU, fVerV,       U         fVerU, fVerV,
384         O         guDissip, gvDissip,
385       I         myTime, myIter, myThid)       I         myTime, myIter, myThid)
386  #endif  #endif
387  #ifdef ALLOW_MOM_VECINV  #ifdef ALLOW_MOM_VECINV
388             IF (vectorInvariantMomentum) CALL MOM_VECINV(             IF (vectorInvariantMomentum) CALL MOM_VECINV(
389       I         bi,bj,iMin,iMax,jMin,jMax,k,kup,kDown,       I         bi,bj,iMin,iMax,jMin,jMax,k,kup,kDown,
390       I         dPhiHydX,dPhiHydY,KappaRU,KappaRV,       I         KappaRU, KappaRV,
391       U         fVerU, fVerV,       U         fVerU, fVerV,
392         O         guDissip, gvDissip,
393       I         myTime, myIter, myThid)       I         myTime, myIter, myThid)
394  #endif  #endif
395             CALL TIMESTEP(             CALL TIMESTEP(
396       I         bi,bj,iMin,iMax,jMin,jMax,k,       I         bi,bj,iMin,iMax,jMin,jMax,k,
397       I         dPhiHydX,dPhiHydY, phiSurfX, phiSurfY,       I         dPhiHydX,dPhiHydY, phiSurfX, phiSurfY,
398         I         guDissip, gvDissip,
399       I         myTime, myIter, myThid)       I         myTime, myIter, myThid)
400    
401  #ifdef   ALLOW_OBCS  #ifdef   ALLOW_OBCS
# Line 412  CADJ STORE gU(:,:,:,bi,bj) = comlev1_bib Line 428  CADJ STORE gU(:,:,:,bi,bj) = comlev1_bib
428  #endif    /* ALLOW_AUTODIFF_TAMC */  #endif    /* ALLOW_AUTODIFF_TAMC */
429            CALL IMPLDIFF(            CALL IMPLDIFF(
430       I         bi, bj, iMin, iMax, jMin, jMax,       I         bi, bj, iMin, iMax, jMin, jMax,
431       I         deltaTmom, KappaRU,recip_HFacW,       I         0, KappaRU,recip_HFacW,
432       U         gU,       U         gU,
433       I         myThid )       I         myThid )
434  #ifdef    ALLOW_AUTODIFF_TAMC  #ifdef    ALLOW_AUTODIFF_TAMC
# Line 421  CADJ STORE gV(:,:,:,bi,bj) = comlev1_bib Line 437  CADJ STORE gV(:,:,:,bi,bj) = comlev1_bib
437  #endif    /* ALLOW_AUTODIFF_TAMC */  #endif    /* ALLOW_AUTODIFF_TAMC */
438            CALL IMPLDIFF(            CALL IMPLDIFF(
439       I         bi, bj, iMin, iMax, jMin, jMax,       I         bi, bj, iMin, iMax, jMin, jMax,
440       I         deltaTmom, KappaRV,recip_HFacS,       I         0, KappaRV,recip_HFacS,
441       U         gV,       U         gV,
442       I         myThid )       I         myThid )
443          ENDIF          ENDIF
# Line 442  CADJ STORE vVelD(:,:,:,bi,bj) = comlev1_ Line 458  CADJ STORE vVelD(:,:,:,bi,bj) = comlev1_
458  #endif    /* ALLOW_AUTODIFF_TAMC */  #endif    /* ALLOW_AUTODIFF_TAMC */
459            CALL IMPLDIFF(            CALL IMPLDIFF(
460       I         bi, bj, iMin, iMax, jMin, jMax,       I         bi, bj, iMin, iMax, jMin, jMax,
461       I         deltaTmom, KappaRU,recip_HFacW,       I         0, KappaRU,recip_HFacW,
462       U         vVelD,       U         vVelD,
463       I         myThid )       I         myThid )
464  #ifdef    ALLOW_AUTODIFF_TAMC  #ifdef    ALLOW_AUTODIFF_TAMC
# Line 450  CADJ STORE uVelD(:,:,:,bi,bj) = comlev1_ Line 466  CADJ STORE uVelD(:,:,:,bi,bj) = comlev1_
466  #endif    /* ALLOW_AUTODIFF_TAMC */  #endif    /* ALLOW_AUTODIFF_TAMC */
467            CALL IMPLDIFF(            CALL IMPLDIFF(
468       I         bi, bj, iMin, iMax, jMin, jMax,       I         bi, bj, iMin, iMax, jMin, jMax,
469       I         deltaTmom, KappaRV,recip_HFacS,       I         0, KappaRV,recip_HFacS,
470       U         uVelD,       U         uVelD,
471       I         myThid )       I         myThid )
472          ENDIF          ENDIF
# Line 460  C--     End implicit Vertical advection Line 476  C--     End implicit Vertical advection
476         ENDDO         ENDDO
477        ENDDO        ENDDO
478    
479    #ifdef ALLOW_OBCS
480          IF (useOBCS) THEN
481           CALL OBCS_PRESCRIBE_EXCHANGES(myThid)
482          ENDIF
483    #endif
484    
485    C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
486    
487    #ifdef ALLOW_NONHYDROSTATIC
488    C--   Step forward W field in N-H algorithm
489          IF ( momStepping .AND. nonHydrostatic ) THEN
490    #ifdef ALLOW_DEBUG
491              IF ( debugLevel .GE. debLevB )
492         &     CALL DEBUG_CALL('CALC_GW',myThid)
493    #endif
494             CALL TIMER_START('CALC_GW          [DYNAMICS]',myThid)
495             CALL CALC_GW( myTime, myIter, myThid )
496             CALL TIMER_STOP ('CALC_GW          [DYNAMICS]',myThid)
497          ENDIF
498    #endif
499    
500    C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
501    
502  Cml(  Cml(
503  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
504  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
# Line 468  C      CALL REMOVE_MEAN_RL( 1, phiHydLow Line 507  C      CALL REMOVE_MEAN_RL( 1, phiHydLow
507  C     &                'phiHydLow', myThid )  C     &                'phiHydLow', myThid )
508  Cml)  Cml)
509    
510    #ifdef ALLOW_DIAGNOSTICS
511          IF ( usediagnostics ) THEN
512    
513           CALL DIAGNOSTICS_FILL(totPhihyd,'PHIHYD  ',0,Nr,0,1,1,myThid)
514           CALL DIAGNOSTICS_FILL(phiHydLow,'PHIBOT  ',0, 1,0,1,1,myThid)
515    
516           tmpFac = 1. _d 0
517           CALL DIAGNOSTICS_SCALE_FILL(totPhihyd,tmpFac,2,
518         &                                 'PHIHYDSQ',0,Nr,0,1,1,myThid)
519    
520           CALL DIAGNOSTICS_SCALE_FILL(phiHydLow,tmpFac,2,
521         &                                 'PHIBOTSQ',0, 1,0,1,1,myThid)
522    
523          ENDIF
524    #endif /* ALLOW_DIAGNOSTICS */
525          
526  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
527        If ( debugLevel .GE. debLevB ) THEN        If ( debugLevel .GE. debLevB ) THEN
528         CALL DEBUG_STATS_RL(1,EtaN,'EtaN (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(1,EtaN,'EtaN (DYNAMICS)',myThid)
# Line 476  Cml) Line 531  Cml)
531         CALL DEBUG_STATS_RL(Nr,wVel,'Wvel (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(Nr,wVel,'Wvel (DYNAMICS)',myThid)
532         CALL DEBUG_STATS_RL(Nr,theta,'Theta (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(Nr,theta,'Theta (DYNAMICS)',myThid)
533         CALL DEBUG_STATS_RL(Nr,salt,'Salt (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(Nr,salt,'Salt (DYNAMICS)',myThid)
534         CALL DEBUG_STATS_RL(Nr,Gu,'Gu (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(Nr,gU,'Gu (DYNAMICS)',myThid)
535         CALL DEBUG_STATS_RL(Nr,Gv,'Gv (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(Nr,gV,'Gv (DYNAMICS)',myThid)
536         CALL DEBUG_STATS_RL(Nr,Gt,'Gt (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(Nr,gT,'Gt (DYNAMICS)',myThid)
537         CALL DEBUG_STATS_RL(Nr,Gs,'Gs (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(Nr,gS,'Gs (DYNAMICS)',myThid)
538         CALL DEBUG_STATS_RL(Nr,GuNm1,'GuNm1 (DYNAMICS)',myThid)  #ifndef ALLOW_ADAMSBASHFORTH_3
539         CALL DEBUG_STATS_RL(Nr,GvNm1,'GvNm1 (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(Nr,guNm1,'GuNm1 (DYNAMICS)',myThid)
540         CALL DEBUG_STATS_RL(Nr,GtNm1,'GtNm1 (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(Nr,gvNm1,'GvNm1 (DYNAMICS)',myThid)
541         CALL DEBUG_STATS_RL(Nr,GsNm1,'GsNm1 (DYNAMICS)',myThid)         CALL DEBUG_STATS_RL(Nr,gtNm1,'GtNm1 (DYNAMICS)',myThid)
542           CALL DEBUG_STATS_RL(Nr,gsNm1,'GsNm1 (DYNAMICS)',myThid)
543    #endif
544        ENDIF        ENDIF
545  #endif  #endif
546    

Legend:
Removed from v.1.108  
changed lines
  Added in v.1.122

  ViewVC Help
Powered by ViewVC 1.1.22