[ncl-talk] Segmentation fault when reading variables from NC

ChenFeng fengfengabc003 at 163.com
Mon Mar 23 21:51:22 MDT 2015


And I use the  pre-compiled binary version which is downloaded from the NCAR website.

From: ChenFeng
Date: 2015-03-24 11:47
To: Dennis Shea; alexander.schaefer
CC: ncl-talk
Subject: Re: Re: [ncl-talk] Segmentation fault when reading variables from NC
Thanks Dennis and Alexander 
The reason I use the printVarSummary(lon2d) is only want to make sure whether the code above this line is correct.
There is no problem when I use this code to read another geo_em.d01.nc file. So I think there is something wrong with the NC file. But I can use ncdump to see the structure and find nothing special.
Is the variable dimention too large (474*524)?  But I have also use this ncl version to read variables more large than this.
I attached the file. Could you please help me check it with another ncl version and platform.
Thanks.

Feng

From: Dennis Shea
Date: 2015-03-23 22:40
To: ChenFeng
CC: ncl-talk
Subject: Re: [ncl-talk] Segmentation fault when reading variables from NC
Also, forgot to mention ...

Using named dimensions should only be done when reordering an array. Nothing wrong with doing so but is is  less efficient than ..

lon2d = inp0->XLONG_M (0, :, :)



On Mon, Mar 23, 2015 at 8:11 AM, Dennis Shea <shea at ucar.edu> wrote:

I don't understand why either.  6.1.2 is no longer available here so I can not test with 6.1.2


When it does work ... what does printVarSummary(lon2d) indicate?



On Mon, Mar 23, 2015 at 2:47 AM, ChenFeng <fengfengabc003 at 163.com> wrote:

Hi ncl-users,

I have encounted an error when reading a variable from an NC file.
the code is listed below:
;************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
;************************************************
begin
  inp0 = addfile("/public/home/chenf/AHWRF/TEST/WPSwks.T02/geo_em.d01.nc","r")
  lon2d = inp0->XLONG_M (Time|0, south_north|:, west_east|:)
  printVarSummary(lon2d)
;************************************************
end

the error message is:
 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 http://www.ncl.ucar.edu/ for more details.
Segmentation fault (core dumped)

The strange thing is when i'm reading the variable without any dimention name cited, the error disappeared.
The code changes into :
;************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
;************************************************
begin
  inp0 = addfile("/public/home/chenf/AHWRF/TEST/WPSwks.T02/geo_em.d01.nc","r")
  lon2d = inp0->XLONG_M
  printVarSummary(lon2d)
;************************************************
end

I don't understand why. It is very appreciate if anybody can tell me the reason.
Thanks.

Feng


_______________________________________________
ncl-talk mailing list
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/20150324/ac649991/attachment.html 


More information about the ncl-talk mailing list