Add river-network preprocessing for the unified MPAS mesh#556
Add river-network preprocessing for the unified MPAS mesh#556xylar wants to merge 6 commits intoE3SM-Project:mainfrom
Conversation
|
This is based off of #545 |
9b31622 to
970d488
Compare
d721849 to
324c1dd
Compare
df5c589 to
83badd1
Compare
This workflow extracts a signed distance function and ocean/land mask from a combined topography dataset on a lat-lon grid. Supported resolutions are 1/4, 1/8, 1/16 and 1/32 degree. It supports three different approaches to the land-ocean interface in Antarctica: 1. coastline at the calving front (main supported case for now) 2. coastline at the grounding (future meshes with ice-shelf cavities) ; and 3. coastline at zero bedrock elevation (potential future meshes with wetting-and-drying). The ocean region is flood-filled from the north pole to ensure that it is contiguous. It uses critical passages and blockages to ensure that the floodfill includes or excludes the same regions as we want in the final ocean mesh.
Add the unified spherical river workflow used to prepare HydroRIVERS data for mesh generation and analysis. - add unified-mesh river configuration and shared defaults under polaris.mesh.spherical.unified - add source, lat-lon, task, step, and visualization plumbing for preparing and inspecting river products - integrate coastline-aware rasterization and shared HydroRIVERS archiving for the retained network - add base-mesh river conditioning so downstream mesh workflows can consume clipped and simplified river products
Add and update tests that cover the new river workflow behavior, including archive handling and unified spherical river processing.
83badd1 to
612e84a
Compare
|
Can you provide more info for: drainage_area_threshold can be a function of mesh resolution, too. outlet_distance_tolerance can be a function of mesh resolution near coast, too. |
Okay, that's good to know. Can you be more specific about how each of these should be specified as a lat-lon field? How do we know the mesh resolution at the point where we're trying to simplify the river network with this information? At the moment, these config options are used before we have constructed the sizing field, as they are inputs to the sizing field itself. Update: Claude helped me understand this better. You aren't deriving these from the resolution maps, just from the scalar resolution values. I'll try to figure out how to do something similar in Polaris. |
I will try to update the user's guide to give a more verbose description of how each of these is used. |
This includes moving the coastline docs into a unified mesh section and some clean up to those docs as well.
612e84a to
25f1998
Compare
|
@changliao1025, I had Claude expand quite a bit on the descriptions of these config options. Could you take a look here and see if that helps? |



Summary
This PR adds
polaris/tasks/mesh/spherical/unified/riveras the river-networkpreprocessing path for the unified spherical mesh workflow, together with unit
tests covering both source-level simplification and lat-lon target-grid
products.
The implementation introduces shared source-level and lat-lon river workflows,
uses HydroRIVERS as the public source dataset, and adds visualization and
diagnostic outputs to make the retained network and outlet matching easier to
inspect.
What This PR Adds
source_river_network.geojsonsimplified_river_network.geojsonretained_outlets.geojsonNEXT_DOWNlinks are acyclicthe supported unified target grids and writes:
river_network.ncriver_outlets.geojsonriver_channel_maskriver_outlet_maskriver_ocean_outlet_maskriver_inland_sink_maskriver_network.cfgsettings for source download, simplification, outlet matching, and rasterizationTesting
This PR adds
tests/mesh/spherical/unified/test_river.pywith coverage for:NEXT_DOWNgraphsNotes
The river simplification is implemented as a focused Polaris-native
reimplementation rather than a direct port of the standalone workflow internals.
The current behavior is designed to preserve basin connectivity, dominant
outlets, and major tributaries while keeping the workflow compact and testable.
Checklist
api.md) has any new or modified class, method and/or functions listedTestingcomment in the PR documents testing used to verify the changes