Closed kuanchihwang closed 5 months ago
I believe the namelist_definition_mpas_dycore.xml
file was (mostly?) automatically generated from the stand-alone MPAS-A Registry.xml
file with a Python script.
@gdicker1 @kuanchihwang Would it be worth committing the script used to generate namelist_definition_mpas_dycore.xml
somewhere in CAM-SIMA so that it's under version control? I think having this script around might make it easier to update CAM-SIMA namelist options as the MPAS-A dycore changes in future.
It's ugly and quick, so I wonder if the script is "ready" for CAM-SIMA. Give me a few to get it into somewhere on GitHub so I can link it for others to judge.
Some of the additions in this PR are generic (in that they are not MPAS-A dycore-specific); for example, the new routines in src/utils/time_manager.F90
.
@nusbaume I'm not sure if there's anything covering this in the CAM development workflow or coding standards pages, but is it preferable to make separate PRs in cases like this?
It's ugly and quick, so I wonder if the script is "ready" for CAM-SIMA. Give me a few to get it into somewhere on GitHub so I can link it for others to judge.
Here it is! Turns out I had it in a repo already: https://github.com/gdicker1/TranslateXML_MPAStoCAMSIMA
It's ugly and quick, so I wonder if the script is "ready" for CAM-SIMA. Give me a few to get it into somewhere on GitHub so I can link it for others to judge.
Here it is! Turns out I had it in a repo already: https://github.com/gdicker1/TranslateXML_MPAStoCAMSIMA
That seems more than clean enough to me. As a question to all, would it make sense to commit that script to, e.g., somewhere in the CAM-SIMA repo like src/dynamics/mpas/scripts/
, or to keep it in a separate repo and reference that in a comment at the top of the namelist_definition_mpas_dycore.xml
file? Essentially, as we need to update the MPAS-A dycore namelist options in CAM-SIMA, it would be nice to not have to go on a quest to find the Python script each time.
I personally think it's fine to bring in code that is not strictly MPAS-specific in an MPAS PR, just as long as the PR itself is not too large (this one is a good size, for example).
Also I'd be happy to have the registry translation script live inside CAM-SIMA, especially since it seems pretty SIMA-specific (i.e. I assume it won't be used elsewhere?). We discussed it in a meeting today and decided that having it sit somewhere under src/dynamics/mpas
makes sense to us.
Finally, I just wanted to let you know that I have finally started my review of this PR and should get any comments I have posted here soon. Thanks!
As a broader comment/question, should we consider "namespacing" the MPAS-A dycore namelist options somehow? For example, right now in this PR we have this namelist group:
&damping
config_mpas_cam_coef = 0.0
config_number_cam_damping_levels = 4
config_number_rayleigh_damp_u_levels = 6
config_rayleigh_damp_u = .false.
config_rayleigh_damp_u_timescale_days = 5.0
config_xnutr = 0.2
config_zd = 22000.0
/
One of the variables in this group does have the "mpas" substring, but for others, there's nothing that indicates that these apply to the MPAS-A dycore. I believe @gdicker1's script substituted config_
for mpas_
(and removed duplicate mpas_
substrings), and perhaps retaining something of that could be useful.
I completely appreciate the desire to use MPAS-A's native namelist reading routines; but that does come at the cost of namelist variable and namelist group names in CAM-SIMA that aren't obviously tied to the MPAS-A dycore.
At a minimum, I think it would be good to:
mpas_
, e.g., &mpas_damping
namelist_definition_mpas_dycore.xml
file.As a broader comment/question, should we consider "namespacing" the MPAS-A dycore namelist options somehow? ...
@mgduda @nusbaume
After some investigations, I think we can have the best of both worlds. Hopefully https://github.com/ESCOMP/CAM-SIMA/pull/248/commits/8669b0e7c212260c6c72a0e7ccc66085160ca5c2 can address your comments.
All MPAS namelist groups are now prefixed by mpas_
, and we still get to use the native MPAS functionality to read its namelist. For example, the damping
namelist group that you mentioned now looks like this in atm_in
:
&mpas_damping
config_mpas_cam_coef = 0.0
config_number_cam_damping_levels = 4
config_number_rayleigh_damp_u_levels = 6
config_rayleigh_damp_u = .false.
config_rayleigh_damp_u_timescale_days = 5.0
config_xnutr = 0.2
config_zd = 22000.0
/
So it will not to be confused with others.
About bringing the "MPAS registry -> CAM-SIMA namelist definition" conversion script, I think it should be in another PR.
About bringing the "MPAS registry -> CAM-SIMA namelist definition" conversion script, I think it should be in another PR.
I have created an Issue to track this and follow-up later: #252
This PR implements namelist reading (
dyn_readnl
) and early initialization of MPAS dynamical core. A new MPAS subdriver module (dyn_mpas_subdriver
) is introduced, which will oversee the life cycle (i.e., initialization, running, and finalization) of MPAS as a dynamical core within CAM-SIMA.Credits to Dylan Dickerson (@gdicker1) for authoring
namelist_definition_mpas_dycore.xml
.Implementation notes:
Test steps:
Observe the following log entries in
atm.log.<job-id>.<date>-<time>
: