Skip to content

global_energy_fixer postblock (gen2) only supports explicit up/down fluxes — no net-flux option, and docs are gen1-only #467

Description

@kjmayer

Summary

The gen1 global energy fixer postblock (credit/postblock/gen1.py::GlobalEnergyFixer) accepts net TOA and surface radiation fluxes (e.g. FSNT, FLNT, FSNS, FLNS), matching what's documented at https://miles-credit.readthedocs.io/en/latest/postblock.html. The gen2 implementation (credit/postblock/conservation.py::GlobalEnergyFixerUpDown) only supports explicit up/down flux decomposition (toa_up_solar_var, toa_up_olr_var, surf_down_solar_var, surf_up_solar_var, surf_down_lw_var, surf_up_lw_var, etc.) — there's no net-flux equivalent registered for gen2.

This means:

  1. Users can't use net-flux output with the gen2 energy fixer without manually decomposing into up/down components first.
  2. The registry key global_energy_fixer in credit/postblock/init.py is aliased to GlobalEnergyFixerUpDown, so a gen1-style config using that key (with net-flux variable names) will fail or silently misconfigure rather than clearly erroring

Proposed fix

  • Port a net-flux-compatible energy fixer (GlobalEnergyFixer, mirroring gen1's class) into credit/postblock/conservation.py for gen2, alongside the existing GlobalEnergyFixerUpDown.
  • Register it under a distinct key (e.g. global_energy_fixer_net) so it doesn't collide with the up/down variant, and consider renaming/aliasing the existing global_energy_fixer key more explicitly

Docs

The postblock readthedocs page currently only shows the gen1/net-flux config example under "Global Energy Fixer." Once gen2 supports both methods, the docs should be updated to show both config examples (net-flux vs. up/down) and clarify which config keys map to which method for gen2.

Environment

  • Repo: NCAR/miles-credit, main branch
  • Relevant files: credit/postblock/gen1.py, credit/postblock/conservation.py, credit/postblock/init.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions