[ncl-talk] editing an existing netCDF4 file
Rick Brownrigg
brownrig at ucar.edu
Fri Oct 19 11:06:13 MDT 2018
Hi,
I was able to open a NetCDF4 file, modify the values of a variable, and
write it back out. I'm using NCL 6.5.0. Are you using an older version of
NCL?
Rick
On Thu, Oct 18, 2018 at 12:17 PM Yoo, Jinwoong (GSFC-6170)[UNIVERSITY OF
MARYLAND] <jinwoong.yoo at nasa.gov> wrote:
> Hi,
>
> I am trying to replace every missing value in a netcdf4 file to 1 using
> NCL.
>
> Unlike netCDF files,
>
> the method available at
> https://www.ncl.ucar.edu/Applications/change_netCDF.shtml does not work.
>
>
>
> I also tried the Dave's solution to "Editing a netcdf4 file" from the
> nil-talk in 2015 (
> http://mailman.ucar.edu/pipermail/ncl-talk/2015-June/003046.html) but it
> did not work either.
>
>
>
> I still get the same error message as they had:
>
> fatal:["NclNetCDF4.c":3073]:NclNetCDF4.c: Error in nc_def_var_chunking in
> file (Nomissing_LIS_HIST_201702081800.d01.nc) for writing, at line: 3073
>
>
>
> line 3074 of NclNetCDF4.c: NetCDF: Attempt to define var properties, like
> deflate, after enddef.
>
>
>
>
>
> My code looks like this:
>
> a = addfile("Nomissing_LIS_HIST_201702081800.d01.nc","w")
>
> ; Read in soil moisture
>
> x = a->SoilMoist_inst;
>
> x_mod = new((/1,4,1200,1200/),"float","No_FillValue")
>
>
>
> x = where(ismissing(x), 1, x)
>
> x_mod = x
>
> a->SoilMoist_inst=(/x_mod/)
>
>
>
> I wonder if this error has been fixed yet?
>
> Thank you very much.
>
>
>
> Regards,
>
>
>
> Jinwoong Yoo
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181019/424489c4/attachment.html>
More information about the ncl-talk
mailing list