--- MITgcm/pkg/ctrl/ctrl_getobcsw.F 2003/06/24 16:07:06 1.2 +++ MITgcm/pkg/ctrl/ctrl_getobcsw.F 2007/05/14 22:02:33 1.7 @@ -125,6 +125,8 @@ & doglobalread, ladinit, optimcycle, & mythid, xx_obcsw_dummy ) +#ifdef ALLOW_CTRL_OBCS_BALANCE + if ( optimcycle .gt. 0) then if (iobcs .eq. 3) then cgg Special attention is needed for the normal velocity. @@ -148,7 +150,7 @@ cgg exactly balance the volume flux, since we are dealing with cgg the baroclinic velocity structure.. utop = tmpfldyz(j,k,bi,bj)* - & maskW(i+ip1,j,k,bi,bj) * delZ(k) + utop + & maskW(i+ip1,j,k,bi,bj) * delR(k) + utop cgg Add the barotropic velocity component. if (maskW(i+ip1,j,k,bi,bj) .ne. 0.) then tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro @@ -156,7 +158,7 @@ enddo cgg Compute the baroclinic velocity at level 1. Should balance flux. tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj) - & - utop / delZ(1) + & - utop / delR(1) enddo enddo enddo @@ -183,7 +185,7 @@ cgg exactly balance the volume flux, since we are dealing with cgg the baroclinic velocity structure.. utop = tmpfldyz(j,k,bi,bj)* - & maskS(i,j,k,bi,bj) * delZ(k) + utop + & maskS(i,j,k,bi,bj) * delR(k) + utop cgg Add the barotropic velocity component. if (maskS(i,j,k,bi,bj) .ne. 0.) then tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro @@ -191,13 +193,15 @@ enddo cgg Compute the baroclinic velocity at level 1. Should balance flux. tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj) - & - utop / delZ(1) + & - utop / delR(1) enddo enddo enddo endif endif +#endif /* ALLOW_CTRL_OBCS_BALANCE */ + do bj = jtlo,jthi do bi = itlo,ithi do k = 1,nr @@ -212,7 +216,7 @@ if ( (obcswfirst) .or. (obcswchanged)) then -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 cgg match up. I will blame Fortran for the ugliness. do bj = jtlo,jthi @@ -242,6 +246,8 @@ & doglobalread, ladinit, optimcycle, & mythid, xx_obcsw_dummy ) +#ifdef ALLOW_CTRL_OBCS_BALANCE + if ( optimcycle .gt. 0) then if (iobcs .eq. 3) then cgg Special attention is needed for the normal velocity. @@ -265,7 +271,7 @@ cgg exactly balance the volume flux, since we are dealing with cgg the baroclinic velocity structure.. utop = tmpfldyz(j,k,bi,bj)* - & maskW(i+ip1,j,k,bi,bj) * delZ(k) + utop + & maskW(i+ip1,j,k,bi,bj) * delR(k) + utop cgg Add the barotropic velocity component. if (maskW(i+ip1,j,k,bi,bj) .ne. 0.) then tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro @@ -273,7 +279,7 @@ enddo cgg Compute the baroclinic velocity at level 1. Should balance flux. tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj) - & - utop / delZ(1) + & - utop / delR(1) enddo enddo enddo @@ -300,7 +306,7 @@ cgg exactly balance the volume flux, since we are dealing with cgg the baroclinic velocity structure.. utop = tmpfldyz(j,k,bi,bj)* - & maskS(i,j,k,bi,bj) * delZ(k) + utop + & maskS(i,j,k,bi,bj) * delR(k) + utop cgg Add the barotropic velocity component. if (maskS(i,j,k,bi,bj) .ne. 0.) then tmpfldyz(j,k,bi,bj) = tmpfldyz(j,k,bi,bj)+ ubaro @@ -308,13 +314,15 @@ enddo cgg Compute the baroclinic velocity at level 1. Should balance flux. tmpfldyz(j,1,bi,bj) = tmpfldyz(j,1,bi,bj) - & - utop / delZ(1) + & - utop / delR(1) enddo enddo enddo endif endif +#endif /* ALLOW_CTRL_OBCS_BALANCE */ + do bj = jtlo,jthi do bi = itlo,ithi do k = 1,nr