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

Diff of /MITgcm/pkg/mom_fluxform/mom_fluxform.F

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

revision 1.7 by adcroft, Thu Nov 7 21:51:15 2002 UTC revision 1.8 by jmc, Sun Jan 26 21:18:50 2003 UTC
# Line 35  C !INTERFACE: ========================== Line 35  C !INTERFACE: ==========================
35       I        bi,bj,iMin,iMax,jMin,jMax,k,kUp,kDown,       I        bi,bj,iMin,iMax,jMin,jMax,k,kUp,kDown,
36       I        phi_hyd,KappaRU,KappaRV,       I        phi_hyd,KappaRU,KappaRV,
37       U        fVerU, fVerV,       U        fVerU, fVerV,
38       I        myCurrentTime,myIter,myThid)       I        myTime,myIter,myThid)
39    
40  C !DESCRIPTION:  C !DESCRIPTION:
41  C Calculates all the horizontal accelerations except for the implicit surface  C Calculates all the horizontal accelerations except for the implicit surface
# Line 63  C  KappaRU              :: vertical visc Line 63  C  KappaRU              :: vertical visc
63  C  KappaRV              :: vertical viscosity  C  KappaRV              :: vertical viscosity
64  C  fVerU                :: vertical flux of U, 2 1/2 dim for pipe-lining  C  fVerU                :: vertical flux of U, 2 1/2 dim for pipe-lining
65  C  fVerV                :: vertical flux of V, 2 1/2 dim for pipe-lining  C  fVerV                :: vertical flux of V, 2 1/2 dim for pipe-lining
66  C  myCurrentTime        :: current time  C  myTime               :: current time
67  C  myIter               :: current time-step number  C  myIter               :: current time-step number
68  C  myThid               :: thread number  C  myThid               :: thread number
69        INTEGER bi,bj,iMin,iMax,jMin,jMax        INTEGER bi,bj,iMin,iMax,jMin,jMax
# Line 73  C  myThid               :: thread number Line 73  C  myThid               :: thread number
73        _RL KappaRV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)        _RL KappaRV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
74        _RL fVerU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)        _RL fVerU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
75        _RL fVerV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)        _RL fVerV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
76        _RL     myCurrentTime        _RL     myTime
77        INTEGER myIter        INTEGER myIter
78        INTEGER myThid        INTEGER myThid
79    
# Line 119  C     uDudxFac, AhDudxFac, etc ... indiv Line 119  C     uDudxFac, AhDudxFac, etc ... indiv
119        _RL  vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL  vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
120        _RL  uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL  uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
121        _RL  vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL  vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
122          _RL  rTransU(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
123          _RL  rTransV(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
124  C     I,J,K - Loop counters  C     I,J,K - Loop counters
125  C     rVelMaskOverride - Factor for imposing special surface boundary conditions  C     rVelMaskOverride - Factor for imposing special surface boundary conditions
126  C                        ( set according to free-surface condition ).  C                        ( set according to free-surface condition ).
# Line 174  C     Initialise intermediate terms Line 176  C     Initialise intermediate terms
176          pF(i,j)   = 0.          pF(i,j)   = 0.
177          fZon(i,j) = 0.          fZon(i,j) = 0.
178          fMer(i,j) = 0.          fMer(i,j) = 0.
179            rTransU(i,j) = 0.
180            rTransV(i,j) = 0.
181         ENDDO         ENDDO
182        ENDDO        ENDDO
183    
# Line 250  C     Calculate velocity field "volume t Line 254  C     Calculate velocity field "volume t
254    
255        CALL MOM_CALC_KE(bi,bj,k,uFld,vFld,KE,myThid)        CALL MOM_CALC_KE(bi,bj,k,uFld,vFld,KE,myThid)
256    
257    C---  First call (k=1): compute vertical adv. flux fVerU(kUp) & fVerV(kUp)
258          IF (momAdvection.AND.k.EQ.1) THEN
259    
260    C-    Calculate vertical transports above U & V points (West & South face):
261           CALL MOM_CALC_RTRANS( k, bi, bj,
262         O                       rTransU, rTransV,
263         I                       myTime, myIter, myThid)
264    
265    C-    Free surface correction term (flux at k=1)
266           CALL MOM_U_ADV_WU(bi,bj,k,uVel,wVel,rTransU,af,myThid)
267           DO j=jMin,jMax
268            DO i=iMin,iMax
269             fVerU(i,j,kUp) = af(i,j)
270            ENDDO
271           ENDDO
272    
273           CALL MOM_V_ADV_WV(bi,bj,k,vVel,wVel,rTransV,af,myThid)
274           DO j=jMin,jMax
275            DO i=iMin,iMax
276             fVerV(i,j,kUp) = af(i,j)
277            ENDDO
278           ENDDO
279    
280    C---  endif momAdvection & k=1
281          ENDIF
282    
283    
284    C---  Calculate vertical transports (at k+1) below U & V points :
285          IF (momAdvection) THEN
286           CALL MOM_CALC_RTRANS( k+1, bi, bj,
287         O                       rTransU, rTransV,
288         I                       myTime, myIter, myThid)
289          ENDIF
290    
291    
292  C---- Zonal momentum equation starts here  C---- Zonal momentum equation starts here
293    
294  C     Bi-harmonic term del^2 U -> v4F  C     Bi-harmonic term del^2 U -> v4F
# Line 294  C     Combine fluxes -> fMer Line 333  C     Combine fluxes -> fMer
333    
334  C--   Vertical flux (fVer is at upper face of "u" cell)  C--   Vertical flux (fVer is at upper face of "u" cell)
335    
 C--   Free surface correction term (flux at k=1)  
       IF (momAdvection.AND.k.EQ.1) THEN  
        CALL MOM_U_ADV_WU(bi,bj,k,uVel,wVel,af,myThid)  
        DO j=jMin,jMax  
         DO i=iMin,iMax  
          fVerU(i,j,kUp) = af(i,j)  
         ENDDO  
        ENDDO  
       ENDIF  
336  C     Mean flow component of vertical flux (at k+1) -> aF  C     Mean flow component of vertical flux (at k+1) -> aF
337        IF (momAdvection)        IF (momAdvection)
338       & CALL MOM_U_ADV_WU(bi,bj,k+1,uVel,wVel,af,myThid)       & CALL MOM_U_ADV_WU(bi,bj,k+1,uVel,wVel,rTransU,af,myThid)
339    
340  C     Eddy component of vertical flux (interior component only) -> vrF  C     Eddy component of vertical flux (interior component only) -> vrF
341        IF (momViscosity.AND..NOT.implicitViscosity)        IF (momViscosity.AND..NOT.implicitViscosity)
# Line 347  C--   Tendency is minus divergence of th Line 377  C--   Tendency is minus divergence of th
377         ENDDO         ENDDO
378        ENDDO        ENDDO
379    
380    #ifdef NONLIN_FRSURF
381    C-- account for 3.D divergence of the flow in rStar coordinate:
382          IF ( momAdvection .AND. select_rStar.GT.0 ) THEN
383           DO j=jMin,jMax
384            DO i=iMin,iMax
385             gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)
386         &     - (rStarExpW(i,j,bi,bj) - 1. _d 0)/deltaTfreesurf
387         &       *uVel(i,j,k,bi,bj)
388            ENDDO
389           ENDDO
390          ENDIF
391          IF ( momAdvection .AND. select_rStar.LT.0 ) THEN
392           DO j=jMin,jMax
393            DO i=iMin,iMax
394             gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)
395         &     - rStarDhWDt(i,j,bi,bj)*uVel(i,j,k,bi,bj)
396            ENDDO
397           ENDDO
398          ENDIF
399    #endif /* NONLIN_FRSURF */
400    
401  C-- No-slip and drag BCs appear as body forces in cell abutting topography  C-- No-slip and drag BCs appear as body forces in cell abutting topography
402        IF (momViscosity.AND.no_slip_sides) THEN        IF (momViscosity.AND.no_slip_sides) THEN
403  C-     No-slip BCs impose a drag at walls...  C-     No-slip BCs impose a drag at walls...
# Line 371  C--   Forcing term Line 422  C--   Forcing term
422        IF (momForcing)        IF (momForcing)
423       &  CALL EXTERNAL_FORCING_U(       &  CALL EXTERNAL_FORCING_U(
424       I     iMin,iMax,jMin,jMax,bi,bj,k,       I     iMin,iMax,jMin,jMax,bi,bj,k,
425       I     myCurrentTime,myThid)       I     myTime,myThid)
426    
427  C--   Metric terms for curvilinear grid systems  C--   Metric terms for curvilinear grid systems
428        IF (useNHMTerms) THEN        IF (useNHMTerms) THEN
# Line 444  C     Combine fluxes -> fMer Line 495  C     Combine fluxes -> fMer
495    
496  C--   Vertical flux (fVer is at upper face of "v" cell)  C--   Vertical flux (fVer is at upper face of "v" cell)
497    
 C--   Free surface correction term (flux at k=1)  
       IF (momAdvection.AND.k.EQ.1) THEN  
        CALL MOM_V_ADV_WV(bi,bj,k,vVel,wVel,af,myThid)  
        DO j=jMin,jMax  
         DO i=iMin,iMax  
          fVerV(i,j,kUp) = af(i,j)  
         ENDDO  
        ENDDO  
       ENDIF  
498  C     o Mean flow component of vertical flux  C     o Mean flow component of vertical flux
499        IF (momAdvection)        IF (momAdvection)
500       & CALL MOM_V_ADV_WV(bi,bj,k+1,vVel,wVel,af,myThid)       & CALL MOM_V_ADV_WV(bi,bj,k+1,vVel,wVel,rTransV,af,myThid)
501    
502  C     Eddy component of vertical flux (interior component only) -> vrF  C     Eddy component of vertical flux (interior component only) -> vrF
503        IF (momViscosity.AND..NOT.implicitViscosity)        IF (momViscosity.AND..NOT.implicitViscosity)
# Line 497  C--   Tendency is minus divergence of th Line 539  C--   Tendency is minus divergence of th
539         ENDDO         ENDDO
540        ENDDO        ENDDO
541    
542    #ifdef NONLIN_FRSURF
543    C-- account for 3.D divergence of the flow in rStar coordinate:
544          IF ( momAdvection .AND. select_rStar.GT.0 ) THEN
545           DO j=jMin,jMax
546            DO i=iMin,iMax
547             gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)
548         &     - (rStarExpS(i,j,bi,bj) - 1. _d 0)/deltaTfreesurf
549         &       *vVel(i,j,k,bi,bj)
550            ENDDO
551           ENDDO
552          ENDIF
553          IF ( momAdvection .AND. select_rStar.LT.0 ) THEN
554           DO j=jMin,jMax
555            DO i=iMin,iMax
556             gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)
557         &     - rStarDhSDt(i,j,bi,bj)*vVel(i,j,k,bi,bj)
558            ENDDO
559           ENDDO
560          ENDIF
561    #endif /* NONLIN_FRSURF */
562    
563  C-- No-slip and drag BCs appear as body forces in cell abutting topography  C-- No-slip and drag BCs appear as body forces in cell abutting topography
564        IF (momViscosity.AND.no_slip_sides) THEN        IF (momViscosity.AND.no_slip_sides) THEN
565  C-     No-slip BCs impose a drag at walls...  C-     No-slip BCs impose a drag at walls...
# Line 521  C--   Forcing term Line 584  C--   Forcing term
584        IF (momForcing)        IF (momForcing)
585       & CALL EXTERNAL_FORCING_V(       & CALL EXTERNAL_FORCING_V(
586       I     iMin,iMax,jMin,jMax,bi,bj,k,       I     iMin,iMax,jMin,jMax,bi,bj,k,
587       I     myCurrentTime,myThid)       I     myTime,myThid)
588    
589  C--   Metric terms for curvilinear grid systems  C--   Metric terms for curvilinear grid systems
590        IF (useNHMTerms) THEN        IF (useNHMTerms) THEN

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.22