Skip to content

Commit

Permalink
workaround for Unidata/netcdf-c#1691 in netcdf 4.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Barth committed Dec 2, 2020
1 parent efd3ef3 commit 4093656
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/netcdf_c.jl
Expand Up @@ -938,9 +938,17 @@ function nc_inq_var_deflate(ncid::Integer,varid::Integer)
deflatep = Ref(Cint(0))
deflate_levelp = Ref(Cint(0))

check(ccall((:nc_inq_var_deflate,libnetcdf),Cint,(Cint,Cint,Ptr{Cint},Ptr{Cint},Ptr{Cint}),ncid,varid,shufflep,deflatep,deflate_levelp))
ncerr = ccall((:nc_inq_var_deflate,libnetcdf),Cint,(Cint,Cint,Ptr{Cint},Ptr{Cint},Ptr{Cint}),ncid,varid,shufflep,deflatep,deflate_levelp)

if ncerr == NC_ENOTNC4
# work-around for netcdf 4.7.4
# https://github.com/Unidata/netcdf-c/issues/1691
return false, false, Cint(0)
else
check(ncerr)
return shufflep[] == 1, deflatep[] == 1, deflate_levelp[]
end

return shufflep[] == 1, deflatep[] == 1, deflate_levelp[]
end

# function nc_inq_var_szip(ncid::Integer,varid::Integer,options_maskp,pixels_per_blockp)
Expand Down

2 comments on commit 4093656

@Alexander-Barth
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error while trying to register: "Tag with name v0.11.0 already exists and points to a different commit"

Please sign in to comment.