Skip to content

Commit db2a121

Browse files
committed
Replace use of C macro _FillValue with string "_FillValue"
1 parent dd3f54a commit db2a121

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/cases/e3sm_io_case.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -340,15 +340,15 @@ int scorpio_write_var(e3sm_io_driver &driver,
340340
#define PUT_ATTR_FILL(val) { \
341341
if (varp->xType == NC_FLOAT) { \
342342
float buf = (float)val; \
343-
err = driver.put_att(ncid,varp->vid,_FillValue,varp->xType, 1, &buf); \
343+
err = driver.put_att(ncid,varp->vid,"_FillValue",varp->xType,1,&buf); \
344344
} \
345345
else if (varp->xType == NC_INT) { \
346346
int buf = (int)val; \
347-
err = driver.put_att(ncid,varp->vid,_FillValue,varp->xType, 1, &buf); \
347+
err = driver.put_att(ncid,varp->vid,"_FillValue",varp->xType,1,&buf); \
348348
} \
349349
else if (varp->xType == NC_DOUBLE) { \
350350
double buf = (double)val; \
351-
err = driver.put_att(ncid,varp->vid,_FillValue,varp->xType, 1, &buf); \
351+
err = driver.put_att(ncid,varp->vid,"_FillValue",varp->xType,1,&buf); \
352352
} \
353353
CHECK_VAR_ERR(varp->_name) \
354354
cmeta->num_attrs++; \
@@ -487,16 +487,16 @@ int scorpio_write_var(e3sm_io_driver &driver,
487487
}
488488
#define GET_ATTR_FILL(val) { \
489489
if (varp->xType == NC_FLOAT) { \
490-
err = driver.get_att(ncid,varp->vid,_FillValue,&val); \
490+
err = driver.get_att(ncid,varp->vid,"_FillValue",&val); \
491491
} \
492492
else if (varp->xType == NC_INT) { \
493493
int buf; \
494-
err = driver.get_att(ncid,varp->vid,_FillValue,&buf); \
494+
err = driver.get_att(ncid,varp->vid,"_FillValue",&buf); \
495495
val = (float)buf; \
496496
} \
497497
else if (varp->xType == NC_DOUBLE) { \
498498
double buf; \
499-
err = driver.get_att(ncid,varp->vid,_FillValue,&buf); \
499+
err = driver.get_att(ncid,varp->vid,"_FillValue",&buf); \
500500
val = (float)buf; \
501501
} \
502502
CHECK_VAR_ERR(varp->_name) \

src/e3sm_io.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
#define NC_NOERR 0 /**< No Error */
6161
#define NC_GLOBAL -1
6262
#define NC_UNLIMITED 0L
63-
#define _FillValue "_FillValue"
6463

6564
typedef int nc_type;
6665
#endif

tests/icase_def.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ int main(int argc, char *argv[])
6060
ERR \
6161
if (xtype == NC_FLOAT) { \
6262
float buf = (float)val; \
63-
err = nc_put_att_float(ncid, varid, _FillValue, xtype, 1, &buf); \
63+
err = nc_put_att_float(ncid, varid, "_FillValue", xtype, 1, &buf);\
6464
} \
6565
else if (xtype == NC_INT) { \
6666
int buf = (int)val; \
67-
err = nc_put_att_int(ncid, varid, _FillValue, xtype, 1, &buf); \
67+
err = nc_put_att_int(ncid, varid, "_FillValue", xtype, 1, &buf); \
6868
} \
6969
else if (xtype == NC_DOUBLE) { \
7070
double buf = (double)val; \
71-
err = nc_put_att_double(ncid, varid, _FillValue, xtype, 1, &buf); \
71+
err = nc_put_att_double(ncid, varid,"_FillValue", xtype, 1, &buf);\
7272
} \
7373
ERR \
7474
}

0 commit comments

Comments
 (0)