Back to home page

MITgcm

 
 

    


File indexing completed on 2020-01-23 06:11:17 UTC

view on githubraw file Latest commit 16fe9e8e on 2019-11-29 15:43:45 UTC
2fa42a6013 Alis*0001 #include "KPP_OPTIONS.h"
08300bd1e7 Jean*0002 #ifdef ALLOW_GMREDI
                0003 #include "GMREDI_OPTIONS.h"
                0004 #endif
2fa42a6013 Alis*0005 
88b144ae49 Jean*0006       SUBROUTINE KPP_TRANSPORT_T (
2fa42a6013 Alis*0007      I     iMin,iMax,jMin,jMax,bi,bj,k,km1,
417c225d28 Jean*0008      O     df,
                0009      I     myTime, myIter, myThid )
88b144ae49 Jean*0010 C     *==========================================================*
                0011 C     | o SUBROUTINE KPP_TRANSPORT_T
                0012 C     |   Add non local KPP transport term (ghat) to diffusive
                0013 C     |   temperature flux.
                0014 C     *==========================================================*
                0015 C     | The nonlocal transport term is nonzero only for scalars
                0016 C     | in unstable (convective) forcing conditions.
                0017 C     | Note: [surfaceForcingT + Qsw * (1-KPPfrac)]
                0018 C     |       is the total heat flux penetrating the mixed layer
                0019 C     |       from the surface in deg C / s referenced to the
                0020 C     |       top layer.
                0021 C     | Note: KPPdiffKzT(-,k) is defined at the top of grid cell
                0022 C     |       k while KPPghat(i,j,k,bi,bj) is defined at the
                0023 C     |       bottom of grid cell k.
                0024 C     |       For K=1, KPPdiffKzT(-,k) = 0 which insures no flux
                0025 C     |       through the surface.
                0026 C     *==========================================================*
2fa42a6013 Alis*0027       IMPLICIT NONE
                0028 
                0029 C     == GLobal variables ==
                0030 #include "SIZE.h"
                0031 #include "EEPARAMS.h"
                0032 #include "PARAMS.h"
                0033 #include "GRID.h"
                0034 #include "FFIELDS.h"
                0035 #include "KPP.h"
                0036 #include "KPP_PARAMS.h"
08300bd1e7 Jean*0037 #ifdef ALLOW_GMREDI
                0038 #include "GMREDI.h"
                0039 #endif
2fa42a6013 Alis*0040 
                0041 C     == Routine arguments ==
52d51b46b8 Jean*0042 C     iMin,iMax,jMin,  :: Range of points for which calculation
                0043 C     jMax,bi,bj,k,km1    results will be set.
                0044 C     df               :: Diffusive flux component work array.
417c225d28 Jean*0045 C     myTime :: Current time in simulation
                0046 C     myIter :: Current iteration number in simulation
                0047 C     myThid :: My Thread Id. number
2fa42a6013 Alis*0048       INTEGER iMin,iMax,jMin,jMax,bi,bj,k,km1
                0049       _RL df     (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
417c225d28 Jean*0050       _RL     myTime
                0051       INTEGER myIter
                0052       INTEGER myThid
2fa42a6013 Alis*0053 
1d478690dc Patr*0054 #if defined(ALLOW_KPP) && defined(KPP_GHAT)
2fa42a6013 Alis*0055 
                0056 C     == Local variables ==
52d51b46b8 Jean*0057 C     i, j :: Loop counters
                0058       INTEGER i, j
                0059       _RL recip_Cp
88b144ae49 Jean*0060 #ifdef ALLOW_GMREDI
08300bd1e7 Jean*0061       _RL tmpFac
88b144ae49 Jean*0062 #endif
                0063 
                0064 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
52d51b46b8 Jean*0065       recip_Cp = 1. _d 0 / HeatCapacity_Cp
2fa42a6013 Alis*0066 
08300bd1e7 Jean*0067 #ifdef ALLOW_GMREDI
88b144ae49 Jean*0068 
                0069       IF ( useGMRedi .AND. KPP_ghatUseTotalDiffus ) THEN
                0070         tmpFac = 1. _d 0
08300bd1e7 Jean*0071       ELSE
88b144ae49 Jean*0072         tmpFac = 0. _d 0
08300bd1e7 Jean*0073       ENDIF
1d478690dc Patr*0074       DO j=jMin,jMax
9d36aec500 Dimi*0075          DO i=iMin,iMax
08300bd1e7 Jean*0076             df(i,j) = - _rA(i,j,bi,bj)
                0077      &          *( KPPdiffKzT(i,j,k,bi,bj) + tmpFac*Kwz(i,j,k,bi,bj) )
                0078      &          *KPPghat(i,j,km1,bi,bj)
                0079      &          *( surfaceForcingT(i,j,bi,bj)
16fe9e8e73 Jean*0080      &            +adjustColdSST_diag(i,j,bi,bj)
f2d9fbc2ed Jean*0081      &            -Qsw(i,j,bi,bj)*recip_Cp*recip_rhoConst
                0082      &            *(1.-KPPfrac(i,j,bi,bj))
9d36aec500 Dimi*0083      &           )
                0084          ENDDO
1d478690dc Patr*0085       ENDDO
2fa42a6013 Alis*0086 
08300bd1e7 Jean*0087 #else /* ALLOW_GMREDI */
                0088 
                0089       DO j=jMin,jMax
                0090          DO i=iMin,iMax
                0091             df(i,j) = - _rA(i,j,bi,bj)
                0092      &          *KPPdiffKzT(i,j,k,bi,bj)
                0093      &          *KPPghat(i,j,km1,bi,bj)
                0094      &          *( surfaceForcingT(i,j,bi,bj)
16fe9e8e73 Jean*0095      &            +adjustColdSST_diag(i,j,bi,bj)
08300bd1e7 Jean*0096      &            -Qsw(i,j,bi,bj)*recip_Cp*recip_rhoConst
                0097      &            *(1.-KPPfrac(i,j,bi,bj))
                0098      &           )
                0099          ENDDO
                0100       ENDDO
                0101 
                0102 #endif /* ALLOW_GMREDI */
                0103 
1d478690dc Patr*0104 #endif /* ALLOW_KPP and KPP_GHAT */
2fa42a6013 Alis*0105 
                0106       RETURN
                0107       END