bug/issue with how GrADS plots constant-valued grids

P.Romero romero619 at HOTMAIL.COM
Thu Sep 18 02:51:19 EDT 2008


I have an issue with the way grads plots constant-valued grids.
As an example, lets assume we set up a region within the grid that's
entirely UNDEFINED, and we setup a clev at 0, and a ccols with a color value
of 3, green.
set lat 0 10
set lon 0 100
set gxout shaded
set clevs 0
set ccols 4

and then we try to plot something

d varsfc

As expected, Grads will print the "ENTIRE GRID UNDEFINED" message, and plots
everything in grayscale.
Now, we when we do this.

set lat 0 10
set lon 0 100
set datawarn off
d varsfc

the grid is still entirely undefined, still plotted in grayscale, but with
no message printed.
Next, when we do this.

set lat 0 10
set lon 0 100
d const(varsfc,0,-u)

We get a RED grid, with a message stating "Constant Field. Value=n"
Finally, if we do this..

set lat 0 10
set lon 0 100
set datawarn off
d const(varsfc,0,-u)

... we get NOTHING, Grads basically plots nothing, except for any other
features that were previously defined (axes, labels, map outlines, etc.),
but the data grid is blank. However, in this example, we *should* have had a
plot with all undefined values set to 0 due to the use of the const()
function, and thus plotted in GREEN. Instead, we get a blank plot.

I believe I can see where exactly in the source code this is happening,
within the gacntr function in the gagx.c source file.
I'm most likely going to have to customize the source code if there's no
other way around this (I don't see an obvious work-around).
I wanted to let this be known, in case it's a bug that should be fixed.
Feedback from the developers as to how to make this change in the code would
be appreciated...

Ideally, I guess it would be ok to at least add a flag / option, to
over-ride this behavior, like 'set constfld on/off' to allow for an
all-constant-valued field to be plotted normally, with user-defined
colors/levels/etc., regardless of whether the 'set datawarn off' option has
been set...

P.Romero



More information about the gradsusr mailing list