No, really. I actually screw-up! There is not a limitation on hc when using Vtransform=2. This is the advantage of the new transformation, it works for both hc < hmin and hc > hmin This was an issue in the old transformation (Vtransform=1) since we cannot have [h(x,y)-hc] to be negative because dz/ds is also negative!
The check here actually needs to be done in term of Vtransform:
IF (Vtransform(ng).eq.1) THEN
# if defined WET_DRY
hc(ng)=MIN(MAX(hmin(ng),0.0_r8),Tcline(ng))
# else
hc(ng)=MIN(hmin(ng),Tcline(ng))
# endif
ELSE IF (Vtransform(ng).eq.2) THEN
hc(ng)=Tcline(ng)
END IF
and it is independent of the vertical stretching function (Vstretching). Then, the following constraint:
IF (hc(ng).le.hmin(ng)) THEN
needs to be removed for Vstretching=2,3.
I also corrected a bug associated with hc in ad_set_depth.F, tl_set_depth.F, and rp_set_depth.F. Many thanks to Andy Moore for discovering this bug which was introduced recently.