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

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

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

revision 1.8 by adcroft, Thu Jul 2 14:16:24 1998 UTC revision 1.9 by adcroft, Thu Jul 2 15:46:21 1998 UTC
# Line 32  C     myThid -  Number of this instance Line 32  C     myThid -  Number of this instance
32  CEndOfInterface  CEndOfInterface
33    
34  C     == Local variables ==  C     == Local variables ==
 C     xG, yG - Global coordinate location.  
 C     zG  
 C     zUpper - Work arrays for upper and lower  
 C     zLower   cell-face heights.  
 C     phi    - Temporary scalar  
35  C     iG, jG - Global coordinate index  C     iG, jG - Global coordinate index
36  C     bi,bj  - Loop counters  C     bi,bj  - Loop counters
 C     zUpper - Temporary arrays holding z coordinates of  
 C     zLower   upper and lower faces.  
37  C     I,J,K  C     I,J,K
38        _RL    xG, yG, zG  C     phi    - total depth of model
       _RL    phi  
       _RL    zUpper(Nz), zLower(Nz)  
39        INTEGER iG, jG        INTEGER iG, jG
40        INTEGER bi, bj        INTEGER bi, bj
41        INTEGER  I,  J, K        INTEGER  I,  J, K
42          _RL phi
43    
44        _BARRIER        _BARRIER
45        IF ( bathyFile .EQ. ' '  ) THEN        IF ( bathyFile .EQ. ' '  ) THEN
# Line 55  C      Set up a flat bottom box with dou Line 47  C      Set up a flat bottom box with dou
47  C      H is the basic variable from which other terms are derived. It  C      H is the basic variable from which other terms are derived. It
48  C      is the term that would be set from an external file for a  C      is the term that would be set from an external file for a
49  C      realistic problem.  C      realistic problem.
50         phi = 0. D0         phi = zFace(nZ+1)
        DO K=1,Nz  
         phi = phi+delZ(K)  
        ENDDO  
51         DO bj = myByLo(myThid), myByHi(myThid)         DO bj = myByLo(myThid), myByHi(myThid)
52          DO bi = myBxLo(myThid), myBxHi(myThid)          DO bi = myBxLo(myThid), myBxHi(myThid)
53           DO j=1,sNy           DO j=1,sNy
# Line 84  C          Island Line 73  C          Island
73         _END_MASTER(myThid)         _END_MASTER(myThid)
74        ENDIF        ENDIF
75        _EXCH_XY_R4(    H, myThid )        _EXCH_XY_R4(    H, myThid )
   
 C--   Now calculate "lopping" factors hFac.  
       zG = delZ(1)*0.5 D0  
       zFace(1) = 0  
       dzC(1)   = delz(1)/2. _d 0  
       rDzC(1)  = 2. _d 0/delZ(1)  
       DO K=1,Nz-1  
        saFac(K) = 1. D0  
        zC(K)      = zG  
        zG         = zG + (delZ(K)+delZ(K+1))*0.5 D0  
        zFace(K+1) = zFace(K)+delZ(K)  
        rDzC(K+1)  = 2. _d 0/(delZ(K)+delZ(K+1))  
        dzC(K+1)   = (delZ(K)+delZ(K+1))/2. _d 0  
       ENDDO  
       zC(Nz)      = zG  
       zFace(Nz+1) = zFace(Nz)+delZ(Nz)  
       DO K=1,Nz  
        zUpper(K) = zFace(K)  
        zLower(K) = zFace(K+1)  
        dzF(K)    = delz(K)  
        rdzF(K)   = 1.d0/dzF(K)  
       ENDDO  
       DO bj=myByLo(myThid), myByHi(myThid)  
        DO bi=myBxLo(myThid), myBxHi(myThid)  
         DO K=1, Nz  
          DO J=1,sNy  
           DO I=1,sNx  
            hFacC(I,J,K,bi,bj) = 1.  
            IF     ( H(I,J,bi,bj) .LE. zUpper(K) ) THEN  
 C           Below base of domain  
             hFacC(I,J,K,bi,bj) = 0.  
            ELSEIF ( H(I,J,bi,bj) .GT. zLower(K) ) THEN  
 C           Base of domain is below this cell  
             hFacC(I,J,K,bi,bj) = 1.  
            ELSE  
 C           Base of domain is in this cell  
 C           Set hFac tp the fraction of the cell that is open.  
             phi = zUpper(K)-H(I,J,bi,bj)  
             hFacC(I,J,K,bi,bj) = phi/(zUpper(K)-zLower(K))  
            ENDIF  
           ENDDO  
          ENDDO  
         ENDDO  
        ENDDO  
       ENDDO  
       _EXCH_XYZ_R4(hFacC , myThid )  
   
76  C  C
77        CALL PLOT_FIELD_XYRS( H, 'Model depths' , 1, myThid )        CALL PLOT_FIELD_XYRS( H, 'Model depths' , 1, myThid )
78  C  C

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

  ViewVC Help
Powered by ViewVC 1.1.22