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 script for adding map of sufficiently deep ocean bathymetry to a scrip file #578

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

matthewhoffman
Copy link
Member

This PR adds a script for adding a mask to a scrip file needed for ocn-glc fjord coupling. This script defines a mask of ocean cells that are deeper than a threshold. This is to be used for updating a scrip file so that it only remaps from ocean cells deeper than that threshold. The resulting mapping file can be used as an OCN2GLC_TF_SMAPNAME mapping file in E3SM. Note that config_2d_thermal_forcing_depth in the MPAS-Ocean namelist needs to match the depth used here.

This PR is needed for generating a mapping file to support E3SM PR:
E3SM-Ocean-Discussion/E3SM#94

@matthewhoffman matthewhoffman changed the title Add script for adding map of sufficiently deep ocean bahtymetry to a scrip file Add script for adding map of sufficiently deep ocean bathymetry to a scrip file Aug 20, 2024
This script defines a mask of ocean cells that are deeper than a
threshold. This is to be used for updating a scrip file so that it only
remaps from ocean cells deeper than that threshold. The resulting
mapping file can be used as an OCN2GLC_TF_SMAPNAME mapping file in E3SM.
Note that config_2d_thermal_forcing_depth in the MPAS-Ocean namelist
needs to match the depth used here!
@matthewhoffman matthewhoffman force-pushed the ocean/add_scrip_depth_mask_script branch from 77cfaee to 0e8677c Compare August 20, 2024 15:48
This is a more logical place to keep it
@matthewhoffman
Copy link
Member Author

@xylar , this is the script needed to create a masked mapping file for E3SM-Ocean-Discussion/E3SM#94. I'm completely open to renaming the file and/or moving its location.

Here are the steps for using this script in a workflow to generate a mapping file:

# create standard MPAS-Ocean scrip file
create_SCRIP_file_from_MPAS_mesh.py -m /lcrc/group/acme/public_html/inputdata/ocn/mpas-o/IcoswISC30E3r5/mpaso.IcoswISC30E3r5.20231120.nc -s ocean.IcoswISC30E3r5.mask.scrip.20231120.deeperThan300m.nc

# add mask for desired depth using the new script
~/mpas/MPAS-Tools2/mesh_tools/create_SCRIP_files/create_scrip_mask_for_sufficiently_deep_ocean_mapping.py -s ocean.IcoswISC30E3r5.mask.scrip.20231120.deeperThan300m.nc -m /lcrc/group/acme/public_html/inputdata/ocn/mpas-o/IcoswISC30E3r5/mpaso.IcoswISC30E3r5.20231120.nc -d 300

# create MALI scrip file
create_SCRIP_file_from_MPAS_mesh.py -m /lcrc/group/e3sm/public_html/inputdata/glc/mpasli/mpas.gis1to10kmR2/gis_1to10km_r02.20240513.nc -s gis_1to10km_r02.20240513.SCRIP.nc

# Create mapping file
ESMF_RegridWeightGen -r -s ocean.IcoswISC30E3r5.mask.scrip.20231120.deeperThan300m.nc -d gis_1to10km_r02.20240513.SCRIP.nc -m neareststod -w map_IcoswISC30E3r5_to_gis_1to10km_r02_esmfneareststod.deeperThan300m.20240820.nc

# The resulting mapping file should then be specified for OCN2GLC_TF_SMAPNAME mapping for that OCN/GLC grid combination

I have a directory on Chrysalis where the above steps have been run:
/lcrc/group/e3sm/ac.mhoffman/scratch/mapping_files_for_ocn2glc_TF_mapping

Note that I created the ocean scrip file without the landice mask. The new bathymetry masking script will clobber the grid_imask set by the landice mask in create_SCRIP_file_from_MPAS_mesh.py, so it really does not matter if create_SCRIP_file_from_MPAS_mesh is called with --landice or not. And that is the behavior we want, because the ocn/glc thermal forcing coupling should still use ocean grid cells inside ice-shelf cavities. Note that facemelting is not applied on MALI underneath an ice shelf, but if the ice shelf were to disappear during a run, you would still want the mapping to exist. This is sort of a minor detail that should generally not be applicable to Greenland conditions, but it will come into play for the few small ice shelves that exist there. When we eventually move to passing a profile of TF built from multiple depths and using extrapolation on the MALI mesh, this script and these caveats will no longer apply.

Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the slow response.

@matthewhoffman, this looks great to me as it is!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants