[WIP] Updated land calibration pipeline #1210
Draft
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.
This PR rewrites the land calibration pipeline to use the latest snowy land model, the new
ObservationRecipe
inClimaCalibrate
, and ClimaAnalysis for data preprocessing and transformations. With these additions, the pipeline should beHowever, the updated land calibration pipeline is brittle in multiple aspects and these issues affect the other calibration pipelines. In this issue, the issues specific to the land calibration pipeline is listed.
ClimaLand.jl/experiments/calibration/forward_model_land.jl
Lines 52 to 75 in ccc3115
Configuring the calibration is not straightforward. To configure the calibration, all the settings are centralized to a single file, but making the user modify what those functions return does not seem ideal. Furthermore, it is not clear whether using functions is the best way to pass those information to the worker processes.
Adding a variable is difficult and not obvious. To add a new variable, you need to modify three different files, specify what the simulation and observational data are, how they should be preprocessed (e.g. units conversion, shifting dates), and add additional data transformation (e.g. seasonal averages). This process is error prone and the transformations can easily get out of sync.
Getting the landsea mask. To get a landsea mask, you need to go through ClimaCore and ClimaAnalysis. This is not intuitive and can easily lead to errors if the diagnostics change.
Mask-aware replace and flatten. In the calibration code, there is a hack to replace all the
NaN
values on land with the average non-nan value on land. Furthermore,flatten
removes allNaN
regardless of where it is. This means that anyNaN
on land and completely stop a calibration.Update to packages