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

Add diag_mode to default diagnostics #462

Merged
merged 5 commits into from
May 16, 2024

Conversation

mnlevy1981
Copy link
Collaborator

@mnlevy1981 mnlevy1981 commented May 9, 2024

Introduce new diag_mode option to MARBL_generate_diagnostics_file.py; when diag_mode = 'none', output diagnostic file should be 'never_{op}' for all variables. When diag_mode = 'minimal', only variables with diag_mode = 'minimal' in diagnostics_latest.json have non-never output frequencies. When diag_mode is 'full', variables with diag_mode = 'minimal' or 'full' will have non-never output frequencies.

Introduce new diag_mode option to MARBL_generate_diagnostics_file.py; when
diag_mode = 'none', output diagnostic file should be 'never_{op}' for all
variables. When diag_mode = 'minimal', only variables with diag_mode =
'minimal' in diagnostics_latest.json have non-never output frequencies. When
diag_mode is 'full', variables with diag_mode = 'minimal' or 'full' will have
non-never output frequencies.
Call MARBL_generate_diagnostics_file.py with a few different --diag-mode
options (and write output to different files)
Previous commit let us call MARBL_generate_diagnostics_file.py from command
line, but caused problems when importing generate_diagnostics_file() into a
python script. This clean-up allows both use-cases.

Also, I renamed diag_mode_opts() -> valid_diag_modes() because that seems like
a more descriptive name.
When generating the MARBL diagnostics file with diag_mode=minimal, some
variables were being listed as "never_average, never_average" (and others were
"medium_average, never_average"); we only need to add never_average to the
freq_op list if that list is empty.
@mnlevy1981
Copy link
Collaborator Author

Just to have this recorded somewhere, I tested this PR in CESM with ocean-only (MOM6) cases. Each was run for a single month.

MARBL_DIAG_MODE Size of RUNDIR
none 18 GB
minimal 19 GB
full 29 GB
test_suite 45 GB

Notes

  1. test_suite is only defined in MOM_interface; it writes monthly means of every diagnostic MARBL provides. For all the other values, MARBL_DIAG_MODE is used for diag_mode as defined in this PR
  2. MOM6 writes all output in single precision, with one exception: when diag_mode = test_suite, the MARBL diagnostics (as well as the MARBL tracer-specific diagnostics computed in MOM6) are written in double precision

1) Cleaned up docstring for valid_diag_modes
2) Dropped valid_diag_modes from __init__.py
3) Moved imports to top of MARBL_generate_diagnostics_file.py
   -- some are inside if __name__ == "__main__" block
   -- I snuck in a sys.path.append() in the middle of the imports to get
      MARBL_tools into the path
@mnlevy1981 mnlevy1981 merged commit ece907b into marbl-ecosys:development May 16, 2024
1 check passed
@mnlevy1981 mnlevy1981 deleted the add_diag_mode branch September 17, 2024 20:53
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 this pull request may close these issues.

1 participant