I've been working on a storm surge simulation with two-way nesting,
and encountered errors if baloclinic timestep dt at child grid is less than 1.
For example, if parent timestep dt(dg) = 3 and child timestep dt(ig) = 0.6,
then ROMS reported the following error:
METRICS - illegal timestep size for finer reciever grid (rg),
It must be an exact divisible factor from donor grid (dg).
Therefore I checked ROMS/Utility/metrics.F and found that MOD function returned non-zero values in line 1081,
though the order was ~O(1E-11). So I modified slightly as following:
IF (MOD(dt(dg),dt(ig)).gt.1.0d-3) THEN
and the error disappeared.
However, there was the another issue in Nesting.F and it caused the error:
PUT_REFINE2D - unbounded contact points temporal: interpolation:
cr = 05 dg = 03 ng = 04
iic(dg) = 0000002 told = 2 tnew = 1
iic(ng) = 0000006 Wold = 1.00000 Wnew = -0.00000
time(ng) = ******* time(told) = ******* time(tnew) = *******
Found Error: 08 Line: 6237 Source: ROMS/Nonlinear/nesting.F
Found Error: 08 Line: 95 Source: ROMS/Utility/get_2dfld.F
Found Error: 08 Line: 134 Source: ROMS/Nonlinear/get_data.F
Found Error: 08 Line: 201 Source: ROMS/Nonlinear/main3d.F
Found Error: 08 Line: 298 Source: ROMS/Drivers/nl_ocean.h
The problem is that the weight value for time interpolation Wnew is negative.
So I added ABS function to Wold and Wnew in the subroutine put_refine2d and put_refine3d as following:
Wold=ABS(RollingTime(tnew,cr)-time(ng))
Wnew=ABS(time(ng)-RollingTime(told,cr))
So far, it seems that the correction works fine.
