Skip to content

Issue #915: Produce BCVs#918

Draft
Ed (mo-gill) wants to merge 16 commits into
mainfrom
915_produce_BCVs
Draft

Issue #915: Produce BCVs#918
Ed (mo-gill) wants to merge 16 commits into
mainfrom
915_produce_BCVs

Conversation

@mo-gill
Copy link
Copy Markdown
Collaborator

Should fulfil #915

@mo-gill Ed (mo-gill) self-assigned this May 11, 2026
@mo-gill Ed (mo-gill) changed the title Add skeleton of coord replacement func. Issue #915: Produce BCVs May 12, 2026
Ed (mo-gill) and others added 5 commits May 12, 2026 15:49
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
merged_cubes = load_cubes_from_pp(all_input_data, load_constraints, run_bounds, ancil_variables)
else:
merged_cubes = load_cubes_from_nc(all_input_data, load_constraints, run_bounds)
merged_cubes = load_cubes_from_nc(all_input_data, load_constraints, effective_run_bounds)
Copy link
Copy Markdown
Collaborator Author

@mo-gill Ed (mo-gill) May 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with the name change from run_bounds to effective_run_boundsto prevent join(run_bounds) (Ln 211) throwing an error due to being used with the None which gets assigned on line 203. Hoping the rename isn't confusing.

else:
cube = apply_time_constraint(merged_cube, time_constraint)
if cube is not None:
cubes.append(cube)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting time_constraint to None was necessary for the nemo ancil that lacked run bounds. However, passing None to setup_time_constraint lead to TypeError: 'NoneType' object is not subscriptable when iris evaluated it. The guard should now only be constructing the time constraint when run_bounds is not None, and appending the cube directly otherwise.

"ancil_variables": [
"u_coord_reference",
"v_coord_reference"
],
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed otherwise moo filter threw an error trying to extract these from MASS.

var_names = [cube.coord(axis=axis).var_name
for cube in input_variables.values()
if not cube.var_name.endswith('_coord_reference')]
if not (cube.var_name and cube.var_name.endswith('_coord_reference'))]
Copy link
Copy Markdown
Collaborator Author

@mo-gill Ed (mo-gill) May 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refinement to the guard added earlier as it caused an attribute error on .pp ancils due to them not having a "var_name" to check.
This allowed these variables to be produced:

land/mrsofc_ti-u-hxy-lnd@fx:fx
land/orog_ti-u-hxy-u@fx:fx

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.

1 participant