38 |
#ifdef ALLOW_TIMEAVE |
#ifdef ALLOW_TIMEAVE |
39 |
#include "TIMEAVE_STATV.h" |
#include "TIMEAVE_STATV.h" |
40 |
#endif |
#endif |
41 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
42 |
|
# include "tamc.h" |
43 |
|
# include "tamc_keys.h" |
44 |
|
#endif |
45 |
|
|
46 |
C == Routine arguments == |
C == Routine arguments == |
47 |
C fVerU :: Flux of momentum in the vertical direction, out of the upper |
C fVerU :: Flux of momentum in the vertical direction, out of the upper |
102 |
LOGICAL bottomDragTerms |
LOGICAL bottomDragTerms |
103 |
LOGICAL writeDiag |
LOGICAL writeDiag |
104 |
LOGICAL harmonic,biharmonic,useVariableViscosity |
LOGICAL harmonic,biharmonic,useVariableViscosity |
105 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
106 |
|
INTEGER imomkey |
107 |
|
#endif |
108 |
|
|
109 |
#ifdef ALLOW_MNC |
#ifdef ALLOW_MNC |
110 |
INTEGER offsets(9) |
INTEGER offsets(9) |
120 |
fVerV(1,1,kUp) = fVerV(1,1,kUp) |
fVerV(1,1,kUp) = fVerV(1,1,kUp) |
121 |
#endif |
#endif |
122 |
|
|
123 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
124 |
|
act0 = k - 1 |
125 |
|
max0 = Nr |
126 |
|
act1 = bi - myBxLo(myThid) |
127 |
|
max1 = myBxHi(myThid) - myBxLo(myThid) + 1 |
128 |
|
act2 = bj - myByLo(myThid) |
129 |
|
max2 = myByHi(myThid) - myByLo(myThid) + 1 |
130 |
|
act3 = myThid - 1 |
131 |
|
max3 = nTx*nTy |
132 |
|
act4 = ikey_dynamics - 1 |
133 |
|
imomkey = (act0 + 1) |
134 |
|
& + act1*max0 |
135 |
|
& + act2*max0*max1 |
136 |
|
& + act3*max0*max1*max2 |
137 |
|
& + act4*max0*max1*max2*max3 |
138 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
139 |
|
|
140 |
writeDiag = DIFFERENT_MULTIPLE(diagFreq, myTime, deltaTClock) |
writeDiag = DIFFERENT_MULTIPLE(diagFreq, myTime, deltaTClock) |
141 |
|
|
142 |
#ifdef ALLOW_MNC |
#ifdef ALLOW_MNC |
234 |
C-- For viscous term, compute horizontal divergence, tension & strain |
C-- For viscous term, compute horizontal divergence, tension & strain |
235 |
C and mask relative vorticity (free-slip case): |
C and mask relative vorticity (free-slip case): |
236 |
|
|
237 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
238 |
|
CADJ STORE vort3(:,:) = |
239 |
|
CADJ & comlev1_bibj_k, key = imomkey, byte = isbyte |
240 |
|
#endif |
241 |
|
|
242 |
CALL MOM_CALC_HDIV(bi,bj,k,2,uFld,vFld,hDiv,myThid) |
CALL MOM_CALC_HDIV(bi,bj,k,2,uFld,vFld,hDiv,myThid) |
243 |
|
|
244 |
CALL MOM_CALC_TENSION(bi,bj,k,uFld,vFld,tension,myThid) |
CALL MOM_CALC_TENSION(bi,bj,k,uFld,vFld,tension,myThid) |