Back to home page

MITgcm

 
 

    


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

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
0c49347dc7 Alis*0001 #include "GMREDI_OPTIONS.h"
                0002 
                0003       SUBROUTINE GMREDI_CALC_DIFF( 
cd3138caa3 Jean*0004      I        bi,bj,iMin,iMax,jMin,jMax,kArg,kSize,
                0005      U        KappaRx,
8061933ad6 Davi*0006      I        tracerIdentity,myThid)
0c49347dc7 Alis*0007 
                0008 C     /==========================================================\
                0009 C     | SUBROUTINE GMREDI_CALC_DIFF                              |
cd3138caa3 Jean*0010 C     | o Add contribution to net diffusivity from GM/Redi       |
0c49347dc7 Alis*0011 C     \==========================================================/
                0012       IMPLICIT NONE
                0013 
                0014 C     == GLobal variables ==
                0015 #include "SIZE.h"
                0016 #include "EEPARAMS.h"
                0017 #include "PARAMS.h"
                0018 #include "GRID.h"
4e66ab0b67 Oliv*0019 #include "GAD.h"
                0020 #ifdef ALLOW_LONGSTEP
                0021 #include "LONGSTEP.h"
                0022 #endif
cd3138caa3 Jean*0023 #ifdef ALLOW_GMREDI
                0024 #include "GMREDI.h"
                0025 #endif
0c49347dc7 Alis*0026 
                0027 C     == Routine arguments ==
cd3138caa3 Jean*0028 C     bi, bj,   :: tile indices
                0029 C     iMin,iMax :: Range of points for which calculation is done
                0030 C     jMin,jMax :: Range of points for which calculation is done
                0031 C     kArg      :: = 0 -> do the k-loop here and treat all levels
                0032 C                  > 0 -> k-loop is done outside and treat only level k=kArg
                0033 C     kSize     :: 3rd Dimension of the vertical diffusivity array KappaRx
                0034 C     KappaRx   :: vertical diffusivity array 
                0035 C     myThid    :: Instance number for this innvocation of GMREDI_CALC_DIFF
0c49347dc7 Alis*0036 C
cd3138caa3 Jean*0037       INTEGER bi,bj,iMin,iMax,jMin,jMax,kArg,kSize
                0038       _RL KappaRx(1-Olx:sNx+Olx,1-Oly:sNy+Oly,kSize)
8061933ad6 Davi*0039       INTEGER tracerIdentity
0c49347dc7 Alis*0040       INTEGER myThid
                0041 
                0042 #ifdef ALLOW_GMREDI
                0043 
                0044 C     == Local variables ==
cd3138caa3 Jean*0045 C     i,j,k     :: Loop counters
                0046       INTEGER i,j,k
                0047 
                0048 C--   Add Vertical diffusivity contribution from GM/Redi
                0049       IF ( kArg .EQ. 0 ) THEN
                0050 C-    do all levels :
                0051         DO k=1,MIN(Nr,kSize)
                0052          DO j=jMin,jMax
                0053           DO i=iMin,iMax
4e66ab0b67 Oliv*0054            IF (tracerIdentity .LT. GAD_TR1) THEN
                0055             KappaRx(i,j,k) = KappaRx(i,j,k)+Kwz(i,j,k,bi,bj)
4d24da31b2 Mart*0056      &           *maskInC(i,j,bi,bj)
4e66ab0b67 Oliv*0057            ELSE
                0058 #ifdef ALLOW_LONGSTEP
                0059             KappaRx(i,j,k) = KappaRx(i,j,k)+LS_Kwz(i,j,k,bi,bj)
                0060 #else
cd3138caa3 Jean*0061             KappaRx(i,j,k) = KappaRx(i,j,k)+Kwz(i,j,k,bi,bj)
4e66ab0b67 Oliv*0062 #endif
4d24da31b2 Mart*0063      &           *maskInC(i,j,bi,bj)
4e66ab0b67 Oliv*0064            ENDIF
cd3138caa3 Jean*0065           ENDDO
                0066          ENDDO
                0067         ENDDO
                0068       ELSE
                0069 C-    do level k=kArg only :
                0070          k = MIN(kArg,kSize)
                0071          DO j=jMin,jMax
                0072           DO i=iMin,iMax
4e66ab0b67 Oliv*0073            IF (tracerIdentity .LT. GAD_TR1) THEN
cd3138caa3 Jean*0074             KappaRx(i,j,k) = KappaRx(i,j,k)+Kwz(i,j,kArg,bi,bj)
4d24da31b2 Mart*0075      &           *maskInC(i,j,bi,bj)
4e66ab0b67 Oliv*0076            ELSE
                0077 #ifdef ALLOW_LONGSTEP
                0078             KappaRx(i,j,k) = KappaRx(i,j,k)+LS_Kwz(i,j,kArg,bi,bj)
                0079 #else
                0080             KappaRx(i,j,k) = KappaRx(i,j,k)+Kwz(i,j,kArg,bi,bj)
                0081 #endif
4d24da31b2 Mart*0082      &           *maskInC(i,j,bi,bj)
4e66ab0b67 Oliv*0083            ENDIF
cd3138caa3 Jean*0084           ENDDO
                0085          ENDDO
                0086       ENDIF
0c49347dc7 Alis*0087 
                0088 #endif /* ALLOW_GMREDI */
                0089 
                0090       RETURN
                0091       END