/[MITgcm]/MITgcm/model/src/calc_common_factors.F
ViewVC logotype

Diff of /MITgcm/model/src/calc_common_factors.F

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

revision 1.4 by cnh, Wed May 27 21:01:47 1998 UTC revision 1.8 by cnh, Sat Aug 22 17:51:07 1998 UTC
# Line 5  C $Header$ Line 5  C $Header$
5  CStartOfInterFace  CStartOfInterFace
6        SUBROUTINE CALC_COMMON_FACTORS(        SUBROUTINE CALC_COMMON_FACTORS(
7       I        bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,       I        bi,bj,iMin,iMax,jMin,jMax,k,kM1,kUp,kDown,
8       O        xA,yA,uTrans,vTrans,wTrans,maskC,maskUp,       O        xA,yA,uTrans,vTrans,rTrans,rVel,maskC,maskUp,
9       I        myThid)       I        myThid)
10    
11  C     /==========================================================\  C     /==========================================================\
# Line 37  C     xA      - Tracer cell face area no Line 37  C     xA      - Tracer cell face area no
37  C     yA      - Tracer cell face area normal to X  C     yA      - Tracer cell face area normal to X
38  C     uTrans  - Zonal volume transport through cell face  C     uTrans  - Zonal volume transport through cell face
39  C     vTrans  - Meridional volume transport through cell face  C     vTrans  - Meridional volume transport through cell face
40  C     wTrans  - Vertical volume transport through cell face  C     rTrans  - R-direction volume transport through cell face
41    C     rVel    - R-direction velocity at cell upper and lower faces
42  C     maskC   - land/water mask for tracer points  C     maskC   - land/water mask for tracer points
43  C     maskUp  - land/water mask for Wvel points (above tracer level)  C     maskUp  - land/water mask for Wvel points (above tracer level)
44  C     myThid - Instance number for this innvocation of CALC_COMMON_FACTORS  C     myThid - Instance number for this innvocation of CALC_COMMON_FACTORS
# Line 47  C Line 48  C
48        _RS yA    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS yA    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
49        _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
50        _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
51        _RL wTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
52          _RL rVel  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2)
53        _RS maskC (1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS maskC (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
54        _RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)        _RS maskUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
55  C  C
# Line 60  C     kUp, kDown, kM1 - Index for layer Line 62  C     kUp, kDown, kM1 - Index for layer
62  C                         are switched with layer to be the appropriate index  C                         are switched with layer to be the appropriate index
63  C                         into fluxUD.  C                         into fluxUD.
64        INTEGER i,j        INTEGER i,j
65          LOGICAL TOP_LAYER
66    
67  C--    Calculate tracer cell face open areas        TOP_LAYER = K .EQ. 1
68    
69    C--   Calculate tracer cell face open areas
70        DO j=jMin,jMax        DO j=jMin,jMax
71         DO i=iMin,iMax         DO i=iMin,iMax
72          xA(i,j) = _dyG(i,j,bi,bj)*dzF(k)*_hFacW(i,j,k,bi,bj)          xA(i,j) = _dyG(i,j,bi,bj)*drF(k)*_hFacW(i,j,k,bi,bj)
73          yA(i,j) = _dxG(i,j,bi,bj)*dzF(k)*_hFacS(i,j,k,bi,bj)          yA(i,j) = _dxG(i,j,bi,bj)*drF(k)*_hFacS(i,j,k,bi,bj)
74         ENDDO         ENDDO
75        ENDDO        ENDDO
76    
77  C--    Calculate velocity field "volume transports" through  C--   Calculate velocity field "volume transports" through
78  C--    tracer cell faces.  C--   tracer cell faces.
79        DO j=jMin,jMax        DO j=jMin,jMax
80         DO i=iMin,iMax         DO i=iMin,iMax
81          uTrans(i,j) = uVel(i,j,k,bi,bj)*xA(i,j)          uTrans(i,j) = uVel(i,j,k,bi,bj)*xA(i,j)
# Line 78  C--    tracer cell faces. Line 83  C--    tracer cell faces.
83         ENDDO         ENDDO
84        ENDDO        ENDDO
85    
86  C--    Calculate vertical "volume transport" through  C--   Calculate vertical "volume transport" through
87  C--    tracer cell face *above* this level.  C--   tracer cell face *above* this level.
88          DO j=jMin,jMax
89           DO i=iMin,iMax
90            rTrans(i,j) = uTrans(i,j)*recip_rkFac-uTrans(i+1,j)*recip_rkFac
91         &               +vTrans(i,j)*recip_rkFac-vTrans(i,j+1)*recip_rkFac
92         &               +rTrans(i,j)
93           ENDDO
94          ENDDO
95    
96    C--   Vertical velocity at upper face
97        DO j=jMin,jMax        DO j=jMin,jMax
98         DO i=iMin,iMax         DO i=iMin,iMax
99          wTrans(i,j) = uTrans(i,j)-uTrans(i+1,j)          rVel(i,j,kUp) = rTrans(i,j)/_rA(i,j,bi,bj)
      &               +vTrans(i,j)-vTrans(i,j+1)  
      &               +wTrans(i,j)  
100         ENDDO         ENDDO
101        ENDDO        ENDDO
102    
# Line 94  C--    Calculate mask for tracer cells Line 106  C--    Calculate mask for tracer cells
106          maskC(i,j) = 1.          maskC(i,j) = 1.
107          if (_hFacC(i,j,k,bi,bj).eq.0.) maskC(i,j)=0.          if (_hFacC(i,j,k,bi,bj).eq.0.) maskC(i,j)=0.
108          maskUp(i,j) = 1.          maskUp(i,j) = 1.
109          if (_hFacC(i,j,kM1,bi,bj).eq.0.) maskUp(i,j)=0.          if (_hFacC(i,j,k,bi,bj).eq.0. .or. TOP_LAYER ) maskUp(i,j)=0.
110         ENDDO         ENDDO
111        ENDDO        ENDDO
112    

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

  ViewVC Help
Powered by ViewVC 1.1.22