Add new observation formulas - #34
Merged
Merged
Conversation
added 6 commits
July 22, 2026 19:43
…1 and scale_offset=0
…y with new obs formulas
…ervation derivation formula
mvertens
marked this pull request as draft
July 24, 2026 09:45
mvertens
marked this pull request as ready for review
July 24, 2026 16:34
mvertens
marked this pull request as draft
July 24, 2026 16:37
mvertens
marked this pull request as ready for review
July 24, 2026 16:37
TomasTorsvik
approved these changes
Jul 28, 2026
TomasTorsvik
left a comment
There was a problem hiding this comment.
@mvertens - thanks for the OBS fix, looks fine to me. Is this update also shared with the NCAR version of ADF?
Author
|
@TomasTorsvik - thanks for reviewing this. We are up to date with the latest version of the NCAR repository. However, I have added a lot of new features that we want and that have not been shared with NCAR. At this point I have another PR that is currently in draft form that I will test once this PR is in. Then I'd for us to have the changes that @adagj will be bringing in that she is using. And at that point I'd like to do a PR back to NCAR. |
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.
Summary:
When ADF compares the model against observations, it needs the obs data for each variable — but that data isn't always sitting in the obs file ready to use. Sometimes the file has the ingredients but not the final field (it stores the two kinds of rain,
PRECCandPRECL, but not total rainPRECT). Sometimes the variable is stored under a different name, or in different units than the model uses. Until now, ADF could only rename a variable and multiply it by a fixednumber, which wasn't enough to cover these cases.
This PR lets you write a short formula that tells ADF how to construct the observational variable from whatever the file actually contains. For example:
PRECT = PRECC + PRECL— add the pieces togetherALBEDO = (solar_mon − fsnt) / solar_mon— a genuine calculationTGCLDLWP = TGCLDWP × 1000— rename and convert units at onceWhat you put in a variable's settings
Two new settings do the work, and one existing setting now has a clearer, narrower role:
obs_var_nameAODVISisAOD_550in the file). Skip it when the name already matches, and skip it for derived variables — there's no single stored field to point at.obs_derivable_from(new)obs_derivation_formula(new)obs_derivable_from— the two go togetherSo it's an either/or: a variable that's stored directly may just need
obs_var_name(if the name differs); a variable that's computed usesobs_derivable_from+obs_derivation_formulaand leavesobs_var_nameoutentirely. A quick example of the derived case: