Back to home page

MITgcm

 
 

    


File indexing completed on 2023-01-05 06:09:34 UTC

view on githubraw file Latest commit 310f4f2d on 2023-01-03 19:44:45 UTC
89474f9a5c Mart*0001 #include "GGL90_OPTIONS.h"
                0002 
310f4f2d26 Jean*0003 CBOP
                0004 C     !ROUTINE: GGL90_CALC_DIFF
                0005 
                0006 C     !INTERFACE:
78524d1402 Jean*0007       SUBROUTINE GGL90_CALC_DIFF(
310f4f2d26 Jean*0008      I        bi, bj, iMin, iMax, jMin, jMax, kArg, kSize,
cd3138caa3 Jean*0009      U        KappaRx,
310f4f2d26 Jean*0010      I        myThid )
89474f9a5c Mart*0011 
310f4f2d26 Jean*0012 C     !DESCRIPTION:
                0013 C     *==========================================================*
89474f9a5c Mart*0014 C     | SUBROUTINE GGL90_CALC_DIFF                               |
310f4f2d26 Jean*0015 C     | o Add contribution to net diffusivity from GGL90 mixing  |
                0016 C     *==========================================================*
89474f9a5c Mart*0017 
310f4f2d26 Jean*0018 C     !USES:
                0019       IMPLICIT NONE
89474f9a5c Mart*0020 C     == GLobal variables ==
                0021 #include "SIZE.h"
                0022 #include "EEPARAMS.h"
                0023 #include "PARAMS.h"
310f4f2d26 Jean*0024 c#include "DYNVARS.h"
                0025 c#include "GRID.h"
cd3138caa3 Jean*0026 #include "GGL90.h"
89474f9a5c Mart*0027 
310f4f2d26 Jean*0028 C     !INPUT/OUTPUT PARAMETERS:
                0029 C     bi, bj    :: current tile indices
cd3138caa3 Jean*0030 C     iMin,iMax :: Range of points for which calculation is done
                0031 C     jMin,jMax :: Range of points for which calculation is done
                0032 C     kArg      :: = 0 -> do the k-loop here and treat all levels
                0033 C                  > 0 -> k-loop is done outside and treat only level k=kArg
                0034 C     kSize     :: 3rd Dimension of the vertical diffusivity array KappaRx
                0035 C     KappaRx   :: vertical diffusivity array
310f4f2d26 Jean*0036 C     myThid    :: my Thread Id number
                0037       INTEGER bi, bj, iMin, iMax, jMin, jMax, kArg, kSize
78524d1402 Jean*0038       _RL KappaRx(1-OLx:sNx+OLx,1-OLy:sNy+OLy,kSize)
89474f9a5c Mart*0039       INTEGER myThid
                0040 
                0041 #ifdef ALLOW_GGL90
310f4f2d26 Jean*0042 C     !LOCAL VARIABLES:
                0043 C     i, j, k   :: Loop counters
                0044       INTEGER i, j, k
                0045 CEOP
89474f9a5c Mart*0046 
cd3138caa3 Jean*0047 C--   Add Vertical diffusivity contribution from GGL90
                0048       IF ( kArg .EQ. 0 ) THEN
                0049 C-    do all levels :
                0050         DO k=1,MIN(Nr,kSize)
                0051          DO j=jMin,jMax
                0052           DO i=iMin,iMax
                0053             KappaRx(i,j,k) = KappaRx(i,j,k)
                0054      &                  +( GGL90diffKr(i,j,k,bi,bj)
78524d1402 Jean*0055      &                     - diffKrNrS(k) )
cd3138caa3 Jean*0056           ENDDO
                0057          ENDDO
                0058         ENDDO
                0059       ELSE
                0060 C-    do level k=kArg only :
                0061          k = MIN(kArg,kSize)
                0062          DO j=jMin,jMax
                0063           DO i=iMin,iMax
                0064             KappaRx(i,j,k) = KappaRx(i,j,k)
                0065      &                  +( GGL90diffKr(i,j,kArg,bi,bj)
78524d1402 Jean*0066      &                     - diffKrNrS(kArg) )
cd3138caa3 Jean*0067           ENDDO
                0068          ENDDO
                0069       ENDIF
89474f9a5c Mart*0070 
                0071 #endif /* ALLOW_GGL90 */
                0072 
                0073       RETURN
                0074       END