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

Introduce multiple default settings files #297

Merged

Conversation

mnlevy1981
Copy link
Collaborator

We want the CESM 2.1 release to use the CMIP6 tunings by default, but also be able to reproduce the CESM 2.0 results. Per #274, we are providing multiple default settings files and allowing the user to choose which one is used.

  • move YAML files from src/ to defaults/
  • move JSON from autogenerated_src/ to defaults/json/
  • rename default_settings.{yaml,json} -> settings_latest.{yaml,json} and also introduce settings_cesm2.0.{yaml,json} to reproduce old tunings
  • rename default_diagnostics.{yaml,json} -> diagnostics_latest.{yaml,json}
  • update yaml_to_json.py to account for new directories / file names (and to convert all yaml -> json instead of looking for specific files)
  • update all MARBL python scripts that looked for default_{diagnostics,settings}.json to look for {diagnostics,settings}_latest.json instead (to allow for SourceMods, these variables could already be changed by the user so nothing needed to be updated to allow users to specify settings_cesm2.0.json instead)
  • Update documentation to reflect this new setup

* Instead of src/, YAML files are in defaults/
* Instead of autogenerated_src/, JSON files are in defaults/json/
* Python scripts in MARBL_tools look for / create these files in correct
  location
To avoid over-using "default" in file / directory names, the most recent yaml
files are "settings_latest.yaml" and "diagnostics_latest.yaml". Note that this
also switches from [version]_{settings,diagnostics}.yaml to
{settings,diagnostics}_[version].yaml so all the settings files are listed
together.

These name changes are also reflected in the JSON.
Rather than explicitly providing a single settings file and single diagnostics
file to convert to JSON, users can pass a list of YAML files with the
--yaml_files option (default value is defaults/*.yaml).
Documentation now reflects changes to location of YAML files and improvements
to yaml_to_json.py script.
@mnlevy1981 mnlevy1981 changed the base branch from stable to development July 10, 2018 17:53
@mnlevy1981
Copy link
Collaborator Author

Updated documentation is on my Read the Docs page. I made changes to three pages:

  1. Steps 4 and 5 of adding a diagnostic
  2. Steps 4 and 5 of adding a new settings parameter
  3. Steps 7 and 8 of adding a new tracer

1. Error from a code consistency check now names the function reporting the
   error
2. Introduced a yaml_to_json() subroutine to make diffs easier to parse on
   github
3. Did some string manipulation to get human-readable results in default values
   when running "yaml_to_json.py -h"
4. Cleaned up docstring to present default values in clearer manner
1. No need to provide output from yaml_to_json.py -h
2. The example in "Adding a Diagnostic" should be a clean snippet of YAML, not
   something with comments, anchors, and / or references.
@mnlevy1981
Copy link
Collaborator Author

Commits 71dad02 and d465de0 address concerns raised in code review with @klindsay28 -- along with marbl_dev_levy_n192 I think this is ready to be put on marbl_dev.

That said, I'm going to wait until the CMIP6 tunings are in MARBL / POP before accepting this pull request so that I can deal with the inevitable conflicts.

merging development onto this branch, default_settings.{yaml,json}
became setings_cesm2.0.{yaml,json} instead of settings_cesm2.1, and
settings_cesm2.1 remained the (old) settings file that didn't have all
the new parameters in it.
Default had inadvertently been set to .true. for the x1 resolution.
@mnlevy1981 mnlevy1981 merged commit a51cb41 into marbl-ecosys:development Jul 20, 2018
@mnlevy1981 mnlevy1981 deleted the enhancement/keep_old_defaults branch July 20, 2018 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant