/[MITgcm]/MITgcm/pkg/mom_vecinv/mom_vecinv.F
ViewVC logotype

Diff of /MITgcm/pkg/mom_vecinv/mom_vecinv.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.24 by edhill, Thu Oct 7 21:52:29 2004 UTC revision 1.29 by jmc, Fri Nov 5 18:39:15 2004 UTC
# Line 66  C     == Functions == Line 66  C     == Functions ==
66        EXTERNAL DIFFERENT_MULTIPLE        EXTERNAL DIFFERENT_MULTIPLE
67    
68  C     == Local variables ==  C     == Local variables ==
       _RL      aF (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
69        _RL      vF (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL      vF (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
70        _RL      vrF (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL      vrF (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
71        _RL      uCf (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL      uCf (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
72        _RL      vCf (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL      vCf (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
73        _RL      mT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  c     _RL      mT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
       _RL      pF (1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
74        _RL del2u(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL del2u(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
75        _RL del2v(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL del2v(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
76        _RL tension(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL tension(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
77        _RL strain(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL strain(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
78        _RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
79        _RS r_hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS r_hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
       _RS xA(1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
       _RS yA(1-OLx:sNx+OLx,1-OLy:sNy+OLy)  
80        _RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
81        _RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
82        _RL dStar(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL dStar(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
# Line 95  C     hFacROpen        - Lopped cell fac Line 91  C     hFacROpen        - Lopped cell fac
91  C     hFacRClosed        and closed cell wall.  C     hFacRClosed        and closed cell wall.
92        _RL  rVelMaskOverride        _RL  rVelMaskOverride
93  C     xxxFac - On-off tracer parameters used for switching terms off.  C     xxxFac - On-off tracer parameters used for switching terms off.
       _RL  uDudxFac  
       _RL  AhDudxFac  
       _RL  A4DuxxdxFac  
       _RL  vDudyFac  
       _RL  AhDudyFac  
       _RL  A4DuyydyFac  
       _RL  rVelDudrFac  
94        _RL  ArDudrFac        _RL  ArDudrFac
       _RL  fuFac  
95        _RL  phxFac        _RL  phxFac
96        _RL  mtFacU  c     _RL  mtFacU
       _RL  uDvdxFac  
       _RL  AhDvdxFac  
       _RL  A4DvxxdxFac  
       _RL  vDvdyFac  
       _RL  AhDvdyFac  
       _RL  A4DvyydyFac  
       _RL  rVelDvdrFac  
97        _RL  ArDvdrFac        _RL  ArDvdrFac
       _RL  fvFac  
98        _RL  phyFac        _RL  phyFac
99        _RL  vForcFac  c     _RL  mtFacV
       _RL  mtFacV  
100        _RL wVelBottomOverride        _RL wVelBottomOverride
101        LOGICAL bottomDragTerms        LOGICAL bottomDragTerms
102        LOGICAL writeDiag        LOGICAL writeDiag
# Line 126  C     xxxFac - On-off tracer parameters Line 105  C     xxxFac - On-off tracer parameters
105        _RL vort3(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL vort3(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
106        _RL hDiv(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL hDiv(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
107    
108    #ifdef ALLOW_MNC
109          INTEGER offsets(9)
110    #endif
111    
112  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
113  C--   only the kDown part of fverU/V is set in this subroutine  C--   only the kDown part of fverU/V is set in this subroutine
114  C--   the kUp is still required  C--   the kUp is still required
# Line 144  C--   (at least in part) Line 127  C--   (at least in part)
127    
128  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
129        IF (useMNC .AND. snapshot_mnc .AND. writeDiag) THEN        IF (useMNC .AND. snapshot_mnc .AND. writeDiag) THEN
130          CALL MNC_CW_SET_UDIM('mom_vi', -1, myThid)          IF ((bi .EQ. 1).AND.(bj .EQ. 1).AND.(k .EQ. 1)) THEN
131          CALL MNC_CW_I_W_S('I','mom_vi',0,0,'iter',myIter,myThid)            CALL MNC_CW_SET_UDIM('mom_vi', -1, myThid)
132          CALL MNC_CW_SET_UDIM('mom_vi', 0, myThid)            CALL MNC_CW_I_W_S('I','mom_vi',0,0,'iter',myIter,myThid)
133              CALL MNC_CW_SET_UDIM('mom_vi', 0, myThid)
134            ENDIF
135            DO i = 1,9
136              offsets(i) = 0
137            ENDDO
138            offsets(3) = k
139    C       write(*,*) 'offsets = ',(offsets(i),i=1,9)
140        ENDIF        ENDIF
141  #endif /*  ALLOW_MNC  */  #endif /*  ALLOW_MNC  */
142    
143  C     Initialise intermediate terms  C     Initialise intermediate terms
144        DO J=1-OLy,sNy+OLy        DO J=1-OLy,sNy+OLy
145         DO I=1-OLx,sNx+OLx         DO I=1-OLx,sNx+OLx
         aF(i,j)   = 0.  
146          vF(i,j)   = 0.          vF(i,j)   = 0.
147          vrF(i,j)  = 0.          vrF(i,j)  = 0.
148          uCf(i,j)   = 0.          uCf(i,j)   = 0.
149          vCf(i,j)   = 0.          vCf(i,j)   = 0.
150          mT(i,j)   = 0.  c       mT(i,j)   = 0.
         pF(i,j)   = 0.  
151          del2u(i,j) = 0.          del2u(i,j) = 0.
152          del2v(i,j) = 0.          del2v(i,j) = 0.
153          dStar(i,j) = 0.          dStar(i,j) = 0.
# Line 178  C     Initialise intermediate terms Line 166  C     Initialise intermediate terms
166    
167  C--   Term by term tracer parmeters  C--   Term by term tracer parmeters
168  C     o U momentum equation  C     o U momentum equation
       uDudxFac     = afFacMom*1.  
       AhDudxFac    = vfFacMom*1.  
       A4DuxxdxFac  = vfFacMom*1.  
       vDudyFac     = afFacMom*1.  
       AhDudyFac    = vfFacMom*1.  
       A4DuyydyFac  = vfFacMom*1.  
       rVelDudrFac  = afFacMom*1.  
169        ArDudrFac    = vfFacMom*1.        ArDudrFac    = vfFacMom*1.
170        mTFacU       = mtFacMom*1.  c     mTFacU       = mtFacMom*1.
       fuFac        = cfFacMom*1.  
171        phxFac       = pfFacMom*1.        phxFac       = pfFacMom*1.
172  C     o V momentum equation  C     o V momentum equation
       uDvdxFac     = afFacMom*1.  
       AhDvdxFac    = vfFacMom*1.  
       A4DvxxdxFac  = vfFacMom*1.  
       vDvdyFac     = afFacMom*1.  
       AhDvdyFac    = vfFacMom*1.  
       A4DvyydyFac  = vfFacMom*1.  
       rVelDvdrFac  = afFacMom*1.  
173        ArDvdrFac    = vfFacMom*1.        ArDvdrFac    = vfFacMom*1.
174        mTFacV       = mtFacMom*1.  c     mTFacV       = mtFacMom*1.
       fvFac        = cfFacMom*1.  
175        phyFac       = pfFacMom*1.        phyFac       = pfFacMom*1.
       vForcFac     = foFacMom*1.  
176    
177        IF (     no_slip_bottom        IF (     no_slip_bottom
178       &    .OR. bottomDragQuadratic.NE.0.       &    .OR. bottomDragQuadratic.NE.0.
# Line 220  C-- with stagger time stepping, grad Phi Line 191  C-- with stagger time stepping, grad Phi
191  C--   Calculate open water fraction at vorticity points  C--   Calculate open water fraction at vorticity points
192        CALL MOM_CALC_HFACZ(bi,bj,k,hFacZ,r_hFacZ,myThid)        CALL MOM_CALC_HFACZ(bi,bj,k,hFacZ,r_hFacZ,myThid)
193    
 C---- Calculate common quantities used in both U and V equations  
 C     Calculate tracer cell face open areas  
       DO j=1-OLy,sNy+OLy  
        DO i=1-OLx,sNx+OLx  
         xA(i,j) = _dyG(i,j,bi,bj)  
      &   *drF(k)*_hFacW(i,j,k,bi,bj)  
         yA(i,j) = _dxG(i,j,bi,bj)  
      &   *drF(k)*_hFacS(i,j,k,bi,bj)  
        ENDDO  
       ENDDO  
   
194  C     Make local copies of horizontal flow field  C     Make local copies of horizontal flow field
195        DO j=1-OLy,sNy+OLy        DO j=1-OLy,sNy+OLy
196         DO i=1-OLx,sNx+OLx         DO i=1-OLx,sNx+OLx
# Line 267  C      Calculate del^2 u and del^2 v for Line 227  C      Calculate del^2 u and del^2 v for
227         ENDIF         ENDIF
228  C      Calculate dissipation terms for U and V equations  C      Calculate dissipation terms for U and V equations
229  C      in terms of vorticity and divergence  C      in terms of vorticity and divergence
230         IF (viscAh.NE.0. .OR. viscA4.NE.0.         IF (    viscAhD.NE.0. .OR. viscAhZ.NE.0.
231       &    .OR.  viscAhGrid.NE.0. .OR. viscA4Grid.NE.0.       &    .OR. viscA4D.NE.0. .OR. viscA4Z.NE.0.
232       &    .OR.  viscC2leith.NE.0. .OR. viscC4leith.NE.0.       &    .OR. viscAhGrid.NE.0. .OR. viscA4Grid.NE.0.
233         &    .OR. viscC2leith.NE.0. .OR. viscC4leith.NE.0.
234       &    ) THEN       &    ) THEN
235           CALL MOM_VI_HDISSIP(bi,bj,k,hDiv,vort3,hFacZ,dStar,zStar,           CALL MOM_VI_HDISSIP(bi,bj,k,hDiv,vort3,hFacZ,dStar,zStar,
236       O                       uDiss,vDiss,       O                       uDiss,vDiss,
# Line 430  C--   Horizontal Coriolis terms Line 391  C--   Horizontal Coriolis terms
391           ENDIF           ENDIF
392  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
393           IF (useMNC .AND. snapshot_mnc) THEN           IF (useMNC .AND. snapshot_mnc) THEN
394             CALL MNC_CW_RL_W('D','mom_vi',0,0, 'fV', uCf, myThid)             CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj, 'fV', uCf,
395             CALL MNC_CW_RL_W('D','mom_vi',0,0, 'fU', vCf, myThid)       &          offsets, myThid)
396               CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj, 'fU', vCf,
397         &          offsets, myThid)
398           ENDIF           ENDIF
399  #endif /*  ALLOW_MNC  */  #endif /*  ALLOW_MNC  */
400         ENDIF         ENDIF
# Line 473  c      CALL MOM_VI_V_CORIOLIS_C4(bi,bj,K Line 436  c      CALL MOM_VI_V_CORIOLIS_C4(bi,bj,K
436           ENDIF           ENDIF
437  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
438           IF (useMNC .AND. snapshot_mnc) THEN           IF (useMNC .AND. snapshot_mnc) THEN
439             CALL MNC_CW_RL_W('D','mom_vi',0,0, 'zV', uCf, myThid)             CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj, 'zV', uCf,
440             CALL MNC_CW_RL_W('D','mom_vi',0,0, 'zU', vCf, myThid)       &          offsets, myThid)
441               CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj, 'zU', vCf,
442         &          offsets, myThid)
443           ENDIF           ENDIF
444  #endif /*  ALLOW_MNC  */  #endif /*  ALLOW_MNC  */
445         ENDIF         ENDIF
# Line 526  C--   Bernoulli term Line 491  C--   Bernoulli term
491           ENDIF           ENDIF
492  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
493           IF (useMNC .AND. snapshot_mnc) THEN           IF (useMNC .AND. snapshot_mnc) THEN
494             CALL MNC_CW_RL_W('D','mom_vi',0,0, 'KEx', uCf, myThid)             CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj, 'KEx', uCf,
495             CALL MNC_CW_RL_W('D','mom_vi',0,0, 'KEy', vCf, myThid)       &          offsets, myThid)
496           ENDIF             CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj, 'KEy', vCf,
497         &          offsets, myThid)
498            ENDIF
499  #endif /*  ALLOW_MNC  */  #endif /*  ALLOW_MNC  */
500         ENDIF         ENDIF
501    
# Line 567  C--   Set du/dt & dv/dt on boundaries to Line 534  C--   Set du/dt & dv/dt on boundaries to
534          ENDIF          ENDIF
535  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
536          IF (useMNC .AND. snapshot_mnc) THEN          IF (useMNC .AND. snapshot_mnc) THEN
537            CALL MNC_CW_RL_W('D','mom_vi',0,0,'Ds',strain, myThid)            CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'Ds',strain,
538            CALL MNC_CW_RL_W('D','mom_vi',0,0,'Dt',tension, myThid)       &          offsets, myThid)
539            CALL MNC_CW_RL_W('D','mom_vi',0,0,'Du',uDiss, myThid)            CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'Dt',tension,
540            CALL MNC_CW_RL_W('D','mom_vi',0,0,'Dv',vDiss, myThid)       &          offsets, myThid)
541            CALL MNC_CW_RL_W('D','mom_vi',0,0,'Z3',vort3, myThid)            CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'Du',uDiss,
542            CALL MNC_CW_RL_W('D','mom_vi',0,0,'W3',omega3, myThid)       &          offsets, myThid)
543            CALL MNC_CW_RL_W('D','mom_vi',0,0,'KE',KE, myThid)            CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'Dv',vDiss,
544            CALL MNC_CW_RL_W('D','mom_vi',0,0,'D', hdiv, myThid)       &          offsets, myThid)
545              CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'Z3',vort3,
546         &          offsets, myThid)
547              CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'W3',omega3,
548         &          offsets, myThid)
549              CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'KE',KE,
550         &          offsets, myThid)
551              CALL MNC_CW_RL_W_OFFSET('D','mom_vi',bi,bj,'D', hdiv,
552         &          offsets, myThid)
553          ENDIF          ENDIF
554  #endif /*  ALLOW_MNC  */  #endif /*  ALLOW_MNC  */
555        ENDIF        ENDIF

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.29

  ViewVC Help
Powered by ViewVC 1.1.22