[ncl-talk] Segmentation fault with addfiles and addfile

Jenney,Andrea Andrea.Jenney at colostate.edu
Tue Aug 27 12:43:29 MDT 2019


All,

I’m getting a segmentation fault error when using addfile and addfiles to read in netcdf files. Each single file is a monthly mean (only one time step) of many variables that are resolved in space. I’ve uploaded an example file to the link, (file is called "spcesm_cam5_control.cam.h0.1910-05.nc"): http://saddleback.atmos.colostate.edu/rr/docexch.php. Running ncl_filedump and ncl_convert2nc on the files works fine and everything looks great. The non-ncl ncview and ncdump also show that things look normal to me. My files are smaller than 400 MB each, all variables are 3D or smaller, and the largest dimension is length 144.

Relevant code:
(when using addfiles)

fnameIn = dir + "spcesm_cam5_*.h0.*.nc"
files = systemfunc("ls "+fnameIn)
f     = addfiles(files, "r") ; <- Error: "warning:_NclOpenFile: Can not open file <filename> file format not supported or file is corrupted"


(when using addfile)
fnameIn = dir + "spcesm_cam5_*.h0.*.nc"
files = systemfunc("ls "+fnameIn)
nf    = dimsizes(files)
do ifile = 0,nf-1
f = addfile(files(ifile), "r") ; <- Error: "Segmentation fault"
…
end do

Thanks in advance for your help
---
Andrea Jenney
PhD Candidate | Randall & Barnes Groups
Colorado State University | Dept. of Atmospheric Science

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


More information about the ncl-talk mailing list