Error when writing global attributes in Netcdf-4 classic file

From: Dave Allured - NOAA Affiliate <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Mon Apr 01 2013 - 20:41:19 MDT

NCL support team,

This program results in a seg fault error on program exit, after
attempting to overwrite some global attributes in a Netcdf-4 classic
file with HDF5 compression. Note that all three global attributes
exist previously in the target file, before running the test program.

After the error, the target file is corrupted. This error is
strangely sensitive to the number and string lengths of the attributes
to be written. Can you please tell me what the problem is? Thank

  outfile = ""
  system ("cat > " + outfile) ; create fresh writable copy

  out = addfile (outfile, "w")
  out@last_update = systemfunc ("date")
  out@last_update_program = " version 2013-apr-01"
  out@last_update_source_file = ""
  print ("Update complete.")

I get the same results with NCL versions 6.0.0 and 6.1.2. My system
is Mac OS 10.8.3 on a 64-bit Intel Mac desktop. Here is the console

mac56:~/ncl/bugs/3-atts/401i 491> ncl
 Copyright (C) 1995-2013 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.1.2
 The use of this software is governed by a License Agreement.
 See for more details.
(0) Update complete.
Segmentation fault

mac56:~/ncl/bugs/3-atts/401i 492> ls -trgo
total 44136
-r--r--r-- 1 11294147 Apr 1 17:14
-rw-r--r-- 1 570 Apr 1 19:51
-rw-r--r-- 1 11294201 Apr 1 20:16

mac56:~/ncl/bugs/3-atts/401i 493> ncdump -k
netCDF-4 classic model

mac56:~/ncl/bugs/3-atts/401i 494> ncdump -k
ncdump: NetCDF: Can't open HDF5 attribute

mac56:~/ncl/bugs/3-atts/401i 495> uname -a
Darwin mac56 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10
PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64

I uploaded the program and original Netcdf file (11 Mbytes) to, as
"". The original Netcdf file
was also made by NCL 6.1.2 and a different script. I can also send a
copy of the generating script and its input file, if you need it.
Please let me know. Thanks for taking a look at this.

--Dave A.
NOAA/PSD/CIRES Climate Analysis Branch
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Mon Apr 1 20:41:32 2013

This archive was generated by hypermail 2.1.8 : Tue Apr 02 2013 - 21:23:48 MDT