Conpack problem

From: Phil Reid (preid@XXXXXX)
Date: Thu May 29 1997 - 20:15:01 MDT


I am having problems with a section of code that is used in conjunction
with the lblbar routine to produce a labled bar that serves as a key for
filled contour plots.

The problem looks like it is in using the routine CPGETC to return a
character representation of a real. I have used this in several programs
and never had problems with it until now...

The following code is a simplified version of the original code and can
serve as an example. When run the program writes the to screen the real
value of the chosen contours and the character representation of that
real. If run in its current form the character representation is an
integer rather than a real! If the value of x or y is changed to a smaller
value, 5 say, and re-run then the character representation is a real, as
it should be. This makes me think that the problem may not be in CPGETC as
CPGETC does not use x or y. Perhaps it is in CPRECT??

This is most confusing! Anyone have any ideas??

=================
        program testncar
        implicit none
 
        integer ierrf,lunit,iwtype,iwkid,iszdm
        parameter (ierrf=6, lunit=2, iwtype=1, iwkid=1)
 
        integer i,j
        integer x,y
        parameter (y=50,x=50)
        integer large
        parameter (large=500000)
        integer iwrk(large)
        integer ncont
        parameter (ncont=3)
 
        real rdat(x,y)
        real rwrk(large)
        real cont(ncont)
 
        character *5 lab(ncont)
 
c Open graphics
        call gopks(ierrf, iszdm)
        call gopwk(iwkid, lunit, iwtype)
        call gacwk(iwkid)
 
c Set a dummy real data array
        do i=1,x
          do j=1,y
            rdat(i,j)=i*j
          enddo
        enddo
 
c Set a dummy contour array
        do i=1,ncont
          cont(i)=i+(0.1*i)
        enddo
 
c Set number of contours
        call cpseti('cls',0)
        call cpseti('ncl',ncont)
 
c Initialise the drawing of the plot
        call cprect(rdat,x,x,y,rwrk,large,iwrk,large)
 
c Specify contours and labels as per the array cont
        do i=1,ncont
          call cpseti('pai',i)
          call cpsetr('clv',cont(i))
          call cpsetr('zdv',cont(i))
          call cpgetc('zdv',lab(i))
          write(ierrf,*)cont(i)," ",lab(i)
        enddo
 
c Close graphics
        call gdawk(iwkid)
        call gclwk(iwkid)
        call gclks
 
        stop
 
        end

======================================================================
  Phil Reid preid@postoffice.antcrc.utas.edu.au
  Antarctic CRC Phone : (03) 62 267546
  University of Tasmania Fax : (03) 62 262973
  PO Box 252-80 Hobart SST #16
  Tasmania 7001
  Australia http://www.antcrc.utas.edu.au/~preid
======================================================================



This archive was generated by hypermail 2b29 : Wed Jun 28 2000 - 09:45:38 MDT