Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check to accomodate move away from _FillValue in libnetcdf #1994

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/clib/pio.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
(((NC_VERSION_MAJOR == Maj) && (NC_VERSION_MINOR == Min) && (NC_VERSION_PATCH >= Pat)) || \
((NC_VERSION_MAJOR == Maj) && (NC_VERSION_MINOR > Min)) || (NC_VERSION_MAJOR > Maj))

#if defined(NC_FillValue)
#define NCDF_FillValue NC_FillValue
#elif defined(_FillValue)
#define NCDF_Fillvalue _FillValue
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think instead of introducing a third macro, just define NC_FillValue if not defined and use that everywhere.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WardF I've made the change suggested by @edwardhartnett can you give me permission to push back to your fork?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jedwards4b sorry for the radio silence, I've been at an NSF Unidata retreat for the last couple of days. I'll modify that permission!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jedwards4b The 'allow edits by maintainers' option is selected, does this not give you access to push changes to this PR? If not, maybe it would be easier (and certainly no problem from my end) to pull the changes I've proposed into a new PR that you can push and merge?

#endif

/** PIO_OFFSET is an integer type of size sufficient to represent the
* size (in bytes) of the largest file supported by MPI. This is not
Expand Down
4 changes: 2 additions & 2 deletions src/clib/pio_nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2430,7 +2430,7 @@ PIOc_def_var_fill(int ncid, int varid, int fill_mode, const void *fill_valuep)
{
ierr = nc_set_fill(file->fh, NC_FILL, NULL);
if (!ierr)
ierr = nc_put_att(file->fh, varid, _FillValue, xtype, 1, fill_valuep);
ierr = nc_put_att(file->fh, varid, NCDF_FillValue, xtype, 1, fill_valuep);
}
}
else
Expand Down Expand Up @@ -2574,7 +2574,7 @@ PIOc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep)

if (!ierr && fill_valuep)
{
ierr = nc_get_att(file->fh, varid, _FillValue, fill_valuep);
ierr = nc_get_att(file->fh, varid, NCDF_FillValue, fill_valuep);
if (ierr == NC_ENOTATT)
{
char char_fill_value = NC_FILL_CHAR;
Expand Down
Loading