Add exclude_top_levels option to energy budget corrector#1320
Open
mcgibbon wants to merge 1 commit into
Open
Conversation
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.
Contributor
Author
|
Validating this change on the 4°/daily v2 ERA5-only baseline with the energy corrector and
Tests whether excluding the top level removes the positive |
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.
The
constant_temperaturetotal-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: addexclude_top_levels: int = 0field (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: acceptexclude_top_levelsand skip the topmost Nair_temperaturelevels (level 0 is the model top) when applying the increment; raise if it exceeds the number of levels. Threaded throughAtmosphereCorrector.__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