40 |
# include "KPP.h" |
# include "KPP.h" |
41 |
#endif |
#endif |
42 |
|
|
43 |
|
#ifdef INCLUDE_DIAGNOSTICS_INTERFACE_CODE |
44 |
|
#include "AVER.h" |
45 |
|
#endif |
46 |
|
|
47 |
C == Routine arguments == |
C == Routine arguments == |
48 |
C myTime - Current time in simulation |
C myTime - Current time in simulation |
49 |
C myIter - Current iteration number in simulation |
C myIter - Current iteration number in simulation |
72 |
C In p coords phiHydiHyd is the geopotential |
C In p coords phiHydiHyd is the geopotential |
73 |
C surface height |
C surface height |
74 |
C anomaly. |
C anomaly. |
75 |
C etaSurfX, - Holds surface elevation gradient in X and Y. |
C phiSurfX, - gradient of Surface potentiel (Pressure/rho, ocean) |
76 |
C etaSurfY |
C phiSurfY or geopotentiel (atmos) in X and Y direction |
77 |
C KappaRT, - Total diffusion in vertical for T and S. |
C KappaRT, - Total diffusion in vertical for T and S. |
78 |
C KappaRS (background + spatially varying, isopycnal term). |
C KappaRS (background + spatially varying, isopycnal term). |
79 |
C iMin, iMax - Ranges and sub-block indices on which calculations |
C iMin, iMax - Ranges and sub-block indices on which calculations |
96 |
_RL phiHyd (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL phiHyd (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
97 |
_RL rhokm1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL rhokm1 (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
98 |
_RL rhok (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL rhok (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
99 |
|
_RL phiSurfX(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
100 |
|
_RL phiSurfY(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
101 |
_RL KappaRT (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
_RL KappaRT (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
102 |
_RL KappaRS (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
_RL KappaRS (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
103 |
_RL KappaRU (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
_RL KappaRU (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr) |
106 |
_RL sigmaY (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL sigmaY (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
107 |
_RL sigmaR (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL sigmaR (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
108 |
|
|
109 |
C This is currently also used by IVDC and Diagnostics |
C This is currently used by IVDC and Diagnostics |
|
C #ifdef INCLUDE_CONVECT_CALL |
|
110 |
_RL ConvectCount (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL ConvectCount (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
|
C #endif |
|
111 |
|
|
112 |
INTEGER iMin, iMax |
INTEGER iMin, iMax |
113 |
INTEGER jMin, jMax |
INTEGER jMin, jMax |
115 |
INTEGER i, j |
INTEGER i, j |
116 |
INTEGER k, km1, kup, kDown |
INTEGER k, km1, kup, kDown |
117 |
|
|
118 |
|
Cjmc : add for phiHyd output <- but not working if multi tile per CPU |
119 |
|
c CHARACTER*(MAX_LEN_MBUF) suff |
120 |
|
c LOGICAL DIFFERENT_MULTIPLE |
121 |
|
c EXTERNAL DIFFERENT_MULTIPLE |
122 |
|
Cjmc(end) |
123 |
|
|
124 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
125 |
INTEGER isbyte |
INTEGER isbyte |
126 |
PARAMETER( isbyte = 4 ) |
PARAMETER( isbyte = 4 ) |
202 |
rhoKM1 (i,j) = 0. _d 0 |
rhoKM1 (i,j) = 0. _d 0 |
203 |
rhok (i,j) = 0. _d 0 |
rhok (i,j) = 0. _d 0 |
204 |
maskC (i,j) = 0. _d 0 |
maskC (i,j) = 0. _d 0 |
205 |
|
phiSurfX(i,j) = 0. _d 0 |
206 |
|
phiSurfY(i,j) = 0. _d 0 |
207 |
ENDDO |
ENDDO |
208 |
ENDDO |
ENDDO |
209 |
|
|
260 |
DO k=1,Nr |
DO k=1,Nr |
261 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
262 |
DO i=1-OLx,sNx+OLx |
DO i=1-OLx,sNx+OLx |
263 |
#ifdef INCLUDE_CONVECT_CALL |
C This is currently also used by IVDC and Diagnostics |
264 |
ConvectCount(i,j,k) = 0. |
ConvectCount(i,j,k) = 0. |
|
#endif |
|
265 |
KappaRT(i,j,k) = 0. _d 0 |
KappaRT(i,j,k) = 0. _d 0 |
266 |
KappaRS(i,j,k) = 0. _d 0 |
KappaRS(i,j,k) = 0. _d 0 |
267 |
ENDDO |
ENDDO |
327 |
I rhoKm1, rhoK, |
I rhoKm1, rhoK, |
328 |
U ConvectCount, KappaRT, KappaRS, |
U ConvectCount, KappaRT, KappaRS, |
329 |
I myTime, myIter, myThid) |
I myTime, myIter, myThid) |
330 |
END IF |
ENDIF |
331 |
|
|
332 |
C-- end of diagnostic k loop (Nr:1) |
C-- end of diagnostic k loop (Nr:1) |
333 |
ENDDO |
ENDDO |
493 |
C-- Implicit diffusion |
C-- Implicit diffusion |
494 |
IF (implicitDiffusion) THEN |
IF (implicitDiffusion) THEN |
495 |
|
|
496 |
IF (tempStepping) THEN |
IF (tempStepping) THEN |
497 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
498 |
idkey = iikey + 1 |
idkey = iikey + 1 |
499 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
527 |
C-- End If implicitDiffusion |
C-- End If implicitDiffusion |
528 |
ENDIF |
ENDIF |
529 |
|
|
530 |
|
C-- Start computation of dynamics |
531 |
|
iMin = 1-OLx+2 |
532 |
|
iMax = sNx+OLx-1 |
533 |
|
jMin = 1-OLy+2 |
534 |
|
jMax = sNy+OLy-1 |
535 |
|
|
536 |
|
C-- Explicit part of the Surface Pressure Gradient (add in TIMESTEP) |
537 |
|
C (note: this loop will be replaced by CALL CALC_GRAD_ETA) |
538 |
|
IF (implicSurfPress.NE.1.) THEN |
539 |
|
DO j=jMin,jMax |
540 |
|
DO i=iMin,iMax |
541 |
|
phiSurfX(i,j) = _recip_dxC(i,j,bi,bj)*gBaro |
542 |
|
& *(cg2d_x(i,j,bi,bj)-cg2d_x(i-1,j,bi,bj)) |
543 |
|
phiSurfY(i,j) = _recip_dyC(i,j,bi,bj)*gBaro |
544 |
|
& *(cg2d_x(i,j,bi,bj)-cg2d_x(i,j-1,bi,bj)) |
545 |
|
ENDDO |
546 |
|
ENDDO |
547 |
|
ENDIF |
548 |
|
|
549 |
C-- Start of dynamics loop |
C-- Start of dynamics loop |
550 |
DO k=1,Nr |
DO k=1,Nr |
557 |
kup = 1+MOD(k+1,2) |
kup = 1+MOD(k+1,2) |
558 |
kDown= 1+MOD(k,2) |
kDown= 1+MOD(k,2) |
559 |
|
|
|
iMin = 1-OLx+2 |
|
|
iMax = sNx+OLx-1 |
|
|
jMin = 1-OLy+2 |
|
|
jMax = sNy+OLy-1 |
|
|
|
|
560 |
C-- Integrate hydrostatic balance for phiHyd with BC of |
C-- Integrate hydrostatic balance for phiHyd with BC of |
561 |
C phiHyd(z=0)=0 |
C phiHyd(z=0)=0 |
562 |
C distinguishe between Stagger and Non Stagger time stepping |
C distinguishe between Stagger and Non Stagger time stepping |
583 |
U fVerU, fVerV, |
U fVerU, fVerV, |
584 |
I myTime, myThid) |
I myTime, myThid) |
585 |
CALL TIMESTEP( |
CALL TIMESTEP( |
586 |
I bi,bj,iMin,iMax,jMin,jMax,k,phiHyd, |
I bi,bj,iMin,iMax,jMin,jMax,k, |
587 |
|
I phiHyd, phiSurfX, phiSurfY, |
588 |
I myIter, myThid) |
I myIter, myThid) |
589 |
|
|
590 |
#ifdef ALLOW_OBCS |
#ifdef ALLOW_OBCS |
662 |
C-- End If implicitViscosity.AND.momStepping |
C-- End If implicitViscosity.AND.momStepping |
663 |
ENDIF |
ENDIF |
664 |
|
|
665 |
|
Cjmc : add for phiHyd output <- but not working if multi tile per CPU |
666 |
|
c IF ( DIFFERENT_MULTIPLE(dumpFreq,myTime+deltaTClock,myTime) |
667 |
|
c & .AND. buoyancyRelation .eq. 'ATMOSPHERIC' ) THEN |
668 |
|
c WRITE(suff,'(I10.10)') myIter+1 |
669 |
|
c CALL WRITE_FLD_XYZ_RL('PH.',suff,phiHyd,myIter+1,myThid) |
670 |
|
c ENDIF |
671 |
|
Cjmc(end) |
672 |
|
|
673 |
|
#ifdef INCLUDE_DIAGNOSTICS_INTERFACE_CODE |
674 |
|
IF (taveFreq.GT.0.) THEN |
675 |
|
DO K=1,Nr |
676 |
|
CALL TIMEAVER_1FLD_XYZ(phiHyd, phiHydtave, |
677 |
|
I deltaTclock, bi, bj, K, myThid) |
678 |
|
IF (ivdc_kappa.NE.0.) THEN |
679 |
|
CALL TIMEAVER_1FLD_XYZ(ConvectCount, ConvectCountTave, |
680 |
|
I deltaTclock, bi, bj, K, myThid) |
681 |
|
ENDIF |
682 |
|
ENDDO |
683 |
|
ENDIF |
684 |
|
#endif /* INCLUDE_DIAGNOSTICS_INTERFACE_CODE */ |
685 |
|
|
686 |
ENDDO |
ENDDO |
687 |
ENDDO |
ENDDO |
688 |
|
|