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

Fillvalue fix.wif #1995

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions .github/workflows/withspack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ jobs:
# the || true prevents a fail if parallelio is not installed
# spack uninstall -y parallelio@=develop+pnetcdf+fortran ^mpich || true
# spack dev-build -d $GITHUB_WORKSPACE parallelio@=develop+pnetcdf+fortran ^mpich
spack uninstall -y parallelio@=develop+pnetcdf+fortran ^mpich || true
spack dev-build -d $GITHUB_WORKSPACE parallelio@=develop+pnetcdf+fortran ^mpich
spack uninstall -y parallelio@develop+pnetcdf+fortran ^mpich || true
spack dev-build -d $GITHUB_WORKSPACE parallelio@develop+pnetcdf+fortran ^mpich

- name: Test parallelio
run: |
Expand All @@ -72,6 +72,6 @@ jobs:
popd


- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
3 changes: 3 additions & 0 deletions src/clib/pio.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
(((NC_VERSION_MAJOR == Maj) && (NC_VERSION_MINOR == Min) && (NC_VERSION_PATCH >= Pat)) || \
((NC_VERSION_MAJOR == Maj) && (NC_VERSION_MINOR > Min)) || (NC_VERSION_MAJOR > Maj))

#ifndef NC_FillValue
#define NC_FillValue _FillValue
#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
8 changes: 4 additions & 4 deletions src/clib/pio_nc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,7 @@ PIOc_def_var(int ncid, const char *name, nc_type xtype, int ndims,
*
* When the fill mode for the file is NC_FILL, then fill values are
* used for missing data. This function sets the fill value to be used
* for a variable. If no specific fill value is set (as a _FillValue
* for a variable. If no specific fill value is set (as a NC_FillValue
* attribute), then the default fill values from netcdf.h are used.
*
* NetCDF-4 and pnetcdf files allow setting fill_mode (to NC_FILL or
Expand Down 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, NC_FillValue, xtype, 1, fill_valuep);
}
}
else
Expand Down Expand Up @@ -2477,7 +2477,7 @@ PIOc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep)
{
iosystem_desc_t *ios; /* Pointer to io system information. */
file_desc_t *file; /* Pointer to file information. */
nc_type xtype; /* Type of variable and its _FillValue attribute. */
nc_type xtype; /* Type of variable and its NC_FillValue attribute. */
PIO_Offset type_size; /* Size in bytes of this variable's type. */
int mpierr = MPI_SUCCESS, mpierr2; /* Return code from MPI function codes. */
int ierr = PIO_NOERR; /* Return code from function calls. */
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, NC_FillValue, fill_valuep);
if (ierr == NC_ENOTATT)
{
char char_fill_value = NC_FILL_CHAR;
Expand Down
Loading