After some troubleshooting, I determined that I was crashing in ssw_bbl, at SSW_LOGINT because z1 became negative at a particular cell. z_r is the elevation of the rho location, and z_w is the elevation of the vertical velocity location, correct? So how can z_r(i,j,1)<z_w(i,j,0)?
I put in a catch for now, but does this mean that the rho point is under the bed? Would a lot of deposition (relative to the original cell depth) cause this? The original depth is 1.2 m, and deposition has reduced that to about 0.75 m. No cell has gone dry at the time of the crash (zeta is well over 1 m in all areas during the crash, "bath" is no less that 0.5 m). Any ideas are appreciated...
Code: Select all
#ifdef SSW_LOGINT
!
! If current height is less than z1ur, interpolate logarithmically
! to z1ur. (This has not been updated wrt ssw...uses outdated zo defs)
!
IF (Zr(i,j).lt.sg_z1min) THEN
DO k=2,N(ng)
z1=z_r(i,j,k-1)-z_w(i,j,0)
z2=z_r(i,j,k )-z_w(i,j,0)
IF ((z1.lt.sg_z1min).and.(sg_z1min.lt.z2)) THEN
fac=1.0_r8/LOG(z2/z1)
fac1=fac*LOG(z2/sg_z1min)
fac2=fac*LOG(sg_z1min/z1)
Ur_sg(i,j)=fac1*u(i,j,k-1,nrhs)+fac2*u(i,j,k,nrhs)
Vr_sg(i,j)=fac1*v(i,j,k-1,nrhs)+fac2*v(i,j,k,nrhs)
Zr(i,j)=sg_z1min
END IF
END DO
END IF