Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:37:03 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
d87b427b2d Jean*0001 #include "CPP_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C     !ROUTINE: SET_GRID_FACTORS
                0005 C     !INTERFACE:
                0006       SUBROUTINE SET_GRID_FACTORS( myThid )
                0007 
                0008 C     !DESCRIPTION: \bv
                0009 C     *==========================================================*
                0010 C     | SUBROUTINE SET_GRID_FACTORS
                0011 C     | o Initialise vertical gridding arrays
                0012 C     *==========================================================*
                0013 C     \ev
                0014 
                0015 C     !USES:
                0016       IMPLICIT NONE
                0017 C     === Global variables ===
                0018 #include "SIZE.h"
                0019 #include "EEPARAMS.h"
                0020 #include "PARAMS.h"
                0021 #include "GRID.h"
                0022 
                0023 C     !INPUT/OUTPUT PARAMETERS:
                0024 C     == Routine arguments ==
                0025 C     myThid   :: my Thread Id number
                0026       INTEGER myThid
                0027 
                0028 C     !LOCAL VARIABLES:
                0029 C     == Local variables ==
                0030 C     k        :: loop index
f04f2001af Jean*0031 C     msgBuf   :: Informational/error message buffer
d87b427b2d Jean*0032       INTEGER k
f04f2001af Jean*0033 c     _RL     tmpRatio, checkRatio1, checkRatio2
                0034 c     CHARACTER*(MAX_LEN_MBUF) msgBuf
d87b427b2d Jean*0035 CEOP
                0036 
                0037       _BEGIN_MASTER(myThid)
                0038 
                0039 c     WRITE(msgBuf,'(A,2(A,L5))') 'Enter SET_GRID_FACTORS:',
                0040 c    &                            ' setInterFDr=', setInterFDr,
                0041 c    &                          ' ; setCenterDr=', setCenterDr
                0042 c     CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0043 c    &                    SQUEEZE_RIGHT, myThid )
                0044 
                0045 C--   Calculate horizontal grid factor for the deep model (<=> dropping the
                0046 C      shallow atmosphere approximation): only function of the vertical index
                0047 C-    first: initialise deep-model grid factor:
                0048       DO k=1,Nr
                0049         deepFacC(k) = 1. _d 0
                0050         deepFac2C(k)= 1. _d 0
                0051         recip_deepFacC(k) = 1. _d 0
                0052         recip_deepFac2C(k)= 1. _d 0
                0053       ENDDO
                0054       DO k=1,Nr+1
                0055         deepFacF(k) = 1. _d 0
                0056         deepFac2F(k)= 1. _d 0
                0057         recip_deepFacF(k) = 1. _d 0
                0058         recip_deepFac2F(k)= 1. _d 0
                0059       ENDDO
                0060       IF ( deepAtmosphere ) THEN
                0061 C-    set deep-model grid factor:
                0062        IF ( usingZCoords ) THEN
                0063         DO k=1,Nr
                0064           deepFacC(k)  = (rSphere+rC(k))*recip_rSphere
                0065           deepFac2C(k) = deepFacC(k)*deepFacC(k)
                0066         ENDDO
                0067         DO k=1,Nr+1
                0068           deepFacF(k)  = (rSphere+rF(k))*recip_rSphere
                0069           deepFac2F(k) = deepFacF(k)*deepFacF(k)
                0070         ENDDO
                0071        ELSE
                0072         DO k=1,Nr
                0073           deepFacC(k)  = ( rSphere + phiRef(2*k)*recip_gravity
                0074      &                   )*recip_rSphere
                0075           deepFac2C(k) = deepFacC(k)*deepFacC(k)
                0076         ENDDO
                0077         DO k=1,Nr+1
                0078           deepFacF(k)  = ( rSphere + phiRef(2*k-1)*recip_gravity
                0079      &                   )*recip_rSphere
                0080           deepFac2F(k) = deepFacF(k)*deepFacF(k)
                0081         ENDDO
                0082        ENDIF
                0083 C-    set reciprocal of deep-model grid factor:
                0084        DO k=1,Nr
                0085         recip_deepFacC(k) = 1. _d 0/deepFacC(k)
                0086         recip_deepFac2C(k)= 1. _d 0/deepFac2C(k)
                0087        ENDDO
                0088        DO k=1,Nr+1
                0089         recip_deepFacF(k) = 1. _d 0/deepFacF(k)
                0090         recip_deepFac2F(k)= 1. _d 0/deepFac2F(k)
                0091        ENDDO
                0092       ENDIF
                0093 
                0094       _END_MASTER(myThid)
                0095       _BARRIER
                0096 
                0097       RETURN
                0098       END