29 |
#include "PARAMS.h" |
#include "PARAMS.h" |
30 |
#include "DYNVARS.h" |
#include "DYNVARS.h" |
31 |
#include "GRID.h" |
#include "GRID.h" |
32 |
|
#ifdef ALLOW_PASSIVE_TRACER |
33 |
|
#include "TR1.h" |
34 |
|
#endif |
35 |
|
|
36 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
37 |
# include "tamc.h" |
# include "tamc.h" |
38 |
# include "tamc_keys.h" |
# include "tamc_keys.h" |
39 |
|
# include "FFIELDS.h" |
40 |
|
# ifdef ALLOW_KPP |
41 |
|
# include "KPP.h" |
42 |
|
# endif |
43 |
|
# ifdef ALLOW_GMREDI |
44 |
|
# include "GMREDI.h" |
45 |
|
# endif |
46 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
47 |
|
|
|
#ifdef ALLOW_KPP |
|
|
# include "KPP.h" |
|
|
#endif |
|
|
|
|
48 |
#ifdef ALLOW_TIMEAVE |
#ifdef ALLOW_TIMEAVE |
49 |
#include "TIMEAVE_STATV.h" |
#include "TIMEAVE_STATV.h" |
50 |
#endif |
#endif |
64 |
C o uTrans: Zonal transport |
C o uTrans: Zonal transport |
65 |
C o vTrans: Meridional transport |
C o vTrans: Meridional transport |
66 |
C o rTrans: Vertical transport |
C o rTrans: Vertical transport |
67 |
C maskC,maskUp o maskC: land/water mask for tracer cells |
C maskUp o maskUp: land/water mask for W points |
|
C o maskUp: land/water mask for W points |
|
68 |
C fVer[STUV] o fVer: Vertical flux term - note fVer |
C fVer[STUV] o fVer: Vertical flux term - note fVer |
69 |
C is "pipelined" in the vertical |
C is "pipelined" in the vertical |
70 |
C so we need an fVer for each |
C so we need an fVer for each |
85 |
C k, kup, - Index for layer above and below. kup and kDown |
C k, kup, - Index for layer above and below. kup and kDown |
86 |
C kDown, km1 are switched with layer to be the appropriate |
C kDown, km1 are switched with layer to be the appropriate |
87 |
C index into fVerTerm. |
C index into fVerTerm. |
88 |
|
C tauAB - Adams-Bashforth timestepping weight: 0=forward ; 1/2=Adams-Bashf. |
89 |
_RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
90 |
_RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS yA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
91 |
_RL uTrans (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL uTrans (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
92 |
_RL vTrans (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vTrans (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
93 |
_RL rTrans (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL rTrans (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
_RS maskC (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
94 |
_RS maskUp (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS maskUp (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
95 |
_RL fVerT (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerT (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
96 |
_RL fVerS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerS (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
97 |
|
_RL fVerTr1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
98 |
_RL fVerU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
99 |
_RL fVerV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
100 |
_RL phiHyd (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL phiHyd (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
109 |
_RL sigmaX (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL sigmaX (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
110 |
_RL sigmaY (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL sigmaY (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
111 |
_RL sigmaR (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL sigmaR (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
112 |
|
_RL tauAB |
113 |
|
|
114 |
C This is currently used by IVDC and Diagnostics |
C This is currently used by IVDC and Diagnostics |
115 |
_RL ConvectCount (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL ConvectCount (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
196 |
ENDDO |
ENDDO |
197 |
rhoKM1 (i,j) = 0. _d 0 |
rhoKM1 (i,j) = 0. _d 0 |
198 |
rhok (i,j) = 0. _d 0 |
rhok (i,j) = 0. _d 0 |
|
maskC (i,j) = 0. _d 0 |
|
199 |
phiSurfX(i,j) = 0. _d 0 |
phiSurfX(i,j) = 0. _d 0 |
200 |
phiSurfY(i,j) = 0. _d 0 |
phiSurfY(i,j) = 0. _d 0 |
201 |
ENDDO |
ENDDO |
212 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
213 |
C-- HPF directive to help TAMC |
C-- HPF directive to help TAMC |
214 |
CHPF$ INDEPENDENT, NEW (rTrans,fVerT,fVerS,fVerU,fVerV |
CHPF$ INDEPENDENT, NEW (rTrans,fVerT,fVerS,fVerU,fVerV |
215 |
CHPF$& ,phiHyd,utrans,vtrans,maskc,xA,yA |
CHPF$& ,phiHyd,utrans,vtrans,xA,yA |
216 |
CHPF$& ,KappaRT,KappaRS,KappaRU,KappaRV |
CHPF$& ,KappaRT,KappaRS,KappaRU,KappaRV |
217 |
CHPF$& ) |
CHPF$& ) |
218 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
239 |
C-- Set up work arrays that need valid initial values |
C-- Set up work arrays that need valid initial values |
240 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
241 |
DO i=1-OLx,sNx+OLx |
DO i=1-OLx,sNx+OLx |
242 |
rTrans(i,j) = 0. _d 0 |
rTrans (i,j) = 0. _d 0 |
243 |
fVerT (i,j,1) = 0. _d 0 |
fVerT (i,j,1) = 0. _d 0 |
244 |
fVerT (i,j,2) = 0. _d 0 |
fVerT (i,j,2) = 0. _d 0 |
245 |
fVerS (i,j,1) = 0. _d 0 |
fVerS (i,j,1) = 0. _d 0 |
246 |
fVerS (i,j,2) = 0. _d 0 |
fVerS (i,j,2) = 0. _d 0 |
247 |
fVerU (i,j,1) = 0. _d 0 |
fVerTr1(i,j,1) = 0. _d 0 |
248 |
fVerU (i,j,2) = 0. _d 0 |
fVerTr1(i,j,2) = 0. _d 0 |
249 |
fVerV (i,j,1) = 0. _d 0 |
fVerU (i,j,1) = 0. _d 0 |
250 |
fVerV (i,j,2) = 0. _d 0 |
fVerU (i,j,2) = 0. _d 0 |
251 |
|
fVerV (i,j,1) = 0. _d 0 |
252 |
|
fVerV (i,j,2) = 0. _d 0 |
253 |
ENDDO |
ENDDO |
254 |
ENDDO |
ENDDO |
255 |
|
|
273 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
274 |
CADJ STORE theta(:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
CADJ STORE theta(:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
275 |
CADJ STORE salt (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
CADJ STORE salt (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
276 |
CADJ STORE uvel(:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
277 |
CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
278 |
|
#ifdef ALLOW_PASSIVE_TRACER |
279 |
|
CADJ STORE tr1 (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
280 |
|
#endif |
281 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
282 |
|
|
283 |
C-- Start of diagnostic loop |
C-- Start of diagnostic loop |
289 |
cph kkey formula corrected. |
cph kkey formula corrected. |
290 |
cph Needed for rhok, rhokm1, in the case useGMREDI. |
cph Needed for rhok, rhokm1, in the case useGMREDI. |
291 |
kkey = (ikey-1)*Nr + k |
kkey = (ikey-1)*Nr + k |
292 |
CADJ STORE rhokm1(:,:) = comlev1_bibj_k , key = kkey, byte = isbyte |
CADJ STORE rhokm1(:,:) = comlev1_bibj_k , key=kkey, byte=isbyte |
293 |
CADJ STORE rhok (:,:) = comlev1_bibj_k , key = kkey, byte = isbyte |
CADJ STORE rhok (:,:) = comlev1_bibj_k , key=kkey, byte=isbyte |
294 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
295 |
|
|
296 |
C-- Integrate continuity vertically for vertical velocity |
C-- Integrate continuity vertically for vertical velocity |
312 |
C slope terms (e.g. GM/Redi tensor or IVDC diffusivity) |
C slope terms (e.g. GM/Redi tensor or IVDC diffusivity) |
313 |
c IF ( k.GT.1 .AND. (useGMRedi.OR.ivdc_kappa.NE.0.) ) THEN |
c IF ( k.GT.1 .AND. (useGMRedi.OR.ivdc_kappa.NE.0.) ) THEN |
314 |
IF ( useGMRedi .OR. (k.GT.1 .AND. ivdc_kappa.NE.0.) ) THEN |
IF ( useGMRedi .OR. (k.GT.1 .AND. ivdc_kappa.NE.0.) ) THEN |
315 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
316 |
|
CADJ STORE theta(:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
317 |
|
CADJ STORE salt (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
318 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
319 |
CALL FIND_RHO( |
CALL FIND_RHO( |
320 |
I bi, bj, iMin, iMax, jMin, jMax, k, k, eosType, |
I bi, bj, iMin, iMax, jMin, jMax, k, k, eosType, |
321 |
I theta, salt, |
I theta, salt, |
322 |
O rhoK, |
O rhoK, |
323 |
I myThid ) |
I myThid ) |
324 |
IF (k.GT.1) CALL FIND_RHO( |
IF (k.GT.1) THEN |
325 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
326 |
|
CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
327 |
|
CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte |
328 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
329 |
|
CALL FIND_RHO( |
330 |
I bi, bj, iMin, iMax, jMin, jMax, k-1, k, eosType, |
I bi, bj, iMin, iMax, jMin, jMax, k-1, k, eosType, |
331 |
I theta, salt, |
I theta, salt, |
332 |
O rhoKm1, |
O rhoKm1, |
333 |
I myThid ) |
I myThid ) |
334 |
|
ENDIF |
335 |
CALL GRAD_SIGMA( |
CALL GRAD_SIGMA( |
336 |
I bi, bj, iMin, iMax, jMin, jMax, k, |
I bi, bj, iMin, iMax, jMin, jMax, k, |
337 |
I rhoK, rhoKm1, rhoK, |
I rhoK, rhoKm1, rhoK, |
352 |
C-- end of diagnostic k loop (Nr:1) |
C-- end of diagnostic k loop (Nr:1) |
353 |
ENDDO |
ENDDO |
354 |
|
|
355 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
356 |
|
cph avoids recomputation of integrate_for_w |
357 |
|
CADJ STORE wvel (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
358 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
359 |
|
|
360 |
#ifdef ALLOW_OBCS |
#ifdef ALLOW_OBCS |
361 |
C-- Calculate future values on open boundaries |
C-- Calculate future values on open boundaries |
362 |
IF (useOBCS) THEN |
IF (useOBCS) THEN |
371 |
CALL EXTERNAL_FORCING_SURF( |
CALL EXTERNAL_FORCING_SURF( |
372 |
I bi, bj, iMin, iMax, jMin, jMax, |
I bi, bj, iMin, iMax, jMin, jMax, |
373 |
I myThid ) |
I myThid ) |
374 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
375 |
|
cph needed for KPP |
376 |
|
CADJ STORE surfacetendencyU(:,:,bi,bj) |
377 |
|
CADJ & = comlev1_bibj, key=ikey, byte=isbyte |
378 |
|
CADJ STORE surfacetendencyV(:,:,bi,bj) |
379 |
|
CADJ & = comlev1_bibj, key=ikey, byte=isbyte |
380 |
|
CADJ STORE surfacetendencyS(:,:,bi,bj) |
381 |
|
CADJ & = comlev1_bibj, key=ikey, byte=isbyte |
382 |
|
CADJ STORE surfacetendencyT(:,:,bi,bj) |
383 |
|
CADJ & = comlev1_bibj, key=ikey, byte=isbyte |
384 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
385 |
|
|
386 |
#ifdef ALLOW_GMREDI |
#ifdef ALLOW_GMREDI |
387 |
|
|
388 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
389 |
|
CADJ STORE sigmaX(:,:,:) = comlev1, key=ikey, byte=isbyte |
390 |
|
CADJ STORE sigmaY(:,:,:) = comlev1, key=ikey, byte=isbyte |
391 |
|
CADJ STORE sigmaR(:,:,:) = comlev1, key=ikey, byte=isbyte |
392 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
393 |
C-- Calculate iso-neutral slopes for the GM/Redi parameterisation |
C-- Calculate iso-neutral slopes for the GM/Redi parameterisation |
394 |
IF (useGMRedi) THEN |
IF (useGMRedi) THEN |
395 |
DO k=1,Nr |
DO k=1,Nr |
408 |
ENDDO |
ENDDO |
409 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
410 |
ENDIF |
ENDIF |
411 |
|
|
412 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
413 |
|
CADJ STORE Kwx(:,:,:,bi,bj) = comlev1_bibj, key=ikey, byte=isbyte |
414 |
|
CADJ STORE Kwy(:,:,:,bi,bj) = comlev1_bibj, key=ikey, byte=isbyte |
415 |
|
CADJ STORE Kwz(:,:,:,bi,bj) = comlev1_bibj, key=ikey, byte=isbyte |
416 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
417 |
|
|
418 |
#endif /* ALLOW_GMREDI */ |
#endif /* ALLOW_GMREDI */ |
419 |
|
|
420 |
#ifdef ALLOW_KPP |
#ifdef ALLOW_KPP |
424 |
I bi, bj, myTime, myThid ) |
I bi, bj, myTime, myThid ) |
425 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
426 |
ELSE |
ELSE |
427 |
DO j=1-OLy,sNy+OLy |
CALL KPP_CALC_DUMMY( |
428 |
DO i=1-OLx,sNx+OLx |
I bi, bj, myTime, myThid ) |
|
KPPhbl (i,j,bi,bj) = 1.0 |
|
|
KPPfrac(i,j,bi,bj) = 0.0 |
|
|
DO k = 1,Nr |
|
|
KPPghat (i,j,k,bi,bj) = 0.0 |
|
|
KPPviscAz (i,j,k,bi,bj) = viscAz |
|
|
KPPdiffKzT(i,j,k,bi,bj) = diffKzT |
|
|
KPPdiffKzS(i,j,k,bi,bj) = diffKzS |
|
|
ENDDO |
|
|
ENDDO |
|
|
ENDDO |
|
429 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
430 |
ENDIF |
ENDIF |
431 |
|
|
447 |
CADJ STORE salt (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
CADJ STORE salt (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
448 |
CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
449 |
CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
450 |
|
#ifdef ALLOW_PASSIVE_TRACER |
451 |
|
CADJ STORE tr1 (:,:,:,bi,bj) = comlev1_bibj, key = ikey, byte = isbyte |
452 |
|
#endif |
453 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
454 |
|
|
455 |
#ifdef ALLOW_AIM |
#ifdef ALLOW_AIM |
457 |
C note(jmc) : phiHyd=0 at this point but is not really used in Molteni Physics |
C note(jmc) : phiHyd=0 at this point but is not really used in Molteni Physics |
458 |
IF ( useAIM ) THEN |
IF ( useAIM ) THEN |
459 |
CALL TIMER_START('AIM_DO_ATMOS_PHYS [DYNAMICS]', myThid) |
CALL TIMER_START('AIM_DO_ATMOS_PHYS [DYNAMICS]', myThid) |
460 |
CALL AIM_DO_ATMOS_PHYSICS( phiHyd, myTime, myThid ) |
CALL AIM_DO_ATMOS_PHYSICS( phiHyd, bi, bj, myTime, myThid ) |
461 |
CALL TIMER_STOP ('AIM_DO_ATMOS_PHYS [DYNAMICS]', myThid) |
CALL TIMER_STOP ('AIM_DO_ATMOS_PHYS [DYNAMICS]', myThid) |
462 |
ENDIF |
ENDIF |
463 |
#endif /* ALLOW_AIM */ |
#endif /* ALLOW_AIM */ |
465 |
|
|
466 |
C-- Start of thermodynamics loop |
C-- Start of thermodynamics loop |
467 |
DO k=Nr,1,-1 |
DO k=Nr,1,-1 |
468 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
469 |
|
C? Patrick Is this formula correct? |
470 |
|
cph Yes, but I rewrote it. |
471 |
|
cph Also, the KappaR? need the index and subscript k! |
472 |
|
kkey = (ikey-1)*Nr + k |
473 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
474 |
|
|
475 |
C-- km1 Points to level above k (=k-1) |
C-- km1 Points to level above k (=k-1) |
476 |
C-- kup Cycles through 1,2 to point to layer above |
C-- kup Cycles through 1,2 to point to layer above |
480 |
kup = 1+MOD(k+1,2) |
kup = 1+MOD(k+1,2) |
481 |
kDown= 1+MOD(k,2) |
kDown= 1+MOD(k,2) |
482 |
|
|
483 |
iMin = 1-OLx+2 |
iMin = 1-OLx |
484 |
iMax = sNx+OLx-1 |
iMax = sNx+OLx |
485 |
jMin = 1-OLy+2 |
jMin = 1-OLy |
486 |
jMax = sNy+OLy-1 |
jMax = sNy+OLy |
487 |
|
|
488 |
|
C-- Get temporary terms used by tendency routines |
489 |
|
CALL CALC_COMMON_FACTORS ( |
490 |
|
I bi,bj,iMin,iMax,jMin,jMax,k, |
491 |
|
O xA,yA,uTrans,vTrans,rTrans,maskUp, |
492 |
|
I myThid) |
493 |
|
|
494 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
495 |
C? Patrick Is this formula correct? |
CADJ STORE KappaRT(:,:,k) = comlev1_bibj_k, key=kkey, byte=isbyte |
496 |
cph Yes, but I rewrote it. |
CADJ STORE KappaRS(:,:,k) = comlev1_bibj_k, key=kkey, byte=isbyte |
|
cph Also, the KappaR? need the index k! |
|
|
kkey = (ikey-1)*Nr + k |
|
|
CADJ STORE KappaRT(:,:,k) = comlev1_bibj_k, key = kkey, byte = isbyte |
|
|
CADJ STORE KappaRS(:,:,k) = comlev1_bibj_k, key = kkey, byte = isbyte |
|
497 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
498 |
|
|
|
C-- Get temporary terms used by tendency routines |
|
|
CALL CALC_COMMON_FACTORS ( |
|
|
I bi,bj,iMin,iMax,jMin,jMax,k,km1,kup,kDown, |
|
|
O xA,yA,uTrans,vTrans,rTrans,maskC,maskUp, |
|
|
I myThid) |
|
|
|
|
499 |
#ifdef INCLUDE_CALC_DIFFUSIVITY_CALL |
#ifdef INCLUDE_CALC_DIFFUSIVITY_CALL |
500 |
C-- Calculate the total vertical diffusivity |
C-- Calculate the total vertical diffusivity |
501 |
CALL CALC_DIFFUSIVITY( |
CALL CALC_DIFFUSIVITY( |
502 |
I bi,bj,iMin,iMax,jMin,jMax,k, |
I bi,bj,iMin,iMax,jMin,jMax,k, |
503 |
I maskC,maskup, |
I maskUp, |
504 |
O KappaRT,KappaRS,KappaRU,KappaRV, |
O KappaRT,KappaRS,KappaRU,KappaRV, |
505 |
I myThid) |
I myThid) |
506 |
#endif |
#endif |
507 |
|
|
508 |
|
iMin = 1-OLx+2 |
509 |
|
iMax = sNx+OLx-1 |
510 |
|
jMin = 1-OLy+2 |
511 |
|
jMax = sNy+OLy-1 |
512 |
|
|
513 |
C-- Calculate active tracer tendencies (gT,gS,...) |
C-- Calculate active tracer tendencies (gT,gS,...) |
514 |
C and step forward storing result in gTnm1, gSnm1, etc. |
C and step forward storing result in gTnm1, gSnm1, etc. |
515 |
IF ( tempStepping ) THEN |
IF ( tempStepping ) THEN |
516 |
CALL CALC_GT( |
CALL CALC_GT( |
517 |
I bi,bj,iMin,iMax,jMin,jMax, k,km1,kup,kDown, |
I bi,bj,iMin,iMax,jMin,jMax, k,km1,kup,kDown, |
518 |
I xA,yA,uTrans,vTrans,rTrans,maskUp,maskC, |
I xA,yA,uTrans,vTrans,rTrans,maskUp, |
519 |
I KappaRT, |
I KappaRT, |
520 |
U fVerT, |
U fVerT, |
521 |
I myTime, myThid) |
I myTime, myThid) |
522 |
|
tauAB = 0.5d0 + abEps |
523 |
CALL TIMESTEP_TRACER( |
CALL TIMESTEP_TRACER( |
524 |
I bi,bj,iMin,iMax,jMin,jMax,k, |
I bi,bj,iMin,iMax,jMin,jMax,k,tauAB, |
525 |
I theta, gT, |
I theta, gT, |
526 |
U gTnm1, |
U gTnm1, |
527 |
I myIter, myThid) |
I myIter, myThid) |
529 |
IF ( saltStepping ) THEN |
IF ( saltStepping ) THEN |
530 |
CALL CALC_GS( |
CALL CALC_GS( |
531 |
I bi,bj,iMin,iMax,jMin,jMax, k,km1,kup,kDown, |
I bi,bj,iMin,iMax,jMin,jMax, k,km1,kup,kDown, |
532 |
I xA,yA,uTrans,vTrans,rTrans,maskUp,maskC, |
I xA,yA,uTrans,vTrans,rTrans,maskUp, |
533 |
I KappaRS, |
I KappaRS, |
534 |
U fVerS, |
U fVerS, |
535 |
I myTime, myThid) |
I myTime, myThid) |
536 |
|
tauAB = 0.5d0 + abEps |
537 |
CALL TIMESTEP_TRACER( |
CALL TIMESTEP_TRACER( |
538 |
I bi,bj,iMin,iMax,jMin,jMax,k, |
I bi,bj,iMin,iMax,jMin,jMax,k,tauAB, |
539 |
I salt, gS, |
I salt, gS, |
540 |
U gSnm1, |
U gSnm1, |
541 |
I myIter, myThid) |
I myIter, myThid) |
542 |
ENDIF |
ENDIF |
543 |
|
#ifdef ALLOW_PASSIVE_TRACER |
544 |
|
IF ( tr1Stepping ) THEN |
545 |
|
CALL CALC_GTR1( |
546 |
|
I bi,bj,iMin,iMax,jMin,jMax, k,km1,kup,kDown, |
547 |
|
I xA,yA,uTrans,vTrans,rTrans,maskUp, |
548 |
|
I KappaRT, |
549 |
|
U fVerTr1, |
550 |
|
I myTime, myThid) |
551 |
|
tauAB = 0.5d0 + abEps |
552 |
|
CALL TIMESTEP_TRACER( |
553 |
|
I bi,bj,iMin,iMax,jMin,jMax,k,tauAB, |
554 |
|
I Tr1, gTr1, |
555 |
|
U gTr1NM1, |
556 |
|
I myIter, myThid) |
557 |
|
ENDIF |
558 |
|
#endif |
559 |
|
|
560 |
#ifdef ALLOW_OBCS |
#ifdef ALLOW_OBCS |
561 |
C-- Apply open boundary conditions |
C-- Apply open boundary conditions |
614 |
I myThid ) |
I myThid ) |
615 |
ENDIF |
ENDIF |
616 |
|
|
617 |
|
#ifdef ALLOW_PASSIVE_TRACER |
618 |
|
IF (tr1Stepping) THEN |
619 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
620 |
|
CADJ STORE gTr1Nm1(:,:,:,bi,bj) = comlev1_bibj , key=ikey, byte=isbyte |
621 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
622 |
|
CALL IMPLDIFF( |
623 |
|
I bi, bj, iMin, iMax, jMin, jMax, |
624 |
|
I deltaTtracer, KappaRT, recip_HFacC, |
625 |
|
U gTr1Nm1, |
626 |
|
I myThid ) |
627 |
|
ENDIF |
628 |
|
#endif |
629 |
|
|
630 |
#ifdef ALLOW_OBCS |
#ifdef ALLOW_OBCS |
631 |
C-- Apply open boundary conditions |
C-- Apply open boundary conditions |
632 |
IF (useOBCS) THEN |
IF (useOBCS) THEN |
785 |
|
|
786 |
#ifdef ALLOW_TIMEAVE |
#ifdef ALLOW_TIMEAVE |
787 |
IF (taveFreq.GT.0.) THEN |
IF (taveFreq.GT.0.) THEN |
788 |
CALL TIMEAVE_CUMULATE(phiHydtave, phiHyd, Nr, |
CALL TIMEAVE_CUMUL_1T(phiHydtave, phiHyd, Nr, |
789 |
I deltaTclock, bi, bj, myThid) |
I deltaTclock, bi, bj, myThid) |
790 |
IF (ivdc_kappa.NE.0.) THEN |
IF (ivdc_kappa.NE.0.) THEN |
791 |
CALL TIMEAVE_CUMULATE(ConvectCountTave, ConvectCount, Nr, |
CALL TIMEAVE_CUMULATE(ConvectCountTave, ConvectCount, Nr, |
797 |
ENDDO |
ENDDO |
798 |
ENDDO |
ENDDO |
799 |
|
|
800 |
|
#ifndef EXCLUDE_DEBUGMODE |
801 |
|
If (debugMode) THEN |
802 |
|
CALL DEBUG_STATS_RL(1,EtaN,'EtaN (DYNAMICS)',myThid) |
803 |
|
CALL DEBUG_STATS_RL(Nr,uVel,'Uvel (DYNAMICS)',myThid) |
804 |
|
CALL DEBUG_STATS_RL(Nr,vVel,'Vvel (DYNAMICS)',myThid) |
805 |
|
CALL DEBUG_STATS_RL(Nr,wVel,'Wvel (DYNAMICS)',myThid) |
806 |
|
CALL DEBUG_STATS_RL(Nr,theta,'Theta (DYNAMICS)',myThid) |
807 |
|
CALL DEBUG_STATS_RL(Nr,salt,'Salt (DYNAMICS)',myThid) |
808 |
|
CALL DEBUG_STATS_RL(Nr,Gu,'Gu (DYNAMICS)',myThid) |
809 |
|
CALL DEBUG_STATS_RL(Nr,Gv,'Gv (DYNAMICS)',myThid) |
810 |
|
CALL DEBUG_STATS_RL(Nr,Gt,'Gt (DYNAMICS)',myThid) |
811 |
|
CALL DEBUG_STATS_RL(Nr,Gs,'Gs (DYNAMICS)',myThid) |
812 |
|
CALL DEBUG_STATS_RL(Nr,GuNm1,'GuNm1 (DYNAMICS)',myThid) |
813 |
|
CALL DEBUG_STATS_RL(Nr,GvNm1,'GvNm1 (DYNAMICS)',myThid) |
814 |
|
CALL DEBUG_STATS_RL(Nr,GtNm1,'GtNm1 (DYNAMICS)',myThid) |
815 |
|
CALL DEBUG_STATS_RL(Nr,GsNm1,'GsNm1 (DYNAMICS)',myThid) |
816 |
|
ENDIF |
817 |
|
#endif |
818 |
|
|
819 |
RETURN |
RETURN |
820 |
END |
END |