ESCOMP / CAM-SIMA

Community Atmosphere Model - System for Integrated Modeling of the Atmosphere
4 stars 12 forks source link

Namelist definitions and defaults #15

Closed nusbaume closed 4 years ago

nusbaume commented 4 years ago

In the current version of CAM, namelist variable definitions and defaults are stored in two XML files (namelist_definition.xml and namelist_defaults_cam.xml) which are located in "cam/bld/namelist_files". These XML files are designed to be read using the "build-namelist" perl script, which is likelly being removed (see issue #9). Plus there are arguably more efficient ways to store this information. Given this, I propose replacing this current set-up with one of two possible alternatives:

  1. replace the files with a CIME namelist definition XML file. This is what is done in several other CESM component models, such as CICE and RTM/MOSART, and would allow for CAM to use CIME's "NamelistGenerator", which would do much of the work of creating the actual namelist for us. Also the organization of the CIME-based XML file allows for the combination of the definitions and defaults into the same file, reducing the total number of files required.

  2. Add the namelist definitions/defaults to the new CAM "configure" python data structure described in issue #8. This would remove all namelist XML files from the "cime_config" directory, and would potentially allow for a code-level unification with the buildcpp configure data. However, the disadvantage is that it could make the data structure substantially more complicated, and possibly harder to follow when reading the code itself.

Any thoughts or opinions? I am personally leaning towards option 1, but could be convinced otherwise if option 2 is preferred by others.

Thanks!

nusbaume commented 4 years ago

I should note that another option could be to use a YAML file and parser, instead of XML. There was discussion of CIME possibly moving to YAML (and MOM6 already has) at the CSEG meeting, so doing so would allow CAM to pre-emptively adjust to future CIME and CESM modifications. Plus YAML allows for conditionals in the definition file itself, and thus could help cut-down on the amount of code required in the buildXXX scripts.

Anyways, just wanted to add this to the thread as a possible solution as well.

gold2718 commented 4 years ago

I agree that option 1 is the correct approach.