From ab970eb3a86dbf0297334fd50799ea7f7308aeca Mon Sep 17 00:00:00 2001 From: Alexander Barth Date: Wed, 9 Nov 2022 14:03:54 +0100 Subject: [PATCH] ignore _FillValue which can be 0 for WOD --- src/variable.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/variable.jl b/src/variable.jl index 6395198d..514d50f8 100644 --- a/src/variable.jl +++ b/src/variable.jl @@ -140,12 +140,13 @@ function loadragged(ncvar,index::Union{Colon,UnitRange}) throw(NetCDFError(-1, "There should be exactly one NetCDF variable with the attribute 'sample_dimension' equal to '$(dimname)'")) end - ncvarsize = ncvarsizes[1] + # ignore _FillValue which can be 0 for WOD + ncvarsize = ncvarsizes[1].var isa(index,Colon)||(index[1]==1) ? n0=1 : n0=1+sum(ncvarsize[1:index[1]-1]) isa(index,Colon) ? n1=sum(ncvarsize[:]) : n1=sum(ncvarsize[1:index[end]]) - varsize = ncvarsize.var[index] + varsize = ncvarsize[index] istart = 0; tmp = ncvar[n0:n1]