From 6d2fda3cf8c0e2eba66d96c804eb0a48bb8f6747 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Wed, 9 May 2018 09:24:48 -0600 Subject: [PATCH] changing fill value handling in write_darray --- src/clib/pio_darray.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/clib/pio_darray.c b/src/clib/pio_darray.c index 7ff5a9ca33d..329bd4b5d18 100644 --- a/src/clib/pio_darray.c +++ b/src/clib/pio_darray.c @@ -411,11 +411,17 @@ pio_inq_var_fill_expected(int ncid, int varid, int pio_type, PIO_Offset type_siz ncid, varid, pio_type, type_size)); /* Is there a _FillValue attribute? */ - ret = PIOc_get_att(ncid, varid, "_FillValue", fillvalue); + ret = PIOc_inq_att(ncid, varid, "_FillValue", NULL, NULL); + LOG((3, "pio_inq_var_fill_expected ret %d", ret)); - /* If no _FillValue at was found we still have work to do. */ - if (ret) + /* If there is a fill value, get it. */ + if (!ret) + { + if ((ret = PIOc_get_att(ncid, varid, "_FillValue", fillvalue))) + return ret; + } + else /* If no _FillValue at was found we still have work to do. */ { /* Did we get some other error? */ if (ret != PIO_ENOTATT)