Thank you for reporting this problem. I forgot to take care of the roundoff issues with the interpolation weights when I implemented the single precision (

SINGLE_PRECISION option) simulations.

Your suggested solutions are incorrect

We cannot take the

ABS value when computing the interpolation weights. It is really bad because the weights are exclusively between

0 and

1 for bounded linear interpolation. Otherwise, we have extrapolation which is not allowed in ROMS. The solution is to convert the time units from

seconds to something smaller, say

milliseconds. Then, we can have in

nesting.F:

**Code:**

!

! Set linear time interpolation weights. Fractional seconds are

! rounded to the nearest milliseconds integer towards zero in the

! time interpolation weights.

!

SecScale=1000.0_dp ! seconds to milliseconds

!

Wold=ANINT((RollingTime(tnew,cr)-time(ng))*SecScale,dp)

Wnew=ANINT((time(ng)-RollingTime(told,cr))*SecScale,dp)

fac=1.0_dp/(Wold+Wnew)

Wold=fac*Wold

Wnew=fac*Wnew

Notice that the scaling does not affect the values of

Wold and

Wnew. They still range between

0 and

1 since we multiple and divide the

SecScale. One could scale to microseconds (

SecSecale=1.0E+6_dp) but is not necessary.

Similarly, your fix in

metrics.F is problematic since that conditional needs to exact to zero! The solution is to use the

SecScale again:

**Code:**

!

! Check refined grid time-step. The time-step size for refined grids

! needs to be an exact mode multiple of its coarser donor grid. In

! principle, it can be a "RefineScale" factor smaller. However, other

! integer smaller or larger factor are allowed such that:

!

! MOD(dt(dg)*SecScale, dt(rg)*SecScale) = 0 dg: donor coarse grid

! rg: receiver fine grid

!

! Notice that SecScale is used to avoid roundoff when the timestep

! between donor and receiver grids are small and less than one.

!

SecScale=1000.0_dp ! seconds to milliseconds

DO ig=1,Ngrids

IF (RefinedGrid(ig).and.(RefineScale(ig).gt.0)) THEN

dg=CoarserDonor(ig)

IF (MOD(dt(dg)*SecScale,dt(ig)*SecScale).ne.0.0_dp) THEN

IF (DOMAIN(ng)%SouthWest_Test(tile)) THEN

IF (Master) THEN

WRITE (stdout,100) ig, dt(ig), dg, dt(dg), &

& MOD(dt(dg),dt(ig))

I will update the code with these changes.