[ncl-talk] Editing a netcdf4 file

Gerry Creager - NOAA Affiliate gerry.creager at noaa.gov
Mon Jun 1 13:15:05 MDT 2015


I've started looking at this with Dusty. Appreciate any thought you might
have as to why we're failing.

I've uploaded the input file (wrfinput_d02) to the FTP incoming site. I'm
testing with the script:

var = "QRAIN"
print(var)
a=addfile("wrfinput_d02.nc", "w")
var_orig=a->QRAIN
print(var_orig)


The result looks like:gerry at loki:~/NEWSe/NCL> ncl test.ncl
 Copyright (C) 1995-2015 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.3.0
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.


Variable: var
Type: string
Total Size: 8 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) QRAIN
fatal:["NclNetCDF4.c":3073]:NclNetCDF4.c: Error in nc_def_var_chunking in
file (wrfinput_d02.nc) for writing, at line: 3073

line 3074 of NclNetCDF4.c: NetCDF: Attempt to define var properties, like
deflate, after enddef.


On Fri, May 29, 2015 at 8:54 PM, Dustan Wheatley - NOAA Affiliate <
dustan.wheatley at noaa.gov> wrote:

> I am trying to overwrite a netcdf4 file analogous to what is shown at
> http://www.ncl.ucar.edu/Applications/change_netCDF.shtml
> <https://exchange.ou.edu/owa/redir.aspx?C=owjNhXjJeU2q3l_CtHOdFTi5otfobdIIrQJSmDqpIJwEqeu5PSxBrYF-uWWKJzwXX3oP_TJTgXA.&URL=http%3a%2f%2fwww.ncl.ucar.edu%2fApplications%2fchange_netCDF.shtml>.
> In the attached ncl script, I open the file to be modified at line 35 and
> attempt the modification at line 73 (with a lot of calculations in
> between).  While I have double-checked that the modified field (var_mod)
> has the same dimensionality as the original variable (QRAIN), I am still
> get a segmentation fault/core dump.  Never had this problem when I tried to
> manipulate netcdf3 files.  Could it possibly be related to the netcdf4
> compression?  It’s possible I may be trying to do something that’s no
> longer possible.
>
> Thanks in advance for any suggestions.
>
> -Dusty Wheatley
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>


-- 
Gerry Creager
NSSL/CIMMS
405.325.6371
++++++++++++++++++++++
“Big whorls have little whorls,
That feed on their velocity;
And little whorls have lesser whorls,
And so on to viscosity.”
Lewis Fry Richardson (1881-1953)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150601/8c2d1508/attachment.html 


More information about the ncl-talk mailing list