marbl-ecosys / MARBL

Marine Biogeochemistry Library
https://marbl-ecosys.github.io
Other
13 stars 21 forks source link

Introduce diagnostic modes to diagnostics_latest.yaml #461

Open mnlevy1981 opened 2 months ago

mnlevy1981 commented 2 months ago

diagnostics_latest.yaml currently provides a list of diagnostics for a GCM to write disk, with no mechanism for changing the variable list under different circumstances. For example, in a fully coupled CESM development run, we might want less MARBL output than in a FOSI production run.

One idea from a meeting with @klindsay28, @kristenkrumhardt, and I is to introduce the idea of a diag_mode that could have valid values of full or minimal. The YAML file could be updated like

ECOSYS_IFRAC :
   dependencies :
      lflux_gas_o2 : .true.
      lflux_gas_co2 : .true.
   dependencies_or : true
   longname : Ice Fraction
   units : fraction
   vertical_grid : none
   frequency :
      - medium
      - high
   operator :
      - average
      - average
+  diag_mode :
+     - minimal
+     - full
 ECOSYS_XKW :
    dependencies :
       lflux_gas_o2 : .true.

and MARBL_generate_diagnostics_file.py could treat these similarly to how python logging works -- if a user requests --diag-mode minimal then they only get the variables labeled minimal, but if they request --diag-mode full they get the variables labeled either minimal or full. Going back to the CESM example, MOM_interface could set a default diag_mode of minimal for fully coupled runs and full for ocean or ocean / ice runs.