Skip to content

Add exclude_top_levels option to energy budget corrector#1320

Open
mcgibbon wants to merge 1 commit into
mainfrom
feature/energy-corrector-exclude-top-levels
Open

Add exclude_top_levels option to energy budget corrector#1320
mcgibbon wants to merge 1 commit into
mainfrom
feature/energy-corrector-exclude-top-levels

Conversation

@mcgibbon

Copy link
Copy Markdown
Contributor

The constant_temperature total-energy-budget correction applies a vertically- and horizontally-uniform air-temperature increment to enforce total-energy conservation. It currently adds that increment to every vertical level, including the thin model top level. In the 4°/daily ERA5-only baseline this introduces a positive bias in the topmost air temperature level. This PR adds an option to exclude the top N levels from receiving the increment, so the bias can be tested/removed without changing the conserved global magnitude.

Changes:

  • fme.core.corrector.atmosphere.EnergyBudgetConfig: add exclude_top_levels: int = 0 field (with a non-negative __post_init__ check); it only restricts which levels receive the per-level temperature addition, the global magnitude of the correction is still computed across all levels.

  • fme.core.corrector.atmosphere._force_conserve_total_energy: accept exclude_top_levels and skip the topmost N air_temperature levels (level 0 is the model top) when applying the increment; raise if it exceeds the number of levels. Threaded through AtmosphereCorrector.__call__.

  • fme.core.corrector.test_atmosphere: excluded top level receives no increment while remaining levels get the same per-level magnitude as the no-exclusion case; negative-value and too-many-levels error cases.

  • Tests added

  • If dependencies changed, "deps only" image rebuilt and "latest_deps_only_image.txt" file updated

The constant_temperature total-energy-budget correction applies a
uniform temperature addition to every vertical level. Add an
exclude_top_levels option on EnergyBudgetConfig so the topmost N levels
(level 0, then 0-1, etc.) can be excluded from receiving the addition.
The global magnitude of the correction is still computed across all
levels; only the per-level application is restricted.
@mcgibbon

Copy link
Copy Markdown
Contributor Author

Validating this change on the 4°/daily v2 ERA5-only baseline with the energy corrector and exclude_top_levels: 1 (excludes the model top level, level 0):

Tests whether excluding the top level removes the positive air_temperature_0 bias the all-levels corrector introduced, without reintroducing energy-budget drift.

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