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

Alexander Schaefer alexander.schaefer at mines.sdsmt.edu
Mon Mar 23 08:38:09 MDT 2015


Feng,

This may be a computer hardware issue?  Did you use a pre-compiled binary
or compile the source code yourself?

As I was not able to reproduce the error you got while using 6.1.2.

 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.
ncl 0> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
ncl 1> f = addfile("geo_em.d01.nc","r")
ncl 2> lon2d = f->XLONG_M(Time|0,south_north|:,west_east|:)
ncl 3> printVarSummary(lon2d)
Variable: lon2d
Type: float
Total Size: 158404 bytes
            39601 values
Number of Dimensions: 2
Dimensions and sizes:   [south_north | 199] x [west_east | 199]
Coordinates:
Number Of Attributes: 7
  FieldType :   104
  MemoryOrder : XY
  units :       degrees longitude
  description : Longitude on mass grid
  stagger :     M
  sr_x :        1
  sr_y :        1
ncl 4>

Maybe one of the Software Engineers/Code Developers will be able to offer
more insight.

-Alex


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
>>
>>
>
> _______________________________________________
> 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/20150323/7011f1d1/attachment.html 


More information about the ncl-talk mailing list