Thanks.
The u2dbc_im.F file
https://www.myroms.org/svn/src/trunk/RO ... u2dbc_im.F treated EAST_M2FLATHER so that BOUNDARY(ng)%zeta_east is used to specify ubar.
Code: Select all
# elif defined EAST_M2FLATHER
!
! Eastern edge, Flather boundary condition.
!
DO j=Jstr,Jend
# if defined SSH_TIDES && !defined UV_TIDES
# ifdef FSOBC_REDUCED
bry_pgr=-g*(BOUNDARY(ng)%zeta_east(j)- &
& zeta(Iend,j,know))* &
& 0.5_r8*GRID(ng)%pm(Iend,j)
# else
bry_pgr=-g*(zeta(Iend+1,j,know)- &
& zeta(Iend ,j,know))* &
& 0.5_r8*(GRID(ng)%pm(Iend ,j)+ &
& GRID(ng)%pm(Iend+1,j))
# endif
# ifdef UV_COR
bry_cor=0.125_r8*(vbar(Iend ,j ,know)+ &
& vbar(Iend ,j+1,know)+ &
& vbar(Iend+1,j ,know)+ &
& vbar(Iend+1,j+1,know))* &
& (GRID(ng)%f(Iend ,j)+ &
& GRID(ng)%f(Iend+1,j))
# else
bry_cor=0.0_r8
# endif
cff1=1.0_r8/(0.5_r8*(GRID(ng)%h(Iend ,j)+ &
& zeta(Iend ,j,know)+ &
& GRID(ng)%h(Iend+1,j)+ &
& zeta(Iend+1,j,know)))
bry_str=cff1*(FORCES(ng)%sustr(Iend+1,j)- &
& FORCES(ng)%bustr(Iend+1,j))
Cx=1.0_r8/SQRT(g*0.5_r8*(GRID(ng)%h(Iend+1,j)+ &
& zeta(Iend+1,j,know)+ &
& GRID(ng)%h(Iend ,j)+ &
& zeta(Iend ,j,know)))
cff2=GRID(ng)%om_u(Iend+1,j)*Cx
!! cff2=dt2d
bry_val=ubar(Iend,j,know)+ &
& cff2*(bry_pgr+ &
& bry_cor+ &
& bry_str)
# else
bry_val=BOUNDARY(ng)%ubar_east(j)
# endif
cff=1.0_r8/(0.5_r8*(GRID(ng)%h(Iend ,j)+ &
& zeta(Iend ,j,know)+ &
& GRID(ng)%h(Iend+1,j)+ &
& zeta(Iend+1,j,know)))
Cx=SQRT(g*cff)
ubar(Iend+1,j,kout)=bry_val+ &
& Cx*(0.5_r8*(zeta(Iend ,j,know)+ &
& zeta(Iend+1,j,know))- &
& BOUNDARY(ng)%zeta_east(j))
# ifdef MASKING
ubar(Iend+1,j,kout)=ubar(Iend+1,j,kout)* &
& GRID(ng)%umask(Iend+1,j)
# endif
END DO
Now I see how boundary forcing values of both ubar_east and zeta_east are used:
Code: Select all
# else
bry_val=BOUNDARY(ng)%ubar_east(j)
# endif
cff=1.0_r8/(0.5_r8*(GRID(ng)%h(Iend ,j)+ &
& zeta(Iend ,j,know)+ &
& GRID(ng)%h(Iend+1,j)+ &
& zeta(Iend+1,j,know)))
Cx=SQRT(g*cff)
ubar(Iend+1,j,kout)=bry_val+ &
& Cx*(0.5_r8*(zeta(Iend ,j,know)+ &
& zeta(Iend+1,j,know))- &
& BOUNDARY(ng)%zeta_east(j))
The caveat is that if I use EAST_M2RADIATION+EAST_M2NUDGING for (ubar,vbar) and EAST_FSCHAPMAN for zeta
then the boundary forcing value for zeta, BOUNDARY(ng)%zeta_east, will NOT be used because the EAST_M2RADIATION+EAST_M2NUDGING section (below) in u2dbc_im.F does not involve BOUNDARY(ng)%zeta_east, neither does the EAST_FSCHAPMAN section of zetabc.F
https://www.myroms.org/svn/src/trunk/RO ... r/zetabc.F
Code: Select all
# if defined EAST_M2RADIATION
!
! Eastern edge, implicit upstream radiation condition.
!
DO j=Jstr,Jend+1
grad(Iend ,j)=ubar(Iend ,j ,know)- &
& ubar(Iend ,j-1,know)
grad(Iend+1,j)=ubar(Iend+1,j ,know)- &
& ubar(Iend+1,j-1,know)
END DO
DO j=Jstr,Jend
dUdt=ubar(Iend,j,know)-ubar(Iend ,j,kout)
dUdx=ubar(Iend,j,kout)-ubar(Iend-1,j,kout)
# ifdef EAST_M2NUDGING
IF ((dUdt*dUdx).lt.0.0_r8) THEN
tau=M2obc_in(ng,ieast)
ELSE
tau=M2obc_out(ng,ieast)
END IF
tau=tau*dt2d
# endif
IF ((dUdt*dUdx).lt.0.0_r8) dUdt=0.0_r8
IF ((dUdt*(grad(Iend,j)+grad(Iend,j+1))).gt.0.0_r8) THEN
dUde=grad(Iend,j)
ELSE
dUde=grad(Iend,j+1)
END IF
cff=MAX(dUdx*dUdx+dUde*dUde,eps)
Cx=dUdt*dUdx
# ifdef RADIATION_2D
Ce=MIN(cff,MAX(dUdt*dUde,-cff))
# else
Ce=0.0_r8
# endif
# if defined CELERITY_WRITE && defined FORWARD_WRITE
BOUNDARY(ng)%ubar_east_Cx(j)=Cx
BOUNDARY(ng)%ubar_east_Ce(j)=Ce
BOUNDARY(ng)%ubar_east_C2(j)=cff
# endif
ubar(Iend+1,j,kout)=(cff*ubar(Iend+1,j,know)+ &
& Cx *ubar(Iend ,j,kout)- &
& MAX(Ce,0.0_r8)*grad(Iend+1,j )- &
& MIN(Ce,0.0_r8)*grad(Iend+1,j+1))/ &
& (cff+Cx)
# ifdef EAST_M2NUDGING
ubar(Iend+1,j,kout)=ubar(Iend+1,j,kout)+ &
& tau*(BOUNDARY(ng)%ubar_east(j)- &
& ubar(Iend+1,j,know))
# endif
# ifdef MASKING
ubar(Iend+1,j,kout)=ubar(Iend+1,j,kout)* &
& GRID(ng)%umask(Iend+1,j)
# endif
END DO