15 |
SUBROUTINE DYNAMICS(myTime, myIter, myThid) |
SUBROUTINE DYNAMICS(myTime, myIter, myThid) |
16 |
C !DESCRIPTION: \bv |
C !DESCRIPTION: \bv |
17 |
C *==========================================================* |
C *==========================================================* |
18 |
C | SUBROUTINE DYNAMICS |
C | SUBROUTINE DYNAMICS |
19 |
C | o Controlling routine for the explicit part of the model |
C | o Controlling routine for the explicit part of the model |
20 |
C | dynamics. |
C | dynamics. |
21 |
C *==========================================================* |
C *==========================================================* |
22 |
C | This routine evaluates the "dynamics" terms for each |
C | This routine evaluates the "dynamics" terms for each |
23 |
C | block of ocean in turn. Because the blocks of ocean have |
C | block of ocean in turn. Because the blocks of ocean have |
24 |
C | overlap regions they are independent of one another. |
C | overlap regions they are independent of one another. |
25 |
C | If terms involving lateral integrals are needed in this |
C | If terms involving lateral integrals are needed in this |
26 |
C | routine care will be needed. Similarly finite-difference |
C | routine care will be needed. Similarly finite-difference |
27 |
C | operations with stencils wider than the overlap region |
C | operations with stencils wider than the overlap region |
28 |
C | require special consideration. |
C | require special consideration. |
29 |
C | The algorithm... |
C | The algorithm... |
30 |
C | |
C | |
31 |
C | "Correction Step" |
C | "Correction Step" |
146 |
INTEGER myIter |
INTEGER myIter |
147 |
INTEGER myThid |
INTEGER myThid |
148 |
|
|
149 |
|
C !FUNCTIONS: |
150 |
|
#ifdef ALLOW_DIAGNOSTICS |
151 |
|
LOGICAL DIAGNOSTICS_IS_ON |
152 |
|
EXTERNAL DIAGNOSTICS_IS_ON |
153 |
|
#endif |
154 |
|
|
155 |
C !LOCAL VARIABLES: |
C !LOCAL VARIABLES: |
156 |
C == Local variables |
C == Local variables |
157 |
C fVer[UV] o fVer: Vertical flux term - note fVer |
C fVer[UV] o fVer: Vertical flux term - note fVer |
174 |
C jMin, jMax are applied. |
C jMin, jMax are applied. |
175 |
C bi, bj |
C bi, bj |
176 |
C k, kup, - Index for layer above and below. kup and kDown |
C k, kup, - Index for layer above and below. kup and kDown |
177 |
C kDown, km1 are switched with layer to be the appropriate |
C kDown, km1 are switched with layer to be the appropriate |
178 |
C index into fVerTerm. |
C index into fVerTerm. |
179 |
_RL fVerU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
180 |
_RL fVerV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
196 |
INTEGER k, km1, kp1, kup, kDown |
INTEGER k, km1, kp1, kup, kDown |
197 |
|
|
198 |
#ifdef ALLOW_DIAGNOSTICS |
#ifdef ALLOW_DIAGNOSTICS |
199 |
|
LOGICAL dPhiHydDiagIsOn |
200 |
_RL tmpFac |
_RL tmpFac |
201 |
#endif /* ALLOW_DIAGNOSTICS */ |
#endif /* ALLOW_DIAGNOSTICS */ |
202 |
|
|
251 |
& CALL DEBUG_ENTER( 'DYNAMICS', myThid ) |
& CALL DEBUG_ENTER( 'DYNAMICS', myThid ) |
252 |
#endif |
#endif |
253 |
|
|
254 |
|
#ifdef ALLOW_DIAGNOSTICS |
255 |
|
dPhiHydDiagIsOn = .FALSE. |
256 |
|
IF ( useDiagnostics ) |
257 |
|
& dPhiHydDiagIsOn = DIAGNOSTICS_IS_ON( 'Um_dPHdx', myThid ) |
258 |
|
& .OR. DIAGNOSTICS_IS_ON( 'Vm_dPHdy', myThid ) |
259 |
|
#endif |
260 |
|
|
261 |
C-- Call to routine for calculation of |
C-- Call to routine for calculation of |
262 |
C Eliassen-Palm-flux-forced U-tendency, |
C Eliassen-Palm-flux-forced U-tendency, |
263 |
C if desired: |
C if desired: |
331 |
guDissip(i,j) = 0. _d 0 |
guDissip(i,j) = 0. _d 0 |
332 |
gvDissip(i,j) = 0. _d 0 |
gvDissip(i,j) = 0. _d 0 |
333 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
334 |
|
phiHydLow(i,j,bi,bj) = 0. _d 0 |
335 |
# ifdef NONLIN_FRSURF |
# ifdef NONLIN_FRSURF |
336 |
# ifndef DISABLE_RSTAR_CODE |
# ifndef DISABLE_RSTAR_CODE |
337 |
dWtransC(i,j,bi,bj) = 0. _d 0 |
dWtransC(i,j,bi,bj) = 0. _d 0 |
409 |
kup = 1+MOD(k+1,2) |
kup = 1+MOD(k+1,2) |
410 |
kDown= 1+MOD(k,2) |
kDown= 1+MOD(k,2) |
411 |
|
|
412 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
413 |
kkey = (idynkey-1)*Nr + k |
kkey = (idynkey-1)*Nr + k |
414 |
c |
c |
415 |
CADJ STORE totphihyd (:,:,k,bi,bj) |
CADJ STORE totphihyd (:,:,k,bi,bj) |
416 |
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
417 |
|
CADJ STORE phihydlow (:,:,bi,bj) |
418 |
|
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
419 |
CADJ STORE theta (:,:,k,bi,bj) |
CADJ STORE theta (:,:,k,bi,bj) |
420 |
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
421 |
CADJ STORE salt (:,:,k,bi,bj) |
CADJ STORE salt (:,:,k,bi,bj) |
465 |
# endif |
# endif |
466 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
467 |
|
|
468 |
C-- Integrate hydrostatic balance for phiHyd with BC of |
C-- Integrate hydrostatic balance for phiHyd with BC of |
469 |
C phiHyd(z=0)=0 |
C phiHyd(z=0)=0 |
470 |
IF ( implicitIntGravWave ) THEN |
IF ( implicitIntGravWave ) THEN |
471 |
CALL CALC_PHI_HYD( |
CALL CALC_PHI_HYD( |
482 |
O phiHydC, dPhiHydX, dPhiHydY, |
O phiHydC, dPhiHydX, dPhiHydY, |
483 |
I myTime, myIter, myThid ) |
I myTime, myIter, myThid ) |
484 |
ENDIF |
ENDIF |
485 |
|
#ifdef ALLOW_DIAGNOSTICS |
486 |
|
IF ( dPhiHydDiagIsOn ) THEN |
487 |
|
tmpFac = -1. _d 0 |
488 |
|
CALL DIAGNOSTICS_SCALE_FILL( dPhiHydX, tmpFac, 1, |
489 |
|
& 'Um_dPHdx', k, 1, 2, bi, bj, myThid ) |
490 |
|
CALL DIAGNOSTICS_SCALE_FILL( dPhiHydY, tmpFac, 1, |
491 |
|
& 'Vm_dPHdy', k, 1, 2, bi, bj, myThid ) |
492 |
|
ENDIF |
493 |
|
#endif /* ALLOW_DIAGNOSTICS */ |
494 |
|
|
495 |
C-- Calculate accelerations in the momentum equations (gU, gV, ...) |
C-- Calculate accelerations in the momentum equations (gU, gV, ...) |
496 |
C and step forward storing the result in gU, gV, etc... |
C and step forward storing the result in gU, gV, etc... |
520 |
ELSE |
ELSE |
521 |
#ifdef ALLOW_MOM_VECINV |
#ifdef ALLOW_MOM_VECINV |
522 |
C |
C |
523 |
# ifdef ALLOW_AUTODIFF_TAMC |
# ifdef ALLOW_AUTODIFF_TAMC |
524 |
# ifdef NONLIN_FRSURF |
# ifdef NONLIN_FRSURF |
525 |
CADJ STORE fVerU(:,:,:) |
CADJ STORE fVerU(:,:,:) |
526 |
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
655 |
C In order to compare the variance of phiHydLow of a p/z-coordinate |
C In order to compare the variance of phiHydLow of a p/z-coordinate |
656 |
C run with etaH of a z/p-coordinate run the drift of phiHydLow |
C run with etaH of a z/p-coordinate run the drift of phiHydLow |
657 |
C has to be removed by something like the following subroutine: |
C has to be removed by something like the following subroutine: |
658 |
C CALL REMOVE_MEAN_RL( 1, phiHydLow, maskH, maskH, rA, drF, |
C CALL REMOVE_MEAN_RL( 1, phiHydLow, maskInC, maskInC, rA, drF, |
659 |
C & 'phiHydLow', myTime, myThid ) |
C & 'phiHydLow', myTime, myThid ) |
660 |
Cml) |
Cml) |
661 |
|
|
662 |
#ifdef ALLOW_DIAGNOSTICS |
#ifdef ALLOW_DIAGNOSTICS |
697 |
#endif |
#endif |
698 |
|
|
699 |
#ifdef DYNAMICS_GUGV_EXCH_CHECK |
#ifdef DYNAMICS_GUGV_EXCH_CHECK |
700 |
C- jmc: For safety checking only: This Exchange here should not change |
C- jmc: For safety checking only: This Exchange here should not change |
701 |
C the solution. If solution changes, it means something is wrong, |
C the solution. If solution changes, it means something is wrong, |
702 |
C but it does not mean that it is less wrong with this exchange. |
C but it does not mean that it is less wrong with this exchange. |
703 |
IF ( debugLevel .GT. debLevB ) THEN |
IF ( debugLevel .GT. debLevB ) THEN |
704 |
CALL EXCH_UV_XYZ_RL(gU,gV,.TRUE.,myThid) |
CALL EXCH_UV_XYZ_RL(gU,gV,.TRUE.,myThid) |