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