Skip to content

Commit 9aeac29

Browse files
Merge pull request #638 from E3SM-Project/jayeshkrishna/fix_nc_fillvalue_aname
Replacing NetCDF constant for fillvalue attribute name with "_FillValue". Fixes #613
2 parents cf67af5 + 900d077 commit 9aeac29

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/clib/pio_nc.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#endif
2323
#include "spio_io_summary.h"
2424

25+
const char spio_nc_fillvalue_aname[] = "_FillValue";
26+
2527
#ifdef _ADIOS2
2628
int get_adios2_type_size(adios2_type type, const void *var)
2729
{
@@ -3908,7 +3910,7 @@ int PIOc_def_var_fill_impl(int ncid, int varid, int fill_mode, const void *fill_
39083910
#ifdef _NETCDF
39093911
LOG((2, "defining fill value attribute for netCDF classic file"));
39103912
if (file->do_io)
3911-
ierr = nc_put_att(file->fh, varid, _FillValue, xtype, 1, fill_valuep);
3913+
ierr = nc_put_att(file->fh, varid, spio_nc_fillvalue_aname, xtype, 1, fill_valuep);
39123914
#endif /* _NETCDF */
39133915
}
39143916
else
@@ -4065,7 +4067,7 @@ int PIOc_inq_var_fill_impl(int ncid, int varid, int *no_fill, void *fill_valuep)
40654067

40664068
if (!ierr && fill_valuep)
40674069
{
4068-
ierr = nc_get_att(file->fh, varid, _FillValue, fill_valuep);
4070+
ierr = nc_get_att(file->fh, varid, spio_nc_fillvalue_aname, fill_valuep);
40694071
if (ierr == NC_ENOTATT)
40704072
{
40714073
char char_fill_value = NC_FILL_CHAR;

0 commit comments

Comments
 (0)