Skip to content

Issue with _FillValue not being written for NetCDF3 files  #843

@hmb1

Description

@hmb1

Please provide as much of the following information as you can, as applicable to the issue being reported. Naturally, not all information is relevant to every issue, but the more information we have to start, the better!

Environment Information

Linux environment

Feel free to skip this if the issue is related to documentation, a feature request, or general discussion.

  • What platform are you using? (please provide specific distribution/version in summary)
    • [X ] Linux
    • Windows
    • OSX
    • Other
    • NA
  • 32 and/or 64 bit?
    • 32-bit
    • [X ] 64-bit
  • What build system are you using?
    • [ X] autotools (configure)
    • cmake
  • Can you provide a sample netCDF file or C code to recreate the issue?
    • Yes (please attach to this issue, thank you!)
    • No
    • Not at this time

Summary of Issue

The following NCO command works in netcdf-4.6.0 and NOT in netcdf-4.6.1
ncap2 -C -v -O -s 'n2=three_dmn_var_dbl;' in.nc foo.nc

I get the following error:

nco_err_exit(): ERROR Short NCO-generated message (usually name of function that triggered error): nco_put_att()
nco_err_exit(): ERROR Error code is -122. Translation into English with nc_strerror(-122) is "NetCDF: Attempt to define fill value when data already exists."
nco_err_exit(): ERROR NCO will now exit with system call exit(EXIT_FAILURE)

When the output is NetCDF4 the command succeeds e.g
ncap2 -4 -C -v -O -s 'n2=three_dmn_var_dbl;' in.nc foo.nc

in.nc is a NetCDF classic file
the variable three_dmn_var_dbl has the following definition:

        double three_dmn_var_dbl(time,lat,lon);
        three_dmn_var_dbl:long_name = "three dimensional record variable of type double";
        three_dmn_var_dbl:units = "watt meter-2";
        three_dmn_var_dbl:_FillValue = -99.;

...Henry

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions