Skip to content
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

Add data interpolation to Antarctica mesh generation case #408

Closed
wants to merge 12 commits into from

Conversation

trhille
Copy link
Collaborator

@trhille trhille commented Jun 3, 2022

Interpolate data from gridded datasets to Antarctic mesh within COMPASS. This takes care of the peculiarities of the current gridded compilation dataset (antarctica_8km_2020_10_20.nc), as well as using conservative remapping directly from the high-resolution BedMachineAntarctica and MeASUReS velocity datasets. There is a fairly heavy degree of pre-processing done to get the BedMachine and MeASUReS datasets ready to be used here. The pre-processing includes renaming variables, setting reasonable _FillValue and missing_value attributes, extrapolating fields to avoid interpolation ramps at ice margins, updating mask values, and raising the bed topography at Lake Vostok to ensure a flat ice surface. Those data files and processing scripts currently live here on Badger: /usr/projects/climate/trhille/data. Eventually that pre-processing could be integrated into a new step in COMPASS, or the processed data files could be added to the server on Anvil and downloaded as needed.

The conservative remapping step using ESMF_RegridWeightGen requires multiple nodes in order to not run out of memory. This is a major short-coming of the current set up for this test-case, which runs the entire case on five Badger nodes, even though four of those nodes are only used for a small fraction of the total run time. This should probably be updated to be a separate step in the future in order to save on cost.

This currently requires use of a branch of MPAS-Tools to interpolate the iceMask variable: https://github.com/trhille/MPAS-Tools/tree/add_iceMask_to_interp_script. The steps to use this are:
1. Create your compass environment as normal and source the load script
2. Go to your MPAS-Tools directory and checkout https://github.com/trhille/MPAS-Tools/tree/add_iceMask_to_interp_script
3. Still from MPAS-Tools directory python -m pip install -e conda_package
4. Proceed setting up test case as normal

This can take a long time to run because the conservative remapping is slow. I recommend at least a 4 hour job on 5 nodes for medium resolution (~6–30km).

trhille added 9 commits May 27, 2022 14:46
Add renaming, scaling, and extrapolation of variables from the gridded
dataset within mesh.py.
Use convention that negative mass balance is melting.
Instead of using bilinear interpolation from the not-so-good composite
gridded dataset for all fields, use conservative remapping for bed,
thickness, and velocity fields directly from those datasets. This
requires multiple nodes (more than 2 badger nodes; 10 works well)
because ESMF_RegridWeightGen on those datasets runs out of memory.
Previous commit inadvertently removed interpolation of fields
from gridded dataset, such as sfcMassBal, floatingBasalMassBal,
and basalHeatFlux. Also set observedSurfaceVelocityUncertainty to
1.0 wherever thickness < 1.0
Use numCells instead of distance when culling from ice margin.
Use extrapolated thickness and velocity fields from BedMachine and
Measures, and then trim back based on iceMask field. Also treat
difference between cull_cell and cull_distance in .cfg file.
Set data path in .cfg file instead of hard-coding in mesh.py
Read scrip files for gridded datasets from data directory instead of
creating every time because that takes a while. That code is left
commented out in case it is needed again.
Set default number of processors to 180 instead of 360. Multiple nodes
are only used for the ESMF_RegridWeightGen step, which does not take long
as long as it does not run out of memory. 2 nodes on Badger is too few,
but I have not tested anything less than 5.
@trhille trhille added land ice in progress This PR is not ready for review or merging labels Jun 3, 2022
@pep8speaks
Copy link

pep8speaks commented Jun 3, 2022

Hello @trhille! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 163:5: E722 do not use bare 'except'
Line 248:80: E501 line too long (80 > 79 characters)
Line 249:80: E501 line too long (84 > 79 characters)
Line 250:80: E501 line too long (85 > 79 characters)

Line 97:8: E114 indentation is not a multiple of four (comment)
Line 98:8: E114 indentation is not a multiple of four (comment)
Line 100:17: E128 continuation line under-indented for visual indent
Line 112:80: E501 line too long (81 > 79 characters)
Line 115:30: E261 at least two spaces before inline comment
Line 115:31: E262 inline comment should start with '# '
Line 116:80: E501 line too long (88 > 79 characters)
Line 118:38: E231 missing whitespace after ','
Line 146:55: E231 missing whitespace after ','
Line 166:45: W291 trailing whitespace
Line 185:8: E114 indentation is not a multiple of four (comment)
Line 225:9: E265 block comment should start with '# '
Line 226:9: E265 block comment should start with '# '
Line 227:80: E501 line too long (108 > 79 characters)
Line 228:80: E501 line too long (80 > 79 characters)
Line 230:9: E265 block comment should start with '# '
Line 232:9: E265 block comment should start with '# '
Line 233:9: E265 block comment should start with '# '
Line 234:80: E501 line too long (83 > 79 characters)
Line 237:9: E265 block comment should start with '# '
Line 281:18: E127 continuation line over-indented for visual indent
Line 288:80: E501 line too long (101 > 79 characters)
Line 320:1: W293 blank line contains whitespace
Line 328:63: E231 missing whitespace after ','
Line 328:70: E231 missing whitespace after ','
Line 368:80: E501 line too long (80 > 79 characters)

Comment last updated at 2022-08-05 15:51:39 UTC

trhille added 3 commits August 3, 2022 17:25
By default, calculate window_size for calculating distance to
grounding line and ice edge from the config options high_dist
. There is also an option to manually set window_size if desired,
but it must not be smaller than high_dist. If it is,
a warning is printed to the log file and window_size is calculated instead
of using the manually set value.
@matthewhoffman
Copy link
Member

Replaced by #750

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress This PR is not ready for review or merging land ice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants