43 |
#include "PARAMS.h" |
#include "PARAMS.h" |
44 |
#include "GRID.h" |
#include "GRID.h" |
45 |
#include "FFIELDS.h" |
#include "FFIELDS.h" |
46 |
|
#ifdef ALLOW_KPP |
47 |
|
#include "KPPMIX.h" |
48 |
|
#endif |
49 |
|
|
50 |
|
|
51 |
C == Routine arguments == |
C == Routine arguments == |
52 |
C fZon - Work array for flux of temperature in the east-west |
C fZon - Work array for flux of temperature in the east-west |
96 |
_RL afFacT, dfFacT |
_RL afFacT, dfFacT |
97 |
_RL dTdx(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL dTdx(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
98 |
_RL dTdy(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL dTdy(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
99 |
|
#ifdef ALLOW_KPP |
100 |
|
_RL hbl (1-OLx:sNx+OLx,1-OLy:sNy+OLy) ! used by KPP mixing scheme |
101 |
|
_RL frac (1-OLx:sNx+OLx,1-OLy:sNy+OLy) ! used by KPP mixing scheme |
102 |
|
integer jwtype ! index for Jerlov water type |
103 |
|
#endif |
104 |
|
|
105 |
afFacT = 1. _d 0 |
afFacT = 1. _d 0 |
106 |
dfFacT = 1. _d 0 |
dfFacT = 1. _d 0 |
253 |
ENDDO |
ENDDO |
254 |
ENDIF |
ENDIF |
255 |
#endif /* INCLUDE_T_DIFFUSION_CODE */ |
#endif /* INCLUDE_T_DIFFUSION_CODE */ |
256 |
|
|
257 |
|
#ifdef ALLOW_KPP |
258 |
|
IF (usingKPPmixing) THEN |
259 |
|
C-- Compute fraction of solar short-wave flux penetrating to |
260 |
|
C the bottom of the mixing layer |
261 |
|
DO j=jMin,jMax |
262 |
|
DO i=iMin,iMax |
263 |
|
hbl(i,j) = KPPhbl(i,j,bi,bj) |
264 |
|
ENDDO |
265 |
|
ENDDO |
266 |
|
j=(sNx+2*OLx)*(sNy+2*OLy) |
267 |
|
jwtype = 3 |
268 |
|
CALL SWFRAC( |
269 |
|
I j, -1., hbl, jwtype, |
270 |
|
O frac ) |
271 |
|
|
272 |
|
C Add non local transport coefficient (ghat term) to right-hand-side |
273 |
|
C The nonlocal transport term is noNrero only for scalars in unstable |
274 |
|
C (convective) forcing conditions. |
275 |
|
C Note: -[Qnet * delZ(1) + Qsw * (1-frac) / KPPhbl] * 4000 * rho |
276 |
|
C is the total heat flux |
277 |
|
C penetrating the mixed layer from the surface in (deg C / s) |
278 |
|
IF ( TOP_LAYER ) THEN |
279 |
|
DO j=jMin,jMax |
280 |
|
DO i=iMin,iMax |
281 |
|
df(i,j) = df(i,j) + _rA(i,j,bi,bj) * |
282 |
|
& ( Qnet(i,j,bi,bj) * delZ(1) + |
283 |
|
& Qsw(i,j,bi,bj) * (1.-frac(i,j)) |
284 |
|
& / KPPhbl(i,j,bi,bj) ) * |
285 |
|
& ( KappaRT(i,j,k) * KPPghat(i,j,k, bi,bj) ) |
286 |
|
ENDDO |
287 |
|
ENDDO |
288 |
|
ELSE |
289 |
|
DO j=jMin,jMax |
290 |
|
DO i=iMin,iMax |
291 |
|
df(i,j) = df(i,j) + _rA(i,j,bi,bj) * |
292 |
|
& ( Qnet(i,j,bi,bj) * delZ(1) + |
293 |
|
& Qsw(i,j,bi,bj) * (1.-frac(i,j)) |
294 |
|
& / KPPhbl(i,j,bi,bj) ) * |
295 |
|
& ( KappaRT(i,j,k) * KPPghat(i,j,k, bi,bj) |
296 |
|
& - KappaRT(i,j,k-1) * KPPghat(i,j,k-1,bi,bj) ) |
297 |
|
ENDDO |
298 |
|
ENDDO |
299 |
|
ENDIF |
300 |
|
ENDIF |
301 |
|
#endif /* ALLOW_KPP */ |
302 |
|
|
303 |
C o Net vertical flux |
C o Net vertical flux |
304 |
DO j=jMin,jMax |
DO j=jMin,jMax |
305 |
DO i=iMin,iMax |
DO i=iMin,iMax |