Write 1D-compatible topo.data and dtopo.data for 1D runs - #745
Conversation
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]
GeoClaw's units policy was implemented in the NetCDF readers but written down nowhere, so enforcement drifted. Adds dev/design/units_policy.md, a UNITS_POLICY registry that both the doc table and a conformance test are generated from, and fixes four violations: CSVFault.read parsed unit annotations from column headings and discarded them (alaska1964.csv read as Mw 5.20 instead of 8.53), input_units was a mutated mutable default that silently declared SI, a unit-less dtopo time axis was silently assumed to be seconds, and two docstrings claimed GeoClaw does not convert on read while it does. Non-conforming rows are xfail(strict) so the remaining ASCII gaps stay visible. Signed-off-by: Kyle Mandli <kyle.mandli@gmail.com> Assisted-by: claude claude-opus-5[1m]
Was not clear that the ASCII files have assumed units and needed some clarification as to how the proposed unit rules apply there.
PR Detailed Description -- Summarized by ClaudeCompanion: clawpack/clawutil#208, which passes What was brokenEvery one of the six 1D and 2D share Fixing so The two layouts are not symmetricWorth spelling out, because the obvious symmetric fix is wrong in one direction
read(iunit,*) dtopofname, dtopotypeList-directed input spans records, so the type sitting on the next line is There is a quieter consequence too. Had that read not aborted, the next The change
Preprocessing attributes set on a 1D file now emit a Verification
The new tests pin both layouts directly — line counts, the Note for anyone re-running the examples: several |
|
Thanks @mandli, this seems to work fine along with clawpack/clawutil#208 |
Signed-off-by: Kyle Mandli <kyle.mandli@gmail.com> Assisted-by: claude claude-opus-5
Signed-off-by: Kyle Mandli <kyle.mandli@gmail.com> Assisted-by: claude claude-opus-5[1m]
31c3193 to
db0d1ad
Compare
…admap Signed-off-by: Kyle Mandli <kyle.mandli@gmail.com> Assisted-by: claude claude-opus-5[1m]
Adds code to handle 1D versions of
topo.dataanddtopo.data. Note that the choice to not have the 1D code support the more complex 2D capabilities and therefore input formats was deliberate. If there should be more parity this PR should be changed to reflect that.