You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Earth Radius in COMPASS and MPAS-Ocean init mode #549
@mark-petersen summarized as follows (with some formatting changes from me):
Here are the steps in the mesh generation
Base mesh (jigsaw): x,y,z coordinates have r=6371000 from triangle_jigsaw_to_netcdf. This value does not matter in the end.
MpasMeshConverter.x computes all mesh variables, including dcEdge and dvEdge
Cell culler – x,y,z remain the same
MPAS-Ocean init mode: Expands x,y,z to have r=6371229, expands dcEdge and dvEdge proportionally.
More details below. The gist is that step 1 could use a unit sphere. It doesn’t matter, because step 4 expands everything to the MPAS radius anyway.
1. triangle_jigsaw_to_netcdf.py
triangle_jigsaw_to_netcdf.py has a hardwired value of 6371000m that determines the (x,y,z) coordinates of the cell centers. Those coordinates are written out by jigsaw, along with the cellsOnCells array, i.e. neighbor relations.
More details below. The gist is that step 1 could use a unit sphere. It doesn’t matter, because step 4 expands everything to the MPAS radius anyway.
This was discussed further and it does not seem to be true for at least 2 reasons:
As both @dengwirda and @xylar pointed out, JIGSAW uses real lengths to determine the target resolution of the mesh it produces (so resolution would have to be normalized if we wanted to use a unit sphere)
There is an interest in using these meshes in situations where MPAS-Ocean init mode is not used (e.g. future land and river components).
This is important for mixed model workflows (i.e. ICoM) in which the MPAS mesh files created by MPAS_mesh_converter.cpp are handed off to various other components (ELM, MOSART, HexWatershed, etc) as well as to MPAS-O.
If MPAS-O re-normalises its mesh data using its own radius value there could be a mismatch in the key mesh variables (dvEdge, dcEdge, etc) used within each dycore.
Rather than requiring mesh re-normalisation on a per model basis, it'd be nice to have consistency throughout.
Thanks @xylar for opening up this issue. Just to add to the comment on using CIME constants, it would be ideal if we were grabbing all of our physical constants, wherever possible, from this location. Like you, I'm not sure of the logistics. I'll give it some thought.
FYI, we're dealing with the basically the same problem in CESM/CIME/MOM.
In MOM, the radius of the Earth is read from a text-based parameter file, while in CIME it is in Fortran source code. We would like to use the CIME value in MOM when running with CIME.
To achieve this, we're leaning towards adding a set parameter method to MOM's parameter infrastructure, and the CIME cap for MOM would call that, passing in values from CIME's shr_const_mod.F90. This applies to other constants besides Earth's radius. A feature of this approach that we like is not introducing multiple copies of the same values that have the potential to get out of sync.
This approach may or may not work for CIME/MPAS-O.
@klindsay28, thanks, that's some really helpful insight! I was thinking along the same lines that it would be ideal if CIME could inform MPAS-Ocean of parameters. (This would not apply to the Earth radius, which is needed at initialization but to a lot of other constants.)
@mgduda, that approach sounds interesting but I've realized that it likely is more complex than we need for MPAS-Ocean, at least for the Earth radius. In MPAS-Ocean, we don't use the earth radius as far as I am aware in forward mode, just in init mode. And that value could come from almost anywhere (certainly no need for it to come from mpas_constants, at least). So we would probably just need to come up with a way to read the value we need from CIME (which is the step I still can't see clearly) and propagate it to both JIGSAW (e.g. with a config option or command-line flag) and MPAS-Ocean init mode (e.g. via a namelist option). But that idea would certainly apply for other physical constants that are used in forward mode.
@xylar just a quick note that some of the GM alterations I'm working on use sphere_radius (I need planetary beta), but we could also move that out of GM_init and into the init_mode since that calculation wouldn't change during the run.
Removing the COMPASS label because the COMPASS portion of this work has been addressed. @mark-petersen, I noticed recently when I was working on creating COMPASS test cases in python that other constants such as the acceleration of gravity, the reference density of seawater and various heat capacities should come from CIME as well to make sure we can use consistent values between E3SM components, in MPAS-Tools, in COMPASS and elsewhere.
Activity
xylar commentedon May 7, 2020
@mark-petersen summarized as follows (with some formatting changes from me):
xylar commentedon May 7, 2020
@proteanplanet suggests that the sphere radius for both (all) cases should be taken from CIME to be consistent with EAM and ELM:
https://github.com/E3SM-Project/E3SM/blob/master/cime/src/share/util/shr_const_mod.F90#L20
This value is: SHR_CONST_REARTH = 6.37122e6
xylar commentedon May 7, 2020
@mark-petersen wrote:
This was discussed further and it does not seem to be true for at least 2 reasons:
[-]Earth Radius in COMPASS[/-][+]Earth Radius in COMPASS and MPAS-Ocean init mode[/+]xylar commentedon May 7, 2020
cc @dengwirda, @proteanplanet, @sbrus89, @pwolfram, @mark-petersen, @jonbob
xylar commentedon May 7, 2020
I like @proteanplanet idea of using CIME constants for our Earth radius. We will just need to figure out the logistics of doing that:
afrom the MPAS framework?dengwirda commentedon May 7, 2020
Quick additional background ---
This is important for mixed model workflows (i.e.
ICoM) in which theMPASmesh files created byMPAS_mesh_converter.cppare handed off to various other components (ELM,MOSART,HexWatershed, etc) as well as toMPAS-O.If
MPAS-Ore-normalises its mesh data using its own radius value there could be a mismatch in the key mesh variables (dvEdge,dcEdge, etc) used within each dycore.Rather than requiring mesh re-normalisation on a per model basis, it'd be nice to have consistency throughout.
xylar commentedon May 7, 2020
Makes sense. Eliminating, rather than replacing, @mark-petersen's step 4.
proteanplanet commentedon May 7, 2020
Thanks @xylar for opening up this issue. Just to add to the comment on using CIME constants, it would be ideal if we were grabbing all of our physical constants, wherever possible, from this location. Like you, I'm not sure of the logistics. I'll give it some thought.
klindsay28 commentedon May 7, 2020
FYI, we're dealing with the basically the same problem in CESM/CIME/MOM.
In MOM, the radius of the Earth is read from a text-based parameter file, while in CIME it is in Fortran source code. We would like to use the CIME value in MOM when running with CIME.
To achieve this, we're leaning towards adding a set parameter method to MOM's parameter infrastructure, and the CIME cap for MOM would call that, passing in values from CIME's shr_const_mod.F90. This applies to other constants besides Earth's radius. A feature of this approach that we like is not introducing multiple copies of the same values that have the potential to get out of sync.
This approach may or may not work for CIME/MPAS-O.
xylar commentedon May 7, 2020
@klindsay28, thanks, that's some really helpful insight! I was thinking along the same lines that it would be ideal if CIME could inform MPAS-Ocean of parameters. (This would not apply to the Earth radius, which is needed at initialization but to a lot of other constants.)
1 remaining item
xylar commentedon May 11, 2020
@mgduda, that approach sounds interesting but I've realized that it likely is more complex than we need for MPAS-Ocean, at least for the Earth radius. In MPAS-Ocean, we don't use the earth radius as far as I am aware in forward mode, just in init mode. And that value could come from almost anywhere (certainly no need for it to come from
mpas_constants, at least). So we would probably just need to come up with a way to read the value we need from CIME (which is the step I still can't see clearly) and propagate it to both JIGSAW (e.g. with a config option or command-line flag) and MPAS-Ocean init mode (e.g. via a namelist option). But that idea would certainly apply for other physical constants that are used in forward mode.Please keep us posted on what you come up with.
vanroekel commentedon May 11, 2020
@xylar just a quick note that some of the GM alterations I'm working on use sphere_radius (I need planetary beta), but we could also move that out of GM_init and into the init_mode since that calculation wouldn't change during the run.
xylar commentedon May 31, 2020
As a starting point, I added CIME's Earth radius to MPAS-Tools: MPAS-Dev/MPAS-Tools#315
xylar commentedon May 31, 2020
In draft PRs I'm still working, I'm then using this new constant for mesh creation in ocean COMPASS test cases. Here are a few examples of where it is used:
https://github.com/MPAS-Dev/MPAS-Tools/pull/314/files#diff-a3d53cac6a453686ae6667f0ee3371f8R61
https://github.com/MPAS-Dev/MPAS-Model/pull/577/files#diff-65f1c5f8084ddcbdc3c12bcf37fccfd7R37
https://github.com/MPAS-Dev/MPAS-Model/pull/577/files#diff-3eeef30f38ba381823b04d95bd4f4677R37
Merge PR MPAS-Dev#680 'xylar/ocean/consistent_compass_earth_radius' i…
xylar commentedon Sep 4, 2020
I believe this has been fully addressed via MPAS-Dev/MPAS-Tools#341 and #680
xylar commentedon Sep 4, 2020
I take that back. It has yet to be addressed in MPAS-Ocean init or forward mode. @mark-petersen, is that something you can look into?
mark-petersen commentedon Sep 4, 2020
Yes, I'll look at it.
xylar commentedon Nov 6, 2020
Removing the COMPASS label because the COMPASS portion of this work has been addressed. @mark-petersen, I noticed recently when I was working on creating COMPASS test cases in python that other constants such as the acceleration of gravity, the reference density of seawater and various heat capacities should come from CIME as well to make sure we can use consistent values between E3SM components, in MPAS-Tools, in COMPASS and elsewhere.