Fileout netCDF cannot generate a valid netCDF file when string datatype has a _FillValue

Description

FilenetCDF out fails to generate either a netcdf3 or a netcdf4 for OMPS due to a string datatype variable has a _FillValue. I can confirm this is not a netCDF bug since netCDF’s nccopy can successfully generate a netCDF-3 file. It is a bug inside the filenetCDF out. I use NcML to rename the _FillValue to _FillValueStr, then I can successfully generate nc-4 or nc-3 files.

1 2 3 4 5 6 7 8 9 10 GeolocationData_UTC_CCSDA_A { String long_name "UTC Image Midpoint Time"; String coverage_content_type "referenceInformation"; String _FillValue "0000-00-00T00:00:00.000000Z"; String valid_range "2012-01-01T00:00:00.000000Z", "2099-12-31T00:00:00.000000Z"; String DIMENSION_LABELS "DimAlongTrack"; String origname "UTC_CCSDA_A"; String fullnamepath "/GeolocationData/UTC_CCSDA_A"; }

Using NCML I can change the string _FillValue to another name and generate netCDF-4 or netCDF-3 files.

http://alpaca:8080/opendap/hyrax/data/ncml/ges_2017_eval/rename_string_fillvalue.ncml.html

1 2 3 4 5 6 7 8 9 <?xml version="1.0" encoding="UTF-8"?> <netcdf location="/data/hdf5/ges-2017/OMPS/OMPS-NPP_NMNO2-L2_2017m0101t000532_o26838_2017m0309t171152.h5" xmlns="http://www.unidata.ucar.edu/namespaces/netcdf/ncml-2.2"> <!-- Although variable@type attribute is technically required by the schema, i have been using type="" to mean "whatever type a variable with the given name has" --> <variable name="GeolocationData_UTC_CCSDA_A"> <!-- Rename attribute _FillValue --> <attribute name="_FillValue_str" orgName="_FillValue" /> </variable> </netcdf>

Environment

None

Status

Assignee

Slav Korolev

Reporter

Kent Yang

Labels

Fix versions

None

Story Points

None

Time tracking

16h

Epic Link

Priority

Highest