Refactor ismip7_forcing - #997
Conversation
bd81e5d to
3b49480
Compare
Resolve forcing files directly from the native AIS and GIS archive layouts instead of requiring manually rearranged inputs. * centralize forcing path discovery in a shared archive resolver * select the latest available version independently for each dataset * support explicit version overrides and numeric version ordering * make forcing product and resolution configurable * support ESM, OCX, and fracture-data directory layouts * include source-grid information in mapping filenames * remove hard-coded versions and resolutions from ice-sheet parameters * update configuration, documentation, and resolver tests Co-authored-by: Codex [codex@openai.com](mailto:codex@openai.com)
Add dedicated mapping steps for atmospheric, ocean, and fracture forcings. Reuse existing compatible mapping files and pass mapping outputs to the processing steps instead of generating them on demand. Update configuration, documentation, and tests for the new workflow.
3b49480 to
436dbc9
Compare
ismip7_forcing
Set min_tasks to 1 to prevent jobs from failing when the number of processors was reduced between running build_mapping_files and the remaining processing steps.
Add ntasks to mapping step test, which was failing during CI.
TestingI used this to process OCX atmosphere and ocean thermal forcing on the 2-20km AIS mesh using the .cfg file below. click to expandI was able to run the |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The all-disabled fracture configuration still attempts source resolution, and several API and OCX documentation details need correction.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (4)
What changed in this PR
Refactors ISMIP7 forcing to resolve native archive layouts and generate reusable mapping files.
Changes:
- Adds configurable archive, version, product, and resolution resolution.
- Introduces dedicated mapping-generation and caching steps.
- Updates processing, tests, configuration, and documentation.
Validation was limited to static review.
| File | Description |
|---|---|
tests/landice/ismip7/test_mapping_step.py |
Tests mapping caching and fracture grid selection. |
tests/landice/ismip7/test_archive.py |
Tests archive resolution behavior. |
docs/users_guide/landice/test_groups/ismip7_forcing.rst |
Documents native layouts and mapping steps. |
docs/developers_guide/landice/test_groups/ismip7_forcing.rst |
Updates implementation documentation. |
docs/developers_guide/landice/framework.rst |
Documents the archive resolver. |
docs/developers_guide/landice/api.rst |
Adds archive APIs. |
compass/landice/tests/ismip7_forcing/ocean_thermal/process_thermal_forcing.py |
Uses resolved ocean sources and mappings. |
compass/landice/tests/ismip7_forcing/ocean_thermal/build_mapping_file.py |
Adds ocean mapping generation. |
compass/landice/tests/ismip7_forcing/ocean_thermal/__init__.py |
Registers the ocean mapping step. |
compass/landice/tests/ismip7_forcing/mapping_step.py |
Implements shared mapping caching. |
compass/landice/tests/ismip7_forcing/ismip7_forcing.cfg |
Adds resolver configuration defaults. |
compass/landice/tests/ismip7_forcing/ismip7_forcing_test.cfg |
Updates the example archive configuration. |
compass/landice/tests/ismip7_forcing/ismip7_forcing_ocx_gis.cfg |
Updates GrIS OCX configuration. |
compass/landice/tests/ismip7_forcing/ismip7_forcing_ocx_ais.cfg |
Updates AIS OCX configuration. |
compass/landice/tests/ismip7_forcing/fracture/process_shelf_collapse.py |
Uses resolved fracture inputs. |
compass/landice/tests/ismip7_forcing/fracture/process_lake_properties.py |
Uses resolved fracture inputs. |
compass/landice/tests/ismip7_forcing/fracture/process_excess_melt.py |
Uses resolved fracture inputs. |
compass/landice/tests/ismip7_forcing/fracture/build_mapping_file.py |
Adds fracture mapping generation. |
compass/landice/tests/ismip7_forcing/fracture/__init__.py |
Registers the fracture mapping step. |
compass/landice/tests/ismip7_forcing/atmosphere/process_temperature.py |
Uses resolved atmosphere inputs. |
compass/landice/tests/ismip7_forcing/atmosphere/process_temperature_gradient.py |
Uses resolved atmosphere inputs. |
compass/landice/tests/ismip7_forcing/atmosphere/process_smb.py |
Uses resolved atmosphere inputs. |
compass/landice/tests/ismip7_forcing/atmosphere/process_smb_gradient.py |
Uses resolved atmosphere inputs. |
compass/landice/tests/ismip7_forcing/atmosphere/process_runoff.py |
Uses resolved atmosphere inputs. |
compass/landice/tests/ismip7_forcing/atmosphere/build_mapping_file.py |
Adds atmosphere mapping generation. |
compass/landice/tests/ismip7_forcing/atmosphere/__init__.py |
Registers the atmosphere mapping step. |
compass/landice/ismip7/ice_sheet_params.py |
Removes fixed versions and resolutions. |
compass/landice/ismip7/archive.py |
Implements native archive resolution. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Add check to skip fracture mappings if none are requested. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
When fracture method config options are not set, section.get() returns None instead of a string. Check for None before calling .lower() to avoid AttributeError and properly skip fracture mappings when no methods are configured. Addresses review comment on PR MPAS-Dev#997.
Update comment to specify that EN4 ocean forcing is used for GrIS in the OCX scenario, not AIS. AIS OCX deliberately leaves ocean_model unset and uses per-choice ocean directories (main/cold/warm/vary). Addresses review comment on PR MPAS-Dev#997.
Add the three new BuildMappingFile classes (atmosphere, ocean_thermal, and fracture) to the ismip7_forcing autosummary in the API documentation so their API pages will be generated. Addresses review comment on PR MPAS-Dev#997.
Update documentation to distinguish that GrIS OCX uses EN4 as the ocean source, while AIS OCX leaves ocean_model unset and uses per-choice ocean directories (main/cold/warm/vary). Addresses review comment on PR MPAS-Dev#997.
Break long line into multiple lines to satisfy 79 character limit. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
0264f24 to
04db5d8
Compare
matthewhoffman
left a comment
There was a problem hiding this comment.
@trhille , I manually skimmed all the changes, looked over copilot's review, used copilot and claude to fix copilot review issues, and compiled and manually looked over docs. I'm approving based on these steps, plus your Testing comment demonstrating this behaves as intended.
Replace manual get_params/forcing_group/source logic with resolve_ocean_source, so the step uses the same label and forcing_group that ProcessThermalForcing wrote. The 2D/3D filename contract now matches what process_thermal_forcing produces (mesh_<2d/3d>ThermalForcing_<label>_). This is a semantic-conflict resolution: build_3d originally mirrored pre-MPAS-Dev#997 source logic; now it consumes the MPAS-Dev#997 ForcingSource object. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>


Resolve forcing files directly from the native AIS and GIS archive layouts instead of requiring manually rearranged inputs.
Co-authored-by: Codex codex@openai.com
Checklist
api.rst) has any new or modified class, method and/or functions listedTestingin this PR) any testing that was used to verify the changes