17 |
C | On entry: | |
C | On entry: | |
18 |
C | dSigmaDrW,S contains the d/dz Sigma | |
C | dSigmaDrW,S contains the d/dz Sigma | |
19 |
C | SlopeX/Y contains X/Y gradients of sigma | |
C | SlopeX/Y contains X/Y gradients of sigma | |
20 |
C | depthZ contains the height (m) of level | |
C | depthZ contains the depth (< 0 !) [m] | |
21 |
C | On exit: | |
C | On exit: | |
22 |
C | dSigmaDrW,S contains the effective dSig/dz | |
C | dSigmaDrW,S contains the effective dSig/dz | |
23 |
C | SlopeX/Y contains X/Y slopes | |
C | SlopeX/Y contains X/Y slopes | |
47 |
_RL dSigmaDrS(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RL dSigmaDrS(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
48 |
_RL LrhoW(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RL LrhoW(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
49 |
_RL LrhoS(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RL LrhoS(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
50 |
_RL depthZ |
_RS depthZ |
51 |
INTEGER K,bi,bj,myThid |
INTEGER K,bi,bj,myThid |
52 |
CEndOfInterface |
CEndOfInterface |
53 |
|
|
55 |
#ifdef GM_BOLUS_ADVEC |
#ifdef GM_BOLUS_ADVEC |
56 |
|
|
57 |
C == Local variables == |
C == Local variables == |
|
_RL gradSmod(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
|
58 |
_RL dSigmaDrLtd(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
_RL dSigmaDrLtd(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
|
_RL SlopeSqr(1-Olx:sNx+Olx,1-Oly:sNy+Oly) |
|
59 |
_RL f1,Smod,f2,Rnondim |
_RL f1,Smod,f2,Rnondim |
60 |
_RL maxSlopeSqr |
_RL maxSlopeSqr |
61 |
_RL slopeCutoff |
_RL slopeCutoff |
124 |
DO j=1-Oly,sNy+Oly |
DO j=1-Oly,sNy+Oly |
125 |
DO i=1-Olx+1,sNx+Olx |
DO i=1-Olx+1,sNx+Olx |
126 |
SlopeX(i,j) = -SlopeX(i,j)/dSigmaDrW(i,j) |
SlopeX(i,j) = -SlopeX(i,j)/dSigmaDrW(i,j) |
127 |
taperX(i,j)=1. _d 0 |
taperX(i,j) = 1. _d 0 |
128 |
ENDDO |
ENDDO |
129 |
ENDDO |
ENDDO |
130 |
|
|
159 |
DO j=1-Oly+1,sNy+Oly |
DO j=1-Oly+1,sNy+Oly |
160 |
DO i=1-Olx,sNx+Olx |
DO i=1-Olx,sNx+Olx |
161 |
SlopeY(i,j) = -SlopeY(i,j)/dSigmaDrS(i,j) |
SlopeY(i,j) = -SlopeY(i,j)/dSigmaDrS(i,j) |
162 |
taperY(i,j)=1. _d 0 |
taperY(i,j) = 1. _d 0 |
163 |
ENDDO |
ENDDO |
164 |
ENDDO |
ENDDO |
165 |
|
|
166 |
#endif /* GM_EXCLUDE_CLIPPING */ |
#endif /* GM_EXCLUDE_CLIPPING */ |
167 |
|
|
168 |
|
ELSEIF (GM_taper_scheme.EQ.'fm07') THEN |
169 |
|
|
170 |
|
STOP 'GMREDI_SLOPE_PSI: AdvForm not yet implemented for fm07' |
171 |
|
|
172 |
ELSE |
ELSE |
173 |
|
|
174 |
#ifdef GM_EXCLUDE_TAPERING |
#ifdef GM_EXCLUDE_TAPERING |
196 |
DO j=1-Oly,sNy+Oly |
DO j=1-Oly,sNy+Oly |
197 |
DO i=1-Olx+1,sNx+Olx |
DO i=1-Olx+1,sNx+Olx |
198 |
SlopeX(i,j) = -SlopeX(i,j)/dSigmaDrW(i,j) |
SlopeX(i,j) = -SlopeX(i,j)/dSigmaDrW(i,j) |
199 |
taperX(i,j)= 1. _d 0 |
taperX(i,j) = 1. _d 0 |
200 |
ENDDO |
ENDDO |
201 |
ENDDO |
ENDDO |
202 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
228 |
DO j=1-Oly+1,sNy+Oly |
DO j=1-Oly+1,sNy+Oly |
229 |
DO i=1-Olx,sNx+Olx |
DO i=1-Olx,sNx+Olx |
230 |
SlopeY(i,j) = -SlopeY(i,j)/dSigmaDrS(i,j) |
SlopeY(i,j) = -SlopeY(i,j)/dSigmaDrS(i,j) |
231 |
taperY(i,j)=1. _d 0 |
taperY(i,j) = 1. _d 0 |
232 |
ENDDO |
ENDDO |
233 |
ENDDO |
ENDDO |
234 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
315 |
DO i=1-Olx+1,sNx+Olx |
DO i=1-Olx+1,sNx+Olx |
316 |
Smod = ABS(SlopeX(i,j)) |
Smod = ABS(SlopeX(i,j)) |
317 |
IF ( Smod .LT. slopeCutoff ) THEN |
IF ( Smod .LT. slopeCutoff ) THEN |
318 |
f1=op5*( 1. _d 0 + TANH( (GM_Scrit-Smod)/GM_Sd )) |
f1=op5*( 1. _d 0 + TANH( (GM_Scrit-Smod)/GM_Sd )) |
319 |
IF (Smod.NE.0.) THEN |
IF (Smod.NE.0.) THEN |
320 |
Rnondim=depthZ/(LrhoW(i,j)*Smod) |
Rnondim = -depthZ/(LrhoW(i,j)*Smod) |
321 |
ELSE |
ELSE |
322 |
Rnondim=0. |
Rnondim = 1. |
323 |
ENDIF |
ENDIF |
324 |
f2=op5*( 1. _d 0 + SIN( fpi*(Rnondim-op5))) |
IF ( Rnondim.GE.1. _d 0 ) THEN |
325 |
taperX(i,j)=f1*f2 |
f2 = 1. _d 0 |
326 |
|
ELSE |
327 |
|
f2 = op5*( 1. _d 0 + SIN( fpi*(Rnondim-op5) )) |
328 |
|
ENDIF |
329 |
|
taperX(i,j)=f1*f2 |
330 |
ENDIF |
ENDIF |
331 |
ENDDO |
ENDDO |
332 |
ENDDO |
ENDDO |
335 |
DO i=1-Olx,sNx+Olx |
DO i=1-Olx,sNx+Olx |
336 |
Smod = ABS(SlopeY(i,j)) |
Smod = ABS(SlopeY(i,j)) |
337 |
IF ( Smod .LT. slopeCutoff ) THEN |
IF ( Smod .LT. slopeCutoff ) THEN |
338 |
f1=op5*( 1. _d 0 + TANH( (GM_Scrit-Smod)/GM_Sd )) |
f1=op5*( 1. _d 0 + TANH( (GM_Scrit-Smod)/GM_Sd )) |
339 |
IF (Smod.NE.0.) THEN |
IF (Smod.NE.0.) THEN |
340 |
Rnondim=depthZ/(LrhoS(i,j)*Smod) |
Rnondim = -depthZ/(LrhoS(i,j)*Smod) |
341 |
ELSE |
ELSE |
342 |
Rnondim=0. |
Rnondim = 1. |
343 |
ENDIF |
ENDIF |
344 |
f2=op5*( 1. _d 0 + SIN( fpi*(Rnondim-op5))) |
IF ( Rnondim.GE.1. _d 0 ) THEN |
345 |
taperY(i,j)=f1*f2 |
f2 = 1. _d 0 |
346 |
|
ELSE |
347 |
|
f2 = op5*( 1. _d 0 + SIN( fpi*(Rnondim-op5) )) |
348 |
|
ENDIF |
349 |
|
taperY(i,j)=f1*f2 |
350 |
ENDIF |
ENDIF |
351 |
ENDDO |
ENDDO |
352 |
ENDDO |
ENDDO |