Back to home page

MITgcm

 
 

    


File indexing completed on 2021-08-21 05:11:24 UTC

view on githubraw file Latest commit 31f96e93 on 2021-08-20 15:23:40 UTC
89474f9a5c Mart*0001 #include "GGL90_OPTIONS.h"
                0002 
31a3206180 Mart*0003 CBOP
                0004 C     !ROUTINE: GGL90_INIT_VARIA
                0005 C     !INTERFACE:
d7017b4e4b Davi*0006       SUBROUTINE GGL90_INIT_VARIA( myThid )
89474f9a5c Mart*0007 
31a3206180 Mart*0008 C     !DESCRIPTION: \bv
                0009 C     *================================================================*
                0010 C     | SUBROUTINE GGL90_INIT_VARIA
                0011 C     | o initialize variables
                0012 C     *================================================================*
                0013 C     \ev
                0014 
                0015 C     !USES:
89474f9a5c Mart*0016       IMPLICIT NONE
                0017 C     === Global variables ===
                0018 #include "SIZE.h"
                0019 #include "EEPARAMS.h"
                0020 #include "PARAMS.h"
                0021 #include "GRID.h"
                0022 #include "GGL90.h"
                0023 
31a3206180 Mart*0024 C     !INPUT/OUTPUT PARAMETERS:
89474f9a5c Mart*0025 C     == Routine arguments ==
                0026 C     myThid -  Number of this instance of GGL90_INIT
                0027       INTEGER myThid
                0028 
31a3206180 Mart*0029 #ifdef ALLOW_GGL90
89474f9a5c Mart*0030 C     !LOCAL VARIABLES:
                0031 C     == Local variables ==
0320e25227 Mart*0032 C     bi,bj,I,J,K - Loop counters
89474f9a5c Mart*0033       INTEGER bi, bj
0320e25227 Mart*0034       INTEGER i, j, k
89474f9a5c Mart*0035 CEOP
                0036 
                0037 C--   Over all tiles
                0038       DO bj = myByLo(myThid), myByHi(myThid)
                0039        DO bi = myBxLo(myThid), myBxHi(myThid)
                0040 
                0041 C-      3D arrays
0320e25227 Mart*0042         DO k=1,Nr
                0043          DO j=1-OLy,sNy+OLy
                0044           DO i=1-OLx,sNx+OLx
                0045            GGL90viscArU(i,j,k,bi,bj) = 0. _d 0
                0046            GGL90viscArV(i,j,k,bi,bj) = 0. _d 0
                0047            GGL90diffKr(i,j,k,bi,bj)  = 0. _d 0
31a3206180 Mart*0048            IF ( useIDEMIX) THEN
0320e25227 Mart*0049             GGL90TKE(i,j,k,bi,bj)=GGL90eps*maskC(i,j,k,bi,bj)
31a3206180 Mart*0050            ELSE
89474f9a5c Mart*0051 CML           GGL90TKE(I,J,K,bi,bj)=0. _d 0
0320e25227 Mart*0052             GGL90TKE(i,j,k,bi,bj)=GGL90TKEmin*maskC(i,j,k,bi,bj)
31a3206180 Mart*0053            ENDIF
89474f9a5c Mart*0054           ENDDO
                0055          ENDDO
                0056         ENDDO
                0057 
                0058 C-      2D arrays
                0059 
                0060        ENDDO
                0061       ENDDO
                0062 
31a3206180 Mart*0063 #ifdef ALLOW_GGL90_IDEMIX
                0064 c-----------------------------------------------------------------------
                0065 c  IDEMIX
                0066 c-----------------------------------------------------------------------
                0067 C--   Over all tiles
                0068       DO bj = myByLo(myThid), myByHi(myThid)
                0069        DO bi = myBxLo(myThid), myBxHi(myThid)
                0070 
0320e25227 Mart*0071         DO k=1,Nr
                0072          DO j=1-OLy,sNy+OLy
                0073           DO i=1-OLx,sNx+OLx
31f96e9372 Jean*0074            IDEMIX_E(i,j,k,bi,bj) = 0. _d 0
31a3206180 Mart*0075           ENDDO
                0076          ENDDO
                0077         ENDDO
                0078 
0320e25227 Mart*0079         DO j=1-OLy,sNy+OLy
                0080          DO i=1-OLx,sNx+OLx
                0081           IDEMIX_F_B(i,j,bi,bj) = 0. _d 0
                0082           IDEMIX_F_S(i,j,bi,bj) = 0. _d 0
31a3206180 Mart*0083          ENDDO
                0084         ENDDO
                0085 
                0086        ENDDO
                0087       ENDDO
                0088 c-----------------------------------------------------------------------
                0089 c      read in forcing fields for IDEMIX
                0090 c-----------------------------------------------------------------------
                0091       IF ( useIDEMIX .AND. IDEMIX_tidal_file .NE. ' ' ) THEN
                0092        CALL READ_REC_XY_RL( IDEMIX_tidal_file,IDEMIX_F_b,1,0,myThid )
                0093        _EXCH_XY_RL(IDEMIX_F_b,myThid)
                0094 
                0095        DO bj = myByLo(myThid), myByHi(myThid)
                0096         DO bi = myBxLo(myThid), myBxHi(myThid)
0320e25227 Mart*0097          DO j=1-OLy,sNy+OLy
                0098           DO i=1-OLx,sNx+OLx
38cd2e647d Jean*0099            IDEMIX_F_b(i,j,bi,bj) = -MAX(0. _d 0,
31a3206180 Mart*0100      &          MIN(1. _d 0,IDEMIX_F_b(i,j,bi,bj)))
                0101 C     fraction that enters IW field
                0102            IDEMIX_F_b(i,j,bi,bj) = IDEMIX_frac_F_b*
                0103 CML     &          IDEMIX_F_b(i,j,bi,bj)*recip_rhoConst
38cd2e647d Jean*0104      &          IDEMIX_F_b(i,j,bi,bj)/1024. _d 0
31a3206180 Mart*0105           ENDDO
                0106          ENDDO
                0107         ENDDO
                0108        ENDDO
                0109       ENDIF
38cd2e647d Jean*0110 
31a3206180 Mart*0111       IF ( useIDEMIX .AND. IDEMIX_wind_file .NE. ' ' ) THEN
                0112        CALL READ_REC_XY_RL( IDEMIX_wind_file ,IDEMIX_F_s,1,0,myThid )
                0113        _EXCH_XY_RL(IDEMIX_F_s,myThid)
                0114        DO bj = myByLo(myThid), myByHi(myThid)
                0115         DO bi = myBxLo(myThid), myBxHi(myThid)
0320e25227 Mart*0116          DO j=1-OLy,sNy+OLy
                0117           DO i=1-OLx,sNx+OLx
38cd2e647d Jean*0118            IDEMIX_F_s(i,j,bi,bj) = MAX(0. _d 0,
31a3206180 Mart*0119      &          MIN(1. _d 0,IDEMIX_F_s(i,j,bi,bj)))
                0120 C     fraction that leaves mixed layer
                0121            IDEMIX_F_s(i,j,bi,bj) = IDEMIX_frac_F_s*
                0122 CML     &          IDEMIX_F_s(i,j,bi,bj)*recip_rhoConst
                0123      &          IDEMIX_F_s(i,j,bi,bj)/1024.
                0124           ENDDO
                0125          ENDDO
                0126         ENDDO
                0127        ENDDO
                0128       ENDIF
                0129 #endif /* ALLOW_GGL90_IDEMIX */
                0130 
5b187c067b Jean*0131       IF ( nIter0.NE.0 .OR. pickupSuff.NE.' ' ) THEN
4ae2976890 Jean*0132        CALL GGL90_READ_PICKUP( nIter0, myThid )
89474f9a5c Mart*0133       ELSE
                0134 C--   Read initial turbulent kinetic energy thickness from file if available.
                0135        IF ( GGL90TKEFile .NE. ' ' ) THEN
                0136         CALL READ_FLD_XYZ_RL( GGL90TKEFile, ' ', GGL90TKE, 0, myThid )
6637358eea Jean*0137         _EXCH_XYZ_RL(GGL90TKE,myThid)
89474f9a5c Mart*0138         DO bj=myByLo(myThid),myByHi(myThid)
                0139          DO bi=myBxLo(myThid),myBxHi(myThid)
0320e25227 Mart*0140           DO k=1,Nr
                0141            DO j=1-OLy,sNy+OLy
                0142             DO i=1-OLx,sNx+OLx
                0143              GGL90TKE(i,j,k,bi,bj) = MAX(GGL90TKE(i,j,k,bi,bj),
                0144      &            GGL90TKEmin)*maskC(i,j,k,bi,bj)
89474f9a5c Mart*0145             ENDDO
                0146            ENDDO
                0147           ENDDO
                0148          ENDDO
                0149         ENDDO
                0150        ENDIF
4ae2976890 Jean*0151       ENDIF
89474f9a5c Mart*0152 
                0153 #endif /*  ALLOW_GGL90  */
                0154 
                0155       RETURN
                0156       END