segmentation fault: gasdf.c:3237, index out of bound

Ryo Furue furue at HAWAII.EDU
Thu Feb 21 04:50:14 EST 2008


Hi Jennifer,

| You will have to provide all the ncdump -c
| output from your file -- maybe this will help me to reproduce the
| error.

I've created a more complete "kit" to reproduce the error:

  http://iprc.soest.hawaii.edu/~furue/tmp/grads-segfault.tar.gz

Download this archive, expand it, descend into the directory,
and run the GrADS script "segfault.gs" contained in it.
The archive is about 370MB.

| As for the positive:down attribute, GrADS was designed with the
| atmosphere in mind, so z=1 is the bottom (close to the surface) and
| z=zmax is at the top.  When your z axis is depth, this orientation
| is maintained, so that the bottom (deepest) level is z=1 and the top
| (shallowest) layer is z=30. That is somewhat opposite to the way
| oceanographers think of the Z (depth) axis, where z=1 is usually at
| or just below the surface.

Does that mean "z" is NOT an index into the underlying array?

After opening my netCDF file (such as the ones contained
in the kit above), this command

  ga-> set lev 5
  ga-> d temp

correctly plots sea surface temperature, and

  ga-> set lev 3845
  ga-> d temp

correctly plots bottom temperature.

So, unless GrADS bothers to transpose the temperature array
on memory, index 1 of the array's 3rd dimension must be
correctly pointing to lev=5, and index 30 must be pointing
to lev=3845, because that's how my array is stored in
my netCDF file.  Therefore, "z" is not an index. . . .

Is there a variable which is a true index into the
underlying array? such as i, j, and k?

Ryo



More information about the gradsusr mailing list