Skip to content

Fix off-by-one in force_dry mask indexing - #752

Open
alorentiar wants to merge 1 commit into
clawpack:masterfrom
alorentiar:fix/force-dry-indexing
Open

alorentiar wants to merge 1 commit into
clawpack:masterfrom
alorentiar:fix/force-dry-indexing

Conversation

@alorentiar

Copy link
Copy Markdown

The force_dry lookups were using two different conventions. qinit.f90
was reading one column too far west (no +1 on the column index), while
filpatch/filval in both the shallow and bouss copies were reading one row
too far north (an extra +1 before the north-edge flip). So the mask lands
one cell away from where it was computed, and the wrong cells start dry
or wet.

Made all five sites use the same convention:

ii = int((x - xlow_fdry + 1d-7) / dx_fdry) + 1
jj = my_fdry - int((y - ylow_fdry + 1d-7) / dy_fdry)

Fixes #751.

qinit.f90 was missing the +1 on the column index, while the
filpatch/filval copies had an extra +1 on the row index before the
north-edge flip. Make all five sites use the same convention.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

force_dry mask is indexed off by one: qinit.f90 shifts it in x, filpatch/filval shift it in y

1 participant