Skip to content

WIP - New example chile2010_netcdf not working - #740

Draft
rjleveque wants to merge 3 commits into
clawpack:masterfrom
rjleveque:chile2010_netcdf
Draft

WIP - New example chile2010_netcdf not working#740
rjleveque wants to merge 3 commits into
clawpack:masterfrom
rjleveque:chile2010_netcdf

Conversation

@rjleveque

Copy link
Copy Markdown
Member

I'm experimenting with this new chile2010_netcdf example, where I tried specifying

    topo_path = '/Users/rjl/git/AGTwork/topo/GEBCO_2026.nc'
    topo = topotools.Topography()
    topo.path = topo_path
    topo.topo_type = 4  # netCDF
    topo.crop_extent = [-190, -60, -60, 0]  # computational domain
    topo.buffer = 1  # buffer to make sure domain is covered
    topo.coarsen = 20 # coarsen from 30 arcsec to 10 arcmin
    topo_data.topofiles.append(topo)

to test using a crop extent that crosses the date line at longitude -180.

Before PR #739, the topo.data file only listed one topo grid, and would only get part of the crop_extent.

With this PR, topo.data lists the same .nc file twice, as desired, so two topo grids are created, as expected, plus a third one internally corresponding to the dtopo data file (topo_for_dtopo).

However, the dtopo is not longer applied, apparently -- no tsunami appears. Cutting the domain and crop_extent back to starting at x_lower = -120, it works fine with the netCDF file as topo data, and the expected tsunami is generated.

Another issue: Even though I have topo.buffer = 1 when GeoClaw runs it reports that the topo does not cover the full domain. Again it works fine with x_lower = -120. The problem I think is that there is a gap between the topo files at -180 that is hard to avoid with 2 files, since the GEBCO data starts at x = -179.99791666666667 and ends at x = 179.99791666666667. But I thought that buffering was perhaps supposed to deal with this case too?

mandli and others added 3 commits September 4, 2026 21:04
Eleven silent failures in crop_extent handling produced wrong answers with
no message: wrapped spellings gave empty grids, sub-cell and non-overlapping
crops gave the full file, a cropped type-4 read reported the full-file
extent, and buffer was dropped for every descriptor-cropped NetCDF file.
Adds the first Fortran regression coverage for the descriptor-crop path and
documents what a Topography represents across the antimeridian.

Signed-off-by: Kyle Mandli <kyle.mandli@gmail.com>
Assisted-by: claude claude-opus-5[1m]
A URL in topofiles was mangled by os.path.abspath into a bogus local path
before the reader's existing URL guard could see it; it is now rejected with
the fetch_remote_topo recipe. A crop crossing the antimeridian raised
'crop_bounds exceed file extent' even though _compute_lon_entries already
covered it; TopographyData.write now resolves entries before writing and
splits such a crop into one descriptor entry per side, carrying buffer and
coarsen onto each so the Fortran buffer fix applies. Adds byte-exact
topo.data goldens and the first end-to-end test of two entries with
differing lon_wrap_offset.

Signed-off-by: Kyle Mandli <kyle.mandli@gmail.com>
Assisted-by: claude claude-opus-5[1m]
Also testing cropping and coarsening. Works on standard domain starting
at x_lower = -120, but with x_lower = -190 it seems to handle topo
properly (specifying two grids in topo.data) but dtopo is no longer
used properly, so no tsunami generated (when testing clawpack#739)
@mandli

mandli commented Sep 7, 2026

Copy link
Copy Markdown
Member

Just want to clarify the input data so I can replicate:

  • topo is the newest version of the GEBCO full globe data set?
  • dtopo is the same as the existing example?

@rjleveque

Copy link
Copy Markdown
Member Author

@mandl - correct!

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.

2 participants