Strange sdfopen templating segfault

Jean Pierre Arabonis arabonis at EGS.UCT.AC.ZA
Thu Jun 23 04:30:00 EDT 2005


Hi
    I can't offer a neat solution, but I sometimes get a similar problem
using the GDS server, I eventually solved this by writing a new data
file of only the variable I wanted to work with, sometimes spitting the
task and defining new variables each step of the way helps.
    cheers
       JP



Warren Tennant wrote:

> I have experienced this same elusive "segmentation fault" for several
> years and have resigned myself to the fact that GrADS does not like
> something in the Linux (in my case RedHat/Fedora) libraries. The problem
> gets even worse when you start mixing files with different number of
> levels [e.g. uwnd (levs=17) + shum (levs=8) + slp (levs=1) ] (see
> attached script).
>
> I ran this script with the debugger (gdb) and here is what it says. Read
> the comments in the script for extra info. Perhaps someone else
> understands this cryptic code from gdb.... looks like library problems
> to me. And as Kilian predicts, when you do not straddle the years the
> script runs right through!
>
> #########################
> Config: v1.9b4 32-bit little-endian readline sdf/xdf netcdf lats athena
> printim
>
> Issue 'q config' command for more information.
>
> Landscape mode? (no for portrait):  l
> GX Package Initialization: Size = 11 8.5
> ga-> run t2.gs
> done mag wind
> done slp (one year only)
> done slp (straddle year/files)
> done shum
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00a29718 in strcmp () from /lib/tls/libc.so.6
> (gdb)
>
> ##############################
>
> PART II that does work
> ##############################
> Config: v1.9b4 32-bit little-endian readline sdf/xdf netcdf lats athena
> printim
>
> Issue 'q config' command for more information.
>
> Landscape mode? (no for portrait):  l
> GX Package Initialization: Size = 11 8.5
> ga-> run t2.gs
> done mag wind
> done slp (one year only)
> done shum
> done all
> No hardcopy metafile open
> GX package terminated
>
> Program exited normally.
> (gdb)
>
> ###################################
>
> Maybe a clever person can help the rest of us out here??
>
> Regards
> Warren
>
> Kilian Hagemann wrote:
>
>> Hi guys,
>>
>> I'm getting a very annoying segfault when running the following script:
>>
>> #!/usr/local/grads/bin/gradsnc -lc
>> 'sdfopen uwnd.sig995.1979.nc uwnd.sig995.%y4.nc 18994'
>> 'sdfopen vwnd.sig995.1979.nc vwnd.sig995.%y4.nc 18994'
>> 'set lat -36 -21'
>> 'set lon 15 34'
>> 'd ave(mag(uwnd,vwnd.2),t=1,t=1461)'
>>
>> It works when I either set the final t to 1460 or less (length of any
>> single
>> NCEP Reanalysis I file) or leave out the set lat/lon statements.
>>
>> What gives?
>>
>> Using grads-1.9b3, compiled from source(no special tweaks though).
>>
>> --
>> Kilian Hagemann
>>
>> Climate Systems Analysis Group
>> University of Cape Town
>> Republic of South Africa
>> Tel(w): ++27 21 650 2748
>>
>>
>>
>
> --
> ======================================================================
> Dr Warren J Tennant: Research Scientist
> South African Weather Service, Private Bag X097, Pretoria 0001
> tennant at weathersa.co.za             http://www.weathersa.co.za
> Tel: 012-367-6004   Fax:+27(0)12-367-6189   Cell: 083-350-9021
> ** PHONE 082 162 FOR WEATHER FORECASTS **
>
>------------------------------------------------------------------------
>
>* Wants the full path "/data" in the template - otherwise, immediate seg fault
>'sdfopen uwnd.1979.nc /data/uwnd.%y4.nc 1994'
>'sdfopen vwnd.1979.nc /data/vwnd.%y4.nc 1994'
>'sdfopen shum.1979.nc /data/shum.%y4.nc 1994'
>'sdfopen slp.1979.nc /data/slp.%y4.nc 1994'
>'set lat -36 -21'
>'set lon 15 34'
>'set lev 850'
>'d ave(mag(uwnd,vwnd.2),t=1000,t=1465)'
>say 'done mag wind'
>* Works all the way with this line
>'d ave(slp.4(z=1),t=1000,t=1365)'
>say 'done slp (one year only)'
>* does not finish last command in script with this line included
>*'d ave(slp.4(z=1),t=1000,t=1465)'
>say 'done slp (straddle year/files)'
>'d ave(sum(shum.3,z=1,z=5),t=1000,t=1365)'
>say 'done shum'
>'d ave(mag(uwnd,vwnd.2)+sum(shum.3,z=1,z=5)-slp.4(z=1),t=1000,t=1365)'
>say 'done all'
>'quit'
>
>

--
Jean Pierre Arabonis
arabonis at egs.uct.ac.za
Tel 021 780 1021 cell 084 401 1365
This email is 100% Microsoft Free

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20050623/add9c079/attachment.html 


More information about the gradsusr mailing list