Create E3SM coupling files within COMPASS#417
Create E3SM coupling files within COMPASS#417mark-petersen merged 3 commits intoMPAS-Dev:ocean/developfrom
Conversation
|
This works on grizzly as follows (more details on this confluence page) First you have to make your initial condition. I assume you already have MPAS-O compiled with gnu: That is all standard. Now make the coupling files. This requires the e3sm-unified package. The output is as follows:
Each step is conducted in its own directory, with |
|
One of the beautiful parts of this system is it creates a directory structure that is identical to the E3SM inputdata directory tree assembled_files_for_upload
This is populated with links only, and all file names are correct and ready for the inputdata repo. To grab them all, you can and copy it over to another machine. Here |
There was a problem hiding this comment.
I'm really concerned that these hard coded paths defeat the purpose of having COMPASS try to be a self-contained, freely available framework with as few preparatory steps as possible. These things can only be done on LANL IC by someone in the climate group.
I'll let this go through as a temporary solution as long as it's accompanied by an issue tracking the need to generalize this ASAP.
There was a problem hiding this comment.
I completely agree. It is on my to do list to move everything out to geometric features, e3sm_unified, or the E3SM inputdata repo. But at least we have a list of what is left outside the repos right now.
There was a problem hiding this comment.
@xylar could we add gen_domain to e3sm_unified? I'm not sure if that means add it to MPAS-Tools, or somewhere else. It is this code:
https://github.com/E3SM-Project/E3SM/tree/master/cime/tools/mapping/gen_domain_files
|
I'll try to give this a more thorough review when I have time. Just mentioning the concern that comes to mind at a quick glance. |
There was a problem hiding this comment.
Another to-do: To be general, COMPASS needs to read its own resolution name. There may be a resolution variable available within COMPASS (I have not seen it). Otherwise, create_E3SM_coupling_files.py could try to parse its path to automatically collect the resolution string QU240.
There was a problem hiding this comment.
There may be a resolution variable available within COMPASS (I have not seen it).
An argument gets added to the config file here:
https://github.com/MPAS-Dev/MPAS-Model/blob/master/testing_and_setup/compass/setup_testcase.py#L1640
config.set('script_input_arguments', 'resolution', args.resolution)
However, we are still using the python 2 version of the config parser:
https://github.com/MPAS-Dev/MPAS-Model/blob/master/testing_and_setup/compass/setup_testcase.py#L25
available in python 3 via the six package.
from six.moves import configparser
That config parser doesn't let you refer to config options in sections other than the one you're in. If we switch to the python 3 config parser exclusively (dropping python 2 support), we could use "extended interpolation":
https://docs.python.org/3/library/configparser.html#configparser.ExtendedInterpolation
do something like:
[main]
mesh_name = o${script_input_arguments:resolution}
There was a problem hiding this comment.
I think this would be a pretty trivial change as long as we're willing to drop python 2 support in COMPASS.
There was a problem hiding this comment.
I take this back. This is a separate config file, parsed by a separate script so there isn't a way to get resolution from the config object in setup_testcase.py. It is probably necessary to parse it out of the path.
|
@kristin-hoch and @darincomeau let's use this PR to create the coupling files for the Southern Ocean mesh. I would like to add the special steps required for ice shelves and data ice bergs. |
xylar
left a comment
There was a problem hiding this comment.
Some comments to get you started. The biggest is that ESMF should ideally be run on many MPI tasks but I don't know if this is possible because IC doesn't support the mpich implementation that comes from conda-forge and is linked into conda-forge ESMF (and many other packages).
testing_and_setup/compass/ocean/global_ocean/config_files/config_e3sm_coupling.xml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
I take this back. This is a separate config file, parsed by a separate script so there isn't a way to get resolution from the config object in setup_testcase.py. It is probably necessary to parse it out of the path.
testing_and_setup/compass/ocean/global_ocean/scripts/create_E3SM_coupling_files.py
Outdated
Show resolved
Hide resolved
testing_and_setup/compass/ocean/global_ocean/scripts/create_E3SM_coupling_files.py
Outdated
Show resolved
Hide resolved
testing_and_setup/compass/ocean/global_ocean/scripts/create_E3SM_coupling_files.py
Outdated
Show resolved
Hide resolved
testing_and_setup/compass/ocean/global_ocean/scripts/create_E3SM_coupling_files.py
Outdated
Show resolved
Hide resolved
testing_and_setup/compass/ocean/global_ocean/scripts/create_E3SM_coupling_files.py
Outdated
Show resolved
Hide resolved
609fae5 to
0bb19ed
Compare
xylar
left a comment
There was a problem hiding this comment.
With the changes you've made, this looks good to me. Let me know if you'd like me to run some specific tests.
f9f1a21 to
27a6085
Compare
|
Note: just spoke with @darincomeau. I should add a flag under main for CORE vs JRA forcing, which modifies the mapping files. Also, when using |
This is a combination of 17 commits. Added e3sm_coupling. Works on grizzly. Remove some flags from config file small changes Alterations from Xylar PR review Add arg parser. Did not work Autodetect mesh_name from path. Works. Change function_list to functions add readme Add ice_shelf_cavities flag for scrip and mapping files Add runoff mapping Add salinity restoring. Works. PEP8 compliance Add nomaskStr for land ice Add date_string config. May also autodetect Added flag for ice_shelf_cavities Add folds Remove changes to template_forward.xml
27a6085 to
ba401b4
Compare
|
@darincomeau, I added directories for JRA mapping files, and the ability to run @matthewhoffman's alteration of the runoff mapping to not go below ice shelves. I'm merging this so it doesn't get too old, but I'd like to go over that and make adjustments in a few weeks. |
Adds a script that produces coupling files for E3SM. This PR adds it to the QU240 as a test, but it is set up in a general way, so that any global case can add it to the init process. The goals for this system are: - speed: An automated method - simplicity: so others can use and alter it - process documentation: ability to record a standard sequence of steps - expandability: so special cases, like ice shelves and data icebergs, are easy to handle. I think this method of a single python script within COMPASS satisfies these. To add this to any case, add a link ``` cd testing_and_setup/compass/ocean/global_ocean/RESOLUTION/init ln -isf ../../config_files/config_e3sm_coupling.xml . ``` Then set up an init case for that resolution, and there is a new directory e3sm_coupling with a run.py script. Documentation of all the steps for coupling files are at - [Confluence: Simplify E3SM Ocean File Generation](https://acme-climate.atlassian.net/wiki/spaces/OCNICE/pages/763854989/Simplify+E3SM+Ocean+File+Generation) - [Confluence: Making mapping, runoff, domain files and adding grids to ACME](https://acme-climate.atlassian.net/wiki/spaces/OCNICE/pages/22052884/Making+mapping+runoff+domain+files+and+adding+grids+to+ACME)
Adds a script that produces coupling files for E3SM. This PR adds it to the QU240 as a test, but it is set up in a general way, so that any global case can add it to the init process. The goals for this system are: - speed: An automated method - simplicity: so others can use and alter it - process documentation: ability to record a standard sequence of steps - expandability: so special cases, like ice shelves and data icebergs, are easy to handle. I think this method of a single python script within COMPASS satisfies these. To add this to any case, add a link ``` cd testing_and_setup/compass/ocean/global_ocean/RESOLUTION/init ln -isf ../../config_files/config_e3sm_coupling.xml . ``` Then set up an init case for that resolution, and there is a new directory e3sm_coupling with a run.py script. Documentation of all the steps for coupling files are at - [Confluence: Simplify E3SM Ocean File Generation](https://acme-climate.atlassian.net/wiki/spaces/OCNICE/pages/763854989/Simplify+E3SM+Ocean+File+Generation) - [Confluence: Making mapping, runoff, domain files and adding grids to ACME](https://acme-climate.atlassian.net/wiki/spaces/OCNICE/pages/22052884/Making+mapping+runoff+domain+files+and+adding+grids+to+ACME)
Adds a script that produces coupling files for E3SM. This PR adds it to the QU240 as a test, but it is set up in a general way, so that any global case can add it to the init process.
The goals for this system are:
I think this method of a single python script within COMPASS satisfies these.
To add this to any case, add a link
Then set up an init case for that resolution, and there is a new directory e3sm_coupling with a run.py script.
Documentation of all the steps for coupling files are at