Skip to content

Commit

Permalink
Revised comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
kwrobot committed Jan 18, 2025
1 parent 20d2266 commit 290b13c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions io/teca_cf_layout_manager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -449,18 +449,21 @@ int teca_cf_layout_manager::define(const teca_metadata &md_in,
#endif
)

// First implementation: Save the var to var_def so that attributes
// get written with other variables
// -> This caused an error when trying to write the attribute
// "_FillValue" after writing the data.
// NOTE: The first implentation was the following:
// Save the var to var_def so that attributes get written with other variables
//
// save the var id
// this->var_def[coord_array_names[i]] = var_def_t(parent_id, var_id,
// var_type_code);

// Second implementation:
//
// While this approach avoided code duplication, it caused an error when
// trying to write the attribute "_FillValue" after writing the data.
// To work around this error, we write the attributes of the coordinate
// axes directly here instead of saving the var id for later writing.
. //
// write variable attributes
// this needs to be done before writing arrays to avoid a NetCDF error
// of specifying fill value when data already exists.
// (this needs to be done before writing arrays to avoid a NetCDF error
// of specifying fill value when data already exists)
teca_metadata array_atts;
if (array_attributes.get(coord_array_names[i], array_atts) == 0)
{
Expand Down

0 comments on commit 290b13c

Please sign in to comment.