Re: Segmentation fault problem in reading nc file

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Sep 02 2013 - 07:00:31 MDT

The netCDF is, as noted, netCDF-4. I has 'chunking'.
It is a bug that the code fails.

Reading the variables without using the named dimensions
works fine.

   fin = addfile("./geo_em.d01.nc","r")
   print(fin)

  ;lon2d = fin->XLONG_M(Time|:, south_north|:, west_east|:)
   lon2d = fin->XLONG_M
   printVarSummary(lon2d)

  ;lat2d = fin->XLAT_M(Time|:, south_north|:, west_east|:)
   lat2d = fin->XLONG_M
   printVarSummary(lat2d)

  ;LU = fin->LU_INDEX(Time|0, south_north|:, west_east|:)
   LU = fin->LU_INDEX(0,:,:)
   printVarSummary(LU)

====
Note the output from print(f)

[SNIP]

dimensions:
     Time = 1 // unlimited
     DateStrLen = 19
     west_east = 70
     south_north = 70
     south_north_stag = 71
     west_east_stag = 71
     land_cat = 24
     soil_cat = 16
     month = 12

chunk dimensions:
     Time = 1 // unlimited
     DateStrLen = 19
     west_east = 35
     south_north = 35
     south_north_stag = 36
     west_east_stag = 36
     land_cat = 24
     soil_cat = 16
     month = 12

variables:
     Times: <character> [ 1 <Time | unlimited>, 19 <DateStrLen> ]
         Chunking Info: [ 1 <Time | unlimited>, 19 <DateStrLen> ]

     XLAT_M: <float> [ 1 <Time | unlimited>, 70 <south_north>, 70
<west_east> ]
         Chunking Info: [ 1 <Time | unlimited>, 35 <south_north>, 35
<west_east> ]
         attributes:
             FieldType : 104
             MemoryOrder : XY
             units : degrees latitude
             description : Latitude on mass grid
             stagger : M
             sr_x : 1
             sr_y : 1

[SNIP]

On 9/2/13 6:41 AM, ChenFeng wrote:
> Thanks for reply.
> I increased the wsMaximumSize in ~/.hluresfile, the problem remains.
> And i used the same memory setting and ncl version 5.2.1, the problem disappeared.
>
> Feng
>
> 发件人: mark schoeberl
> 发送时间: 2013-09-02 19:12
> 收件人: ChenFeng
> 主题: Re: [ncl-talk] Segmentation fault problem in reading nc file
> Usually it means you have run out of memory - an array is too large.
>
>
> mark.schoeberl@mac.com
> Chief Scientist
> Science and Technology Corporation
> 10015 Old Columbia Road
> Suite E-250
> Columbia, MD 21046
> phone: 410-309-0818 x 106
> cell: 240-481-7390
> http://markschoeberl.com
>
>
>
>
>
>
>
>
> On Sep 1, 2013, at 11:59 PM, ChenFeng <fengfengabc003@163.com> wrote:
>
>
> Dear NCL-users,
>
> I have an incomprehensible problem.
> when i read the nc file from WRF-WPS-geogrid.exe, ncl says "Segmentation fault".
> I never met this problem before, so i doubt it would be the problem with the data.
> but it shows ok when i use 'ncdump' to see the data information.
>
> the configuration of my computer is listed below:
> [chenf@TC5000 result] uname -a
> Linux TC5000 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
> [chenf@TC5000 result] gcc -v
> Using built-in specs.
> Target: x86_64-redhat-linux
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
> Thread model: posix
> gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC)
> [chenf@TC5000 result] ncl -V
> 6.1.2
> [chenf@TC5000 result] ncdump
> netcdf library version 4.2.1.1 of May 4 2013 10:24:55
>
> I have no idea what the problem is and attach the script and data for help.
> if anyone knows the problem, please tell me.
>
> thanks very much.
>
> feng<geo_em.d01.nc><ncdump info><test_script.ncl>_______________________________________________
> 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
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Sep 2 07:00:58 2013

This archive was generated by hypermail 2.1.8 : Wed Sep 04 2013 - 10:27:57 MDT