8 |
|
|
9 |
C !INTERFACE: ====================================================== |
C !INTERFACE: ====================================================== |
10 |
SUBROUTINE GGL90_CALC( |
SUBROUTINE GGL90_CALC( |
11 |
I bi, bj, myTime, myIter, myThid ) |
I bi, bj, sigmaR, myTime, myIter, myThid ) |
12 |
|
|
13 |
|
|
14 |
C !DESCRIPTION: \bv |
C !DESCRIPTION: \bv |
15 |
C *==========================================================* |
C *==========================================================* |
42 |
|
|
43 |
C !INPUT PARAMETERS: =================================================== |
C !INPUT PARAMETERS: =================================================== |
44 |
C Routine arguments |
C Routine arguments |
45 |
C bi, bj :: array indices on which to apply calculations |
C bi, bj :: Current tile indices |
46 |
|
C sigmaR :: Vertical gradient of iso-neutral density |
47 |
C myTime :: Current time in simulation |
C myTime :: Current time in simulation |
48 |
C myIter :: Current time-step number |
C myIter :: Current time-step number |
49 |
C myThid :: My Thread Id number |
C myThid :: My Thread Id number |
50 |
INTEGER bi, bj |
INTEGER bi, bj |
51 |
|
_RL sigmaR(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
52 |
_RL myTime |
_RL myTime |
53 |
INTEGER myIter |
INTEGER myIter |
54 |
INTEGER myThid |
INTEGER myThid |
136 |
|
|
137 |
C Initialize local fields |
C Initialize local fields |
138 |
DO k = 1, Nr |
DO k = 1, Nr |
139 |
DO j=1-Oly,sNy+Oly |
DO j=1-OLy,sNy+OLy |
140 |
DO i=1-Olx,sNx+Olx |
DO i=1-OLx,sNx+OLx |
141 |
KappaE(i,j,k) = 0. _d 0 |
KappaE(i,j,k) = 0. _d 0 |
142 |
TKEPrandtlNumber(i,j,k) = 1. _d 0 |
TKEPrandtlNumber(i,j,k) = 1. _d 0 |
143 |
GGL90mixingLength(i,j,k) = GGL90mixingLengthMin |
GGL90mixingLength(i,j,k) = GGL90mixingLengthMin |
150 |
ENDDO |
ENDDO |
151 |
ENDDO |
ENDDO |
152 |
ENDDO |
ENDDO |
153 |
DO j=1-Oly,sNy+Oly |
DO j=1-OLy,sNy+OLy |
154 |
DO i=1-Olx,sNx+Olx |
DO i=1-OLx,sNx+OLx |
155 |
rhoK(i,j) = 0. _d 0 |
rhoK(i,j) = 0. _d 0 |
156 |
rhoKm1(i,j) = 0. _d 0 |
rhoKm1(i,j) = 0. _d 0 |
157 |
totalDepth(i,j) = Ro_surf(i,j,bi,bj) - R_low(i,j,bi,bj) |
totalDepth(i,j) = Ro_surf(i,j,bi,bj) - R_low(i,j,bi,bj) |
181 |
SQRTTKE(i,j,k)=SQRT( GGL90TKE(i,j,k,bi,bj) ) |
SQRTTKE(i,j,k)=SQRT( GGL90TKE(i,j,k,bi,bj) ) |
182 |
|
|
183 |
C buoyancy frequency |
C buoyancy frequency |
184 |
|
Nsquare(i,j,k) = gravity*gravitySign*recip_rhoConst |
185 |
|
& * sigmaR(i,j,k) |
186 |
Nsquare(i,j,k) = - gravity*recip_rhoConst*recip_drC(k) |
Nsquare(i,j,k) = - gravity*recip_rhoConst*recip_drC(k) |
187 |
& * ( rhoKm1(i,j) - rhoK(i,j) )*maskC(i,j,k,bi,bj) |
& * ( rhoKm1(i,j) - rhoK(i,j) )*maskC(i,j,k,bi,bj) |
188 |
cC vertical shear term (dU/dz)^2+(dV/dz)^2 |
cC vertical shear term (dU/dz)^2+(dV/dz)^2 |
207 |
|
|
208 |
C- Impose upper and lower bound for mixing length |
C- Impose upper and lower bound for mixing length |
209 |
IF ( mxlMaxFlag .EQ. 0 ) THEN |
IF ( mxlMaxFlag .EQ. 0 ) THEN |
210 |
C- |
|
211 |
DO k=2,Nr |
DO k=2,Nr |
212 |
DO j=jMin,jMax |
DO j=jMin,jMax |
213 |
DO i=iMin,iMax |
DO i=iMin,iMax |
229 |
ENDDO |
ENDDO |
230 |
|
|
231 |
ELSEIF ( mxlMaxFlag .EQ. 1 ) THEN |
ELSEIF ( mxlMaxFlag .EQ. 1 ) THEN |
232 |
C- |
|
233 |
DO k=2,Nr |
DO k=2,Nr |
234 |
DO j=jMin,jMax |
DO j=jMin,jMax |
235 |
DO i=iMin,iMax |
DO i=iMin,iMax |
252 |
ENDDO |
ENDDO |
253 |
|
|
254 |
ELSEIF ( mxlMaxFlag .EQ. 2 ) THEN |
ELSEIF ( mxlMaxFlag .EQ. 2 ) THEN |
255 |
C- |
|
256 |
cgf ensure mixing between first and second level |
cgf ensure mixing between first and second level |
257 |
c DO j=jMin,jMax |
c DO j=jMin,jMax |
258 |
c DO i=iMin,iMax |
c DO i=iMin,iMax |
294 |
ENDDO |
ENDDO |
295 |
|
|
296 |
ELSEIF ( mxlMaxFlag .EQ. 3 ) THEN |
ELSEIF ( mxlMaxFlag .EQ. 3 ) THEN |
297 |
C- |
|
298 |
DO k=2,Nr |
DO k=2,Nr |
299 |
DO j=jMin,jMax |
DO j=jMin,jMax |
300 |
DO i=iMin,iMax |
DO i=iMin,iMax |
353 |
C horizontal diffusion of TKE (requires an exchange in |
C horizontal diffusion of TKE (requires an exchange in |
354 |
C do_fields_blocking_exchanges) |
C do_fields_blocking_exchanges) |
355 |
C common factors |
C common factors |
356 |
DO j=1-Oly,sNy+Oly |
DO j=1-OLy,sNy+OLy |
357 |
DO i=1-Olx,sNx+Olx |
DO i=1-OLx,sNx+OLx |
358 |
xA(i,j) = _dyG(i,j,bi,bj) |
xA(i,j) = _dyG(i,j,bi,bj) |
359 |
& *drF(k)*_hFacW(i,j,k,bi,bj) |
& *drF(k)*_hFacW(i,j,k,bi,bj) |
360 |
yA(i,j) = _dxG(i,j,bi,bj) |
yA(i,j) = _dxG(i,j,bi,bj) |
363 |
ENDDO |
ENDDO |
364 |
C Compute diffusive fluxes |
C Compute diffusive fluxes |
365 |
C ... across x-faces |
C ... across x-faces |
366 |
DO j=1-Oly,sNy+Oly |
DO j=1-OLy,sNy+OLy |
367 |
dfx(1-Olx,j)=0. _d 0 |
dfx(1-OLx,j)=0. _d 0 |
368 |
DO i=1-Olx+1,sNx+Olx |
DO i=1-OLx+1,sNx+OLx |
369 |
dfx(i,j) = -GGL90diffTKEh*xA(i,j) |
dfx(i,j) = -GGL90diffTKEh*xA(i,j) |
370 |
& *_recip_dxC(i,j,bi,bj) |
& *_recip_dxC(i,j,bi,bj) |
371 |
& *(GGL90TKE(i,j,k,bi,bj)-GGL90TKE(i-1,j,k,bi,bj)) |
& *(GGL90TKE(i,j,k,bi,bj)-GGL90TKE(i-1,j,k,bi,bj)) |
373 |
ENDDO |
ENDDO |
374 |
ENDDO |
ENDDO |
375 |
C ... across y-faces |
C ... across y-faces |
376 |
DO i=1-Olx,sNx+Olx |
DO i=1-OLx,sNx+OLx |
377 |
dfy(i,1-Oly)=0. _d 0 |
dfy(i,1-OLy)=0. _d 0 |
378 |
ENDDO |
ENDDO |
379 |
DO j=1-Oly+1,sNy+Oly |
DO j=1-OLy+1,sNy+OLy |
380 |
DO i=1-Olx,sNx+Olx |
DO i=1-OLx,sNx+OLx |
381 |
dfy(i,j) = -GGL90diffTKEh*yA(i,j) |
dfy(i,j) = -GGL90diffTKEh*yA(i,j) |
382 |
& *_recip_dyC(i,j,bi,bj) |
& *_recip_dyC(i,j,bi,bj) |
383 |
& *(GGL90TKE(i,j,k,bi,bj)-GGL90TKE(i,j-1,k,bi,bj)) |
& *(GGL90TKE(i,j,k,bi,bj)-GGL90TKE(i,j-1,k,bi,bj)) |
387 |
ENDDO |
ENDDO |
388 |
ENDDO |
ENDDO |
389 |
C Compute divergence of fluxes |
C Compute divergence of fluxes |
390 |
DO j=1-Oly,sNy+Oly-1 |
DO j=1-OLy,sNy+OLy-1 |
391 |
DO i=1-Olx,sNx+Olx-1 |
DO i=1-OLx,sNx+OLx-1 |
392 |
gTKE(i,j) = |
gTKE(i,j) = |
393 |
& -_recip_hFacC(i,j,k,bi,bj)*recip_drF(k)*recip_rA(i,j,bi,bj) |
& -_recip_hFacC(i,j,k,bi,bj)*recip_drF(k)*recip_rA(i,j,bi,bj) |
394 |
& *( (dfx(i+1,j)-dfx(i,j)) |
& *( (dfx(i+1,j)-dfx(i,j)) |