25 |
C stresses as well as internal viscous stresses. |
C stresses as well as internal viscous stresses. |
26 |
CEOI |
CEOI |
27 |
|
|
28 |
#include "CPP_OPTIONS.h" |
#include "MOM_FLUXFORM_OPTIONS.h" |
29 |
|
|
30 |
CBOP |
CBOP |
31 |
C !ROUTINE: MOM_FLUXFORM |
C !ROUTINE: MOM_FLUXFORM |
32 |
|
|
33 |
C !INTERFACE: ========================================================== |
C !INTERFACE: ========================================================== |
34 |
SUBROUTINE MOM_FLUXFORM( |
SUBROUTINE MOM_FLUXFORM( |
35 |
I bi,bj,iMin,iMax,jMin,jMax,k,kUp,kDown, |
I bi,bj,k,iMin,iMax,jMin,jMax, |
36 |
I phi_hyd,KappaRU,KappaRV, |
I KappaRU, KappaRV, |
37 |
U fVerU, fVerV, |
U fVerUkm, fVerVkm, |
38 |
I myCurrentTime,myIter,myThid) |
O fVerUkp, fVerVkp, |
39 |
|
O guDiss, gvDiss, |
40 |
|
I myTime, myIter, myThid ) |
41 |
|
|
42 |
C !DESCRIPTION: |
C !DESCRIPTION: |
43 |
C Calculates all the horizontal accelerations except for the implicit surface |
C Calculates all the horizontal accelerations except for the implicit surface |
44 |
C pressure gradient and implciit vertical viscosity. |
C pressure gradient and implicit vertical viscosity. |
45 |
|
|
46 |
C !USES: =============================================================== |
C !USES: =============================================================== |
47 |
C == Global variables == |
C == Global variables == |
53 |
#include "PARAMS.h" |
#include "PARAMS.h" |
54 |
#include "GRID.h" |
#include "GRID.h" |
55 |
#include "SURFACE.h" |
#include "SURFACE.h" |
56 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
57 |
|
# include "tamc.h" |
58 |
|
# include "tamc_keys.h" |
59 |
|
# include "MOM_FLUXFORM.h" |
60 |
|
#endif |
61 |
|
|
62 |
C !INPUT PARAMETERS: =================================================== |
C !INPUT PARAMETERS: =================================================== |
63 |
C bi,bj :: tile indices |
C bi,bj :: current tile indices |
64 |
C iMin,iMax,jMin,jMAx :: loop ranges |
C k :: current vertical level |
65 |
C k :: vertical level |
C iMin,iMax,jMin,jMax :: loop ranges |
|
C kUp :: =1 or 2 for consecutive k |
|
|
C kDown :: =2 or 1 for consecutive k |
|
|
C phi_hyd :: hydrostatic pressure (perturbation) |
|
66 |
C KappaRU :: vertical viscosity |
C KappaRU :: vertical viscosity |
67 |
C KappaRV :: vertical viscosity |
C KappaRV :: vertical viscosity |
68 |
C fVerU :: vertical flux of U, 2 1/2 dim for pipe-lining |
C fVerUkm :: vertical advective flux of U, interface above (k-1/2) |
69 |
C fVerV :: vertical flux of V, 2 1/2 dim for pipe-lining |
C fVerVkm :: vertical advective flux of V, interface above (k-1/2) |
70 |
C myCurrentTime :: current time |
C fVerUkp :: vertical advective flux of U, interface below (k+1/2) |
71 |
|
C fVerVkp :: vertical advective flux of V, interface below (k+1/2) |
72 |
|
C guDiss :: dissipation tendency (all explicit terms), u component |
73 |
|
C gvDiss :: dissipation tendency (all explicit terms), v component |
74 |
|
C myTime :: current time |
75 |
C myIter :: current time-step number |
C myIter :: current time-step number |
76 |
C myThid :: thread number |
C myThid :: my Thread Id number |
77 |
INTEGER bi,bj,iMin,iMax,jMin,jMax |
INTEGER bi,bj,k |
78 |
INTEGER k,kUp,kDown |
INTEGER iMin,iMax,jMin,jMax |
|
_RL phi_hyd(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
|
79 |
_RL KappaRU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL KappaRU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
80 |
_RL KappaRV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
_RL KappaRV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
81 |
_RL fVerU(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerUkm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
82 |
_RL fVerV(1-OLx:sNx+OLx,1-OLy:sNy+OLy,2) |
_RL fVerVkm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
83 |
_RL myCurrentTime |
_RL fVerUkp(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
84 |
|
_RL fVerVkp(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
85 |
|
_RL guDiss(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
86 |
|
_RL gvDiss(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
87 |
|
_RL myTime |
88 |
INTEGER myIter |
INTEGER myIter |
89 |
INTEGER myThid |
INTEGER myThid |
90 |
|
|
93 |
|
|
94 |
C !LOCAL VARIABLES: ==================================================== |
C !LOCAL VARIABLES: ==================================================== |
95 |
C i,j :: loop indices |
C i,j :: loop indices |
|
C aF :: advective flux |
|
96 |
C vF :: viscous flux |
C vF :: viscous flux |
97 |
C v4F :: bi-harmonic viscous flux |
C v4F :: bi-harmonic viscous flux |
|
C vrF :: vertical viscous flux |
|
98 |
C cF :: Coriolis acceleration |
C cF :: Coriolis acceleration |
99 |
C mT :: Metric terms |
C mT :: Metric terms |
|
C pF :: Pressure gradient |
|
100 |
C fZon :: zonal fluxes |
C fZon :: zonal fluxes |
101 |
C fMer :: meridional fluxes |
C fMer :: meridional fluxes |
102 |
|
C fVrUp,fVrDw :: vertical viscous fluxes at interface k & k+1 |
103 |
INTEGER i,j |
INTEGER i,j |
104 |
_RL aF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
#ifdef ALLOW_AUTODIFF_TAMC |
105 |
|
INTEGER imomkey |
106 |
|
#endif |
107 |
_RL vF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
108 |
_RL v4F(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL v4F(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
_RL vrF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
109 |
_RL cF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL cF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
110 |
_RL mT(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL mT(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
_RL pF(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
111 |
_RL fZon(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL fZon(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
112 |
_RL fMer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL fMer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
113 |
C wMaskOverride - Land sea flag override for top layer. |
_RL fVrUp(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
114 |
C afFacMom - Tracer parameters for turning terms |
_RL fVrDw(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
115 |
C vfFacMom on and off. |
C afFacMom :: Tracer parameters for turning terms on and off. |
116 |
C pfFacMom afFacMom - Advective terms |
C vfFacMom |
117 |
|
C pfFacMom afFacMom - Advective terms |
118 |
C cfFacMom vfFacMom - Eddy viscosity terms |
C cfFacMom vfFacMom - Eddy viscosity terms |
119 |
C mTFacMom pfFacMom - Pressure terms |
C mtFacMom pfFacMom - Pressure terms |
120 |
C cfFacMom - Coriolis terms |
C cfFacMom - Coriolis terms |
121 |
C foFacMom - Forcing |
C foFacMom - Forcing |
122 |
C mTFacMom - Metric term |
C mtFacMom - Metric term |
123 |
C uDudxFac, AhDudxFac, etc ... individual term tracer parameters |
C uDudxFac, AhDudxFac, etc ... individual term parameters for switching terms off |
124 |
_RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
125 |
_RS r_hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS r_hFacZ(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
126 |
_RS xA(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RS xA(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
129 |
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
130 |
_RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
131 |
_RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
_RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
132 |
C I,J,K - Loop counters |
_RL rTransU(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
133 |
C rVelMaskOverride - Factor for imposing special surface boundary conditions |
_RL rTransV(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
134 |
C ( set according to free-surface condition ). |
_RL KE(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
135 |
C hFacROpen - Lopped cell factos used tohold fraction of open |
_RL viscAh_D(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
136 |
C hFacRClosed and closed cell wall. |
_RL viscAh_Z(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
137 |
_RL rVelMaskOverride |
_RL viscA4_D(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
138 |
C xxxFac - On-off tracer parameters used for switching terms off. |
_RL viscA4_Z(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
139 |
|
_RL vort3(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
140 |
|
_RL hDiv(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
141 |
|
_RL strain(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
142 |
|
_RL tension(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
143 |
_RL uDudxFac |
_RL uDudxFac |
144 |
_RL AhDudxFac |
_RL AhDudxFac |
|
_RL A4DuxxdxFac |
|
145 |
_RL vDudyFac |
_RL vDudyFac |
146 |
_RL AhDudyFac |
_RL AhDudyFac |
|
_RL A4DuyydyFac |
|
147 |
_RL rVelDudrFac |
_RL rVelDudrFac |
148 |
_RL ArDudrFac |
_RL ArDudrFac |
149 |
_RL fuFac |
_RL fuFac |
|
_RL phxFac |
|
150 |
_RL mtFacU |
_RL mtFacU |
151 |
|
_RL mtNHFacU |
152 |
_RL uDvdxFac |
_RL uDvdxFac |
153 |
_RL AhDvdxFac |
_RL AhDvdxFac |
|
_RL A4DvxxdxFac |
|
154 |
_RL vDvdyFac |
_RL vDvdyFac |
155 |
_RL AhDvdyFac |
_RL AhDvdyFac |
|
_RL A4DvyydyFac |
|
156 |
_RL rVelDvdrFac |
_RL rVelDvdrFac |
157 |
_RL ArDvdrFac |
_RL ArDvdrFac |
158 |
_RL fvFac |
_RL fvFac |
|
_RL phyFac |
|
|
_RL vForcFac |
|
159 |
_RL mtFacV |
_RL mtFacV |
160 |
INTEGER km1,kp1 |
_RL mtNHFacV |
161 |
_RL wVelBottomOverride |
_RL sideMaskFac |
162 |
LOGICAL bottomDragTerms |
LOGICAL bottomDragTerms,harmonic,biharmonic,useVariableViscosity |
|
_RL KE(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
|
163 |
CEOP |
CEOP |
164 |
|
#ifdef MOM_BOUNDARY_CONSERVE |
165 |
km1=MAX(1,k-1) |
COMMON / MOM_FLUXFORM_LOCAL / uBnd, vBnd |
166 |
kp1=MIN(Nr,k+1) |
_RL uBnd(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
167 |
rVelMaskOverride=1. |
_RL vBnd(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
168 |
IF ( k .EQ. 1 ) rVelMaskOverride=freeSurfFac |
#endif /* MOM_BOUNDARY_CONSERVE */ |
169 |
wVelBottomOverride=1. |
|
170 |
IF (k.EQ.Nr) wVelBottomOverride=0. |
#ifdef ALLOW_AUTODIFF_TAMC |
171 |
|
act0 = k - 1 |
172 |
|
max0 = Nr |
173 |
|
act1 = bi - myBxLo(myThid) |
174 |
|
max1 = myBxHi(myThid) - myBxLo(myThid) + 1 |
175 |
|
act2 = bj - myByLo(myThid) |
176 |
|
max2 = myByHi(myThid) - myByLo(myThid) + 1 |
177 |
|
act3 = myThid - 1 |
178 |
|
max3 = nTx*nTy |
179 |
|
act4 = ikey_dynamics - 1 |
180 |
|
imomkey = (act0 + 1) |
181 |
|
& + act1*max0 |
182 |
|
& + act2*max0*max1 |
183 |
|
& + act3*max0*max1*max2 |
184 |
|
& + act4*max0*max1*max2*max3 |
185 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
186 |
|
|
187 |
C Initialise intermediate terms |
C Initialise intermediate terms |
188 |
DO J=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
189 |
DO I=1-OLx,sNx+OLx |
DO i=1-OLx,sNx+OLx |
|
aF(i,j) = 0. |
|
190 |
vF(i,j) = 0. |
vF(i,j) = 0. |
191 |
v4F(i,j) = 0. |
v4F(i,j) = 0. |
|
vrF(i,j) = 0. |
|
192 |
cF(i,j) = 0. |
cF(i,j) = 0. |
193 |
mT(i,j) = 0. |
mT(i,j) = 0. |
|
pF(i,j) = 0. |
|
194 |
fZon(i,j) = 0. |
fZon(i,j) = 0. |
195 |
fMer(i,j) = 0. |
fMer(i,j) = 0. |
196 |
|
fVrUp(i,j)= 0. |
197 |
|
fVrDw(i,j)= 0. |
198 |
|
rTransU(i,j)= 0. |
199 |
|
rTransV(i,j)= 0. |
200 |
|
c KE(i,j) = 0. |
201 |
|
hDiv(i,j) = 0. |
202 |
|
vort3(i,j) = 0. |
203 |
|
strain(i,j) = 0. |
204 |
|
tension(i,j)= 0. |
205 |
|
guDiss(i,j) = 0. |
206 |
|
gvDiss(i,j) = 0. |
207 |
ENDDO |
ENDDO |
208 |
ENDDO |
ENDDO |
209 |
|
|
211 |
C o U momentum equation |
C o U momentum equation |
212 |
uDudxFac = afFacMom*1. |
uDudxFac = afFacMom*1. |
213 |
AhDudxFac = vfFacMom*1. |
AhDudxFac = vfFacMom*1. |
|
A4DuxxdxFac = vfFacMom*1. |
|
214 |
vDudyFac = afFacMom*1. |
vDudyFac = afFacMom*1. |
215 |
AhDudyFac = vfFacMom*1. |
AhDudyFac = vfFacMom*1. |
|
A4DuyydyFac = vfFacMom*1. |
|
216 |
rVelDudrFac = afFacMom*1. |
rVelDudrFac = afFacMom*1. |
217 |
ArDudrFac = vfFacMom*1. |
ArDudrFac = vfFacMom*1. |
218 |
mTFacU = mtFacMom*1. |
mtFacU = mtFacMom*1. |
219 |
|
mtNHFacU = 1. |
220 |
fuFac = cfFacMom*1. |
fuFac = cfFacMom*1. |
|
phxFac = pfFacMom*1. |
|
221 |
C o V momentum equation |
C o V momentum equation |
222 |
uDvdxFac = afFacMom*1. |
uDvdxFac = afFacMom*1. |
223 |
AhDvdxFac = vfFacMom*1. |
AhDvdxFac = vfFacMom*1. |
|
A4DvxxdxFac = vfFacMom*1. |
|
224 |
vDvdyFac = afFacMom*1. |
vDvdyFac = afFacMom*1. |
225 |
AhDvdyFac = vfFacMom*1. |
AhDvdyFac = vfFacMom*1. |
|
A4DvyydyFac = vfFacMom*1. |
|
226 |
rVelDvdrFac = afFacMom*1. |
rVelDvdrFac = afFacMom*1. |
227 |
ArDvdrFac = vfFacMom*1. |
ArDvdrFac = vfFacMom*1. |
228 |
mTFacV = mtFacMom*1. |
mtFacV = mtFacMom*1. |
229 |
|
mtNHFacV = 1. |
230 |
fvFac = cfFacMom*1. |
fvFac = cfFacMom*1. |
231 |
phyFac = pfFacMom*1. |
|
232 |
vForcFac = foFacMom*1. |
IF (implicitViscosity) THEN |
233 |
|
ArDudrFac = 0. |
234 |
|
ArDvdrFac = 0. |
235 |
|
ENDIF |
236 |
|
|
237 |
|
C note: using standard stencil (no mask) results in under-estimating |
238 |
|
C vorticity at a no-slip boundary by a factor of 2 = sideDragFactor |
239 |
|
IF ( no_slip_sides ) THEN |
240 |
|
sideMaskFac = sideDragFactor |
241 |
|
ELSE |
242 |
|
sideMaskFac = 0. _d 0 |
243 |
|
ENDIF |
244 |
|
|
245 |
IF ( no_slip_bottom |
IF ( no_slip_bottom |
246 |
& .OR. bottomDragQuadratic.NE.0. |
& .OR. bottomDragQuadratic.NE.0. |
250 |
bottomDragTerms=.FALSE. |
bottomDragTerms=.FALSE. |
251 |
ENDIF |
ENDIF |
252 |
|
|
|
C-- with stagger time stepping, grad Phi_Hyp is directly incoporated in TIMESTEP |
|
|
IF (staggerTimeStep) THEN |
|
|
phxFac = 0. |
|
|
phyFac = 0. |
|
|
ENDIF |
|
|
|
|
253 |
C-- Calculate open water fraction at vorticity points |
C-- Calculate open water fraction at vorticity points |
254 |
CALL MOM_CALC_HFACZ(bi,bj,k,hFacZ,r_hFacZ,myThid) |
CALL MOM_CALC_HFACZ(bi,bj,k,hFacZ,r_hFacZ,myThid) |
255 |
|
|
257 |
C Calculate tracer cell face open areas |
C Calculate tracer cell face open areas |
258 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
259 |
DO i=1-OLx,sNx+OLx |
DO i=1-OLx,sNx+OLx |
260 |
xA(i,j) = _dyG(i,j,bi,bj) |
xA(i,j) = _dyG(i,j,bi,bj)*deepFacC(k) |
261 |
& *drF(k)*_hFacW(i,j,k,bi,bj) |
& *drF(k)*_hFacW(i,j,k,bi,bj) |
262 |
yA(i,j) = _dxG(i,j,bi,bj) |
yA(i,j) = _dxG(i,j,bi,bj)*deepFacC(k) |
263 |
& *drF(k)*_hFacS(i,j,k,bi,bj) |
& *drF(k)*_hFacS(i,j,k,bi,bj) |
264 |
ENDDO |
ENDDO |
265 |
ENDDO |
ENDDO |
266 |
|
|
273 |
ENDDO |
ENDDO |
274 |
|
|
275 |
C Calculate velocity field "volume transports" through tracer cell faces. |
C Calculate velocity field "volume transports" through tracer cell faces. |
276 |
|
C anelastic: transports are scaled by rhoFacC (~ mass transport) |
277 |
DO j=1-OLy,sNy+OLy |
DO j=1-OLy,sNy+OLy |
278 |
DO i=1-OLx,sNx+OLx |
DO i=1-OLx,sNx+OLx |
279 |
uTrans(i,j) = uFld(i,j)*xA(i,j) |
uTrans(i,j) = uFld(i,j)*xA(i,j)*rhoFacC(k) |
280 |
vTrans(i,j) = vFld(i,j)*yA(i,j) |
vTrans(i,j) = vFld(i,j)*yA(i,j)*rhoFacC(k) |
281 |
ENDDO |
ENDDO |
282 |
ENDDO |
ENDDO |
283 |
|
|
284 |
CALL MOM_CALC_KE(bi,bj,k,uFld,vFld,KE,myThid) |
CALL MOM_CALC_KE(bi,bj,k,2,uFld,vFld,KE,myThid) |
285 |
|
IF ( momViscosity) THEN |
286 |
|
CALL MOM_CALC_HDIV(bi,bj,k,2,uFld,vFld,hDiv,myThid) |
287 |
|
CALL MOM_CALC_RELVORT3(bi,bj,k,uFld,vFld,hFacZ,vort3,myThid) |
288 |
|
CALL MOM_CALC_TENSION(bi,bj,k,uFld,vFld,tension,myThid) |
289 |
|
CALL MOM_CALC_STRAIN(bi,bj,k,uFld,vFld,hFacZ,strain,myThid) |
290 |
|
DO j=1-OLy,sNy+OLy |
291 |
|
DO i=1-OLx,sNx+OLx |
292 |
|
IF ( hFacZ(i,j).EQ.0. ) THEN |
293 |
|
vort3(i,j) = sideMaskFac*vort3(i,j) |
294 |
|
strain(i,j) = sideMaskFac*strain(i,j) |
295 |
|
ENDIF |
296 |
|
ENDDO |
297 |
|
ENDDO |
298 |
|
#ifdef ALLOW_DIAGNOSTICS |
299 |
|
IF ( useDiagnostics ) THEN |
300 |
|
CALL DIAGNOSTICS_FILL(hDiv, 'momHDiv ',k,1,2,bi,bj,myThid) |
301 |
|
CALL DIAGNOSTICS_FILL(vort3, 'momVort3',k,1,2,bi,bj,myThid) |
302 |
|
CALL DIAGNOSTICS_FILL(tension,'Tension ',k,1,2,bi,bj,myThid) |
303 |
|
CALL DIAGNOSTICS_FILL(strain, 'Strain ',k,1,2,bi,bj,myThid) |
304 |
|
ENDIF |
305 |
|
#endif |
306 |
|
ENDIF |
307 |
|
|
308 |
C---- Zonal momentum equation starts here |
C--- First call (k=1): compute vertical adv. flux fVerUkm & fVerVkm |
309 |
|
IF (momAdvection.AND.k.EQ.1) THEN |
310 |
|
|
311 |
C Bi-harmonic term del^2 U -> v4F |
#ifdef MOM_BOUNDARY_CONSERVE |
312 |
IF (momViscosity) |
CALL MOM_UV_BOUNDARY( bi, bj, k, |
313 |
& CALL MOM_U_DEL2U(bi,bj,k,uFld,hFacZ,v4f,myThid) |
I uVel, vVel, |
314 |
|
O uBnd(1-OLx,1-OLy,k,bi,bj), |
315 |
|
O vBnd(1-OLx,1-OLy,k,bi,bj), |
316 |
|
I myTime, myIter, myThid ) |
317 |
|
#endif /* MOM_BOUNDARY_CONSERVE */ |
318 |
|
|
319 |
|
C- Calculate vertical transports above U & V points (West & South face): |
320 |
|
|
321 |
|
#ifdef ALLOW_AUTODIFF_TAMC |
322 |
|
# ifdef NONLIN_FRSURF |
323 |
|
# ifndef DISABLE_RSTAR_CODE |
324 |
|
CADJ STORE dwtransc(:,:,bi,bj) = |
325 |
|
CADJ & comlev1_bibj_k, key = imomkey, byte = isbyte |
326 |
|
CADJ STORE dwtransu(:,:,bi,bj) = |
327 |
|
CADJ & comlev1_bibj_k, key = imomkey, byte = isbyte |
328 |
|
CADJ STORE dwtransv(:,:,bi,bj) = |
329 |
|
CADJ & comlev1_bibj_k, key = imomkey, byte = isbyte |
330 |
|
# endif |
331 |
|
# endif /* NONLIN_FRSURF */ |
332 |
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
333 |
|
CALL MOM_CALC_RTRANS( k, bi, bj, |
334 |
|
O rTransU, rTransV, |
335 |
|
I myTime, myIter, myThid) |
336 |
|
|
337 |
|
C- Free surface correction term (flux at k=1) |
338 |
|
CALL MOM_U_ADV_WU( bi,bj,k,uVel,wVel,rTransU, |
339 |
|
O fVerUkm, myThid ) |
340 |
|
|
341 |
|
CALL MOM_V_ADV_WV( bi,bj,k,vVel,wVel,rTransV, |
342 |
|
O fVerVkm, myThid ) |
343 |
|
|
344 |
|
C--- endif momAdvection & k=1 |
345 |
|
ENDIF |
346 |
|
|
347 |
|
|
348 |
|
C--- Calculate vertical transports (at k+1) below U & V points : |
349 |
|
IF (momAdvection) THEN |
350 |
|
CALL MOM_CALC_RTRANS( k+1, bi, bj, |
351 |
|
O rTransU, rTransV, |
352 |
|
I myTime, myIter, myThid) |
353 |
|
ENDIF |
354 |
|
|
355 |
|
#ifdef MOM_BOUNDARY_CONSERVE |
356 |
|
IF ( momAdvection .AND. k.LT.Nr ) THEN |
357 |
|
CALL MOM_UV_BOUNDARY( bi, bj, k+1, |
358 |
|
I uVel, vVel, |
359 |
|
O uBnd(1-OLx,1-OLy,k+1,bi,bj), |
360 |
|
O vBnd(1-OLx,1-OLy,k+1,bi,bj), |
361 |
|
I myTime, myIter, myThid ) |
362 |
|
ENDIF |
363 |
|
#endif /* MOM_BOUNDARY_CONSERVE */ |
364 |
|
|
365 |
|
IF (momViscosity) THEN |
366 |
|
CALL MOM_CALC_VISC( |
367 |
|
I bi,bj,k, |
368 |
|
O viscAh_Z,viscAh_D,viscA4_Z,viscA4_D, |
369 |
|
O harmonic,biharmonic,useVariableViscosity, |
370 |
|
I hDiv,vort3,tension,strain,KE,hFacZ, |
371 |
|
I myThid) |
372 |
|
ENDIF |
373 |
|
|
374 |
C--- Calculate mean and eddy fluxes between cells for zonal flow. |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
375 |
|
|
376 |
C-- Zonal flux (fZon is at east face of "u" cell) |
C---- Zonal momentum equation starts here |
377 |
|
|
378 |
C Mean flow component of zonal flux -> aF |
IF (momAdvection) THEN |
379 |
IF (momAdvection) |
C--- Calculate mean fluxes (advection) between cells for zonal flow. |
|
& CALL MOM_U_ADV_UU(bi,bj,k,uTrans,uFld,aF,myThid) |
|
|
|
|
|
C Laplacian and bi-harmonic terms -> vF |
|
|
IF (momViscosity) |
|
|
& CALL MOM_U_XVISCFLUX(bi,bj,k,uFld,v4F,vF,myThid) |
|
380 |
|
|
381 |
C Combine fluxes -> fZon |
#ifdef MOM_BOUNDARY_CONSERVE |
382 |
DO j=jMin,jMax |
CALL MOM_U_ADV_UU( bi,bj,k,uTrans,uBnd(1-OLx,1-OLy,k,bi,bj), |
383 |
DO i=iMin,iMax |
O fZon,myThid ) |
384 |
fZon(i,j) = uDudxFac*aF(i,j) + AhDudxFac*vF(i,j) |
CALL MOM_U_ADV_VU( bi,bj,k,vTrans,uBnd(1-OLx,1-OLy,k,bi,bj), |
385 |
ENDDO |
O fMer,myThid ) |
386 |
ENDDO |
CALL MOM_U_ADV_WU( |
387 |
|
I bi,bj,k+1,uBnd,wVel,rTransU, |
388 |
|
O fVerUkp, myThid ) |
389 |
|
#else /* MOM_BOUNDARY_CONSERVE */ |
390 |
|
C-- Zonal flux (fZon is at east face of "u" cell) |
391 |
|
C Mean flow component of zonal flux -> fZon |
392 |
|
CALL MOM_U_ADV_UU(bi,bj,k,uTrans,uFld,fZon,myThid) |
393 |
|
|
394 |
C-- Meridional flux (fMer is at south face of "u" cell) |
C-- Meridional flux (fMer is at south face of "u" cell) |
395 |
|
C Mean flow component of meridional flux -> fMer |
396 |
C Mean flow component of meridional flux |
CALL MOM_U_ADV_VU(bi,bj,k,vTrans,uFld,fMer,myThid) |
|
IF (momAdvection) |
|
|
& CALL MOM_U_ADV_VU(bi,bj,k,vTrans,uFld,aF,myThid) |
|
|
|
|
|
C Laplacian and bi-harmonic term |
|
|
IF (momViscosity) |
|
|
& CALL MOM_U_YVISCFLUX(bi,bj,k,uFld,v4F,hFacZ,vF,myThid) |
|
|
|
|
|
C Combine fluxes -> fMer |
|
|
DO j=jMin,jMax |
|
|
DO i=iMin,iMax |
|
|
fMer(i,j) = vDudyFac*aF(i,j) + AhDudyFac*vF(i,j) |
|
|
ENDDO |
|
|
ENDDO |
|
397 |
|
|
398 |
C-- Vertical flux (fVer is at upper face of "u" cell) |
C-- Vertical flux (fVer is at upper face of "u" cell) |
399 |
|
C Mean flow component of vertical flux (at k+1) -> fVer |
400 |
|
CALL MOM_U_ADV_WU( |
401 |
|
I bi,bj,k+1,uVel,wVel,rTransU, |
402 |
|
O fVerUkp, myThid ) |
403 |
|
#endif /* MOM_BOUNDARY_CONSERVE */ |
404 |
|
|
405 |
C-- Free surface correction term (flux at k=1) |
C-- Tendency is minus divergence of the fluxes + coriolis + pressure term |
406 |
IF (momAdvection.AND.k.EQ.1) THEN |
DO j=jMin,jMax |
407 |
CALL MOM_U_ADV_WU(bi,bj,k,uVel,wVel,af,myThid) |
DO i=iMin,iMax |
408 |
DO j=jMin,jMax |
gU(i,j,k,bi,bj) = |
409 |
DO i=iMin,iMax |
#ifdef OLD_UV_GEOM |
410 |
fVerU(i,j,kUp) = af(i,j) |
& -_recip_hFacW(i,j,k,bi,bj)*recip_drF(k)/ |
411 |
|
& ( 0.5 _d 0*(rA(i,j,bi,bj)+rA(i-1,j,bi,bj)) ) |
412 |
|
#else |
413 |
|
& -_recip_hFacW(i,j,k,bi,bj)*recip_drF(k) |
414 |
|
& *recip_rAw(i,j,bi,bj)*recip_deepFac2C(k)*recip_rhoFacC(k) |
415 |
|
#endif |
416 |
|
& *( ( fZon(i,j ) - fZon(i-1,j) )*uDudxFac |
417 |
|
& +( fMer(i,j+1) - fMer(i, j) )*vDudyFac |
418 |
|
& +( fVerUkp(i,j) - fVerUkm(i,j) )*rkSign*rVelDudrFac |
419 |
|
& ) |
420 |
|
ENDDO |
421 |
ENDDO |
ENDDO |
|
ENDDO |
|
|
ENDIF |
|
|
C Mean flow component of vertical flux (at k+1) -> aF |
|
|
IF (momAdvection) |
|
|
& CALL MOM_U_ADV_WU(bi,bj,k+1,uVel,wVel,af,myThid) |
|
422 |
|
|
423 |
C Eddy component of vertical flux (interior component only) -> vrF |
#ifdef ALLOW_DIAGNOSTICS |
424 |
IF (momViscosity.AND..NOT.implicitViscosity) |
IF ( useDiagnostics ) THEN |
425 |
& CALL MOM_U_RVISCFLUX(bi,bj,k,uVel,KappaRU,vrF,myThid) |
CALL DIAGNOSTICS_FILL( fZon, 'ADVx_Um ',k,1,2,bi,bj,myThid) |
426 |
|
CALL DIAGNOSTICS_FILL( fMer, 'ADVy_Um ',k,1,2,bi,bj,myThid) |
427 |
|
CALL DIAGNOSTICS_FILL(fVerUkm,'ADVrE_Um',k,1,2,bi,bj,myThid) |
428 |
|
ENDIF |
429 |
|
#endif |
430 |
|
|
431 |
C Combine fluxes |
#ifdef NONLIN_FRSURF |
432 |
DO j=jMin,jMax |
C-- account for 3.D divergence of the flow in rStar coordinate: |
433 |
DO i=iMin,iMax |
# ifndef DISABLE_RSTAR_CODE |
434 |
fVerU(i,j,kDown) = rVelDudrFac*aF(i,j) + ArDudrFac*vrF(i,j) |
IF ( select_rStar.GT.0 ) THEN |
435 |
ENDDO |
DO j=jMin,jMax |
436 |
ENDDO |
DO i=iMin,iMax |
437 |
|
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj) |
438 |
|
& - (rStarExpW(i,j,bi,bj) - 1. _d 0)/deltaTfreesurf |
439 |
|
& *uVel(i,j,k,bi,bj) |
440 |
|
ENDDO |
441 |
|
ENDDO |
442 |
|
ENDIF |
443 |
|
IF ( select_rStar.LT.0 ) THEN |
444 |
|
DO j=jMin,jMax |
445 |
|
DO i=iMin,iMax |
446 |
|
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj) |
447 |
|
& - rStarDhWDt(i,j,bi,bj)*uVel(i,j,k,bi,bj) |
448 |
|
ENDDO |
449 |
|
ENDDO |
450 |
|
ENDIF |
451 |
|
# endif /* DISABLE_RSTAR_CODE */ |
452 |
|
#endif /* NONLIN_FRSURF */ |
453 |
|
|
454 |
|
#ifdef ALLOW_ADDFLUID |
455 |
|
IF ( selectAddFluid.GE.1 ) THEN |
456 |
|
DO j=jMin,jMax |
457 |
|
DO i=iMin,iMax |
458 |
|
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj) |
459 |
|
& + uVel(i,j,k,bi,bj)*mass2rUnit*0.5 _d 0 |
460 |
|
& *( addMass(i-1,j,k,bi,bj) + addMass(i,j,k,bi,bj) ) |
461 |
|
& *_recip_hFacW(i,j,k,bi,bj)*recip_drF(k)*recip_rhoFacC(k) |
462 |
|
& * recip_rAw(i,j,bi,bj)*recip_deepFac2C(k) |
463 |
|
ENDDO |
464 |
|
ENDDO |
465 |
|
ENDIF |
466 |
|
#endif /* ALLOW_ADDFLUID */ |
467 |
|
|
468 |
C--- Hydrostatic term ( -1/rhoConst . dphi/dx ) |
ELSE |
469 |
IF (momPressureForcing) THEN |
C- if momAdvection / else |
470 |
DO j=jMin,jMax |
DO j=1-OLy,sNy+OLy |
471 |
DO i=iMin,iMax |
DO i=1-OLx,sNx+OLx |
472 |
pf(i,j) = - _recip_dxC(i,j,bi,bj) |
gU(i,j,k,bi,bj) = 0. _d 0 |
473 |
& *(phi_hyd(i,j,k)-phi_hyd(i-1,j,k)) |
ENDDO |
474 |
ENDDO |
ENDDO |
475 |
ENDDO |
|
476 |
|
C- endif momAdvection. |
477 |
ENDIF |
ENDIF |
478 |
|
|
479 |
C-- Tendency is minus divergence of the fluxes + coriolis + pressure term |
IF (momViscosity) THEN |
480 |
DO j=jMin,jMax |
C--- Calculate eddy fluxes (dissipation) between cells for zonal flow. |
481 |
DO i=iMin,iMax |
|
482 |
gU(i,j,k,bi,bj) = |
C Bi-harmonic term del^2 U -> v4F |
483 |
|
IF (biharmonic) |
484 |
|
& CALL MOM_U_DEL2U(bi,bj,k,uFld,hFacZ,v4f,myThid) |
485 |
|
|
486 |
|
C Laplacian and bi-harmonic terms, Zonal Fluxes -> fZon |
487 |
|
CALL MOM_U_XVISCFLUX(bi,bj,k,uFld,v4F,fZon, |
488 |
|
I viscAh_D,viscA4_D,myThid) |
489 |
|
|
490 |
|
C Laplacian and bi-harmonic termis, Merid Fluxes -> fMer |
491 |
|
CALL MOM_U_YVISCFLUX(bi,bj,k,uFld,v4F,hFacZ,fMer, |
492 |
|
I viscAh_Z,viscA4_Z,myThid) |
493 |
|
|
494 |
|
C Eddy component of vertical flux (interior component only) -> fVrUp & fVrDw |
495 |
|
IF (.NOT.implicitViscosity) THEN |
496 |
|
CALL MOM_U_RVISCFLUX(bi,bj, k, uVel,KappaRU,fVrUp,myThid) |
497 |
|
CALL MOM_U_RVISCFLUX(bi,bj,k+1,uVel,KappaRU,fVrDw,myThid) |
498 |
|
ENDIF |
499 |
|
|
500 |
|
C-- Tendency is minus divergence of the fluxes |
501 |
|
C anelastic: hor.visc.fluxes are not scaled by rhoFac (by vert.visc.flx is) |
502 |
|
DO j=jMin,jMax |
503 |
|
DO i=iMin,iMax |
504 |
|
guDiss(i,j) = |
505 |
#ifdef OLD_UV_GEOM |
#ifdef OLD_UV_GEOM |
506 |
& -_recip_hFacW(i,j,k,bi,bj)*recip_drF(k)/ |
& -_recip_hFacW(i,j,k,bi,bj)*recip_drF(k)/ |
507 |
& ( 0.5 _d 0*(rA(i,j,bi,bj)+rA(i-1,j,bi,bj)) ) |
& ( 0.5 _d 0*(rA(i,j,bi,bj)+rA(i-1,j,bi,bj)) ) |
508 |
#else |
#else |
509 |
& -_recip_hFacW(i,j,k,bi,bj)*recip_drF(k) |
& -_recip_hFacW(i,j,k,bi,bj)*recip_drF(k) |
510 |
& *recip_rAw(i,j,bi,bj) |
& *recip_rAw(i,j,bi,bj)*recip_deepFac2C(k) |
511 |
|
#endif |
512 |
|
& *( ( fZon(i,j ) - fZon(i-1,j) )*AhDudxFac |
513 |
|
& +( fMer(i,j+1) - fMer(i, j) )*AhDudyFac |
514 |
|
& +( fVrDw(i,j) - fVrUp(i,j) )*rkSign*ArDudrFac |
515 |
|
& *recip_rhoFacC(k) |
516 |
|
& ) |
517 |
|
ENDDO |
518 |
|
ENDDO |
519 |
|
|
520 |
|
#ifdef ALLOW_DIAGNOSTICS |
521 |
|
IF ( useDiagnostics ) THEN |
522 |
|
CALL DIAGNOSTICS_FILL(fZon, 'VISCx_Um',k,1,2,bi,bj,myThid) |
523 |
|
CALL DIAGNOSTICS_FILL(fMer, 'VISCy_Um',k,1,2,bi,bj,myThid) |
524 |
|
IF (.NOT.implicitViscosity) |
525 |
|
& CALL DIAGNOSTICS_FILL(fVrUp,'VISrE_Um',k,1,2,bi,bj,myThid) |
526 |
|
ENDIF |
527 |
#endif |
#endif |
|
& *(fZon(i,j ) - fZon(i-1,j) |
|
|
& +fMer(i,j+1) - fMer(i ,j) |
|
|
& +fVerU(i,j,kUp)*rkFac - fVerU(i,j,kDown)*rkFac |
|
|
& ) |
|
|
& _PHM( +phxFac * pf(i,j) ) |
|
|
ENDDO |
|
|
ENDDO |
|
528 |
|
|
529 |
C-- No-slip and drag BCs appear as body forces in cell abutting topography |
C-- No-slip and drag BCs appear as body forces in cell abutting topography |
530 |
IF (momViscosity.AND.no_slip_sides) THEN |
IF (no_slip_sides) THEN |
531 |
C- No-slip BCs impose a drag at walls... |
C- No-slip BCs impose a drag at walls... |
532 |
CALL MOM_U_SIDEDRAG(bi,bj,k,uFld,v4F,hFacZ,vF,myThid) |
CALL MOM_U_SIDEDRAG( |
533 |
DO j=jMin,jMax |
I bi,bj,k, |
534 |
DO i=iMin,iMax |
I uFld, v4f, hFacZ, |
535 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+vF(i,j) |
I viscAh_Z,viscA4_Z, |
536 |
ENDDO |
I harmonic,biharmonic,useVariableViscosity, |
537 |
ENDDO |
O vF, |
538 |
ENDIF |
I myThid) |
539 |
|
DO j=jMin,jMax |
540 |
|
DO i=iMin,iMax |
541 |
|
gUdiss(i,j) = gUdiss(i,j) + vF(i,j) |
542 |
|
ENDDO |
543 |
|
ENDDO |
544 |
|
ENDIF |
545 |
C- No-slip BCs impose a drag at bottom |
C- No-slip BCs impose a drag at bottom |
546 |
IF (momViscosity.AND.bottomDragTerms) THEN |
IF (bottomDragTerms) THEN |
547 |
CALL MOM_U_BOTTOMDRAG(bi,bj,k,uFld,KE,KappaRU,vF,myThid) |
CALL MOM_U_BOTTOMDRAG(bi,bj,k,uFld,KE,KappaRU,vF,myThid) |
548 |
DO j=jMin,jMax |
DO j=jMin,jMax |
549 |
DO i=iMin,iMax |
DO i=iMin,iMax |
550 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+vF(i,j) |
gUdiss(i,j) = gUdiss(i,j) + vF(i,j) |
551 |
ENDDO |
ENDDO |
552 |
ENDDO |
ENDDO |
553 |
ENDIF |
ENDIF |
554 |
|
|
555 |
C-- Forcing term |
#ifdef ALLOW_SHELFICE |
556 |
IF (momForcing) |
IF (useShelfIce) THEN |
557 |
& CALL EXTERNAL_FORCING_U( |
CALL SHELFICE_U_DRAG(bi,bj,k,uFld,KE,KappaRU,vF,myThid) |
558 |
I iMin,iMax,jMin,jMax,bi,bj,k, |
DO j=jMin,jMax |
559 |
I myCurrentTime,myThid) |
DO i=iMin,iMax |
560 |
|
gUdiss(i,j) = gUdiss(i,j) + vF(i,j) |
561 |
|
ENDDO |
562 |
|
ENDDO |
563 |
|
ENDIF |
564 |
|
#endif /* ALLOW_SHELFICE */ |
565 |
|
|
566 |
|
C- endif momViscosity |
567 |
|
ENDIF |
568 |
|
|
569 |
|
C-- Forcing term (moved to timestep.F) |
570 |
|
c IF (momForcing) |
571 |
|
c & CALL EXTERNAL_FORCING_U( |
572 |
|
c I iMin,iMax,jMin,jMax,bi,bj,k, |
573 |
|
c I myTime,myThid) |
574 |
|
|
575 |
C-- Metric terms for curvilinear grid systems |
C-- Metric terms for curvilinear grid systems |
576 |
IF (useNHMTerms) THEN |
IF (useNHMTerms) THEN |
577 |
C o Non-hydrosatic metric terms |
C o Non-Hydrostatic (spherical) metric terms |
578 |
CALL MOM_U_METRIC_NH(bi,bj,k,uFld,wVel,mT,myThid) |
CALL MOM_U_METRIC_NH(bi,bj,k,uFld,wVel,mT,myThid) |
579 |
DO j=jMin,jMax |
DO j=jMin,jMax |
580 |
DO i=iMin,iMax |
DO i=iMin,iMax |
581 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+mTFacU*mT(i,j) |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+mtNHFacU*mT(i,j) |
582 |
ENDDO |
ENDDO |
583 |
ENDDO |
ENDDO |
584 |
ENDIF |
ENDIF |
585 |
IF (usingSphericalPolarMTerms) THEN |
IF ( usingSphericalPolarGrid .AND. metricTerms ) THEN |
586 |
|
C o Spherical polar grid metric terms |
587 |
CALL MOM_U_METRIC_SPHERE(bi,bj,k,uFld,vFld,mT,myThid) |
CALL MOM_U_METRIC_SPHERE(bi,bj,k,uFld,vFld,mT,myThid) |
588 |
DO j=jMin,jMax |
DO j=jMin,jMax |
589 |
DO i=iMin,iMax |
DO i=iMin,iMax |
590 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+mTFacU*mT(i,j) |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+mtFacU*mT(i,j) |
591 |
ENDDO |
ENDDO |
592 |
ENDDO |
ENDDO |
593 |
ENDIF |
ENDIF |
594 |
|
IF ( usingCylindricalGrid .AND. metricTerms ) THEN |
595 |
C-- Set du/dt on boundaries to zero |
C o Cylindrical grid metric terms |
596 |
DO j=jMin,jMax |
CALL MOM_U_METRIC_CYLINDER(bi,bj,k,uFld,vFld,mT,myThid) |
597 |
DO i=iMin,iMax |
DO j=jMin,jMax |
598 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)*_maskW(i,j,k,bi,bj) |
DO i=iMin,iMax |
599 |
|
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+mtFacU*mT(i,j) |
600 |
|
ENDDO |
601 |
ENDDO |
ENDDO |
602 |
ENDDO |
ENDIF |
603 |
|
|
604 |
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
605 |
|
|
606 |
C---- Meridional momentum equation starts here |
C---- Meridional momentum equation starts here |
607 |
|
|
608 |
C Bi-harmonic term del^2 V -> v4F |
IF (momAdvection) THEN |
|
IF (momViscosity) |
|
|
& CALL MOM_V_DEL2V(bi,bj,k,vFld,hFacZ,v4f,myThid) |
|
|
|
|
|
C--- Calculate mean and eddy fluxes between cells for meridional flow. |
|
|
|
|
|
C-- Zonal flux (fZon is at west face of "v" cell) |
|
609 |
|
|
610 |
C Mean flow component of zonal flux -> aF |
#ifdef MOM_BOUNDARY_CONSERVE |
611 |
IF (momAdvection) |
CALL MOM_V_ADV_UV( bi,bj,k,uTrans,vBnd(1-OLx,1-OLy,k,bi,bj), |
612 |
& CALL MOM_V_ADV_UV(bi,bj,k,uTrans,vFld,af,myThid) |
O fZon,myThid ) |
613 |
|
CALL MOM_V_ADV_VV( bi,bj,k,vTrans,vBnd(1-OLx,1-OLy,k,bi,bj), |
614 |
C Laplacian and bi-harmonic terms -> vF |
O fMer,myThid ) |
615 |
IF (momViscosity) |
CALL MOM_V_ADV_WV( bi,bj,k+1,vBnd,wVel,rTransV, |
616 |
& CALL MOM_V_XVISCFLUX(bi,bj,k,vFld,v4f,hFacZ,vf,myThid) |
O fVerVkp, myThid ) |
617 |
|
#else /* MOM_BOUNDARY_CONSERVE */ |
618 |
C Combine fluxes -> fZon |
C--- Calculate mean fluxes (advection) between cells for meridional flow. |
619 |
DO j=jMin,jMax |
C Mean flow component of zonal flux -> fZon |
620 |
DO i=iMin,iMax |
CALL MOM_V_ADV_UV( bi,bj,k,uTrans,vFld,fZon,myThid ) |
|
fZon(i,j) = uDvdxFac*aF(i,j) + AhDvdxFac*vF(i,j) |
|
|
ENDDO |
|
|
ENDDO |
|
621 |
|
|
622 |
C-- Meridional flux (fMer is at north face of "v" cell) |
C-- Meridional flux (fMer is at north face of "v" cell) |
623 |
|
C Mean flow component of meridional flux -> fMer |
624 |
C Mean flow component of meridional flux |
CALL MOM_V_ADV_VV( bi,bj,k,vTrans,vFld,fMer,myThid ) |
|
IF (momAdvection) |
|
|
& CALL MOM_V_ADV_VV(bi,bj,k,vTrans,vFld,af,myThid) |
|
|
|
|
|
C Laplacian and bi-harmonic term |
|
|
IF (momViscosity) |
|
|
& CALL MOM_V_YVISCFLUX(bi,bj,k,vFld,v4f,vf,myThid) |
|
|
|
|
|
C Combine fluxes -> fMer |
|
|
DO j=jMin,jMax |
|
|
DO i=iMin,iMax |
|
|
fMer(i,j) = vDvdyFac*aF(i,j) + AhDvdyFac*vF(i,j) |
|
|
ENDDO |
|
|
ENDDO |
|
625 |
|
|
626 |
C-- Vertical flux (fVer is at upper face of "v" cell) |
C-- Vertical flux (fVer is at upper face of "v" cell) |
627 |
|
C Mean flow component of vertical flux (at k+1) -> fVerV |
628 |
|
CALL MOM_V_ADV_WV( bi,bj,k+1,vVel,wVel,rTransV, |
629 |
|
O fVerVkp, myThid ) |
630 |
|
#endif /* MOM_BOUNDARY_CONSERVE */ |
631 |
|
|
632 |
C-- Free surface correction term (flux at k=1) |
C-- Tendency is minus divergence of the fluxes + coriolis + pressure term |
633 |
IF (momAdvection.AND.k.EQ.1) THEN |
DO j=jMin,jMax |
634 |
CALL MOM_V_ADV_WV(bi,bj,k,vVel,wVel,af,myThid) |
DO i=iMin,iMax |
635 |
DO j=jMin,jMax |
gV(i,j,k,bi,bj) = |
636 |
DO i=iMin,iMax |
#ifdef OLD_UV_GEOM |
637 |
fVerV(i,j,kUp) = af(i,j) |
& -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k)/ |
638 |
|
& ( 0.5 _d 0*(_rA(i,j,bi,bj)+_rA(i,j-1,bi,bj)) ) |
639 |
|
#else |
640 |
|
& -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k) |
641 |
|
& *recip_rAs(i,j,bi,bj)*recip_deepFac2C(k)*recip_rhoFacC(k) |
642 |
|
#endif |
643 |
|
& *( ( fZon(i+1,j) - fZon(i,j ) )*uDvdxFac |
644 |
|
& +( fMer(i, j) - fMer(i,j-1) )*vDvdyFac |
645 |
|
& +( fVerVkp(i,j) - fVerVkm(i,j) )*rkSign*rVelDvdrFac |
646 |
|
& ) |
647 |
|
ENDDO |
648 |
ENDDO |
ENDDO |
|
ENDDO |
|
|
ENDIF |
|
|
C o Mean flow component of vertical flux |
|
|
IF (momAdvection) |
|
|
& CALL MOM_V_ADV_WV(bi,bj,k+1,vVel,wVel,af,myThid) |
|
649 |
|
|
650 |
C Eddy component of vertical flux (interior component only) -> vrF |
#ifdef ALLOW_DIAGNOSTICS |
651 |
IF (momViscosity.AND..NOT.implicitViscosity) |
IF ( useDiagnostics ) THEN |
652 |
& CALL MOM_V_RVISCFLUX(bi,bj,k,vVel,KappaRV,vrf,myThid) |
CALL DIAGNOSTICS_FILL( fZon, 'ADVx_Vm ',k,1,2,bi,bj,myThid) |
653 |
|
CALL DIAGNOSTICS_FILL( fMer, 'ADVy_Vm ',k,1,2,bi,bj,myThid) |
654 |
|
CALL DIAGNOSTICS_FILL(fVerVkm,'ADVrE_Vm',k,1,2,bi,bj,myThid) |
655 |
|
ENDIF |
656 |
|
#endif |
657 |
|
|
658 |
C Combine fluxes -> fVerV |
#ifdef NONLIN_FRSURF |
659 |
DO j=jMin,jMax |
C-- account for 3.D divergence of the flow in rStar coordinate: |
660 |
DO i=iMin,iMax |
# ifndef DISABLE_RSTAR_CODE |
661 |
fVerV(i,j,kDown) = rVelDvdrFac*aF(i,j) + ArDvdrFac*vrF(i,j) |
IF ( select_rStar.GT.0 ) THEN |
662 |
ENDDO |
DO j=jMin,jMax |
663 |
ENDDO |
DO i=iMin,iMax |
664 |
|
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj) |
665 |
|
& - (rStarExpS(i,j,bi,bj) - 1. _d 0)/deltaTfreesurf |
666 |
|
& *vVel(i,j,k,bi,bj) |
667 |
|
ENDDO |
668 |
|
ENDDO |
669 |
|
ENDIF |
670 |
|
IF ( select_rStar.LT.0 ) THEN |
671 |
|
DO j=jMin,jMax |
672 |
|
DO i=iMin,iMax |
673 |
|
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj) |
674 |
|
& - rStarDhSDt(i,j,bi,bj)*vVel(i,j,k,bi,bj) |
675 |
|
ENDDO |
676 |
|
ENDDO |
677 |
|
ENDIF |
678 |
|
# endif /* DISABLE_RSTAR_CODE */ |
679 |
|
#endif /* NONLIN_FRSURF */ |
680 |
|
|
681 |
|
#ifdef ALLOW_ADDFLUID |
682 |
|
IF ( selectAddFluid.GE.1 ) THEN |
683 |
|
DO j=jMin,jMax |
684 |
|
DO i=iMin,iMax |
685 |
|
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj) |
686 |
|
& + vVel(i,j,k,bi,bj)*mass2rUnit*0.5 _d 0 |
687 |
|
& *( addMass(i,j-1,k,bi,bj) + addMass(i,j,k,bi,bj) ) |
688 |
|
& *_recip_hFacS(i,j,k,bi,bj)*recip_drF(k)*recip_rhoFacC(k) |
689 |
|
& * recip_rAs(i,j,bi,bj)*recip_deepFac2C(k) |
690 |
|
ENDDO |
691 |
|
ENDDO |
692 |
|
ENDIF |
693 |
|
#endif /* ALLOW_ADDFLUID */ |
694 |
|
|
695 |
C--- Hydorstatic term (-1/rhoConst . dphi/dy ) |
ELSE |
696 |
IF (momPressureForcing) THEN |
C- if momAdvection / else |
697 |
DO j=jMin,jMax |
DO j=1-OLy,sNy+OLy |
698 |
DO i=iMin,iMax |
DO i=1-OLx,sNx+OLx |
699 |
pF(i,j) = -_recip_dyC(i,j,bi,bj) |
gV(i,j,k,bi,bj) = 0. _d 0 |
700 |
& *(phi_hyd(i,j,k)-phi_hyd(i,j-1,k)) |
ENDDO |
701 |
ENDDO |
ENDDO |
702 |
ENDDO |
|
703 |
|
C- endif momAdvection. |
704 |
ENDIF |
ENDIF |
705 |
|
|
706 |
|
IF (momViscosity) THEN |
707 |
|
C--- Calculate eddy fluxes (dissipation) between cells for meridional flow. |
708 |
|
C Bi-harmonic term del^2 V -> v4F |
709 |
|
IF (biharmonic) |
710 |
|
& CALL MOM_V_DEL2V(bi,bj,k,vFld,hFacZ,v4f,myThid) |
711 |
|
|
712 |
|
C Laplacian and bi-harmonic terms, Zonal Fluxes -> fZon |
713 |
|
CALL MOM_V_XVISCFLUX(bi,bj,k,vFld,v4f,hFacZ,fZon, |
714 |
|
I viscAh_Z,viscA4_Z,myThid) |
715 |
|
|
716 |
|
C Laplacian and bi-harmonic termis, Merid Fluxes -> fMer |
717 |
|
CALL MOM_V_YVISCFLUX(bi,bj,k,vFld,v4f,fMer, |
718 |
|
I viscAh_D,viscA4_D,myThid) |
719 |
|
|
720 |
|
C Eddy component of vertical flux (interior component only) -> fVrUp & fVrDw |
721 |
|
IF (.NOT.implicitViscosity) THEN |
722 |
|
CALL MOM_V_RVISCFLUX(bi,bj, k, vVel,KappaRV,fVrUp,myThid) |
723 |
|
CALL MOM_V_RVISCFLUX(bi,bj,k+1,vVel,KappaRV,fVrDw,myThid) |
724 |
|
ENDIF |
725 |
|
|
726 |
C-- Tendency is minus divergence of the fluxes + coriolis + pressure term |
C-- Tendency is minus divergence of the fluxes + coriolis + pressure term |
727 |
DO j=jMin,jMax |
C anelastic: hor.visc.fluxes are not scaled by rhoFac (by vert.visc.flx is) |
728 |
DO i=iMin,iMax |
DO j=jMin,jMax |
729 |
gV(i,j,k,bi,bj) = |
DO i=iMin,iMax |
730 |
|
gvDiss(i,j) = |
731 |
#ifdef OLD_UV_GEOM |
#ifdef OLD_UV_GEOM |
732 |
& -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k)/ |
& -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k)/ |
733 |
& ( 0.5 _d 0*(_rA(i,j,bi,bj)+_rA(i,j-1,bi,bj)) ) |
& ( 0.5 _d 0*(_rA(i,j,bi,bj)+_rA(i,j-1,bi,bj)) ) |
734 |
#else |
#else |
735 |
& -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k) |
& -_recip_hFacS(i,j,k,bi,bj)*recip_drF(k) |
736 |
& *recip_rAs(i,j,bi,bj) |
& *recip_rAs(i,j,bi,bj)*recip_deepFac2C(k) |
737 |
#endif |
#endif |
738 |
& *(fZon(i+1,j) - fZon(i,j ) |
& *( ( fZon(i+1,j) - fZon(i,j ) )*AhDvdxFac |
739 |
& +fMer(i,j ) - fMer(i,j-1) |
& +( fMer(i, j) - fMer(i,j-1) )*AhDvdyFac |
740 |
& +fVerV(i,j,kUp)*rkFac - fVerV(i,j,kDown)*rkFac |
& +( fVrDw(i,j) - fVrUp(i,j) )*rkSign*ArDvdrFac |
741 |
& ) |
& *recip_rhoFacC(k) |
742 |
& _PHM( +phyFac*pf(i,j) ) |
& ) |
743 |
ENDDO |
ENDDO |
744 |
ENDDO |
ENDDO |
745 |
|
|
746 |
C-- No-slip and drag BCs appear as body forces in cell abutting topography |
#ifdef ALLOW_DIAGNOSTICS |
747 |
IF (momViscosity.AND.no_slip_sides) THEN |
IF ( useDiagnostics ) THEN |
748 |
|
CALL DIAGNOSTICS_FILL(fZon, 'VISCx_Vm',k,1,2,bi,bj,myThid) |
749 |
|
CALL DIAGNOSTICS_FILL(fMer, 'VISCy_Vm',k,1,2,bi,bj,myThid) |
750 |
|
IF (.NOT.implicitViscosity) |
751 |
|
& CALL DIAGNOSTICS_FILL(fVrUp,'VISrE_Vm',k,1,2,bi,bj,myThid) |
752 |
|
ENDIF |
753 |
|
#endif |
754 |
|
|
755 |
|
C-- No-slip and drag BCs appear as body forces in cell abutting topography |
756 |
|
IF (no_slip_sides) THEN |
757 |
C- No-slip BCs impose a drag at walls... |
C- No-slip BCs impose a drag at walls... |
758 |
CALL MOM_V_SIDEDRAG(bi,bj,k,vFld,v4F,hFacZ,vF,myThid) |
CALL MOM_V_SIDEDRAG( |
759 |
DO j=jMin,jMax |
I bi,bj,k, |
760 |
DO i=iMin,iMax |
I vFld, v4f, hFacZ, |
761 |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+vF(i,j) |
I viscAh_Z,viscA4_Z, |
762 |
ENDDO |
I harmonic,biharmonic,useVariableViscosity, |
763 |
ENDDO |
O vF, |
764 |
ENDIF |
I myThid) |
765 |
|
DO j=jMin,jMax |
766 |
|
DO i=iMin,iMax |
767 |
|
gvDiss(i,j) = gvDiss(i,j) + vF(i,j) |
768 |
|
ENDDO |
769 |
|
ENDDO |
770 |
|
ENDIF |
771 |
C- No-slip BCs impose a drag at bottom |
C- No-slip BCs impose a drag at bottom |
772 |
IF (momViscosity.AND.bottomDragTerms) THEN |
IF (bottomDragTerms) THEN |
773 |
CALL MOM_V_BOTTOMDRAG(bi,bj,k,vFld,KE,KappaRV,vF,myThid) |
CALL MOM_V_BOTTOMDRAG(bi,bj,k,vFld,KE,KappaRV,vF,myThid) |
774 |
|
DO j=jMin,jMax |
775 |
|
DO i=iMin,iMax |
776 |
|
gvDiss(i,j) = gvDiss(i,j) + vF(i,j) |
777 |
|
ENDDO |
778 |
|
ENDDO |
779 |
|
ENDIF |
780 |
|
|
781 |
|
#ifdef ALLOW_SHELFICE |
782 |
|
IF (useShelfIce) THEN |
783 |
|
CALL SHELFICE_V_DRAG(bi,bj,k,vFld,KE,KappaRU,vF,myThid) |
784 |
|
DO j=jMin,jMax |
785 |
|
DO i=iMin,iMax |
786 |
|
gvDiss(i,j) = gvDiss(i,j) + vF(i,j) |
787 |
|
ENDDO |
788 |
|
ENDDO |
789 |
|
ENDIF |
790 |
|
#endif /* ALLOW_SHELFICE */ |
791 |
|
|
792 |
|
C- endif momViscosity |
793 |
|
ENDIF |
794 |
|
|
795 |
|
C-- Forcing term (moved to timestep.F) |
796 |
|
c IF (momForcing) |
797 |
|
c & CALL EXTERNAL_FORCING_V( |
798 |
|
c I iMin,iMax,jMin,jMax,bi,bj,k, |
799 |
|
c I myTime,myThid) |
800 |
|
|
801 |
|
C-- Metric terms for curvilinear grid systems |
802 |
|
IF (useNHMTerms) THEN |
803 |
|
C o Non-Hydrostatic (spherical) metric terms |
804 |
|
CALL MOM_V_METRIC_NH(bi,bj,k,vFld,wVel,mT,myThid) |
805 |
DO j=jMin,jMax |
DO j=jMin,jMax |
806 |
DO i=iMin,iMax |
DO i=iMin,iMax |
807 |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+vF(i,j) |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+mtNHFacV*mT(i,j) |
808 |
ENDDO |
ENDDO |
809 |
ENDDO |
ENDDO |
810 |
ENDIF |
ENDIF |
811 |
|
IF ( usingSphericalPolarGrid .AND. metricTerms ) THEN |
|
C-- Forcing term |
|
|
IF (momForcing) |
|
|
& CALL EXTERNAL_FORCING_V( |
|
|
I iMin,iMax,jMin,jMax,bi,bj,k, |
|
|
I myCurrentTime,myThid) |
|
|
|
|
|
C-- Metric terms for curvilinear grid systems |
|
|
IF (useNHMTerms) THEN |
|
812 |
C o Spherical polar grid metric terms |
C o Spherical polar grid metric terms |
813 |
CALL MOM_V_METRIC_NH(bi,bj,k,vFld,wVel,mT,myThid) |
CALL MOM_V_METRIC_SPHERE(bi,bj,k,uFld,mT,myThid) |
814 |
DO j=jMin,jMax |
DO j=jMin,jMax |
815 |
DO i=iMin,iMax |
DO i=iMin,iMax |
816 |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+mTFacV*mT(i,j) |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+mtFacV*mT(i,j) |
817 |
ENDDO |
ENDDO |
818 |
ENDDO |
ENDDO |
819 |
ENDIF |
ENDIF |
820 |
IF (usingSphericalPolarMTerms) THEN |
IF ( usingCylindricalGrid .AND. metricTerms ) THEN |
821 |
CALL MOM_V_METRIC_SPHERE(bi,bj,k,uFld,mT,myThid) |
C o Cylindrical grid metric terms |
822 |
|
CALL MOM_V_METRIC_CYLINDER(bi,bj,k,uFld,vFld,mT,myThid) |
823 |
DO j=jMin,jMax |
DO j=jMin,jMax |
824 |
DO i=iMin,iMax |
DO i=iMin,iMax |
825 |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+mTFacV*mT(i,j) |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+mtFacV*mT(i,j) |
826 |
ENDDO |
ENDDO |
827 |
ENDDO |
ENDDO |
828 |
ENDIF |
ENDIF |
829 |
|
|
830 |
C-- Set dv/dt on boundaries to zero |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
|
DO j=jMin,jMax |
|
|
DO i=iMin,iMax |
|
|
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)*_maskS(i,j,k,bi,bj) |
|
|
ENDDO |
|
|
ENDDO |
|
831 |
|
|
832 |
C-- Coriolis term |
C-- Coriolis term |
833 |
C Note. As coded here, coriolis will not work with "thin walls" |
C Note. As coded here, coriolis will not work with "thin walls" |
834 |
#ifdef INCLUDE_CD_CODE |
c IF (useCDscheme) THEN |
835 |
CALL MOM_CDSCHEME(bi,bj,k,phi_hyd,myThid) |
c CALL MOM_CDSCHEME(bi,bj,k,dPhiHydX,dPhiHydY,myThid) |
836 |
#else |
c ELSE |
837 |
CALL MOM_U_CORIOLIS(bi,bj,k,vFld,cf,myThid) |
IF (.NOT.useCDscheme) THEN |
838 |
DO j=jMin,jMax |
CALL MOM_U_CORIOLIS(bi,bj,k,vFld,cf,myThid) |
839 |
DO i=iMin,iMax |
DO j=jMin,jMax |
840 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+fuFac*cf(i,j) |
DO i=iMin,iMax |
841 |
ENDDO |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+fuFac*cf(i,j) |
842 |
ENDDO |
ENDDO |
843 |
CALL MOM_V_CORIOLIS(bi,bj,k,uFld,cf,myThid) |
ENDDO |
844 |
|
#ifdef ALLOW_DIAGNOSTICS |
845 |
|
IF ( useDiagnostics ) |
846 |
|
& CALL DIAGNOSTICS_FILL(cf,'Um_Cori ',k,1,2,bi,bj,myThid) |
847 |
|
#endif |
848 |
|
CALL MOM_V_CORIOLIS(bi,bj,k,uFld,cf,myThid) |
849 |
|
DO j=jMin,jMax |
850 |
|
DO i=iMin,iMax |
851 |
|
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+fvFac*cf(i,j) |
852 |
|
ENDDO |
853 |
|
ENDDO |
854 |
|
#ifdef ALLOW_DIAGNOSTICS |
855 |
|
IF ( useDiagnostics ) |
856 |
|
& CALL DIAGNOSTICS_FILL(cf,'Vm_Cori ',k,1,2,bi,bj,myThid) |
857 |
|
#endif |
858 |
|
ENDIF |
859 |
|
|
860 |
|
C-- 3.D Coriolis term (horizontal momentum, Eastward component: -fprime*w) |
861 |
|
IF ( use3dCoriolis ) THEN |
862 |
|
CALL MOM_U_CORIOLIS_NH(bi,bj,k,wVel,cf,myThid) |
863 |
|
DO j=jMin,jMax |
864 |
|
DO i=iMin,iMax |
865 |
|
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+fuFac*cf(i,j) |
866 |
|
ENDDO |
867 |
|
ENDDO |
868 |
|
IF ( usingCurvilinearGrid ) THEN |
869 |
|
C- presently, non zero angleSinC array only supported with Curvilinear-Grid |
870 |
|
CALL MOM_V_CORIOLIS_NH(bi,bj,k,wVel,cf,myThid) |
871 |
|
DO j=jMin,jMax |
872 |
|
DO i=iMin,iMax |
873 |
|
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+fvFac*cf(i,j) |
874 |
|
ENDDO |
875 |
|
ENDDO |
876 |
|
ENDIF |
877 |
|
ENDIF |
878 |
|
|
879 |
|
C-- Set du/dt & dv/dt on boundaries to zero |
880 |
DO j=jMin,jMax |
DO j=jMin,jMax |
881 |
DO i=iMin,iMax |
DO i=iMin,iMax |
882 |
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)+fvFac*cf(i,j) |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)*_maskW(i,j,k,bi,bj) |
883 |
|
guDiss(i,j) = guDiss(i,j) *_maskW(i,j,k,bi,bj) |
884 |
|
gV(i,j,k,bi,bj) = gV(i,j,k,bi,bj)*_maskS(i,j,k,bi,bj) |
885 |
|
gvDiss(i,j) = gvDiss(i,j) *_maskS(i,j,k,bi,bj) |
886 |
ENDDO |
ENDDO |
887 |
ENDDO |
ENDDO |
888 |
#endif /* INCLUDE_CD_CODE */ |
|
889 |
IF (nonHydrostatic) THEN |
#ifdef ALLOW_DIAGNOSTICS |
890 |
CALL MOM_U_CORIOLIS_NH(bi,bj,k,wVel,cf,myThid) |
IF ( useDiagnostics ) THEN |
891 |
DO j=jMin,jMax |
CALL DIAGNOSTICS_FILL(KE, 'momKE ',k,1,2,bi,bj,myThid) |
892 |
DO i=iMin,iMax |
CALL DIAGNOSTICS_FILL(gU(1-OLx,1-OLy,k,bi,bj), |
893 |
gU(i,j,k,bi,bj) = gU(i,j,k,bi,bj)+fuFac*cf(i,j) |
& 'Um_Advec',k,1,2,bi,bj,myThid) |
894 |
ENDDO |
CALL DIAGNOSTICS_FILL(gV(1-OLx,1-OLy,k,bi,bj), |
895 |
ENDDO |
& 'Vm_Advec',k,1,2,bi,bj,myThid) |
896 |
|
IF (momViscosity) THEN |
897 |
|
CALL DIAGNOSTICS_FILL(guDiss,'Um_Diss ',k,1,2,bi,bj,myThid) |
898 |
|
CALL DIAGNOSTICS_FILL(gvDiss,'Vm_Diss ',k,1,2,bi,bj,myThid) |
899 |
|
ENDIF |
900 |
ENDIF |
ENDIF |
901 |
|
#endif /* ALLOW_DIAGNOSTICS */ |
902 |
|
|
903 |
RETURN |
RETURN |
904 |
END |
END |