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" |
168 |
C jMin, jMax are applied. |
C jMin, jMax are applied. |
169 |
C bi, bj |
C bi, bj |
170 |
C k, kup, - Index for layer above and below. kup and kDown |
C k, kup, - Index for layer above and below. kup and kDown |
171 |
C kDown, km1 are switched with layer to be the appropriate |
C kDown, km1 are switched with layer to be the appropriate |
172 |
C index into fVerTerm. |
C index into fVerTerm. |
173 |
_RL fVerU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
174 |
_RL fVerV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
317 |
guDissip(i,j) = 0. _d 0 |
guDissip(i,j) = 0. _d 0 |
318 |
gvDissip(i,j) = 0. _d 0 |
gvDissip(i,j) = 0. _d 0 |
319 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
320 |
|
phiHydLow(i,j,bi,bj) = 0. _d 0 |
321 |
# ifdef NONLIN_FRSURF |
# ifdef NONLIN_FRSURF |
322 |
# ifndef DISABLE_RSTAR_CODE |
# ifndef DISABLE_RSTAR_CODE |
323 |
dWtransC(i,j,bi,bj) = 0. _d 0 |
dWtransC(i,j,bi,bj) = 0. _d 0 |
395 |
kup = 1+MOD(k+1,2) |
kup = 1+MOD(k+1,2) |
396 |
kDown= 1+MOD(k,2) |
kDown= 1+MOD(k,2) |
397 |
|
|
398 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
399 |
kkey = (idynkey-1)*Nr + k |
kkey = (idynkey-1)*Nr + k |
400 |
c |
c |
401 |
CADJ STORE totphihyd (:,:,k,bi,bj) |
CADJ STORE totphihyd (:,:,k,bi,bj) |
402 |
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
403 |
|
CADJ STORE phihydlow (:,:,bi,bj) |
404 |
|
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
405 |
CADJ STORE theta (:,:,k,bi,bj) |
CADJ STORE theta (:,:,k,bi,bj) |
406 |
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
407 |
CADJ STORE salt (:,:,k,bi,bj) |
CADJ STORE salt (:,:,k,bi,bj) |
451 |
# endif |
# endif |
452 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
#endif /* ALLOW_AUTODIFF_TAMC */ |
453 |
|
|
454 |
C-- Integrate hydrostatic balance for phiHyd with BC of |
C-- Integrate hydrostatic balance for phiHyd with BC of |
455 |
C phiHyd(z=0)=0 |
C phiHyd(z=0)=0 |
456 |
IF ( implicitIntGravWave ) THEN |
IF ( implicitIntGravWave ) THEN |
457 |
CALL CALC_PHI_HYD( |
CALL CALC_PHI_HYD( |
497 |
ELSE |
ELSE |
498 |
#ifdef ALLOW_MOM_VECINV |
#ifdef ALLOW_MOM_VECINV |
499 |
C |
C |
500 |
# ifdef ALLOW_AUTODIFF_TAMC |
# ifdef ALLOW_AUTODIFF_TAMC |
501 |
# ifdef NONLIN_FRSURF |
# ifdef NONLIN_FRSURF |
502 |
CADJ STORE fVerU(:,:,:) |
CADJ STORE fVerU(:,:,:) |
503 |
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
CADJ & = comlev1_bibj_k, key=kkey, byte=isbyte |
632 |
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 |
633 |
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 |
634 |
C has to be removed by something like the following subroutine: |
C has to be removed by something like the following subroutine: |
635 |
C CALL REMOVE_MEAN_RL( 1, phiHydLow, maskH, maskH, rA, drF, |
C CALL REMOVE_MEAN_RL( 1, phiHydLow, maskInC, maskInC, rA, drF, |
636 |
C & 'phiHydLow', myThid ) |
C & 'phiHydLow', myTime, myThid ) |
637 |
Cml) |
Cml) |
638 |
|
|
639 |
#ifdef ALLOW_DIAGNOSTICS |
#ifdef ALLOW_DIAGNOSTICS |
674 |
#endif |
#endif |
675 |
|
|
676 |
#ifdef DYNAMICS_GUGV_EXCH_CHECK |
#ifdef DYNAMICS_GUGV_EXCH_CHECK |
677 |
C- jmc: For safety checking only: This Exchange here should not change |
C- jmc: For safety checking only: This Exchange here should not change |
678 |
C the solution. If solution changes, it means something is wrong, |
C the solution. If solution changes, it means something is wrong, |
679 |
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. |
680 |
IF ( debugLevel .GT. debLevB ) THEN |
IF ( debugLevel .GT. debLevB ) THEN |
681 |
CALL EXCH_UV_XYZ_RL(gU,gV,.TRUE.,myThid) |
CALL EXCH_UV_XYZ_RL(gU,gV,.TRUE.,myThid) |