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

Dennis Shea shea at ucar.edu
Tue Mar 24 13:17:24 MDT 2015


Forgot to mention:

NCL 6.2.1 did have some netCDF4 issues.

Please download the 6.3.0 version of NCL

On Tue, Mar 24, 2015 at 1:06 PM, Dennis Shea <shea at ucar.edu> wrote:

>
> I 'found' 6.2.0 and 6.2.1. I have run the attached test script with:
> 6.2.0, 6.2.1, 6.3.0
>
> It runs correctly under all versions. The file is netCDF4 which,
> 'under-the-hood', is HDF5.
>
> %> ncdump -k geo_em.d01.nc
> netCDF-4
>
> %> ncl_filedump geo_em.d01.nc >&! dump.geo_em
>
> %> ncl tst_geo.ncl
>
> ===
> Summary: I do not know what is wrong. I can not replicate the problem.
>
> D
>
> On Tue, Mar 24, 2015 at 12:13 AM, ChenFeng <fengfengabc003 at 163.com> wrote:
>
>>
>> What I do not understand is the file is generated from the standard WRF-WPS program, which I used several times with no problem.
>>
>> I can read the variable without the dimention name, and then reorder or subcite the data. This approach can solve the problem temporarily.
>> Thanks for your help.
>>
>> Feng
>>
>>  *From:* Alex Schaefer <alexander.schaefer at mines.sdsmt.edu>
>> *Date:* 2015-03-24 13:25
>> *To:* ChenFeng <fengfengabc003 at 163.com>
>> *CC:* Dennis Shea <shea at ucar.edu>; ncl-talk <ncl-talk at ucar.edu>
>> *Subject:* Re: [ncl-talk] Segmentation fault when reading variables from
>> NC
>>  Feng,
>>
>> I got the same seg fault that you got with your file.  My guess is
>> something is just not quite right with that file.  The size of that  domain
>> should not be an issue.  My ncl 6.1.2 is compiled from source so the
>> precompiled binary theory affecting it is not the case.  I am not sure what
>> other things will spit out seg faults so Dennis will have to take lead.
>>
>> Sorry I couldn’t be of more help,
>> -Alex
>>
>>
>>  On Mar 23, 2015, at 9:51 PM, ChenFeng <fengfengabc003 at 163.com> wrote:
>>
>>  And I use the  pre-compiled binary version which is downloaded from the
>> NCAR website.
>>
>>  *From:* ChenFeng <fengfengabc003 at 163.com>
>> *Date:* 2015-03-24 11:47
>> *To:* Dennis Shea <shea at ucar.edu>; alexander.schaefer
>> <alexander.schaefer at mines.sdsmt.edu>
>> *CC:* ncl-talk <ncl-talk at ucar.edu>
>> *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 <shea at ucar.edu>
>> *Date:* 2015-03-23 22:40
>> *To:* ChenFeng <fengfengabc003 at 163.com>
>> *CC:* ncl-talk <ncl-talk at ucar.edu>
>> *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/499b669c/attachment.html 


More information about the ncl-talk mailing list