Code: Select all
cff=1.0_r8/(0.5_r8*(GRID(ng)%h(Iend ,j)+ &
& GRID(ng)%h(Iend+1,j)))
cff1=SQRT(g*cff)
Cx=dt2d*cff1*0.5_r8*(GRID(ng)%pm(Iend ,j)+ &
& GRID(ng)%pm(Iend+1,j))
Code: Select all
ubar(Iend+1,j,kout)=0.5_r8* &
& ((1.0_r8-Cx)*ubar(Iend+1,j,know)+ &
& Cx*ubar(Iend,j,know)+ &
& bry_val+ &
& cff1*(Zx-BOUNDARY(ng)%zeta_east(j)))
Code: Select all
Cx=dt2d*SQRT(g*1/cff)*0.5_r8*(GRID(ng)%pm(Iend ,j)+ &
& GRID(ng)%pm(Iend+1,j))
The second bug is for the case Cx > Co. In the code, Zx is reassigned the value of Zx + cff2*cff3 when this condition is true.
Code: Select all
Zx=(0.5_r8+Cx)*zeta(Iend ,j,know)+ &
& (0.5_r8-Cx)*zeta(Iend+1,j,know)
IF (Cx.gt.Co) THEN
cff2=(1.0_r8-Co/Cx)**2
cff3=zeta(Iend,j,kout)+ &
& Cx*zeta(Iend+1,j,know)- &
& (1.0_r8-Cx)*zeta(Iend,j,know)
Zx=Zx+cff2*cff3
END IF
Code: Select all
cff3=zeta(Iend,j,kout)+ &
& Cx*zeta(Iend+1,j,know)- &
& (1.0_r8+Cx)*zeta(Iend,j,know)
Deepak
Mason, E., Molemaker, J., Shchepetkin, A. F., Colas, F., McWilliams, J. C., & Sangrà, P. (2010). Procedures for offline grid nesting in regional ocean models. Ocean Modelling, 35(1-2), 1–15. doi:10.1016/j.ocemod.2010.05.007