| 52 |
#include "PARAMS.h" |
#include "PARAMS.h" |
| 53 |
#include "GRID.h" |
#include "GRID.h" |
| 54 |
#include "SURFACE.h" |
#include "SURFACE.h" |
| 55 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
| 56 |
|
# include "tamc.h" |
| 57 |
|
# include "tamc_keys.h" |
| 58 |
|
# include "MOM_FLUXFORM.h" |
| 59 |
|
#endif |
| 60 |
|
|
| 61 |
C !INPUT PARAMETERS: =================================================== |
C !INPUT PARAMETERS: =================================================== |
| 62 |
C bi,bj :: tile indices |
C bi,bj :: tile indices |
| 98 |
C fMer :: meridional fluxes |
C fMer :: meridional fluxes |
| 99 |
C fVrUp,fVrDw :: vertical viscous fluxes at interface k-1 & k |
C fVrUp,fVrDw :: vertical viscous fluxes at interface k-1 & k |
| 100 |
INTEGER i,j |
INTEGER i,j |
| 101 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
| 102 |
|
INTEGER imomkey |
| 103 |
|
#endif |
| 104 |
_RL vF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
| 105 |
_RL v4F(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL v4F(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
| 106 |
_RL cF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL cF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
| 159 |
LOGICAL bottomDragTerms,harmonic,biharmonic,useVariableViscosity |
LOGICAL bottomDragTerms,harmonic,biharmonic,useVariableViscosity |
| 160 |
CEOP |
CEOP |
| 161 |
|
|
| 162 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
| 163 |
|
act0 = k - 1 |
| 164 |
|
max0 = Nr |
| 165 |
|
act1 = bi - myBxLo(myThid) |
| 166 |
|
max1 = myBxHi(myThid) - myBxLo(myThid) + 1 |
| 167 |
|
act2 = bj - myByLo(myThid) |
| 168 |
|
max2 = myByHi(myThid) - myByLo(myThid) + 1 |
| 169 |
|
act3 = myThid - 1 |
| 170 |
|
max3 = nTx*nTy |
| 171 |
|
act4 = ikey_dynamics - 1 |
| 172 |
|
imomkey = (act0 + 1) |
| 173 |
|
& + act1*max0 |
| 174 |
|
& + act2*max0*max1 |
| 175 |
|
& + act3*max0*max1*max2 |
| 176 |
|
& + act4*max0*max1*max2*max3 |
| 177 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
| 178 |
|
|
| 179 |
C Initialise intermediate terms |
C Initialise intermediate terms |
| 180 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
| 181 |
DO i=1-OLx,sNx+OLx |
DO i=1-OLx,sNx+OLx |
| 302 |
IF (momAdvection.AND.k.EQ.1) THEN |
IF (momAdvection.AND.k.EQ.1) THEN |
| 303 |
|
|
| 304 |
C- Calculate vertical transports above U & V points (West & South face): |
C- Calculate vertical transports above U & V points (West & South face): |
| 305 |
|
|
| 306 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
| 307 |
|
CADJ STORE dwtransc(:,:,bi,bj) = |
| 308 |
|
CADJ & comlev1_bibj_k, key = imomkey, byte = isbyte |
| 309 |
|
CADJ STORE dwtransu(:,:,bi,bj) = |
| 310 |
|
CADJ & comlev1_bibj_k, key = imomkey, byte = isbyte |
| 311 |
|
CADJ STORE dwtransv(:,:,bi,bj) = |
| 312 |
|
CADJ & comlev1_bibj_k, key = imomkey, byte = isbyte |
| 313 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
| 314 |
CALL MOM_CALC_RTRANS( k, bi, bj, |
CALL MOM_CALC_RTRANS( k, bi, bj, |
| 315 |
O rTransU, rTransV, |
O rTransU, rTransV, |
| 316 |
I myTime, myIter, myThid) |
I myTime, myIter, myThid) |