I occasionally get incorrect area identifiers produced by conpack
plots (NCAR version 4.1 on a DEC alpha).
I want to fill contour levels with color between a specified set of
levels only.
For example in a plot for wind speeds, I want to color levels
above 20 m/s, leaving the region with speeds below that uncolored. I
set area identifiers for contour level 20 as AIB=0, AIA=1,
next level as AIB=1, AIA=2,
.... last level as AIB=nlevel-1, AIA=0
This usually works, but sometimes the plots color the area below 20
m/s the same color as the region above 20 m/s. The values of AIB,
AIA remain correct when printed out in the code, but if the debug
routine "ardbpa" is called, this shows on the plot that the area
identifiers are 1 both below and above the first 20 m/s contour
level, giving the same color above and below that level.
Can any more diagnostics be run to see why the area identifiers are
changed for the first contour level?
Thanks,
Keith Sashegyi
Code 7531
Naval Research Laboratory
7 Grace Hopper Ave
Monterey CA 93943
-----------------------------------------------------------------------
The following code sets AIB, AIA:
index=2
istep=2
do 105 i=1,nlevel
c contour level
clv=flo+float(i-1)*dci
c define color index used for color bar & shading
if (i.ne.nlevel) then
c define color index array as function of area identifier
lclr(i)=index
endif
call cpseti('PAI - parameter array index',i)
call cpsetr('CLV - contour level values',clv)
c set area identifiers for contour program arscam
ibelow = i-1
iabove = i
if (i.eq.1) ibelow =0
if (i.eq.nlevel) iabove =0
call cpseti('AIB - area identifier below level',ibelow)
call cpseti('AIA - area identifier above level',iabove)
print *, 'i lv AIB AIA index: ', i, clv, ibelow, iabove, index
if (i.lt.nlevel) then
c increment color index
index = index+istep
endif
105 continue
plotting code:
c initialize area map
call arinam(iama,400000)
c add contour lines to area map
call cpclam(d,rwrk,iwrk,iama)
c fill regions with colors
call arscam(iama,xcra,ycra,99000,iaia,igia,ngrps,colram)
c draw contours
call cpcldr(d,rwrk,iwrk)
c debug area identifiers
c call ardbpa(iama,3,'crossing contours')
c draw labels
call cplbdr(d,rwrk,iwrk)
-----------------------------------------------------------
subroutine colram(xcra,ycra,ncra,iaia,igia,naia)
c
c
c***********************************************************************
c dimension statements
c***********************************************************************
c
dimension xcra(*),ycra(*),iaia(*),igia(*)
c
c***********************************************************************
c the arrays xcra and ycra, for indices 1 to ncra, contain
c the x and y coordinates of points defining a polygon.
c the area identifiers in the array iaia, each with an
c associated group identifier in the array igia, tell us
c whether the polygon is to be color-filled or not
c
c group identifier igia=1 for contours
c igia=3 for geographic map
c
c area identifier iaia<0 area outside plotting area
c iaia=0 area identifier not assigned
c iaia>0 addressable areas
c
c***********************************************************************
c
c***********************************************************************
c assume the polygon will be filled until we find otherwise
c***********************************************************************
c
ifll=1
c
c***********************************************************************
c if any of the area identifiers is negative, don't fill
c the polygon
c***********************************************************************
c
do 100 i=1,naia
if (iaia(i).lt.0) ifll=0
100 continue
c
c***********************************************************************
c otherwise, fill the polygon in the color implied by its area
c identifier relative to edge group 3 (the contour-line group)
c***********************************************************************
c
if (ifll.ne.0) then
ifll=0
do 105 i=1,naia
if (igia(i).eq.3) then
ifll=iaia(i)
endif
105 continue
if (ifll.gt.0) then
call gsfaci(indx_colr(ifll))
call gfa(ncra-1,xcra,ycra)
endif
endif
c
c***********************************************************************
c
return
end
c
integer function indx_colr(ifll)
c
c map area identifier ifll to a color index in array lclr
c
integer ifll
common/graf07/lclr(256)
c
indx_colr = lclr(ifll)
c
return
end
c
This archive was generated by hypermail 2b29 : Thu May 24 2001 - 10:35:05 MDT