[ncl-talk] editing an existing netCDF4 file

Yoo, Jinwoong (GSFC-6170)[UNIVERSITY OF MARYLAND] jinwoong.yoo at nasa.gov
Thu Oct 18 12:17:48 MDT 2018


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<http://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<http://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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181018/9bcff2f0/attachment.html>


More information about the ncl-talk mailing list