[gradsusr] Lats4d segemntation fault

James Hughes J.Hughes at lboro.ac.uk
Tue Apr 19 04:46:36 EDT 2011


Good morning, I am using grads to convert ERA operational analysis data from grads format to grib. The data is separated into monthly folders containing 6 hourly ‘snapshots’ comprising a .ctl file a .idx file and a file with no extension. The data can be opened and visualised using grads so as far as I can tell its integrity is not in question. I have written a script to sequentially process the grads files and convert them to grib (shown below) which produces a grib file output for the first time interval but halts with a segmentation fault (shown below script) when it appears to be dealing with the time range. I am new to programming and grads so please be forgiving.

Many thanks

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

d = 1
while (d <= 31)

a = 0
while (a <= 18)

if (d<10)
name = 'lisf96010'd''
e = 0d
else
name = 'lisf9601'd''
e = d
endif
if (a<10)
name = ''name'0'a''
f = 0a
else
name = 'name''a'
f = a
endif
'lats4d -v -i 'name'.ctl -o 9601'd''a'_sf -format grib -table .grads.lats.table -time 'f'Z'e'JAN96 'f'Z'e'JAN96'

a = a + 06
reset

endwhile
d = d + 01

endwhile

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-bash-3.2$ grads

Grid Analysis and Display System (GrADS) Version 2.0.a9.oga.1
Copyright (c) 1988-2010 by Brian Doty and the
Institute for Global Environment and Society (IGES)
GrADS comes with ABSOLUTELY NO WARRANTY
See file COPYRIGHT for more information

Config: v2.0.a9.oga.1 little-endian readline printim grib2 netcdf hdf4-sds hdf5 opendap-grids,stn athena geotiff shapefile
Issue 'q config' command for more detailed configuration information
Loading User Defined Extensions table </usr/local/WRF-NMM/tar_archives/grads-2.0.a9.oga.1/Classic/bin/gex/udxt> ... ok.
Landscape mode? ('n' for portrait):
GX Package Initialization: Size = 11 8.5
ga-> run do
lats4d: Version 2.1.5 of 28 June 2010
No hardcopy metafile open
All files closed; all defined objects released;
All GrADS attributes have been reinitialized
lats4d: Data file is
File 1 : lisf96010100
  Descriptor: lisf96010100.ctl
  Binary: lisf96010100
  Type = Gridded
  Xsize = 144  Ysize = 73  Zsize = 1  Tsize = 1  Esize = 1
  Number of Variables = 21
     no10u  0  165  ** surface 10 metre u wind component m s**-1
     no10v  0  166  ** surface 10 metre v wind component m s**-1
     no2d  0  168  ** surface 2 metre dewpoint temperature K
     no2t  0  167  ** surface 2 metre temperature K
     al  0  174  ** surface Albedo -
     asq  0  233  ** surface Apparent Surface Humidity kg kg**-1
     cdst  0  183  ** Clim deep soil tmp/soil tmp lev3(930804) K
     cdsw  0  184  ** Clim deep soil wet/soil wet lev3(930803) m (of water)
     dst  0  170  ** Deep soil tmp/soil temp lev2(from 930804) K
     dsw  0  171  ** Deep soil wet/soil wet lev2(from 930803) m (of water)
     lsrh  0  234  ** surface Log of surface roughness length for heat -
     msl  0  151  ** surface Mean sea level pressure Pa
     sd  0  141  ** surface Snow depth m (of water equivalent)
     skt  0  235  ** surface Skin Temperature K
     sr  0  173  ** surface Surface roughness m
     src  0  198  ** surface Skin reservoir content m (of water)
     ssw  0  140  ** Surf soil wet/soil wet lev1(from 930803) m (of water)
     st  0  139  ** Surf.temp/soil temp lev 1 (from 930804) K
     stl4  0  236  ** Soil temperature level 4 K
     swl4  0  237  ** Soil wetness level 4 m
     veg  0  199  ** surface Percentage of vegetation %

lats4d: Dimension environment file same as data file
lats4d: time range: 00Z01JAN1996 00Z01JAN1996 by 1, delta t: 6 hourly
lats4d: vertical levels:  1
lats4d: using PRESSURE for vertical coordinate
lats4d: latitudinal  range: -90 90
lats4d: longitudinal range: 0 357.5
lats4d: surface   variables:  no10u no10v no2d no2t al asq cdst cdsw dst dsw lsrh msl sd skt sr src ssw st stl4 swl4 veg
lats4d: writing to grib_only file 960110_sf.grb on 00Z01JAN1996
lats4d: created grib_only file 960110_sf.grb
Most GrADS attributes have been reset
lats4d: Version 2.1.5 of 28 June 2010
No hardcopy metafile open
All files closed; all defined objects released;
All GrADS attributes have been reinitialized
lats4d: Data file is
File 1 : lisf96010106
  Descriptor: lisf96010106.ctl
  Binary: lisf96010106
  Type = Gridded
  Xsize = 144  Ysize = 73  Zsize = 1  Tsize = 1  Esize = 1
  Number of Variables = 21
     no10u  0  165  ** surface 10 metre u wind component m s**-1
     no10v  0  166  ** surface 10 metre v wind component m s**-1
     no2d  0  168  ** surface 2 metre dewpoint temperature K
     no2t  0  167  ** surface 2 metre temperature K
     al  0  174  ** surface Albedo -
     asq  0  233  ** surface Apparent Surface Humidity kg kg**-1
     cdst  0  183  ** Clim deep soil tmp/soil tmp lev3(930804) K
     cdsw  0  184  ** Clim deep soil wet/soil wet lev3(930803) m (of water)
     dst  0  170  ** Deep soil tmp/soil temp lev2(from 930804) K
     dsw  0  171  ** Deep soil wet/soil wet lev2(from 930803) m (of water)
     lsrh  0  234  ** surface Log of surface roughness length for heat -
     msl  0  151  ** surface Mean sea level pressure Pa
     sd  0  141  ** surface Snow depth m (of water equivalent)
     skt  0  235  ** surface Skin Temperature K
     sr  0  173  ** surface Surface roughness m
     src  0  198  ** surface Skin reservoir content m (of water)
     ssw  0  140  ** Surf soil wet/soil wet lev1(from 930803) m (of water)
     st  0  139  ** Surf.temp/soil temp lev 1 (from 930804) K
     stl4  0  236  ** Soil temperature level 4 K
     swl4  0  237  ** Soil wetness level 4 m
     veg  0  199  ** surface Percentage of vegetation %

lats4d: Dimension environment file same as data file
Segmentation fault

James Hughes
Centre for Renewable Energy Systems Technology
Loughborough University
Tel: +44 1509 635312
Email: j.hughes at lboro.ac.uk

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


More information about the gradsusr mailing list