<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hi <br>
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. <br>
cheers<br>
JP<br>
<br>
<br>
<br>
Warren Tennant wrote:<br>
<blockquote type="cite" cite="mid42BA68CF.6030906@weathersa.co.za">I
have experienced this same elusive "segmentation fault" for several
<br>
years and have resigned myself to the fact that GrADS does not like
<br>
something in the Linux (in my case RedHat/Fedora) libraries. The
problem
<br>
gets even worse when you start mixing files with different number of
<br>
levels [e.g. uwnd (levs=17) + shum (levs=8) + slp (levs=1) ] (see
<br>
attached script).
<br>
<br>
I ran this script with the debugger (gdb) and here is what it says.
Read
<br>
the comments in the script for extra info. Perhaps someone else
<br>
understands this cryptic code from gdb.... looks like library problems
<br>
to me. And as Kilian predicts, when you do not straddle the years the
<br>
script runs right through!
<br>
<br>
#########################
<br>
Config: v1.9b4 32-bit little-endian readline sdf/xdf netcdf lats athena
<br>
printim
<br>
<br>
Issue 'q config' command for more information.
<br>
<br>
Landscape mode? (no for portrait): l
<br>
GX Package Initialization: Size = 11 8.5
<br>
ga-> run t2.gs
<br>
done mag wind
<br>
done slp (one year only)
<br>
done slp (straddle year/files)
<br>
done shum
<br>
<br>
Program received signal SIGSEGV, Segmentation fault.
<br>
0x00a29718 in strcmp () from /lib/tls/libc.so.6
<br>
(gdb)
<br>
<br>
##############################
<br>
<br>
PART II that does work
<br>
##############################
<br>
Config: v1.9b4 32-bit little-endian readline sdf/xdf netcdf lats athena
<br>
printim
<br>
<br>
Issue 'q config' command for more information.
<br>
<br>
Landscape mode? (no for portrait): l
<br>
GX Package Initialization: Size = 11 8.5
<br>
ga-> run t2.gs
<br>
done mag wind
<br>
done slp (one year only)
<br>
done shum
<br>
done all
<br>
No hardcopy metafile open
<br>
GX package terminated
<br>
<br>
Program exited normally.
<br>
(gdb)
<br>
<br>
###################################
<br>
<br>
Maybe a clever person can help the rest of us out here??
<br>
<br>
Regards
<br>
Warren
<br>
<br>
Kilian Hagemann wrote:
<br>
<br>
<blockquote type="cite">Hi guys,
<br>
<br>
I'm getting a very annoying segfault when running the following script:
<br>
<br>
#!/usr/local/grads/bin/gradsnc -lc
<br>
'sdfopen uwnd.sig995.1979.nc uwnd.sig995.%y4.nc 18994'
<br>
'sdfopen vwnd.sig995.1979.nc vwnd.sig995.%y4.nc 18994'
<br>
'set lat -36 -21'
<br>
'set lon 15 34'
<br>
'd ave(mag(uwnd,vwnd.2),t=1,t=1461)'
<br>
<br>
It works when I either set the final t to 1460 or less (length of any
single
<br>
NCEP Reanalysis I file) or leave out the set lat/lon statements.
<br>
<br>
What gives?
<br>
<br>
Using grads-1.9b3, compiled from source(no special tweaks though).
<br>
<br>
--
<br>
Kilian Hagemann
<br>
<br>
Climate Systems Analysis Group
<br>
University of Cape Town
<br>
Republic of South Africa
<br>
Tel(w): ++27 21 650 2748
<br>
<br>
<br>
<br>
</blockquote>
<br>
--
<br>
======================================================================
<br>
Dr Warren J Tennant: Research Scientist
<br>
South African Weather Service, Private Bag X097, Pretoria 0001
<br>
<a class="moz-txt-link-abbreviated" href="mailto:tennant@weathersa.co.za">tennant@weathersa.co.za</a> <a class="moz-txt-link-freetext" href="http://www.weathersa.co.za">http://www.weathersa.co.za</a>
<br>
Tel: 012-367-6004 Fax:+27(0)12-367-6189 Cell: 083-350-9021
<br>
** PHONE 082 162 FOR WEATHER FORECASTS **
<br>
<br>
<pre wrap="">
<hr width="90%" size="4">
* 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'
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Jean Pierre Arabonis
<a class="moz-txt-link-abbreviated" href="mailto:arabonis@egs.uct.ac.za">arabonis@egs.uct.ac.za</a>
Tel 021 780 1021 cell 084 401 1365
This email is 100% Microsoft Free
</pre>
</body>
</html>