-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extrapolate landice variable #576
Extrapolate landice variable #576
Conversation
Not dependent on exo to mpas conversion script
Depending on which field you want to extrapolate, use grounded or floating mask to define the values that are kept.
Also do not allow any zero-valued cells in keepMask
Add option to set all cells outside keepCellMask to a specific value
Ensure that very large or infinite values are removed during extrapolation.
The entire masking and extrapolation logic has been moved into a loop over vertical levels. It seemed conceivable that the masking criteria could differ between different levels of the same variable, which is why the masking operation is also moved inside the vertical level loop.
@trhille, CI is breaking for reasons unrelated to your script. Someone accidentally released Anyway, I'll fix it if it becomes critical before they actually release the new version. |
Thanks, @xylar. This script has been lying around on a branch for years, and we decided that it has ended up with enough use cases that we'll merge it, but it's not at all time-sensitive. |
If thickness and bedTopography are not in file, define keepMask where floatingBasalMassBal != 0.
b1c260a
to
6ad55be
Compare
Remove lines that were intended to set the extrapolation method based on the variable being extrapolated, which contained typos. These were removed instead of just fixing the typos because it doesn't make sense to override the method option passed from the command line.
I'm going to close and re-open to cause CI to restart. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trhille , thanks for formalizing this script. I have a few comments - feel free to take or leave. The script works as-is and I don't want to drag this out.
# ensure zero muFriction does not get extrapolated | ||
keepCellMask *= (varValue > 0) | ||
# Get rid of invalid values | ||
keepCellMask *= (varValue < 1.e12) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think 1e12 seems big enough to avoid clipping any of the relevant fields any under situation. The worst case I can think of is mu for a very plastic bed, but even then I think this feels safe. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's safe, but will add it as a constant at the top of the script as with the densities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 8f7ef92
Co-authored-by: Matt Hoffman <wyeast@gmail.com>
Co-authored-by: Matt Hoffman <wyeast@gmail.com>
Move constants to top of script, change some formatting for PEP8 compliance, and raise an exception if thicknes and/or bedTopography are missing when extrapolating certain fields.
Add a script to extrapolate landice variables into regions of missing or invalid data using nearest-neighbor or inverse-distance weighted methods.