NOAA-GFDL / FMS

GFDL's Flexible Modeling System
Other
92 stars 134 forks source link

Fix for z subaxis, for static variables, and for static files #1461

Closed uramirez8707 closed 7 months ago

uramirez8707 commented 7 months ago

Description The diag manager allows for variables in a file to have a different number of Z subaxis, so this table should work:

- file_name: test_subZaxis
  freq: 6 hours
  time_units: hours
  unlimdim: time
  varlist:
  - module: ocn_mod
    var_name: var3
    output_name: var3_Z1
    reduction: none
    kind: r4
    zbounds: 2. 3.
  - module: ocn_mod
    var_name: var3
    output_name: var3_Z2
    reduction: none
    kind: r4
    zbounds: 3. 5.

But without this updates, it doesn't work and it leads to errors when writing the metadata. This update fixes it by adding the number of Z subaxis to the fileobject and it uses that to set the name of the Z subaxis. This update also adds a test with checks.

This update also fixes the logic so that static files only get written in the beginning of the run and so that the static variables only get written once.

Fixes # (issue)

How Has This Been Tested? Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration (e.g. compiler, OS). Include enough information so someone can reproduce your tests.

Checklist: