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" |
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) |
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 |
|
|
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 |
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 |
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 |
C-- Get temporary terms used by tendency routines |
489 |
CALL CALC_COMMON_FACTORS ( |
CALL CALC_COMMON_FACTORS ( |
490 |
I bi,bj,iMin,iMax,jMin,jMax,k, |
I bi,bj,iMin,iMax,jMin,jMax,k, |
491 |
O xA,yA,uTrans,vTrans,rTrans,maskUp, |
O xA,yA,uTrans,vTrans,rTrans,maskUp, |
492 |
I myThid) |
I myThid) |
493 |
|
|
494 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
495 |
CADJ STORE KappaRT(:,:,k) = comlev1_bibj_k, key=kkey, byte=isbyte |
CADJ STORE KappaRT(:,:,k) = comlev1_bibj_k, key=kkey, byte=isbyte |
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 |
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 |
800 |
#ifndef EXCLUDE_DEBUGMODE |
#ifndef EXCLUDE_DEBUGMODE |
801 |
If (debugMode) THEN |
If (debugMode) THEN |
802 |
CALL DEBUG_STATS_RL(1,EtaN,'EtaN (DYNAMICS)',myThid) |
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) |
CALL DEBUG_STATS_RL(Nr,vVel,'Vvel (DYNAMICS)',myThid) |
805 |
CALL DEBUG_STATS_RL(Nr,wVel,'Wvel (DYNAMICS)',myThid) |
CALL DEBUG_STATS_RL(Nr,wVel,'Wvel (DYNAMICS)',myThid) |
806 |
CALL DEBUG_STATS_RL(Nr,theta,'Theta (DYNAMICS)',myThid) |
CALL DEBUG_STATS_RL(Nr,theta,'Theta (DYNAMICS)',myThid) |