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

Can not nccopy a file with a _Netcdf4Dimid attribute #423

Closed
4 tasks done
kwilcox opened this issue Jun 9, 2017 · 2 comments
Closed
4 tasks done

Can not nccopy a file with a _Netcdf4Dimid attribute #423

kwilcox opened this issue Jun 9, 2017 · 2 comments

Comments

@kwilcox
Copy link

kwilcox commented Jun 9, 2017

Environment Information

netCDF library version 4.4.1.1 of Dec 25 2016 19:06:13

  • What platform are you using? (please provide specific distribution/version in summary)
    • Linux
  • 32 and/or 64 bit?
    • 64-bit
  • What build system are you using?
    • cmake
  • Can you provide a sample netCDF file or C code to recreate the issue?
    • Yes (please attach to this issue, thank you!)

Summary of Issue

A file or DAP endpoint with a variable attribute of _Netcdf4Dimid will fail to download/convert to netCDF4. Originally discovered/reported here nco/nco#57.

Steps to reproduce the behavior

$ nccopy -7 -v z http://oceanmodeling.pmc.ucsc.edu:8080/thredds/dodsC/ccsra_2016a_phys_agg_zlevs/fmrc/CCSRA_2016a_Phys_ROMS_z-level_\(depth\)_Aggregation_best.ncd out.nc
NetCDF: String match to name in use
Location: file /feedstock_root/build_artefacts/recipe_root_1482692731718/work/netcdf-c-4.4.1.1/ncdump/nccopy.c; line 788
@DennisHeimbigner
Copy link
Collaborator

The Thredds server you are accessing is very old: 4.2.9.
The current is 4.6.10.

Since _Netcdf4Dimid is a reserved netcdf name, it should not be
possible to access it thru the netcdf API. But the Thredds
server by default uses the HDF5 Iosp to read the netcdf-4 file
and it is probable that the version of the Iosp the server is
using is not suppressing reserved attributes. I did a quick
check, and the latest thredds 4.6 server does properly suppress
_Netcdf4Dimid.

The only solutions I can think of are:

  1. Get the server upgraded.
  2. hack the netcdf-c library to do the suppression
  3. hack nco to do the suppression.

I am not happy with #2 and I am sure Charlie would not be happy with #3.
Is a server upgrade at all feasible?

=Dennis Heimbigner
Unidata

@kwilcox
Copy link
Author

kwilcox commented Jun 9, 2017

I'm also against fixing this in netcdf-c or nco. I don't control the THREDDS server but I can reach out and see if they are willing to upgrade. I have a work-around in place to remove the attribute so it plays nicely with the rest of the workflow. Feel free to close!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants