File indexing completed on 2021-06-27 05:11:26 UTC
view on githubraw file Latest commit 4e4ad91a on 2021-06-26 16:30:07 UTC
4e66ab0b67 Oliv*0001 #include "LONGSTEP_OPTIONS.h"
0002
0003
0004
0005
7908448559 Jean*0006 SUBROUTINE LONGSTEP_THERMODYNAMICS( myTime, myIter, myThid )
4e66ab0b67 Oliv*0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 IMPLICIT NONE
0023
0024 #include "SIZE.h"
0025 #include "EEPARAMS.h"
0026 #include "PARAMS.h"
0027 #include "RESTART.h"
0028 #include "DYNVARS.h"
0029 #include "GRID.h"
36487395b9 Jean*0030 #include "SURFACE.h"
4e66ab0b67 Oliv*0031 #ifdef ALLOW_GENERIC_ADVDIFF
0032 # include "GAD.h"
0033 #endif
0034 #include "LONGSTEP_PARAMS.h"
0035 #include "LONGSTEP.h"
0036 #ifdef ALLOW_PTRACERS
0037 # include "PTRACERS_SIZE.h"
0038 # include "PTRACERS_PARAMS.h"
0039 # include "PTRACERS_FIELDS.h"
0040 #endif
0041
0042
0043
7908448559 Jean*0044
0045
0046
4e66ab0b67 Oliv*0047 _RL myTime
0048 INTEGER myIter
0049 INTEGER myThid
0050
0051 #ifdef ALLOW_LONGSTEP
0052
0053
7908448559 Jean*0054
0055
0056
0057
0058
0059
0060
0061 _RL uFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
0062 _RL vFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
0063 _RL wFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
36487395b9 Jean*0064 _RL kappaRk (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
0065 _RS recip_hFacNew(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
4e66ab0b67 Oliv*0066 INTEGER iMin, iMax
0067 INTEGER jMin, jMax
0068 INTEGER bi, bj
7908448559 Jean*0069 INTEGER i, j, k
4e66ab0b67 Oliv*0070
0071
0072 #ifdef ALLOW_DEBUG
1378a26402 Jean*0073 IF (debugMode) CALL DEBUG_ENTER('LONGSTEP_THERMODYNAMICS',myThid)
4e66ab0b67 Oliv*0074 #endif
0075
0076
0077 IF ( LS_doTimeStep ) THEN
0078
0079 DO bj=myByLo(myThid),myByHi(myThid)
0080 DO bi=myBxLo(myThid),myBxHi(myThid)
0081
0082
0083
0084
0085
0086
0087
0088 DO k=1,Nr
0089 DO j=1-OLy,sNy+OLy
0090 DO i=1-OLx,sNx+OLx
0091
0092 kappaRk(i,j,k) = 0. _d 0
0093 ENDDO
0094 ENDDO
0095 ENDDO
0096
36487395b9 Jean*0097
0098 #ifdef NONLIN_FRSURF
0099 IF ( nonlinFreeSurf.GT.0 ) THEN
0100 IF ( select_rStar.GT.0 ) THEN
0101 # ifndef DISABLE_RSTAR_CODE
0102 DO k=1,Nr
0103 DO j=1-OLy,sNy+OLy
0104 DO i=1-OLx,sNx+OLx
0105 recip_hFacNew(i,j,k) = recip_hFacC(i,j,k,bi,bj)
0106 & / rStarExpC(i,j,bi,bj)
0107 ENDDO
0108 ENDDO
0109 ENDDO
0110 # endif /* DISABLE_RSTAR_CODE */
0111 ELSEIF ( selectSigmaCoord.NE.0 ) THEN
0112 # ifndef DISABLE_SIGMA_CODE
0113 DO k=1,Nr
0114 DO j=1-OLy,sNy+OLy
0115 DO i=1-OLx,sNx+OLx
0116 recip_hFacNew(i,j,k) = recip_hFacC(i,j,k,bi,bj)
7908448559 Jean*0117 & /( 1. _d 0 + dEtaHdt(i,j,bi,bj)*deltaTFreeSurf
36487395b9 Jean*0118 & *dBHybSigF(k)*recip_drF(k)
0119 & *recip_hFacC(i,j,k,bi,bj)
0120 & )
0121 ENDDO
0122 ENDDO
0123 ENDDO
0124 # endif /* DISABLE_RSTAR_CODE */
0125 ELSE
0126 DO k=1,Nr
0127 DO j=1-OLy,sNy+OLy
0128 DO i=1-OLx,sNx+OLx
0129 IF ( k.EQ.kSurfC(i,j,bi,bj) ) THEN
0130 recip_hFacNew(i,j,k) = 1. _d 0 / hFac_surfC(i,j,bi,bj)
0131 ELSE
0132 recip_hFacNew(i,j,k) = recip_hFacC(i,j,k,bi,bj)
0133 ENDIF
0134 ENDDO
0135 ENDDO
0136 ENDDO
0137 ENDIF
0138 ELSE
0139 #endif /* NONLIN_FRSURF */
0140 DO k=1,Nr
0141 DO j=1-OLy,sNy+OLy
0142 DO i=1-OLx,sNx+OLx
0143 recip_hFacNew(i,j,k) = _recip_hFacC(i,j,k,bi,bj)
0144 ENDDO
0145 ENDDO
0146 ENDDO
0147 #ifdef NONLIN_FRSURF
0148 ENDIF
0149 #endif /* NONLIN_FRSURF */
0150
f941e53e0a Jean*0151 iMin = 1-OLx
0152 iMax = sNx+OLx
0153 jMin = 1-OLy
0154 jMax = sNy+OLy
4e66ab0b67 Oliv*0155
f941e53e0a Jean*0156
0157 CALL LONGSTEP_FORCING_SURF(
0158 I bi, bj, iMin, iMax, jMin, jMax,
0159 I myTime,myIter,myThid )
4e66ab0b67 Oliv*0160
f941e53e0a Jean*0161
0162
0163 DO k=1,Nr
0164 DO j=1-OLy,sNy+OLy
0165 DO i=1-OLx,sNx+OLx
0166 uFld(i,j,k) = LS_uVel(i,j,k,bi,bj)
0167 vFld(i,j,k) = LS_vVel(i,j,k,bi,bj)
0168 wFld(i,j,k) = LS_wVel(i,j,k,bi,bj)
0169 ENDDO
0170 ENDDO
0171 ENDDO
0172 #ifdef ALLOW_GMREDI
0173
0174 IF (useGMRedi) THEN
0175 CALL GMREDI_RESIDUAL_FLOW(
0176 U uFld, vFld, wFld,
0177 I bi, bj, myIter, myThid )
0178 ENDIF
0179 #endif /* ALLOW_GMREDI */
4e66ab0b67 Oliv*0180
0181 #ifdef ALLOW_PTRACERS
f941e53e0a Jean*0182
0183
0184
0185 IF ( usePTRACERS ) THEN
0186 #ifdef ALLOW_DEBUG
0187 IF (debugMode) CALL DEBUG_CALL('PTRACERS_INTEGRATE',myThid)
0188 #endif
0189 CALL PTRACERS_INTEGRATE(
0190 I bi, bj, recip_hFacNew,
0191 I uFld, vFld, wFld,
0192 U kappaRk,
0193 I myTime, myIter, myThid )
4e66ab0b67 Oliv*0194 ENDIF
0195 #endif /* ALLOW_PTRACERS */
0196
0197
0198 ENDDO
0199 ENDDO
0200
0201 #ifdef ALLOW_DEBUG
8830b8f970 Jean*0202 IF ( debugLevel.GE.debLevD ) THEN
4e66ab0b67 Oliv*0203 CALL DEBUG_STATS_RL(Nr,LS_uVel,'LS_Uvel (THERMODYNAMICS)',myThid)
0204 CALL DEBUG_STATS_RL(Nr,LS_vVel,'LS_Vvel (THERMODYNAMICS)',myThid)
0205 CALL DEBUG_STATS_RL(Nr,LS_wVel,'LS_Wvel (THERMODYNAMICS)',myThid)
0206 CALL DEBUG_STATS_RL(Nr,LS_theta,'LS_Theta (THERMODYNAMICS)',
0207 & myThid)
0208 CALL DEBUG_STATS_RL(Nr,LS_salt,'LS_Salt (THERMODYNAMICS)',myThid)
0209 #ifdef ALLOW_PTRACERS
0210 IF ( usePTRACERS ) THEN
0211 CALL PTRACERS_DEBUG(myThid)
0212 ENDIF
0213 #endif /* ALLOW_PTRACERS */
0214 ENDIF
0215 #endif /* ALLOW_DEBUG */
0216
0217
0218 ENDIF
0219
0220 #ifdef ALLOW_DEBUG
1378a26402 Jean*0221 IF (debugMode) CALL DEBUG_LEAVE('LONGSTEP_THERMODYNAMICS',myThid)
4e66ab0b67 Oliv*0222 #endif
0223
0224 #endif /* ALLOW_LONGSTEP */
0225
0226 RETURN
0227 END