Repository navigation
Online Lapse Rate Mean Calculation and refactor - #83
jjguerrette wants to merge 8 commits into
Conversation
LapseRateHelper is reused in both the LapseRate and CloudLiquidWater (for GMI) predictors. The public fillTlapchnAndMeans API supplies both mean lapse rates (either from file or calculated online) and the per-channel/-location lapse rates of the ObsSpace. Both the offline and online mean paths store an &ObsSpace-keyed map value only once per simulation, which retrieved by other callers in with same &ObsSpace context. This provides bit-for-bit equivalence with today's code as long as users always provide the same mean lapse rate file to all applicable predictors per ObsSpace.
|
@BenjaminRuston @ADCollard Other than for formatting cleanups and missing value checks, there have been few substantive changes to the code in several years. Any ideas on who could review? |
|
@rajichidamb would you be willing to review? |
|
@jjguerrette This looks like it will be very useful. There are a lot of changes here, so it may take me a while, but I can review. |
There was a problem hiding this comment.
Good catch. I failed to update the missing check. It needs to target the new helper output (tlapchn_v, tlapchn_h) instead of tsavg5, ptau5, and tvp. Same for the other comments.
There was a problem hiding this comment.
nlevs does not appear to be declared
There was a problem hiding this comment.
tvp does not appear to be declared.
|
@ADCollard I confess to having built this in an older version (UFO 1.12.0), then attempting to port it forward to develop. Clearly I have made some errors, and need to attempt to build/debug this in develop. I'm not sure if I can do it easily, because we are still migrating from spack 1.9.x to 2.x. |
|
Thanks @jjguerrette. I will also create a corresponding PR in |
|
Thank you @rajichidamb! I would like to fix the issues Andrew brought up, and get this branch up to date with develop. Are changes I push to |
Replace old local references to tsavg5, tvp, and ptau5 with tlapchn_v, tlapchn_h, and tlap (mean).
| geovals.getAtLevel(pred, oops::Variable{"air_temperature"}, js); | ||
| tvp.push_back(pred); | ||
| } | ||
| nlevs = geovals.nlevs(oops::Variable{"air_pressure"}); |
There was a problem hiding this comment.
Another thing that changed from UFO 1.12 to develop is how nlevs is determined. 1.12 uses air_pressure (see this line) and develop removes that line entirely (3 weeks ago in this commit), which defaults back to using the air_temperature nlevs.
I did not write the science on this metric, and defer to other developers. If air_temperature is the correct source, then air_pressure can be removed from the required vars. @ADCollard @rajichidamb
Description
We often have users ask for mean lapse rate files during their experiment periods. This is also a challenge for researchers setting up new regional domains where our sensors have not been assimilated before.
This PR adds an online mean option for mean temperature lapse rates used by bias-correction predictors, and consolidates the shared lapse-rate logic into a new
LapseRateHelperused by bothlapseRateand GMIcloudWaterContent.Motivation / problem
Today,
lapseRate(and GMIcloudWaterContent) require a precomputedtlapsetext file of per-channel mean lapse rates. Those files can be generated for instruments that are assimilated operationally in GDAS fromabiasfiles acquired from NOMADS, NCEI, etc., but are often unavailable for a user’s time window for sensors that have not been assimilated before. This forces offline generation of mean files, and adds complexity to workflows, before VarBC can be configured.What this PR does
LapseRateMeanParameters(flat under predictor options):tlapse: <path>oronline mean: true(exactly one required).tlapsehas the same behavior as before via a new pathway.save means: <path>to write computed/file means on the first fillLapseRateHelperwith a single public API,fillTlapchnAndMeans, that:tlapchn) for theObsSpacechannelsObsSpacemean&ObsSpace-keyed map so all predictors sharing an ObsSpace reuse the same frozen means (first fill only), preserving consistency between NL/TL and across predictors. The frozen means are typical of the behavior that is used for file-sourced values in most workflows.LapseRateand GMICloudLiquidWaterto use the helper; helper-only required GeoVaLs / hdiags are registered by the helper rather than duplicated by callerstlapsepath and the newonline meanpathIssue(s) addressed
N/A
Dependencies
List the other PRs that this PR is dependent on:
Impact
Expected impact on downstream repositories:
tlapseonline mean: true(and optionallysave means) instead of providing atlapsefilecloudWaterContentnow shares the same mean-lapse configuration contract aslapseRateChecklist
Unit tests exercised by this change
YAML / ctests covering the shared helper and online-mean path:
test_ufo_amsua_crtm_bc_obsoperatortest/testinput/unit_tests/predictors/amsua_crtm_bc.yaml(filetlapse+ second obs withonline mean: true)test_ufo_amsua_crtm_bc_tladamsua_crtm_bc.yamltest_ufo_gmi_qc_filterstest/testinput/unit_tests/filters/gmi_qc_filters.yaml(filetlapse+ second obs withonline mean: trueon lapseRate / cloudWaterContent;passedBenchmark: 624for both)