NOAA-PMEL / Ferret

The Ferret program from NOAA/PMEL
https://ferret.pmel.noaa.gov/Ferret/
The Unlicense
55 stars 20 forks source link

SET ATTRIBUTE errors working with global attributes #1955

Closed AnsleyManke closed 4 years ago

AnsleyManke commented 4 years ago

Use a dataset such as DSG datasets from ERDDAP, where the dimensions, OBS, TRAJECTORY are dimensions only, not coordinate variables. The SET ATTRIBUTE/OUTPUT command marks the attributes for writing to netCDF files. The first use of this works fine, but subsequent ones cause errors.

The bug appears both in previous non-DSG Ferret and in ferret_dsg.

These datasets are the benchmark data/ directory

yes?  use bench/data/dsg.nc
yes? set att/output=all .   ! and writing data to files does write all global attributes

yes?  use bench/data/dsg_cross_dateline.nc 
yes? set att/output=all .
 **ERROR: invalid command: variable, axis, or attribute does not exist .
AnsleyManke commented 4 years ago

Fixed in cd_clean_grids.F

See also #1492. That fix didn't get to the root cause of this.

In #1499 we had run into files where a 2-D coordinate variable that shares the name of a dimension. In cd_clean_grids we changed things so that we don't try to write out both a 1-D coordinate variable for the dimension and the 2-D coordinate variable. That code renames the dimension stored as a coordinate variable.

Here, we haven't stored the dimension as a named variable in the linked-list structure for variables, attributes and so on, but the code in CD_CLEAN_GRIDS was making calls as if to rename the dimension.