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

MARBL_settings_class assumes units in input_file match YAML, not unit_system #444

Open
mnlevy1981 opened this issue Oct 12, 2023 · 0 comments · Fixed by #441
Open

MARBL_settings_class assumes units in input_file match YAML, not unit_system #444

mnlevy1981 opened this issue Oct 12, 2023 · 0 comments · Fixed by #441

Comments

@mnlevy1981
Copy link
Collaborator

If I am running CESM+MOM6, I can use user_nl_marbl to change variable values in marbl_in. Since MOM6 is in mks, I want to use mks values in user_nl_marbl, but the python script that generates marbl_in will assume user_nl_marbl will provide values in the units defined in the settings YAML file (which is cgs for the most part).

Here's a concrete example -- parm_POC_diss is defined in the YAML as

   parm_POC_diss :
      defined_if : base_bio_on
      longname : Base POC dissolution length scale
      subcategory : 5. general parameters (dissolution)
      units : cm
      datatype : real
      default_value : 100e2

In MOM6, this default value is correctly appears in marbl_in as parm_POC_diss = 1.0000000000000000e+02 because we convert the default value to mks. However, if I set

parm_POC_diss = 150

in user_nl_marbl, then marbl_in contains parm_POC_diss = 1.5000000000000000e+00 rather than the desired parm_POC_diss = 1.5000000000000000e+02. The fix is to return a scale factor of 1. to _translate_JSON_value() if the variable came from an input file.

@mnlevy1981 mnlevy1981 linked a pull request Oct 12, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant