125 |
& doglobalread, ladinit, optimcycle, |
& doglobalread, ladinit, optimcycle, |
126 |
& mythid, xx_obcsw_dummy ) |
& mythid, xx_obcsw_dummy ) |
127 |
|
|
128 |
|
#ifdef ALLOW_CTRL_OBCS_BALANCE |
129 |
|
|
130 |
if ( optimcycle .gt. 0) then |
if ( optimcycle .gt. 0) then |
131 |
if (iobcs .eq. 3) then |
if (iobcs .eq. 3) then |
132 |
cgg Special attention is needed for the normal velocity. |
cgg Special attention is needed for the normal velocity. |
150 |
cgg exactly balance the volume flux, since we are dealing with |
cgg exactly balance the volume flux, since we are dealing with |
151 |
cgg the baroclinic velocity structure.. |
cgg the baroclinic velocity structure.. |
152 |
utop = tmpfldyz(j,k,bi,bj)* |
utop = tmpfldyz(j,k,bi,bj)* |
153 |
& maskW(i+ip1,j,k,bi,bj) * delZ(k) + utop |
& maskW(i+ip1,j,k,bi,bj) * delR(k) + utop |
154 |
cgg Add the barotropic velocity component. |
cgg Add the barotropic velocity component. |
155 |
if (maskW(i+ip1,j,k,bi,bj) .ne. 0.) then |
if (maskW(i+ip1,j,k,bi,bj) .ne. 0.) then |
156 |
tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro |
tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro |
158 |
enddo |
enddo |
159 |
cgg Compute the baroclinic velocity at level 1. Should balance flux. |
cgg Compute the baroclinic velocity at level 1. Should balance flux. |
160 |
tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj) |
tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj) |
161 |
& - utop / delZ(1) |
& - utop / delR(1) |
162 |
enddo |
enddo |
163 |
enddo |
enddo |
164 |
enddo |
enddo |
185 |
cgg exactly balance the volume flux, since we are dealing with |
cgg exactly balance the volume flux, since we are dealing with |
186 |
cgg the baroclinic velocity structure.. |
cgg the baroclinic velocity structure.. |
187 |
utop = tmpfldyz(j,k,bi,bj)* |
utop = tmpfldyz(j,k,bi,bj)* |
188 |
& maskS(i,j,k,bi,bj) * delZ(k) + utop |
& maskS(i,j,k,bi,bj) * delR(k) + utop |
189 |
cgg Add the barotropic velocity component. |
cgg Add the barotropic velocity component. |
190 |
if (maskS(i,j,k,bi,bj) .ne. 0.) then |
if (maskS(i,j,k,bi,bj) .ne. 0.) then |
191 |
tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro |
tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro |
193 |
enddo |
enddo |
194 |
cgg Compute the baroclinic velocity at level 1. Should balance flux. |
cgg Compute the baroclinic velocity at level 1. Should balance flux. |
195 |
tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj) |
tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj) |
196 |
& - utop / delZ(1) |
& - utop / delR(1) |
197 |
enddo |
enddo |
198 |
enddo |
enddo |
199 |
enddo |
enddo |
200 |
endif |
endif |
201 |
endif |
endif |
202 |
|
|
203 |
|
#endif /* ALLOW_CTRL_OBCS_BALANCE */ |
204 |
|
|
205 |
do bj = jtlo,jthi |
do bj = jtlo,jthi |
206 |
do bi = itlo,ithi |
do bi = itlo,ithi |
207 |
do k = 1,nr |
do k = 1,nr |
216 |
|
|
217 |
if ( (obcswfirst) .or. (obcswchanged)) then |
if ( (obcswfirst) .or. (obcswchanged)) then |
218 |
|
|
219 |
cgg( This is a terribly long way to do it. However, the dimensions don't exactly |
cgg( This is a terribly long way to do it. However, the dimensions do not exactly |
220 |
cgg match up. I will blame Fortran for the ugliness. |
cgg match up. I will blame Fortran for the ugliness. |
221 |
|
|
222 |
do bj = jtlo,jthi |
do bj = jtlo,jthi |
246 |
& doglobalread, ladinit, optimcycle, |
& doglobalread, ladinit, optimcycle, |
247 |
& mythid, xx_obcsw_dummy ) |
& mythid, xx_obcsw_dummy ) |
248 |
|
|
249 |
|
#ifdef ALLOW_CTRL_OBCS_BALANCE |
250 |
|
|
251 |
if ( optimcycle .gt. 0) then |
if ( optimcycle .gt. 0) then |
252 |
if (iobcs .eq. 3) then |
if (iobcs .eq. 3) then |
253 |
cgg Special attention is needed for the normal velocity. |
cgg Special attention is needed for the normal velocity. |
271 |
cgg exactly balance the volume flux, since we are dealing with |
cgg exactly balance the volume flux, since we are dealing with |
272 |
cgg the baroclinic velocity structure.. |
cgg the baroclinic velocity structure.. |
273 |
utop = tmpfldyz(j,k,bi,bj)* |
utop = tmpfldyz(j,k,bi,bj)* |
274 |
& maskW(i+ip1,j,k,bi,bj) * delZ(k) + utop |
& maskW(i+ip1,j,k,bi,bj) * delR(k) + utop |
275 |
cgg Add the barotropic velocity component. |
cgg Add the barotropic velocity component. |
276 |
if (maskW(i+ip1,j,k,bi,bj) .ne. 0.) then |
if (maskW(i+ip1,j,k,bi,bj) .ne. 0.) then |
277 |
tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro |
tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro |
279 |
enddo |
enddo |
280 |
cgg Compute the baroclinic velocity at level 1. Should balance flux. |
cgg Compute the baroclinic velocity at level 1. Should balance flux. |
281 |
tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj) |
tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj) |
282 |
& - utop / delZ(1) |
& - utop / delR(1) |
283 |
enddo |
enddo |
284 |
enddo |
enddo |
285 |
enddo |
enddo |
306 |
cgg exactly balance the volume flux, since we are dealing with |
cgg exactly balance the volume flux, since we are dealing with |
307 |
cgg the baroclinic velocity structure.. |
cgg the baroclinic velocity structure.. |
308 |
utop = tmpfldyz(j,k,bi,bj)* |
utop = tmpfldyz(j,k,bi,bj)* |
309 |
& maskS(i,j,k,bi,bj) * delZ(k) + utop |
& maskS(i,j,k,bi,bj) * delR(k) + utop |
310 |
cgg Add the barotropic velocity component. |
cgg Add the barotropic velocity component. |
311 |
if (maskS(i,j,k,bi,bj) .ne. 0.) then |
if (maskS(i,j,k,bi,bj) .ne. 0.) then |
312 |
tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro |
tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro |
314 |
enddo |
enddo |
315 |
cgg Compute the baroclinic velocity at level 1. Should balance flux. |
cgg Compute the baroclinic velocity at level 1. Should balance flux. |
316 |
tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj) |
tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj) |
317 |
& - utop / delZ(1) |
& - utop / delR(1) |
318 |
enddo |
enddo |
319 |
enddo |
enddo |
320 |
enddo |
enddo |
321 |
endif |
endif |
322 |
endif |
endif |
323 |
|
|
324 |
|
#endif /* ALLOW_CTRL_OBCS_BALANCE */ |
325 |
|
|
326 |
do bj = jtlo,jthi |
do bj = jtlo,jthi |
327 |
do bi = itlo,ithi |
do bi = itlo,ithi |
328 |
do k = 1,nr |
do k = 1,nr |