Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:39:15 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
b6bbe8cccf Jean*0001 #include "DWNSLP_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C     !ROUTINE: DWNSLP_CALC_RHO
                0005 C     !INTERFACE:
                0006       SUBROUTINE DWNSLP_CALC_RHO(
                0007      I                tFld, sFld,
04f24c0cdf Jean*0008      O                rhoLoc,
b6bbe8cccf Jean*0009      I                k, bi, bj, myTime, myIter, myThid )
                0010 
                0011 C     !DESCRIPTION: \bv
                0012 C     *==========================================================*
                0013 C     | SUBROUTINE DWNSLP_CALC_RHO
                0014 C     | o Calculates [rho(S,T,z)-rhoConst] of a 2-D slice
                0015 C     |   filling land-points with bottom density
                0016 C     *==========================================================*
                0017 C     | Note: could move this S/R to model/src (if needed) since
                0018 C     |  it does not contain anything specific to Down-Slope pkg
                0019 C     *==========================================================*
                0020 C     \ev
                0021 
                0022 C     !USES:
                0023       IMPLICIT NONE
                0024 
                0025 C     === Global variables ===
                0026 #include "SIZE.h"
                0027 #include "EEPARAMS.h"
                0028 #include "PARAMS.h"
                0029 #include "GRID.h"
                0030 
                0031 C     !INPUT/OUTPUT PARAMETERS:
                0032 C     === Routine arguments ===
                0033 C     tFld      :: Pot.Temperature (3-D array)
                0034 C     sFld      :: Salinity (3-D array)
                0035 C     rhoLoc    :: In-situ density [kg/m3] (2-D array) computed at z=rC ;
                0036 C     k         :: current vertical index
                0037 C     bi,bj     :: Tile indices
                0038 C     myTime    :: Current time in simulation
                0039 C     myIter    :: Current time-step number
                0040 C     myThid    :: my Thread Id number
                0041       _RL     tFld     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0042       _RL     sFld     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
72ae0fb86b Jean*0043       _RL     rhoLoc   (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
b6bbe8cccf Jean*0044       INTEGER k, bi, bj
                0045       _RL     myTime
                0046       INTEGER myIter, myThid
                0047 CEOP
                0048 
                0049 C     !LOCAL VARIABLES:
                0050 C     === Local variables ===
0884a363a5 Jean*0051 C     msgBuf     :: Informational/error message buffer
b6bbe8cccf Jean*0052 c     CHARACTER*(MAX_LEN_MBUF) msgBuf
                0053       _RL     tLoc     (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0054       _RL     sLoc     (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0055       INTEGER i,j,kl
                0056 
                0057 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0058 
72ae0fb86b Jean*0059 C--   make a local copy of Temp & salt, copying bottom values further down
b6bbe8cccf Jean*0060       DO j=1-OLy,sNy+OLy
                0061        DO i=1-OLx,sNx+OLx
                0062 c        kl = k
                0063 c        IF ( kLowC(i,j,bi,bj).GE.1 ) THEN
                0064 c          IF ( k.GT.kLowC (i,j,bi,bj) ) k = kLowC (i,j,bi,bj)
                0065 c          IF ( k.LT.kSurfC(i,j,bi,bj) ) k = kSurfC(i,j,bi,bj)
                0066 c        ENDIF
                0067 C-    same as above, using min,max:
                0068          kl = MIN( MAX(k,kSurfC(i,j,bi,bj)), MAX(kLowC(i,j,bi,bj),1) )
                0069          tLoc(i,j) = tFld(i,j,kl,bi,bj)
                0070          sLoc(i,j) = sFld(i,j,kl,bi,bj)
                0071        ENDDO
                0072       ENDDO
                0073 
                0074       CALL FIND_RHO_2D(
                0075      I      1-OLx, sNx+OLx, 1-OLy, sNy+OLy, k,
                0076      I      tLoc, sLoc,
                0077      O      rhoLoc,
                0078      I      k, bi, bj, myThid )
                0079 
                0080 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0081 
                0082       RETURN
                0083       END