Skip to content

Add an "overlay" for variables specific to NorESM and CESM#33

Merged
mvertens merged 5 commits into
noresmfrom
feature/new_overlay_file
Jul 22, 2026
Merged

Add an "overlay" for variables specific to NorESM and CESM#33
mvertens merged 5 commits into
noresmfrom
feature/new_overlay_file

Conversation

@mvertens

@mvertens mvertens commented Jul 21, 2026

Copy link
Copy Markdown

Summary: Add an "overlay" for variable defaults so each model keeps only its own differences

Previously, NorESM's aerosol/chemistry plotting defaults were written directly into the shared lib/adf_variable_defaults.yaml. That made the shared file drift from upstream and hard to maintain. This PR adds a small feature so a run can lay a second, short defaults file on top of the shared one — overriding only the variables that differ, and leaving everything else untouched.
In particular, the NorESM overlay file - adf_variable_defaults_noresm - will contain NorESM aerosol and surface emission variables whereas the CESM overlay file adf_variable_defaults_cesm will contain CESM aerosol variables.

IMPORTANT:
The NorESM/CESM aerosol variable defaults were moved out of the shared adf_variable_defaults.yaml into per-model overlay files. As a result, defaults_overlay_file is required for any run whose variable list includes those aerosol variables:

  • NorESM runs must set defaults_overlay_file: adf_variable_defaults_noresm.yaml
  • CESM runs must set defaults_overlay_file: adf_variable_defaults_cesm.yaml
    Without it, the derived aerosols won't be generated (their derivable_from/derivation_formula and aerosol_zonal_list now live in the overlay), and the remaining aerosol vars lose their plotting defaults.

Changes:

  • lib/adf_obs.py — after loading the shared defaults, optionally read a defaults_overlay_file and apply it. Each variable in the overlay replaces that variable's entry in the shared file; variables not listed keep their shared settings. A plain filename is looked for in lib/; a full path is used as-is.
  • lib/adf_variable_defaults.yaml — removed the NorESM-specific entries (~705 lines) so the shared file holds only common defaults again.
  • lib/adf_variable_defaults_noresm.yaml (new) — NorESM's overlay (its aerosol/chemistry differences).
  • lib/adf_variable_defaults_cesm.yaml (new) — CESM's overlay, for the same mechanism.
  • config_noresm_template.yaml — turns on the NorESM overlay via defaults_overlay_file.
  • CONFIG_REFERENCE.md — documents the new defaults_overlay_file setting and how it differs from defaults_file.

Testing:
A full NorESM ne16 run loads the shared file + NorESM overlay, with the aerosol variables getting their overlay settings and producing tables/plots as before.

@mvertens
mvertens marked this pull request as draft July 21, 2026 19:15
@mvertens
mvertens marked this pull request as ready for review July 22, 2026 10:02
@mvertens
mvertens requested a review from TomasTorsvik July 22, 2026 10:03
@mvertens

Copy link
Copy Markdown
Author

@adagj - this PR should address the issue you raised regarding how to keep CESM and NorESM aerosol and surface emissions separate and support both. I'm happy to try to merge in your changes if you want as a possible next step - if you point me to your branch.

@mvertens
mvertens merged commit b3a7d3f into noresm Jul 22, 2026
9 checks passed
@mvertens
mvertens deleted the feature/new_overlay_file branch July 22, 2026 12:06
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.

2 participants