Add a grid option in areacella calculation process - #676
Open
rhaegar325 wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #676 +/- ##
=======================================
+ Coverage 78.1% 78.3% +0.2%
=======================================
Files 40 40
Lines 8822 8877 +55
Branches 1664 1676 +12
=======================================
+ Hits 6891 6951 +60
+ Misses 1594 1591 -3
+ Partials 337 335 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #672
Summary
areacellacan now be built on any of the four ACCESS atmosphere stagger pointsinstead of only the theta points. CMIP7 only.
Changes
calculate_areacellatakes agrid_key—derivations/calc_atmos.pygrid_key:"default"|"U"|"V"|"other", the samekeys
resolve_atmosphere_grid_keyreturns. Defaults to the theta points.formula are untouched: the existing midpoint-plus-pole-clamp bounds are already
correct for both the 145 theta rows and the 144
lat_vrows.nlatstill counts theta rows;"V"and"other"derivenlat - 1from them.grid_keyraises instead of falling back to the theta grid.commentnames the point (theta/u/v/uv) fromGRID_KEY_POINT_NAMES, whichATMOS_GRID_KEYSis also derived from, so the twocannot fall out of sync. The published text uses the UM's names for the points,
not our configuration keys.
New
match_variableargument —driver.pymatch_variable→ an explicitgrid_label, read back throughthe model's own
cmip7_grid_labels→ the mapping entry's own dimensions.dimensionsare rewritten for that pointand
grid_keyis injected intocalculation.kwargs, so the computed areas, thedimensions and the grid label all describe the same cells. The CMORiser is
unchanged — it already forwards
calculation.kwargsto the internal function.match_variablethat is unknown, is not on theatmosphere grid, contradicts an explicit
grid_label, names anything other thana computed
areacella, or is used withcmip_version != "CMIP7".Two helpers —
utilities.pyload_variable_entry(cmor_name, model_id)looks up a mapping entry by bare CMORname.
load_model_mappingsnow delegates to it and behaves as before.invert_atmosphere_grid_labels(grid_labels)mapsg110 → "other". A labelconfigured for more than one point is omitted rather than resolved arbitrarily.
Batch config —
templates/cmor_job_script.j2,templates/cmor_python_script.j2match_variablerides the existingvariable_resourceschannel, next togrid_label.Scope
CMIP7 only: the grid label is what tells the four points apart, and only CMIP7
registers one per point. CMIP6 publishes them all under
gnand itsareacellatable entry asks for the mass-point areas, so CMIP6 output is unchanged and
match_variableis rejected there.