(tput) 1>/dev/null 2>&1
if [ $? = 1 ]; then
  CLEAR="clear"; export CLEAR
else
  CLEAR="tput clear"; export CLEAR
fi
$CLEAR
echo "
                    Object Access
            Programmer's Reusable Library
                        PLOT
 

  Demo Program Build and Run Procedure
  ====================================
 
  This Procedure will compile and run the library
  demonstration programs.  The library object archive
  file 'libplot.a' must be created, and the
  library environment variable PLOT must be
  defined, prior to performing this Procedure.
 "
echo "  <CR> to Continue"
read answer
if [ "$SYSID" = "" ]; then
$CLEAR
echo "
                    Object Access
            Programmer's Reusable Library
                        PLOT
 

       Select System
      ===============
         1. APOLLO
         2. RISC6K
         3. CONVEX
         4. SGIRIX
         5. SUNOS
         6. UNICOS
         7. HP9000
         8. DECOSF
         9. LINUX
 "
read SYSID; export SYSID
fi
LINK="f77 "; export LINK
FORTRAN=FORTRAN;export FORTRAN
LIBX11="libX11.a";export LIBX11
if [ "$SYSID" = "1" ]; then
  LINK="f77 "
fi
if [ "$SYSID" = "2" ]; then
  LINK='xlf '
fi
if [ "$SYSID" = "3" ]; then
  LINK='fc '
fi
if [ "$SYSID" = "4" ]; then
  LINK='f77 '
fi
if [ "$SYSID" = "5" ]; then
  LINK='f77 '
fi
if [ "$SYSID" = "6" ]; then
  LINK='cf77 -Wl"-D DUPENTRY=IGNORE" '
fi
if [ "$SYSID" = "7" ]; then
  LINK='fort77 '
fi
if [ "$SYSID" = "8" ]; then
  LINK='f77 -taso '
  LIBX11='libX11.so'
  echo " "
fi
if [ "$SYSID" = "9" ]; then
  LINK='g77 -Wunused '
fi
$CLEAR
echo "
 
        Creating demo program source files.
 "
echo "  Generating =====> [ ./AXISLBL.INC ]"
cat <<"STOP_CAT"> ././AXISLBL.INC
C     ------------------Start AXISLBL.INC Include File---------------------
C
C                       AXISLBL Object Hidden Information
C
C
C
      INTEGER   KZXALN, KZYALN, KZXLN3, KZYLN3, KZZLN3, KZXNFL, KZYNFL
     *        , KZXNM3, KZYNM3, KZZNM3, KZXRLB, KZYRLB, KZZRLB
      CHARACTER   KZXLAB*80, KZYLAB*80, KZXLB3*80, KZYLB3*80, KZZLB3*80
C
      COMMON /AXISLBLC/  KZXLAB, KZYLAB, KZXLB3, KZYLB3, KZZLB3
      COMMON /AXISLBL/  KZXALN, KZYALN, KZXLN3, KZYLN3, KZZLN3, KZXNFL
     *        , KZYNFL, KZXNM3, KZYNM3, KZZNM3, KZXRLB, KZYRLB, KZZRLB
C
C     PRIVATE CONSTANTS
C       None
C
C     PRIVATE VARIABLES
C       KZXLAB = 2D X axis label
C                ' '          no X axis label
C       KZYLAB = 2D Y axis label
C                ' '          no Y axis label
C       KZXLB3 = 3D X axis label
C                ' '          no X axis label
C       KZYLB3 = 3D Y axis label
C                ' '          no Y axis label
C       KZZLB3 = 3D Z axis label
C                ' '          no Z axis label
C       KZXALN = length of 2D X axis label
C                0            no X axis label (default)
C                1:80         number of characters in label
C                100          label is self-counting string
C       KZYALN = length of 2D Y axis label
C                0            no Y axis label (default)
C                1:80         number of characters in label
C                100          label is self-counting string
C       KZXLN3 = length of 3D X axis label
C                0            no X axis label (default)
C                1:80         number of characters in label
C                100          label is self-counting string
C       KZYLN3 = length of 3D Y axis label
C                0            no Y axis label (default)
C                1:80         number of characters in label
C                100          label is self-counting string
C       KZZLN3 = length of 3D Z axis label
C                0            no Z axis label (default)
C                1:80         number of characters in label
C                100          label is self-counting string
C       KZXNFL = 2D X axis labeling switch
C                111          Y: label X axis
C                222          N: do not label X axis
C       KZYNFL = 2D Y axis labeling switch
C                111          Y: label Y axis
C                222          N: do not label Y axis
C       KZXNM3 = 3D X axis labeling switch
C                111          Y: label X axis
C                222          N: do not label X axis
C       KZYNM3 = 3D Y axis labeling switch
C                111          Y: label Y axis
C                222          N: do not label Y axis
C       KZZNM3 = 3D Z axis labeling switch
C                111          Y: label Z axis
C                222          N: do not label Z axis
C       KZXRLB = X axis reverse label drawing switch
C                111          Y: draw label on inside edge of axis
C                222          N: draw label on outside edge of axis
C                                (default)
C       KZYRLB = Y axis reverse label drawing switch
C                111          Y: draw label on inside edge of axis
C                222          N: draw label on outside edge of axis
C                                (default)
C       KZZRLB = Z axis reverse label drawing switch
C                111          Y: draw label on inside edge of axis
C                222          N: draw label on outside edge of axis
C                                (default)
C
C     ------------------End AXISLBL.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./AXISNUM.INC ]"
cat <<"STOP_CAT"> ././AXISNUM.INC
C     ------------------Start AXISNUM.INC Include File---------------------
C
C                       AXISNUM Object Hidden Information
C
C
C
      INTEGER   KZXTYP, KZYTYP, KZZTYP, KZXNON, KZYNON, KZZNON
      REAL      ZZXLBA, ZZYLBA, ZZZLBA, CXSIZE
      LOGICAL   IXAXSF, IYAXSF, IZAXSF, IXAXCL, IYAXCL, IZAXCL
C
      COMMON /AXISNUM/  KZXTYP, KZYTYP, KZZTYP, KZXNON, KZYNON
     *        , KZZNON, IXAXSF, IYAXSF, IZAXSF, IXAXCL, IYAXCL, IZAXCL
     *        , ZZXLBA, ZZYLBA, ZZZLBA, CXSIZE
C
C     PRIVATE CONSTANTS
C       None
C
C     PRIVATE VARIABLES
C       KZXTYP = X axis numbering type indicator
C                1            integer axis numbers
C                2            real axis numbers (default)
C                3            logarithmic axis numbers
C       KZYTYP = Y axis numbering type indicator
C                1            integer axis numbers
C                2            real axis numbers (default)
C                3            logarithmic axis numbers
C       KZZTYP = Z axis numbering type indicator
C                1            integer axis numbers
C                2            real axis numbers (default)
C       KZXNON = X axis numbering suppression switch
C                111          Y: suppress axis numbering
C                222          N: draw axis numbers (default)
C       KZYNON = Y axis numbering suppression switch
C                111          Y: suppress axis numbering
C                222          N: draw axis numbers (default)
C       KZZNON = Z axis numbering suppression switch
C                111          Y: suppress axis numbering
C                222          N: draw axis numbers (default)
C       IXAXSF = X axis exponential numbering switch
C                .T.          force exponential format for numbering
C                .F.          choose format based on value (default)
C       IYAXSF = Y axis exponential numbering switch
C                .T.          force exponential format for numbering
C                .F.          choose format based on value (default)
C       IZAXSF = Z axis exponential numbering switch
C                .T.          force exponential format for numbering
C                .F.          choose format based on value (default)
C       IXAXCL = X axis numbering activation switch
C                .T.          axis numbering in progress
C                .F.          axis not now being numbered (default)
C       IYAXCL = Y axis numbering activation switch
C                .T.          axis numbering in progress
C                .F.          axis not now being numbered (default)
C       IZAXCL = Z axis numbering activation switch
C                .T.          axis numbering in progress
C                .F.          axis not now being numbered (default)
C       ZZXLBA = X axis numbering angle, degrees
C                [0.0]        default
C       ZZYLBA = Y axis numbering angle, degrees
C                90.0         default
C       ZZZLBA = Z axis numbering angle, degrees
C                [0.0]        default
C       CXSIZE = average axis number character width, cm
C                             width of character '0'
C
C     ------------------End AXISNUM.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./AXISSCALE.INC ]"
cat <<"STOP_CAT"> ././AXISSCALE.INC
C     ------------------Start AXISSCALE.INC Include File---------------------
C
C                       AXISSCALE Object Hidden Information
C
C
C
      INTEGER   KZASCL
      REAL      XMIN, XMAX, YMIN, YMAX, UX0, UDX, UY0, UDY
      LOGICAL   CROSSZ
C
      COMMON /AXISSCALE/  KZASCL, CROSSZ, XMIN, XMAX, YMIN, YMAX, UX0
     *        , UDX, UY0, UDY
C
C     PRIVATE CONSTANTS
C       None
C
C     PRIVATE VARIABLES
C       KZASCL = autoscale algorithm selector
C                1            use autoscale algorithm #1 (default)
C                2            use autoscale algorithm #2
C                3            use autoscale algorithm #3
C                4            use autoscale algorithm #4
C       CROSSZ = axes cross-at-zero switch
C                .T.          axes drawn at 0.0
C                .F.          axes drawn at min values (default)
C       XMIN   = X axis minimum value, tick-scaled wc
C       XMAX   = X axis maximum value, tick-scaled wc
C       YMIN   = Y axis minimum value, tick-scaled wc
C       YMAX   = Y axis maximum value, tick-scaled wc
C       UX0    = X axis minimum value, tick-scaled wc
C       UDX    = X axis length, tick-scaled wc
C       UY0    = Y axis minimum value, tick-scaled wc
C       UDY    = Y axis length, tick-scaled wc
C
C     ------------------End AXISSCALE.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./AXISTICK.INC ]"
cat <<"STOP_CAT"> ././AXISTICK.INC
C     ------------------Start AXISTICK.INC Include File---------------------
C
C                       AXISTICK Object Hidden Information
C
C
C
      INTEGER   KZMXTK, KZXTCK, KZYTCK, KZZTCK, KZXRTK, KZYRTK, KZZRTK
      REAL      TICKLN
      LOGICAL   XLOGTK, YLOGTK
C
      COMMON /AXISTICK/  KZMXTK, KZXTCK, KZYTCK, KZZTCK, KZXRTK, KZYRTK
     *        , KZZRTK, XLOGTK, YLOGTK, TICKLN
C
C     PRIVATE CONSTANTS
C       None
C
C     PRIVATE VARIABLES
C       KZMXTK = maximum number of major tick marks
C                1:25         user-specified number of ticks
C                0            use computer-generated number of
C                              ticks (default)
C       KZXTCK = number of X axis ticks per step
C                1            default (one tick per step)
C                [0]          do not draw tick marks
C       KZYTCK = number of Y axis ticks per step
C                1            default (one tick per step)
C                [0]          do not draw tick marks
C       KZZTCK = number of Z axis ticks per step
C                1            default (one tick per step)
C                [0]          do not draw tick marks
C       KZXRTK = X axis reverse tick drawing switch
C                111          Y: draw ticks on inside edge of axis
C                222          N: draw ticks on outside edge of axis
C                                (default)
C       KZYRTK = Y axis reverse tick drawing switch
C                111          Y: draw ticks on inside edge of axis
C                222          N: draw ticks on outside edge of axis
C                                (default)
C       KZZRTK = Z axis reverse tick drawing switch
C                111          Y: draw ticks on inside edge of axis
C                222          N: draw ticks on outside edge of axis
C                                (default)
C       XLOGTK = X log axis minor tick supression switch
C                .T.          do not draw minor ticks
C                .F.          draw minor ticks
C       YLOGTK = Y log axis minor tick supression switch
C                .T.          do not draw minor ticks
C                .F.          draw minor ticks (default)
C       TICKLN = length of tick mark, cm
C                [.6*ZZHITE]  default (ZZHITE=character height)
C
C     ------------------End AXISTICK.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./BARCHART.INC ]"
cat <<"STOP_CAT"> ././BARCHART.INC
C     ------------------Start BARCHART.INC Include File---------------------
C
C                       BARCHART Object Hidden Information
C
      INTEGER   KZBRMC
C
      PARAMETER (KZBRMC = 50)
C
      INTEGER   KZBRBL, KZBRGP, KZBRGI, KZBRLT, KZBRLV, KZBRLH, KZBRLO
     *        , KZBRIP, KZBRLR, KZBRFR, KZBRCL, KCBRCL(KZBRMC)
      REAL      ZZBRGP, ZZBRTH
C
      COMMON /BARCHART/  KZBRBL, KZBRGP, KZBRGI, KZBRLT, KZBRLV, KZBRLH
     *        , KZBRLO, KZBRIP, KZBRLR, KZBRFR, KZBRCL, KCBRCL, ZZBRGP
     *        , ZZBRTH
C
C     PRIVATE CONSTANTS
C       KZBRMC = subscript size constant for KCBRCL
C
C     PRIVATE VARIABLES
C       KZBRBL = bar area blanking switch
C                -1           F: do not area blank bars (default)
C                1            T: area blank with bars
C       KZBRGP = number of bars per group
C                1            no bar grouping (default)
C       KZBRGI = most recent bar in a group drawn
C                0            no bar yet drawn (default)
C       KZBRLT = label type for labeling bars
C                0            do not label bars (default)
C                1            use YBOT values
C                2            use YTOP values
C                3            use larger of YBOT or YTOP values
C                4            use smaller of YBOT or YTOP values
C                5            use difference of YTOP-YBOT
C                6            use XBOT values
C       KZBRLV = vertical label location relative to bar
C                1            just above top edge of bar
C                2            just below top edge of bar
C                3            midway between bar top,bottom edges
C                4            just above bottom edge of bar
C                5            just below bottom edge of bar
C       KZBRLH = horiz label location relative to bar
C                1            just left of left edge of bar
C                2            centered between left,right edges bar
C                3            just right of right edge of bar
C       KZBRLO = label orientation relative to a bar
C                1            parallel to bar
C                2            perpendicular to bar
C       KZBRIP = label format for numeric labels
C                -40:-1       exponential with -KZBRIP decimals
C                0:100        floating point with KZBRIP decimals
C                101:140      fixed length format with KZBRIP-100
C                             digits and exponent if necessary
C       KZBRLR = bar label color
C                0            draw label same color as bar (default)
C                1:255        color in which to draw all labels
C       KZBRFR = bar label framing switch
C                0            F: do not frame labels (default)
C                1            T: draw frame around labels
C       KZBRCL = number of bar colors in KCBRCL()
C                0            KCBRCL empty, use current color
C                1:50         use bar colors in KCBRCL
C       KCBRCL = list of colors for drawing bars
C                             (i)=color of i'th bar, 50 max
C       ZZBRGP = distance between bars in a group
C                >0.000001    inches between bars in a group
C                <0.0         distance between bars in a group as
C                              fraction of bar width
C       ZZBRTH = bar thickness or width
C                >.000001     bar thickness in page units
C                -1.0:0.0     bar thickness as fraction of spacing
C                              between first two X or Y values
C                -0.7         default
C
C     ------------------End BARCHART.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./FILLAREA.INC ]"
cat <<"STOP_CAT"> ././FILLAREA.INC
C     ------------------Start FILLAREA.INC Include File---------------------
C
C                       FILLAREA Object Hidden Information
C
      INTEGER   MAXGGG
C
      PARAMETER (MAXGGG = 600)
C
      INTEGER   KZPPAT, KZUPAT
      REAL      ZZHSPC, GX(MAXGGG), GY(MAXGGG)
C
      COMMON /FILLAREA/  KZPPAT, KZUPAT, ZZHSPC, GX, GY
C
C     PRIVATE CONSTANTS
C       MAXGGG = subscript size constant for GX, GY
C
C     PRIVATE VARIABLES
C       KZPPAT = index of current fill pattern
C                0            no fill pattern active
C                1:15         indicated fill pattern active
C       KZUPAT = index of user-specified fill pattern
C                1            user-defined fill pattern not active
C                -19:-1       index of active user-defined pattern
C                -17          blank fill pattern (default)
C       ZZHSPC = distance between shading lines, cm
C       GX    = X coords of curve to fill, wc
C                             (i)=i'th point of curve, 600 max
C       GY    = Y coords of curve to fill, wc
C                             (i)=i'th point of curve, 600 max
C
C     ------------------End FILLAREA.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./LOGPEN2.INC ]"
cat <<"STOP_CAT"> ././LOGPEN2.INC
C     ------------------Start LOGPEN2.INC Include File---------------------
C
C                       LOGPEN2 Object Hidden Information
C
C
C
      INTEGER   IXPOSN, IYPOSN
      REAL      XVPOS, YVPOS, XAPOS, YAPOS
C
      COMMON /LOGPEN2/  IXPOSN, IYPOSN, XVPOS, YVPOS, XAPOS, YAPOS
C
C     PRIVATE CONSTANTS
C       None
C
C     PRIVATE VARIABLES
C       IXPOSN = X coord of current position, device unit
C       IYPOSN = Y coord of current position, device unit
C       XVPOS  = X coord of current position without
C                             rotation, translation, scaling, cm
C       YVPOS  = Y coord of current position without
C                             rotation, translation, scaling, cm
C       XAPOS  = X coord of current position after
C                             rotation, translation, scaling, cm
C       YAPOS  = Y coord of current position after
C                             rotation, translation, scaling, cm
C
C     ------------------End LOGPEN2.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./ORIGIN.INC ]"
cat <<"STOP_CAT"> ././ORIGIN.INC
C     ------------------Start ORIGIN.INC Include File---------------------
C
C                       ORIGIN Object Hidden Information
C
C
C
      INTEGER   KZOR
      REAL      UUXOR, UUYOR, ZZXOR, ZZYOR
C
      COMMON /ORIGINC/  KZOR, UUXOR, UUYOR, ZZXOR, ZZYOR
C
C     PRIVATE CONSTANTS
C       None
C
C     PRIVATE VARIABLES
C       KZOR   = origin location source indicator
C                111          Y: user has defined origin
C                222          N: use default origin
C       UUXOR  = origin X location from left page edge,cm
C                1.27:1.905   default (0.5 or 0.75 inches)
C       UUYOR  = origin X location from left page edge,cm
C                1.27:1.905   default (0.5 or 0.75 inches)
C       ZZXOR  = device-adjusted X origin location, cm
C       ZZYOR  = device-adjusted Y origin location, cm
C
C     ------------------End ORIGIN.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./PAGE.INC ]"
cat <<"STOP_CAT"> ././PAGE.INC
C     ------------------Start PAGE.INC Include File---------------------
C
C                       PAGE Object Hidden Information
C
C
C
      INTEGER   KZBEGN, KZAUTO, KZPAGE, KZSCAL, IVIS
      REAL      UUPAGX, UUPAGY, ZZPAGX, ZZPAGY, ZZPAGR, XCM0, XCM1, YCM0
     *        , YCM1, XCLIPD, YCLIPD, ZZUNIT
C
      COMMON /PAGEC/  KZBEGN, KZAUTO, KZPAGE, KZSCAL, UUPAGX, UUPAGY
     *        , ZZPAGX, ZZPAGY, ZZPAGR, XCM0, XCM1, YCM0, YCM1, IVIS
     *        , XCLIPD, YCLIPD, ZZUNIT
C
C     PRIVATE CONSTANTS
C       None
C
C     PRIVATE VARIABLES
C       KZBEGN = index for beginning of plot
C                111          Y: plot has begun on this page
C                222          N: starting new plot, clear page
C       KZAUTO = page rotation auto-selection switch
C                111          Y: sw auto-selects portrait,landscape
C                                (default)
C                222          N: user selects portrait or landscape
C       KZPAGE = page size source indicator
C                111          Y: user has defined page size
C                222          N: use default page size
C       KZSCAL = oversize plot behavior switch
C                12           clip out-of-bounds objects
C                13           scale down plot to fit device limits
C                14           scale plot to fit device limits
C                15           abort plot if exceeds device limits
C       UUPAGX = user-defined X page size, cm
C                27.94        default (11 inches)
C       UUPAGY = user-defined Y page size, cm
C                21.59        default (8.5 inches)
C       ZZPAGX = device-adjusted X page size, cm
C       ZZPAGY = device-adjusted Y page size, cm
C       ZZPAGR = page ratio multiplier; (device page size
C                             divided by user-def page size)*.95
C                1.0          default value, non-dimensional
C       XCM0   = min X location of clipping boundary from
C                [<ZZPAGX]    page left edge, cm
C       XCM1   = max X location of clipping boundary from
C                [<ZZPAGX]    page left edge, cm
C       YCM0   = min Y location of clipping boundary from
C                [<ZZPAGY]    page bottom edge, cm
C       YCM1   = max Y location of clipping boundary from
C                [<ZZPAGY]    page bottom edge, cm
C       IVIS   = clipped point visibility indicator
C                0            point visible (in clipping boundary)
C                >1           point not visible (clipped)
C       XCLIPD = max X extent of clipping boundary, cm
C       YCLIPD = max Y extent of clipping boundary, cm
C       ZZUNIT = factor for converting page units to cm
C                2.54         cm/in., page units in inches
C                0.1          cm/mm,  page units in mm
C                1.0          cm/cm,  page units in cm
C
C     ------------------End PAGE.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./PLOT2D.INC ]"
cat <<"STOP_CAT"> ././PLOT2D.INC
C     ------------------Start PLOT2D.INC Include File---------------------
C
C                       PLOT2D Object Hidden Information
C
C
C
      REAL      ZZXMIN, ZZXMAX, ZZXSTP, ZZYMIN, ZZYMAX, ZZYSTP
C
      COMMON /PLOT2D/  ZZXMIN, ZZXMAX, ZZXSTP, ZZYMIN, ZZYMAX, ZZYSTP
C
C     PRIVATE CONSTANTS
C       None
C
C     PRIVATE VARIABLES
C       ZZXMIN = X axis minimum value, wc
C       ZZXMAX = X axis maximum value, wc
C       ZZXSTP = X axis step size, wc
C       ZZYMIN = Y axis minimum value, wc
C       ZZYMAX = Y axis maximum value, wc
C       ZZYSTP = Y axis step size, wc
C
C     ------------------End PLOT2D.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./PLOTLOG.INC ]"
cat <<"STOP_CAT"> ././PLOTLOG.INC
C     ------------------Start PLOTLOG.INC Include File---------------------
C
C                       PLOTLOG Object Hidden Information
C
      INTEGER   K2MXAR
C
      PARAMETER (K2MXAR = 2)
C
      REAL      AREA2(K2MXAR)
      LOGICAL   LOGX, LOGY
C
      COMMON /PLOTLOG/  LOGX, LOGY, AREA2
C
C     PRIVATE CONSTANTS
C       K2MXAR = subscript size constant for AREA2
C
C     PRIVATE VARIABLES
C       LOGX   = X log axis indicator
C                .T.          log X axis is being drawn
C                .F.          log X axis not being drawn (default)
C       LOGY   = Y log axis indicator
C                .T.          log X axis is being drawn
C                .F.          log X axis not being drawn (default)
C       AREA2  = log axis attribute storage array for 3D
C                             to 2D projection
C                             (i)=i'th parameter, 2 max
C
C     ------------------End PLOTLOG.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./PLOTPOLR.INC ]"
cat <<"STOP_CAT"> ././PLOTPOLR.INC
C     ------------------Start PLOTPOLR.INC Include File---------------------
C
C                       PLOTPOLR Object Hidden Information
C
C
C
      REAL      PORG
      LOGICAL   PCOORD
C
      COMMON /PLOTPOLR/  PCOORD, PORG
C
C     PRIVATE CONSTANTS
C       None
C
C     PRIVATE VARIABLES
C       PCOORD = polar plot indicator
C                .T.          polar plot is being drawn
C                .F.          polar plot not being drawn (default)
C       PORG   = minimum radius at polor origin, wc
C                [0.0]        default
C
C     ------------------End PLOTPOLR.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./SUBPLOT.INC ]"
cat <<"STOP_CAT"> ././SUBPLOT.INC
C     ------------------Start SUBPLOT.INC Include File---------------------
C
C                       SUBPLOT Object Hidden Information
C
      INTEGER   M_123
C
      PARAMETER (M_123 = 4)
C
      REAL      UUXAXS, UUYAXS, ZZXAXS, ZZYAXS, ZZXLFT, ZZXRGT, ZZYBOT
     *        , ZZYTOP, XVSTRT, YVSTRT, XVLEN, YVLEN, YVINI, ZZXAXR
     *        , ZZYAXR, XS, YS, XT, YT, RCOS, RSIN, BLOWXY, AREA3(M_123)
C
      COMMON /SUBPLOT/  UUXAXS, UUYAXS, ZZXAXS, ZZYAXS, ZZXLFT, ZZXRGT
     *        , ZZYBOT, ZZYTOP, XVSTRT, YVSTRT, XVLEN, YVLEN, YVINI
     *        , ZZXAXR, ZZYAXR, XS, YS, XT, YT, RCOS, RSIN, BLOWXY
     *        , AREA3
C
C     PRIVATE CONSTANTS
C       M_123 = subscript size constant for AREA3
C
C     PRIVATE VARIABLES
C       UUXAXS = length of X axis, cm
C       UUYAXS = length of Y axis, cm
C       ZZXAXS = device-adjusted length of X axis, cm
C       ZZYAXS = device-adjusted length of Y axis, cm
C       ZZXLFT = min X coord of subplot area from left
C                             edge of page, cm
C       ZZXRGT = max Y coord of subplot area from left
C                             edge of page, cm
C       ZZYBOT = min Y coord of subplot area from bottom
C                             edge of page, cm
C       ZZYTOP = max Y coord of subplot area from bottom
C                             edge of page, cm
C       XVSTRT = min X coord of subplot area from left
C                             edge of page, cm
C       YVSTRT = min Y coord of subplot area from bottom
C                             edge of page, cm
C       XVLEN  = width of subplot area, cm
C       YVLEN  = height of subplot area, cm
C       YVINI  = height of subplot area, cm
C       ZZXAXR = distance from origin to right
C                             edge of clipping boundary as fraction
C                             of X axis length, non-dim
C       ZZYAXR = distance from origin to top
C                             edge of clipping boundary as fraction
C                             of Y axis length, non-dim
C       XS     = subplot X blowup scale factor, non-dim
C                1.0          default
C       YS     = subplot Y blowup scale factor, non-dim
C                1.0          default
C       XT     = subplot X translation factor, cm
C                0.0          default
C       YT     = subplot Y translation factor, cm
C                0.0          default
C       RCOS   = cosine of subplot rotation angle
C                1.0          default (0.0 degrees)
C       RSIN   = sine of subplot rotation angle
C                0.0          default (0.0 degrees)
C       BLOWXY = subplot uniform blowup factor, non-dim
C                1.0          default
C       AREA3  = subplot attribute storage array for 3D
C                             to 2D projection
C                             (i)=i'th parameter, 4 max
C
C     ------------------End SUBPLOT.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./VIEWPT.INC ]"
cat <<"STOP_CAT"> ././VIEWPT.INC
C     ------------------Start VIEWPT.INC Include File---------------------
C
C                       VIEWPT Object Hidden Information
C
C
C
      INTEGER   KZVPTP, KZAXXY, KZAXYX, KZAXZX, KZAXZY, KZVWPT
      REAL      ZZVPXI, ZZVPYI, ZZVPZI, ZZVPTX, ZZVPTY, ZZVPTZ
C
      COMMON /VIEWPT/  KZVPTP, KZAXXY, KZAXYX, KZAXZX, KZAXZY, KZVWPT
     *        , ZZVPXI, ZZVPYI, ZZVPZI, ZZVPTX, ZZVPTY, ZZVPTZ
C
C     PRIVATE CONSTANTS
C       None
C
C     PRIVATE VARIABLES
C       KZVPTP = viewpoint location relative to workbox
C                1            -X (left), +Y (behind), +Z (above)
C                2             X within, +Y (behind), +Z (above)
C                3            +X (right),+Y (behind), +Z (above)
C                4            -X (left),  Y within,   +Z (above)
C                5             X within,  Y within,   +Z (above)
C                6            +X (right), Y within,   +Z (above)
C                7            -X (left), -Y (front),  +Z (above)
C                8             X within, -Y (front),  +Z (above)
C                9            +X (right),-Y (front),  +Z (above)
C                11           -X (left), +Y (behind), -Z (below)
C                12            X within, +Y (behind), -Z (below)
C                13           +X (right),+Y (behind), -Z (below)
C                14           -X (left),  Y within,   -Z (below)
C                15            X within,  Y within,   -Z (below)
C                16           +X (right), Y within,   -Z (below)
C                17           -X (left), -Y (front),  -Z (below)
C                18            X within, -Y (front),  -Z (below)
C                19           +X (right),-Y (front),  -Z (below)
C       KZAXXY = ?viewpoint location indicator
C                1            T:
C                -1           F:
C       KZAXYX = ?viewpoint location indicator
C                1            T:
C                -1           F:
C       KZAXZX = ?viewpoint location indicator
C                1            T:
C                -1           F:
C       KZAXZY = ?viewpoint location indicator
C                1            T:
C                -1           F:
C       KZVWPT = viewpoint reference system indicator
C                1            workbox cartesian reference system
C                2            workbox spherical reference system
C                3            user world coordinate ref system
C       ZZVPXI = X-Y angle of viewpoint in workbox
C                             spherical ref sys, degrees
C       ZZVPYI = Z angle of viewpoint in workbox
C                             spherical ref sys, degrees
C       ZZVPZI = radial location of viewpoint in workbox
C                             spherical ref sys, box units
C       ZZVPTX = X location of viewpoint, box units
C       ZZVPTY = Y location of viewpoint, box units
C       ZZVPTZ = Z location of viewpoint, box units
C
C     ------------------End VIEWPT.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./WORKBOX.INC ]"
cat <<"STOP_CAT"> ././WORKBOX.INC
C     ------------------Start WORKBOX.INC Include File---------------------
C
C                       WORKBOX Object Hidden Information
C
      INTEGER   K4MXTX, K3MXTX
C
      PARAMETER (K4MXTX = 4)
      PARAMETER (K3MXTX = 3)
C
      REAL      ZZRATX, ZZRATY, ZZRATZ, ZZMATX(K4MXTX,K3MXTX)
     *        , ZZMATV(K4MXTX,K3MXTX), ZZVOLX, ZZVOLY, ZZVOLZ, ZZ3WSZ
     *        , ZZXWO3, ZZYWO3, ZZ3VSZ, ZZXVO3, ZZYVO3
C
      COMMON /WORKBOX/  ZZRATX, ZZRATY, ZZRATZ, ZZMATX, ZZMATV, ZZVOLX
     *        , ZZVOLY, ZZVOLZ, ZZ3WSZ, ZZXWO3, ZZYWO3, ZZ3VSZ, ZZXVO3
     *        , ZZYVO3
C
C     PRIVATE CONSTANTS
C       K4MXTX = first  subscript size for ZZMATX, ZZMATV
C       K3MXTX = second subscript size for ZZMATX, ZZMATV
C
C     PRIVATE VARIABLES
C       ZZRATX = ratio of X workbox length to
C                             X axis length, non-dim
C       ZZRATY = ratio of Y workbox length to
C                             Y axis length, non-dim
C       ZZRATZ = ratio of Z workbox length to
C                             Z axis length, non-dim
C       ZZMATX = 3D to 2D transform matrix, box units
C                             (i,)=matrix element for ?, size=4
C                             (,j)=matrix element for X,Y,Z, size=3
C       ZZMATV = 3D to 2D transform matrix, box units
C                             (i,)=matrix element for ?, size=4
C                             (,j)=matrix element for X,Y,Z, size=3
C       ZZVOLX = X workbox size, box units
C       ZZVOLY = Y workbox size, box units
C       ZZVOLZ = Z workbox size, box units
C       ZZ3WSZ = ?min length of 2D projection of workbox
C       ZZXWO3 = ?X length of 2D projection of workbox
C       ZZYWO3 = ?Y length of 2D projection of workbox
C       ZZ3VSZ = ?min length of 2D projection of workbox
C       ZZXVO3 = ?X length of 2D projection of workbox
C       ZZYVO3 = ?Y length of 2D projection of workbox
C
C     ------------------End WORKBOX.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./_plot.tk ]"
cat <<"STOP_CAT"> ././_plot.tk
#!/tmp/tk/usr/X386/bin/wish -f
#
#       Programmer's Reusable Library, Version 0.7      (TM)
#
#            Copyright (C) 1995 Object Access (SM)
#
#     Permission is granted to any individual or institution
#     to use, copy, modify, and distribute this single program
#     unit, provided that this complete copyright and
#     permission notice is maintained, intact, in all copies.
#
#     Object Access Incorporated provides this software
#     "as is" without express or implied warranty.
#
#     PURPOSE: Demonstrate features of the PRL-PLOT library
#
#     NOTES:
#
#     ******************************************************************
#
#                       Define window title
#
set auto_path "$tk_library/demos $auto_path"
wm title . "PRL-PLOT Demonstration"
#
#     ******************************************************************
#
#                       Create the main window, consisting of a menu
#                       bar and a message explaining the basic operation
#                       of the program
#
frame .menu -relief raised -borderwidth 1
#
message .msg -font -Adobe-times-medium-r-normal--*-180* -relief raised \
-width 650 -borderwidth 1 -text \
"This window demonstrates the Programmer's Reuseable Library \
PRL-PLOT, Version 0.7 \
using a graphical user interface provided by the Tk toolkit.
 
To invoke a demonstration, press the left mouse button over one of the \
menu buttons, drag the mouse to the desired menu file, then release the \
mouse button.
 
The Demo menu tells more about using this window.
The More menu has more information about PRL-PLOT.
 
To exit, select the \"Quit\" option in the Demo menu.
 
----------------------------------------------------------
 
Copyright (C) 1995 Object Access (SM)
 
Permission is granted to any individual or institution \
to use, copy, modify, and distribute this single program \
unit, provided that this complete copyright and \
permission notice is maintained, intact, in all copies.
 
Object Access Incorporated provides this software \
\"as is\" without express or implied warranty."
#
pack .menu -side top -fill x
pack .msg -side bottom -expand yes -fill both
#
#     ******************************************************************
#
#                       DEFINE MENUS FOR TOP MENU ROW
#
#     ******************************************************************
#
#                       "Demo" menu
#
menubutton .menu.demo -text "Demo " -menu .menu.demo.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.demo.m
#
#                       "Tear-off menus" button
.menu.demo.m add command -label "Tear-off menus" -command mkTear
#
#                       "Quit" button
.menu.demo.m add command -label "Quit" -command "destroy ."
#
#     ******************************************************************
#
#                       "PRL" menu
#
menubutton .menu.prl -text "PRL " -menu .menu.prl.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.prl.m
#
#                       "prl1" button
.menu.prl.m add command -label "prl1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e prl1.x }
#
#     ******************************************************************
#
#                       "DEVICE" menu
#
menubutton .menu.device -text "DEVICE " -menu .menu.device.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.device.m
#
#                       "device1" button
.menu.device.m add command -label "device1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e device1.x }
#
#     ******************************************************************
#
#                       "PLOT" menu
#
menubutton .menu.plot -text "PLOT " -menu .menu.plot.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.plot.m
#
#                       "plot1" button
.menu.plot.m add command -label "plot1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plot1.x }
#
#     ******************************************************************
#
#                       "Graph_Setup" menu
#
menubutton .menu.setup -text "Graph_Setup " -menu .menu.setup.m
#
#     ******************************************************************
#
                        menu .menu.setup.m
#
#                       "PAGE" menu
#
.menu.setup.m add cascade -label "PAGE" -menu .menu.setup.page
#
#     ------------------------------------------------------------------
#
                        menu .menu.setup.page
#
#                       "page1" button
.menu.setup.page add command -label "page1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e page1.x }
#
#                       "page2" button
.menu.setup.page add command -label "page2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e page2.x }
#
#                       "page3" button
.menu.setup.page add command -label "page3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e page3.x }
#
#                       "page4" button
.menu.setup.page add command -label "page4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e page4.x }
#
#     ******************************************************************
#
#                       "ORIGIN" menu
#
.menu.setup.m add cascade -label "ORIGIN" -menu .menu.setup.origin
#
#     ------------------------------------------------------------------
#
                        menu .menu.setup.origin
#
#                       "origin1" button
.menu.setup.origin add command -label "origin1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e origin1.x }
#
#     ******************************************************************
#
#                       "SUBPLOT" menu
#
.menu.setup.m add cascade -label "SUBPLOT" -menu .menu.setup.subplot
#
#     ------------------------------------------------------------------
#
                        menu .menu.setup.subplot
#
#                       "subplot1" button
.menu.setup.subplot add command -label "subplot1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e subplot1.x }
#
#     ******************************************************************
#
#                       "Axes_Setup" menu
#
menubutton .menu.axes -text "Axes_Setup " -menu .menu.axes.m
#
#     ******************************************************************
#
                        menu .menu.axes.m
#
#                       "AXISLBL" menu
#
.menu.axes.m add cascade -label "AXISLBL" -menu .menu.axes.axislbl
#
#     ------------------------------------------------------------------
#
                        menu .menu.axes.axislbl
#
#                       "axislbl1" button
.menu.axes.axislbl add command -label "axislbl1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axislbl1.x }
#
#                       "axislbl2" button
.menu.axes.axislbl add command -label "axislbl2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axislbl2.x }
#
#     ******************************************************************
#
#                       "AXISNUM" menu
#
.menu.axes.m add cascade -label "AXISNUM" -menu .menu.axes.axisnum
#
#     ------------------------------------------------------------------
#
                        menu .menu.axes.axisnum
#
#                       "axisnum1" button
.menu.axes.axisnum add command -label "axisnum1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axisnum1.x }
#
#                       "axisnum2" button
.menu.axes.axisnum add command -label "axisnum2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axisnum2.x }
#
#                       "axisnum3" button
.menu.axes.axisnum add command -label "axisnum3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axisnum3.x }
#
#                       "axisnum4" button
.menu.axes.axisnum add command -label "axisnum4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axisnum4.x }
#
#                       "axisnum5" button
.menu.axes.axisnum add command -label "axisnum5" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axisnum5.x }
#
#     ******************************************************************
#
#                       "AXISSCALE" menu
#
.menu.axes.m add cascade -label "AXISSCALE" -menu .menu.axes.axisscale
#
#     ------------------------------------------------------------------
#
                        menu .menu.axes.axisscale
#
#                       "axisscale1" button
.menu.axes.axisscale add command -label "axisscale1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axisscale1.x }
#
#                       "axisscale2" button
.menu.axes.axisscale add command -label "axisscale2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axisscale2.x }
#
#                       "axisscale3" button
.menu.axes.axisscale add command -label "axisscale3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axisscale3.x }
#
#                       "axisscale4" button
.menu.axes.axisscale add command -label "axisscale4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axisscale4.x }
#
#                       "axisscale5" button
.menu.axes.axisscale add command -label "axisscale5" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axisscale5.x }
#
#     ******************************************************************
#
#                       "AXISTICK" menu
#
.menu.axes.m add cascade -label "AXISTICK" -menu .menu.axes.axistick
#
#     ------------------------------------------------------------------
#
                        menu .menu.axes.axistick
#
#                       "axistick1" button
.menu.axes.axistick add command -label "axistick1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axistick1.x }
#
#                       "axistick2" button
.menu.axes.axistick add command -label "axistick2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axistick2.x }
#
#                       "axistick3" button
.menu.axes.axistick add command -label "axistick3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axistick3.x }
#
#                       "axistick4" button
.menu.axes.axistick add command -label "axistick4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axistick4.x }
#
#                       "axistick5" button
.menu.axes.axistick add command -label "axistick5" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axistick5.x }
#
#                       "axistick6" button
.menu.axes.axistick add command -label "axistick6" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e axistick6.x }
#
#     ******************************************************************
#
#                       "GRID" menu
#
.menu.axes.m add cascade -label "GRID" -menu .menu.axes.grid
#
#     ------------------------------------------------------------------
#
                        menu .menu.axes.grid
#
#                       "grid1" button
.menu.axes.grid add command -label "grid1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e grid1.x }
#
#     ******************************************************************
#
#                       "PLOT2D" menu
#
.menu.axes.m add cascade -label "PLOT2D" -menu .menu.axes.plot2d
#
#     ------------------------------------------------------------------
#
                        menu .menu.axes.plot2d
#
#                       "plot2d1" button
.menu.axes.plot2d add command -label "plot2d1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plot2d1.x }
#
#                       "plot2d2" button
.menu.axes.plot2d add command -label "plot2d2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plot2d2.x }
#
#     ******************************************************************
#
#                       "PLOT3D" menu
#
.menu.axes.m add cascade -label "PLOT3D" -menu .menu.axes.plot3d
#
#     ------------------------------------------------------------------
#
                        menu .menu.axes.plot3d
#
#                       "plot3d1" button
.menu.axes.plot3d add command -label "plot3d1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plot3d1.x }
#
#                       "plot3d2" button
.menu.axes.plot3d add command -label "plot3d2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plot3d2.x }
#
#     ******************************************************************
#
#                       "PLOTLOG" menu
#
.menu.axes.m add cascade -label "PLOTLOG" -menu .menu.axes.plotlog
#
#     ------------------------------------------------------------------
#
                        menu .menu.axes.plotlog
#
#                       "plotlog1" button
.menu.axes.plotlog add command -label "plotlog1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plotlog1.x }
#
#                       "plotlog2" button
.menu.axes.plotlog add command -label "plotlog2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plotlog2.x }
#
#                       "plotlog3" button
.menu.axes.plotlog add command -label "plotlog3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plotlog3.x }
#
#                       "plotlog4" button
.menu.axes.plotlog add command -label "plotlog4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plotlog4.x }
#
#                       "plotlog5" button
.menu.axes.plotlog add command -label "plotlog5" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plotlog5.x }
#
#                       "plotlog6" button
.menu.axes.plotlog add command -label "plotlog6" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plotlog6.x }
#
#                       "plotlog7" button
.menu.axes.plotlog add command -label "plotlog7" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plotlog7.x }
#
#     ******************************************************************
#
#                       "PLOTPOLR" menu
#
.menu.axes.m add cascade -label "PLOTPOLR" -menu .menu.axes.plotpolr
#
#     ------------------------------------------------------------------
#
                        menu .menu.axes.plotpolr
#
#                       "plotpolr1" button
.menu.axes.plotpolr add command -label "plotpolr1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plotpolr1.x }
#
#                       "plotpolr2" button
.menu.axes.plotpolr add command -label "plotpolr2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plotpolr2.x }
#
#                       "plotpolr3" button
.menu.axes.plotpolr add command -label "plotpolr3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plotpolr3.x }
#
#     ******************************************************************
#
#                       "PLOTSPHER" menu
#
.menu.axes.m add cascade -label "PLOTSPHER" -menu .menu.axes.plotspher
#
#     ------------------------------------------------------------------
#
                        menu .menu.axes.plotspher
#
#                       "plotspher1" button
.menu.axes.plotspher add command -label "plotspher1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plotspher1.x }
#
#     ******************************************************************
#
#                       "VIEWPT" menu
#
.menu.axes.m add cascade -label "VIEWPT" -menu .menu.axes.viewpt
#
#     ------------------------------------------------------------------
#
                        menu .menu.axes.viewpt
#
#                       "viewpt1" button
.menu.axes.viewpt add command -label "viewpt1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e viewpt1.x }
#
#                       "viewpt2" button
.menu.axes.viewpt add command -label "viewpt2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e viewpt2.x }
#
#                       "viewpt3" button
.menu.axes.viewpt add command -label "viewpt3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e viewpt3.x }
#
#     ******************************************************************
#
#                       "WCOORD2" menu
#
.menu.axes.m add cascade -label "WCOORD2" -menu .menu.axes.wcoord2
#
#     ------------------------------------------------------------------
#
                        menu .menu.axes.wcoord2
#
#                       "wcoord21" button
.menu.axes.wcoord2 add command -label "wcoord21" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e wcoord21.x }
#
#                       "wcoord22" button
.menu.axes.wcoord2 add command -label "wcoord22" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e wcoord22.x }
#
#                       "wcoord23" button
.menu.axes.wcoord2 add command -label "wcoord23" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e wcoord23.x }
#
#                       "wcoord24" button
.menu.axes.wcoord2 add command -label "wcoord24" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e wcoord24.x }
#
#     ******************************************************************
#
#                       "WORKBOX" menu
#
.menu.axes.m add cascade -label "WORKBOX" -menu .menu.axes.workbox
#
#     ------------------------------------------------------------------
#
                        menu .menu.axes.workbox
#
#                       "workbox1" button
.menu.axes.workbox add command -label "workbox1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e workbox1.x }
#
#     ******************************************************************
#
#                       "Line_Drawing" menu
#
menubutton .menu.line -text "Line_Drawing " -menu .menu.line.m
#
#     ******************************************************************
#
                        menu .menu.line.m
#
#                       "CURVE2D" menu
#
.menu.line.m add cascade -label "CURVE2D" -menu .menu.line.curve2d
#
#     ------------------------------------------------------------------
#
                        menu .menu.line.curve2d
#
#                       "curve2d1" button
.menu.line.curve2d add command -label "curve2d1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e curve2d1.x }
#
#                       "curve2d2" button
.menu.line.curve2d add command -label "curve2d2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e curve2d2.x }
#
#                       "curve2d3" button
.menu.line.curve2d add command -label "curve2d3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e curve2d3.x }
#
#     ******************************************************************
#
#                       "CURVE3D" menu
#
.menu.line.m add cascade -label "CURVE3D" -menu .menu.line.curve3d
#
#     ------------------------------------------------------------------
#
                        menu .menu.line.curve3d
#
#                       "curve3d1" button
.menu.line.curve3d add command -label "curve3d1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e curve3d1.x }
#
#     ******************************************************************
#
#                       "FILLAREA" menu
#
.menu.line.m add cascade -label "FILLAREA" -menu .menu.line.fillarea
#
#     ------------------------------------------------------------------
#
                        menu .menu.line.fillarea
#
#                       "fillarea1" button
.menu.line.fillarea add command -label "fillarea1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e fillarea1.x }
#
#                       "fillarea2" button
.menu.line.fillarea add command -label "fillarea2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e fillarea2.x }
#
#                       "fillarea3" button
.menu.line.fillarea add command -label "fillarea3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e fillarea3.x }
#
#                       "fillarea4" button
.menu.line.fillarea add command -label "fillarea4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e fillarea4.x }
#
#     ******************************************************************
#
#                       "LEGEND" menu
#
.menu.line.m add cascade -label "LEGEND" -menu .menu.line.legend
#
#     ------------------------------------------------------------------
#
                        menu .menu.line.legend
#
#                       "legend1" button
.menu.line.legend add command -label "legend1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e legend1.x }
#
#                       "legend2" button
.menu.line.legend add command -label "legend2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e legend2.x }
#
#                       "legend3" button
.menu.line.legend add command -label "legend3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e legend3.x }
#
#                       "legend4" button
.menu.line.legend add command -label "legend4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e legend4.x }
#
#                       "legend5" button
.menu.line.legend add command -label "legend5" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e legend5.x }
#
#     ******************************************************************
#
#                       "LOCATOR" menu
#
.menu.line.m add cascade -label "LOCATOR" -menu .menu.line.locator
#
#     ------------------------------------------------------------------
#
                        menu .menu.line.locator
#
#                       "locator1" button
.menu.line.locator add command -label "locator1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e locator1.x }
#
#     ******************************************************************
#
#                       "LOGPEN2" menu
#
.menu.line.m add cascade -label "LOGPEN2" -menu .menu.line.logpen2
#
#     ------------------------------------------------------------------
#
                        menu .menu.line.logpen2
#
#                       "logpen21" button
.menu.line.logpen2 add command -label "logpen21" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e logpen21.x }
#
#     ******************************************************************
#
#                       "VEC2" menu
#
.menu.line.m add cascade -label "VEC2" -menu .menu.line.vec2
#
#     ------------------------------------------------------------------
#
                        menu .menu.line.vec2
#
#                       "vec21" button
.menu.line.vec2 add command -label "vec21" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e vec21.x }
#
#                       "vec22" button
.menu.line.vec2 add command -label "vec22" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e vec22.x }
#
#                       "vec23" button
.menu.line.vec2 add command -label "vec23" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e vec23.x }
#
#                       "vec24" button
.menu.line.vec2 add command -label "vec24" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e vec24.x }
#
#     ******************************************************************
#
#                       "VEC3" menu
#
.menu.line.m add cascade -label "VEC3" -menu .menu.line.vec3
#
#     ------------------------------------------------------------------
#
                        menu .menu.line.vec3
#
#                       "vec31" button
.menu.line.vec3 add command -label "vec31" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e vec31.x }
#
#     ******************************************************************
#
#                       "Char_Drawing" menu
#
menubutton .menu.char -text "Char_Drawing " -menu .menu.char.m
#
#     ******************************************************************
#
                        menu .menu.char.m
#
#                       "INT" menu
#
.menu.char.m add cascade -label "INT" -menu .menu.char.int
#
#     ------------------------------------------------------------------
#
                        menu .menu.char.int
#
#                       "int1" button
.menu.char.int add command -label "int1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e int1.x }
#
#                       "int2" button
.menu.char.int add command -label "int2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e int2.x }
#
#     ******************************************************************
#
#                       "PACKARY" menu
#
.menu.char.m add cascade -label "PACKARY" -menu .menu.char.packary
#
#     ------------------------------------------------------------------
#
                        menu .menu.char.packary
#
#                       "packary1" button
.menu.char.packary add command -label "packary1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e packary1.x }
#
#                       "packary2" button
.menu.char.packary add command -label "packary2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e packary2.x }
#
#                       "packary3" button
.menu.char.packary add command -label "packary3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e packary3.x }
#
#                       "packary4" button
.menu.char.packary add command -label "packary4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e packary4.x }
#
#                       "packary5" button
.menu.char.packary add command -label "packary5" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e packary5.x }
#
#     ******************************************************************
#
#                       "REAL" menu
#
.menu.char.m add cascade -label "REAL" -menu .menu.char.real
#
#     ------------------------------------------------------------------
#
                        menu .menu.char.real
#
#                       "real1" button
.menu.char.real add command -label "real1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e real1.x }
#
#                       "real2" button
.menu.char.real add command -label "real2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e real2.x }
#
#     ******************************************************************
#
#                       "TEXT2D" menu
#
.menu.char.m add cascade -label "TEXT2D" -menu .menu.char.text2d
#
#     ------------------------------------------------------------------
#
                        menu .menu.char.text2d
#
#                       "text2d1" button
.menu.char.text2d add command -label "text2d1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e text2d1.x }
#
#                       "text2d2" button
.menu.char.text2d add command -label "text2d2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e text2d2.x }
#
#     ******************************************************************
#
#                       "Chart_Drawing" menu
#
menubutton .menu.chart -text "Chart_Drawing " -menu .menu.chart.m
#
#     ******************************************************************
#
                        menu .menu.chart.m
#
#                       "BARCHART" menu
#
.menu.chart.m add cascade -label "BARCHART" -menu .menu.chart.barchart
#
#     ------------------------------------------------------------------
#
                        menu .menu.chart.barchart
#
#                       "barchart1" button
.menu.chart.barchart add command -label "barchart1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e barchart1.x }
#
#                       "barchart2" button
.menu.chart.barchart add command -label "barchart2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e barchart2.x }
#
#                       "barchart3" button
.menu.chart.barchart add command -label "barchart3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e barchart3.x }
#
#                       "barchart4" button
.menu.chart.barchart add command -label "barchart4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e barchart4.x }
#
#                       "barchart5" button
.menu.chart.barchart add command -label "barchart5" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e barchart5.x }
#
#                       "barchart6" button
.menu.chart.barchart add command -label "barchart6" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e barchart6.x }
#
#     ******************************************************************
#
#                       "PIECHART" menu
#
.menu.chart.m add cascade -label "PIECHART" -menu .menu.chart.piechart
#
#     ------------------------------------------------------------------
#
                        menu .menu.chart.piechart
#
#                       "piechart1" button
.menu.chart.piechart add command -label "piechart1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e piechart1.x }
#
#                       "piechart2" button
.menu.chart.piechart add command -label "piechart2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e piechart2.x }
#
#                       "piechart3" button
.menu.chart.piechart add command -label "piechart3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e piechart3.x }
#
#                       "piechart4" button
.menu.chart.piechart add command -label "piechart4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e piechart4.x }
#
#                       "piechart5" button
.menu.chart.piechart add command -label "piechart5" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e piechart5.x }
#
#                       "piechart6" button
.menu.chart.piechart add command -label "piechart6" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e piechart6.x }
#
#     ******************************************************************
#
#                       "PROCESS" menu
#
menubutton .menu.process -text "PROCESS " -menu .menu.process.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.process.m
#
#                       "process1" button
.menu.process.m add command -label "process1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e process1.x }
#
#     ******************************************************************
#
#                       "More" menu
#
menubutton .menu.more -text "More" -menu .menu.more.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.more.m
#
#                       "MENU Definitions" button
.menu.more.m add cascade -label "MENU Definitions" -menu .menu.more.defs
#
#     ------------------------------------------------------------------
#
                        menu .menu.more.defs
#
#                       "AXISLBL" button
.menu.more.defs add command -label "AXISLBL" -command \
{ mkDialog .modal {-text \
{The AXISLBL menu invokes demonstrations of the PRL-PLOT \
AXISLBL object subprograms.  The AXISLBL object is \
a text string near an axis identifying the quantity represented by the axis. \
} -aspect 450 -justify left} {OK {}}
}
#                       "AXISNUM" button
.menu.more.defs add command -label "AXISNUM" -command \
{ mkDialog .modal {-text \
{The AXISNUM menu invokes demonstrations of the PRL-PLOT \
AXISNUM object subprograms.  The AXISNUM object is \
a text string adjacent to an axis tick mark identifying the tick coordinate. \
} -aspect 450 -justify left} {OK {}}
}
#                       "AXISSCALE" button
.menu.more.defs add command -label "AXISSCALE" -command \
{ mkDialog .modal {-text \
{The AXISSCALE menu invokes demonstrations of the PRL-PLOT \
AXISSCALE object subprograms.  The AXISSCALE object is \
a mapping between a world coordinate system and an axis of specified length. \
} -aspect 450 -justify left} {OK {}}
}
#                       "AXISTICK" button
.menu.more.defs add command -label "AXISTICK" -command \
{ mkDialog .modal {-text \
{The AXISTICK menu invokes demonstrations of the PRL-PLOT \
AXISTICK object subprograms.  The AXISTICK object is \
a short line segment drawn perpendicular to, and intersecting, an axis. \
} -aspect 450 -justify left} {OK {}}
}
#                       "BARCHART" button
.menu.more.defs add command -label "BARCHART" -command \
{ mkDialog .modal {-text \
{The BARCHART menu invokes demonstrations of the PRL-PLOT \
BARCHART object subprograms.  The BARCHART object is \
rectangular bars perpendicular to an axis showing relative magnitudes of values.
} -aspect 450 -justify left} {OK {}}
}
#                       "CURVE2D" button
.menu.more.defs add command -label "CURVE2D" -command \
{ mkDialog .modal {-text \
{The CURVE2D menu invokes demonstrations of the PRL-PLOT \
CURVE2D object subprograms.  The CURVE2D object is \
a locus through two or more 2D points defined by an interpolation method. \
} -aspect 450 -justify left} {OK {}}
}
#                       "CURVE3D" button
.menu.more.defs add command -label "CURVE3D" -command \
{ mkDialog .modal {-text \
{The CURVE3D menu invokes demonstrations of the PRL-PLOT \
CURVE3D object subprograms.  The CURVE3D object is \
a locus through two or more 3D points defined by an interpolation method. \
} -aspect 450 -justify left} {OK {}}
}
#                       "DEVICE" button
.menu.more.defs add command -label "DEVICE" -command \
{ mkDialog .modal {-text \
{The DEVICE menu invokes demonstrations of the PRL-PLOT \
DEVICE object subprograms.  The DEVICE object is \
the parent object for all other PRL-DEVICE objects. \
} -aspect 450 -justify left} {OK {}}
}
#                       "FILLAREA" button
.menu.more.defs add command -label "FILLAREA" -command \
{ mkDialog .modal {-text \
{The FILLAREA menu invokes demonstrations of the PRL-PLOT \
FILLAREA object subprograms.  The FILLAREA object is \
an area between two curves, or a curve and a subplot edge, filled with a pattern
} -aspect 450 -justify left} {OK {}}
}
#                       "GRID" button
.menu.more.defs add command -label "GRID" -command \
{ mkDialog .modal {-text \
{The GRID menu invokes demonstrations of the PRL-PLOT \
GRID object subprograms.  The GRID object is \
a set of lines perpendicular to the axes keyed to the axis tick marks. \
} -aspect 450 -justify left} {OK {}}
}
#                       "INT" button
.menu.more.defs add command -label "INT" -command \
{ mkDialog .modal {-text \
{The INT menu invokes demonstrations of the PRL-PLOT \
INT object subprograms.  The INT object is \
an exact representation of an integral integer value. \
} -aspect 450 -justify left} {OK {}}
}
#                       "LEGEND" button
.menu.more.defs add command -label "LEGEND" -command \
{ mkDialog .modal {-text \
{The LEGEND menu invokes demonstrations of the PRL-PLOT \
LEGEND object subprograms.  The LEGEND object is \
a block of labeled line styles identifying the curves of a subplot. \
} -aspect 450 -justify left} {OK {}}
}
#                       "LOCATOR" button
.menu.more.defs add command -label "LOCATOR" -command \
{ mkDialog .modal {-text \
{The LOCATOR menu invokes demonstrations of the PRL-PLOT \
LOCATOR object subprograms.  The LOCATOR object is \
a device that provides coordinate information for a view surface location. \
} -aspect 450 -justify left} {OK {}}
}
#                       "LOGPEN2" button
.menu.more.defs add command -label "LOGPEN2" -command \
{ mkDialog .modal {-text \
{The LOGPEN2 menu invokes demonstrations of the PRL-PLOT \
LOGPEN2 object subprograms.  The LOGPEN2 object is \
the 2D drawing cursor or logical pen. \
} -aspect 450 -justify left} {OK {}}
}
#                       "ORIGIN" button
.menu.more.defs add command -label "ORIGIN" -command \
{ mkDialog .modal {-text \
{The ORIGIN menu invokes demonstrations of the PRL-PLOT \
ORIGIN object subprograms.  The ORIGIN object is \
the lower left-hand corner of a subplot. \
} -aspect 450 -justify left} {OK {}}
}
#                       "PACKARY" button
.menu.more.defs add command -label "PACKARY" -command \
{ mkDialog .modal {-text \
{The PACKARY menu invokes demonstrations of the PRL-PLOT \
PACKARY object subprograms.  The PACKARY object is \
a block of one or more numbered text strings stored in an integer array. \
} -aspect 450 -justify left} {OK {}}
}
#                       "PAGE" button
.menu.more.defs add command -label "PAGE" -command \
{ mkDialog .modal {-text \
{The PAGE menu invokes demonstrations of the PRL-PLOT \
PAGE object subprograms.  The PAGE object is \
a drawing surface of fixed size. \
} -aspect 450 -justify left} {OK {}}
}
#                       "PIECHART" button
.menu.more.defs add command -label "PIECHART" -command \
{ mkDialog .modal {-text \
{The PIECHART menu invokes demonstrations of the PRL-PLOT \
PIECHART object subprograms.  The PIECHART object is \
pie-shaped wedges subdividing a circle showing relative magnitudes of values. \
} -aspect 450 -justify left} {OK {}}
}
#                       "PLOT" button
.menu.more.defs add command -label "PLOT" -command \
{ mkDialog .modal {-text \
{The PLOT menu invokes demonstrations of the PRL-PLOT \
PLOT object subprograms.  The PLOT object is \
the parent object for all other PRL-PLOT objects. \
} -aspect 450 -justify left} {OK {}}
}
#                       "PLOT2D" button
.menu.more.defs add command -label "PLOT2D" -command \
{ mkDialog .modal {-text \
{The PLOT2D menu invokes demonstrations of the PRL-PLOT \
PLOT2D object subprograms.  The PLOT2D object is \
a plot referenced to 2D axes scaled for linear world coordinates. \
} -aspect 450 -justify left} {OK {}}
}
#                       "PLOT3D" button
.menu.more.defs add command -label "PLOT3D" -command \
{ mkDialog .modal {-text \
{The PLOT3D menu invokes demonstrations of the PRL-PLOT \
PLOT3D object subprograms.  The PLOT3D object is \
a plot referenced to 3D axes scaled for linear world coordinates. \
} -aspect 450 -justify left} {OK {}}
}
#                       "PLOTLOG" button
.menu.more.defs add command -label "PLOTLOG" -command \
{ mkDialog .modal {-text \
{The PLOTLOG menu invokes demonstrations of the PRL-PLOT \
PLOTLOG object subprograms.  The PLOTLOG object is \
a plot referenced to 2D axes scaled for logarithmic world coordinates. \
} -aspect 450 -justify left} {OK {}}
}
#                       "PLOTPOLR" button
.menu.more.defs add command -label "PLOTPOLR" -command \
{ mkDialog .modal {-text \
{The PLOTPOLR menu invokes demonstrations of the PRL-PLOT \
PLOTPOLR object subprograms.  The PLOTPOLR object is \
a plot referenced to 2D axes scaled for polar world coordinates. \
} -aspect 450 -justify left} {OK {}}
}
#                       "PLOTSPHER" button
.menu.more.defs add command -label "PLOTSPHER" -command \
{ mkDialog .modal {-text \
{The PLOTSPHER menu invokes demonstrations of the PRL-PLOT \
PLOTSPHER object subprograms.  The PLOTSPHER object is \
a plot referenced to 3D axes scaled for spherical world coordinates. \
} -aspect 450 -justify left} {OK {}}
}
#                       "PRL" button
.menu.more.defs add command -label "PRL" -command \
{ mkDialog .modal {-text \
{The PRL menu invokes demonstrations of the PRL-PLOT \
PRL object subprograms.  The PRL object is \
the grandparent object of all Programmer's Reusable Library objects. \
} -aspect 450 -justify left} {OK {}}
}
#                       "PROCESS" button
.menu.more.defs add command -label "PROCESS" -command \
{ mkDialog .modal {-text \
{The PROCESS menu invokes demonstrations of the PRL-PLOT \
PROCESS object subprograms.  The PROCESS object is \
a single thread of control that executes within an address spacce. \
} -aspect 450 -justify left} {OK {}}
}
#                       "REAL" button
.menu.more.defs add command -label "REAL" -command \
{ mkDialog .modal {-text \
{The REAL menu invokes demonstrations of the PRL-PLOT \
REAL object subprograms.  The REAL object is \
a processor approximation to the value of a real number. \
} -aspect 450 -justify left} {OK {}}
}
#                       "SUBPLOT" button
.menu.more.defs add command -label "SUBPLOT" -command \
{ mkDialog .modal {-text \
{The SUBPLOT menu invokes demonstrations of the PRL-PLOT \
SUBPLOT object subprograms.  The SUBPLOT object is \
a collection of graphical objects associated with a given reference system. \
} -aspect 450 -justify left} {OK {}}
}
#                       "TEXT2D" button
.menu.more.defs add command -label "TEXT2D" -command \
{ mkDialog .modal {-text \
{The TEXT2D menu invokes demonstrations of the PRL-PLOT \
TEXT2D object subprograms.  The TEXT2D object is \
a linear arrangement of 2D symbols drawn on the graphics output device. \
} -aspect 450 -justify left} {OK {}}
}
#                       "VEC2" button
.menu.more.defs add command -label "VEC2" -command \
{ mkDialog .modal {-text \
{The VEC2 menu invokes demonstrations of the PRL-PLOT \
VEC2 object subprograms.  The VEC2 object is \
a quantity consisting of a magnitude and a direction in 2D space. \
} -aspect 450 -justify left} {OK {}}
}
#                       "VEC3" button
.menu.more.defs add command -label "VEC3" -command \
{ mkDialog .modal {-text \
{The VEC3 menu invokes demonstrations of the PRL-PLOT \
VEC3 object subprograms.  The VEC3 object is \
a quantity consisting of a magnitude and a direction in 3D space. \
} -aspect 450 -justify left} {OK {}}
}
#                       "VIEWPT" button
.menu.more.defs add command -label "VIEWPT" -command \
{ mkDialog .modal {-text \
{The VIEWPT menu invokes demonstrations of the PRL-PLOT \
VIEWPT object subprograms.  The VIEWPT object is \
a location in 3-D space used to generate a projection of 3D graphical objects. \
} -aspect 450 -justify left} {OK {}}
}
#                       "WCOORD2" button
.menu.more.defs add command -label "WCOORD2" -command \
{ mkDialog .modal {-text \
{The WCOORD2 menu invokes demonstrations of the PRL-PLOT \
WCOORD2 object subprograms.  The WCOORD2 object is \
a distance on a plot relative to the origin and measured in user-defined units.
} -aspect 450 -justify left} {OK {}}
}
#                       "WORKBOX" button
.menu.more.defs add command -label "WORKBOX" -command \
{ mkDialog .modal {-text \
{The WORKBOX menu invokes demonstrations of the PRL-PLOT \
WORKBOX object subprograms.  The WORKBOX object is \
a volume within which a 3D image is viewed. \
} -aspect 450 -justify left} {OK {}}
}
#     ******************************************************************
#
#                       Pack menus
#
pack .menu.demo \
     .menu.prl \
     .menu.device \
     .menu.plot \
     .menu.setup \
     .menu.axes \
     .menu.line \
     .menu.char \
     .menu.chart \
     .menu.process \
     .menu.more -side left
#
#     ******************************************************************
#
#                       Set up for keyboard-based menu traversal
#
bind . <Any-FocusIn> {
    if {("%d" == "NotifyVirtual") && ("%m" == "NotifyNormal")} {
	focus .menu
    }
}
tk_menuBar .menu .menu.demo \
           .menu.prl \
           .menu.device \
           .menu.plot \
           .menu.setup \
           .menu.axes \
           .menu.line \
           .menu.char \
           .menu.chart \
           .menu.process \
           .menu.more
#
#     ******************************************************************
#
#                       Position a dialog box on the screen
#
proc dpos w {
    wm geometry $w +300+300
}
#
STOP_CAT
echo "  Generating =====> [ ./axislbl1.f ]"
cat <<"STOP_CAT"> ././axislbl1.f
C     PROGRAM AXISLBL1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISLBL_DEFX2 and
C              AXISLBL_DEFY2
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISLBL object access program
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV105 =  1)
      PARAMETER (NVV106 =  3)
      PARAMETER (NVV107 =  1)
      PARAMETER (NVV108 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISLBL.INC'
C
C                       Integer variables and arrays
      INTEGER TMP102, TMP103, TMP104, LABN2, TMP106, LABM2, TMP108
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER TMP101*80, XLABEL*80, TMP105*80, YLABEL*80, TMP107*80
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*80 VV105(NVV105), VV107(NVV107)
      INTEGER VV106(NVV106), VV108(NVV108)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV105 /'X Axis$'/
C
      DATA VV106 /0, 100, -100/
C
      DATA VV107 /'Y Axis$'/
C
      DATA VV108 /0, 100, -100/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axislbl_defx2.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISLBL Object Demo Program #1'/
     * ' This program tests the AXISLBL object access programs'/
     * ' AXISLBL_DEFX2 and AXISLBL_DEFY2.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISLBL_DEFX2 object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV105 = 1,NVV105
        XLABEL = VV105(IVV105)
C
      DO 588 IVV106 = 1,NVV106
        LABN2 = VV106(IVV106)
C
      DO 587 IVV107 = 1,NVV107
        YLABEL = VV107(IVV107)
C
      DO 586 IVV108 = 1,NVV108
        LABM2 = VV108(IVV108)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.25)
C
C                       Define X axis label for 2D plot
      CALL AXISLBL_DEFX2 (XLABEL,LABN2)
C
C                       Define Y axis label for 2D plot
      CALL AXISLBL_DEFY2 (YLABEL,LABM2)
C
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=510) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106,TMP107,TMP108
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZXLAB .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZXNFL .NE. TMP102 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZXRLB .NE. TMP103 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZXALN .NE. TMP104 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 523
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=512) KZXLAB,KZXNFL,KZXRLB,KZXALN,XLABEL,LABN2,
     *                       YLABEL,LABM2
  502 FORMAT (A,I21,I21,I21,A,I21,A,I21)
      GOTO 523
C                       Print file I/O error messages
  510 WRITE (IER,511) FILNAM
  511 FORMAT (' Error reading file ',A)
      GOTO 523
C
  512 WRITE (IER,513) FILNAM
  513 FORMAT (' Error writing file ',A)
C
  523 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  586 CONTINUE
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
      CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISLBL Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axislbl2.f ]"
cat <<"STOP_CAT"> ././axislbl2.f
C     PROGRAM AXISLBL2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISLBL_DEFX3,
C              AXISLBL_DEFY3, and AXISLBL_DEFZ3
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISLBL object access program
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3, AXISLBL_DEFZ3
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT3D_DEFINE, VIEWPT_SETBU, WORKBOX_DEFINE
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV104 =  1)
      PARAMETER (NVV105 =  2)
      PARAMETER (NVV204 =  1)
      PARAMETER (NVV205 =  2)
      PARAMETER (NVV304 =  1)
      PARAMETER (NVV305 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISLBL.INC'
C
C                       Integer variables and arrays
      INTEGER TMP102, TMP103, LABN3, TMP105
      INTEGER TMP202, TMP203, LABM3, TMP205
      INTEGER TMP302, TMP303, LABL3, TMP305
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER TMP101*80, XLABEL*80, TMP104*80
      CHARACTER TMP201*80, YLABEL*80, TMP204*80
      CHARACTER TMP301*80, ZLABEL*80, TMP304*80
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*80 VV104(NVV104), VV204(NVV204), VV304(NVV304)
      INTEGER VV105(NVV105), VV205(NVV205), VV305(NVV305)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV104 /'X Axis$'/
      DATA VV204 /'Y Axis$'/
      DATA VV304 /'Z Axis$'/
C
      DATA VV105 /0, 100/
      DATA VV205 /0, 100/
      DATA VV305 /0, 100/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axislbl_defx3.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISLBL Object Demo Program #2'/
     * ' This program tests the AXISLBL object access program'/
     * ' AXISLBL_DEFX3, AXISLBL_DEFY3 and AXISLBL_DEFZ3.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISLBL_DEFX3 object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV104 = 1,NVV104
        XLABEL = VV104(IVV104)
C
      DO 588 IVV105 = 1,NVV105
        LABN3 = VV105(IVV105)
C
      DO 587 IVV204 = 1,NVV204
        YLABEL = VV204(IVV204)
C
      DO 586 IVV205 = 1,NVV205
        LABM3 = VV205(IVV205)
C
      DO 585 IVV304 = 1,NVV304
        ZLABEL = VV304(IVV304)
C
      DO 584 IVV305 = 1,NVV305
        LABL3 = VV305(IVV305)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0, YPAGE-2.0)
      CALL TEXT2D_SETHT (.25)
      CALL WORKBOX_DEFINE (1., 1., 1.)
      CALL VIEWPT_SETBU (1.0, -2.0, 1.5)
C
C                       Define X axis label for 3D plot
      CALL AXISLBL_DEFX3 (XLABEL,LABN3)
C
C                       Define Y axis label for 3D plot
      CALL AXISLBL_DEFY3 (YLABEL,LABM3)
C
C                       Define Z axis label for 3D plot
      CALL AXISLBL_DEFZ3 (ZLABEL,LABL3)
C
      CALL PLOT3D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=510) TMP101,TMP102,TMP103,TMP104,TMP105,
     *                           TMP201,TMP202,TMP203,TMP204,TMP205,
     *                           TMP301,TMP302,TMP303,TMP304,TMP305
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZXLB3 .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZXNM3 .NE. TMP102 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZXLN3 .NE. TMP103 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZYLB3 .NE. TMP201 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZYNM3 .NE. TMP202 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZYLN3 .NE. TMP203 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZZLB3 .NE. TMP301 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZZNM3 .NE. TMP302 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZZLN3 .NE. TMP303 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 523
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=512) KZXLB3,KZXNM3,KZXLN3,XLABEL,LABN3,
     *                       KZYLB3,KZYNM3,KZYLN3,YLABEL,LABM3,
     *                       KZZLB3,KZZNM3,KZZLN3,ZLABEL,LABL3
  502 FORMAT (3(A,I21,I21,A,I21))
      GOTO 523
C                       Print file I/O error messages
  510 WRITE (IER,511) FILNAM
  511 FORMAT (' Error reading file ',A)
      GOTO 523
C
  512 WRITE (IER,513) FILNAM
  513 FORMAT (' Error writing file ',A)
C
  523 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  584 CONTINUE
  585 CONTINUE
  586 CONTINUE
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
      CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISLBL Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axislbl_defx2.dat ]"
cat <<"STOP_CAT"> ././axislbl_defx2.uuu
begin 660 ./axislbl_defx2.dat
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`R,C(@("`@("`@("`@("`@("`@("`R,C(@("`@("`@("`@("`@
M("`@("`@(#!8($%X:7,D("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@,%D@07AI<R0@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`P"B`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@,C(R("`@
M("`@("`@("`@("`@("`@,C(R("`@("`@("`@("`@("`@("`@("`P6"!!>&ES
M)"`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@(#!9($%X:7,D("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@(#$P,`H@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@(#(R,B`@("`@("`@("`@("`@("`@
M(#(R,B`@("`@("`@("`@("`@("`@("`@,%@@07AI<R0@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`P62!!>&ES)"`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("TQ
M,#`*6"!!>&ES("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`Q,3$@("`@("`@("`@("`@("`@("`R,C(@("`@("`@("`@
M("`@("`@("`@(#98($%X:7,D("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@(#$P,%D@07AI<R0@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`P"E@@07AI<R`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@,3$Q
M("`@("`@("`@("`@("`@("`@,C(R("`@("`@("`@("`@("`@("`@("`V6"!!
M>&ES)"`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`Q,#!9($%X:7,D("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@(#$P,`I8($%X:7,@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@(#$Q,2`@("`@("`@("`@("`@
M("`@(#(R,B`@("`@("`@("`@("`@("`@("`@-E@@07AI<R0@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@,3`P62!!>&ES
M)"`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("TQ,#`*6"!!>&ES("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`Q,3$@("`@("`@("`@("`@("`@("`Q,3$@("`@("`@
M("`@("`@("`@("`@(#98($%X:7,D("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@+3$P,%D@07AI<R0@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`P"E@@07AI<R`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M,3$Q("`@("`@("`@("`@("`@("`@,3$Q("`@("`@("`@("`@("`@("`@("`V
M6"!!>&ES)"`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("TQ,#!9($%X:7,D("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@(#$P,`I8($%X:7,@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(#$Q,2`@("`@("`@("`@
M("`@("`@(#$Q,2`@("`@("`@("`@("`@("`@("`@-E@@07AI<R0@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`M,3`P62!!
M>&ES)"`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
)("`@("TQ,#`*
`
end
STOP_CAT
echo "  Generating =====> [ ./axislbl_defx3.dat ]"
cat <<"STOP_CAT"> ././axislbl_defx3.uuu
begin 660 ./axislbl_defx3.dat
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`R,C(@("`@("`@("`@("`@("`@("`@(#!8($%X:7,D("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@,"`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@,C(R("`@("`@("`@("`@("`@("`@("`P62!!>&ES)"`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(#`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@(#(R,B`@("`@("`@("`@("`@("`@("`@,%H@07AI<R0@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`P"B`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@,C(R("`@("`@("`@("`@("`@("`@("`P6"!!>&ES)"`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(#`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M(#(R,B`@("`@("`@("`@("`@("`@("`@,%D@07AI<R0@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`P6B!!>&ES("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`Q
M,3$@("`@("`@("`@("`@("`@("`@(#9:($%X:7,D("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(#$P,`H@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(#(R
M,B`@("`@("`@("`@("`@("`@("`@,%@@07AI<R0@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`P62!!>&ES("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`Q,3$@
M("`@("`@("`@("`@("`@("`@(#99($%X:7,D("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@(#$P,"`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@,C(R("`@
M("`@("`@("`@("`@("`@("`P6B!!>&ES)"`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@(#`*("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`R,C(@("`@
M("`@("`@("`@("`@("`@(#!8($%X:7,D("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@,%D@07AI<R`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@,3$Q("`@("`@
M("`@("`@("`@("`@("`V62!!>&ES)"`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`Q,#!:($%X:7,@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(#$Q,2`@("`@("`@
M("`@("`@("`@("`@-EH@07AI<R0@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@,3`P"E@@07AI<R`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@,3$Q("`@("`@("`@
M("`@("`@("`@("`V6"!!>&ES)"`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`Q,#`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(#(R,B`@("`@("`@("`@
M("`@("`@("`@,%D@07AI<R0@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`P("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`R,C(@("`@("`@("`@("`@
M("`@("`@(#!:($%X:7,D("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@,`I8($%X:7,@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@(#$Q,2`@("`@("`@("`@("`@
M("`@("`@-E@@07AI<R0@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@,3`P("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`R,C(@("`@("`@("`@("`@("`@
M("`@(#!9($%X:7,D("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@,%H@07AI<R`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@,3$Q("`@("`@("`@("`@("`@("`@
M("`V6B!!>&ES)"`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`Q,#`*6"!!>&ES("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`Q,3$@("`@("`@("`@("`@("`@("`@
M(#98($%X:7,D("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@(#$P,%D@07AI<R`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@,3$Q("`@("`@("`@("`@("`@("`@("`V
M62!!>&ES)"`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`Q,#`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@(#(R,B`@("`@("`@("`@("`@("`@("`@,%H@
M07AI<R0@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`P"E@@07AI<R`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@,3$Q("`@("`@("`@("`@("`@("`@("`V6"!!
M>&ES)"`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`Q,#!9($%X:7,@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@(#$Q,2`@("`@("`@("`@("`@("`@("`@-ED@07AI
M<R0@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@,3`P6B!!>&ES("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`Q,3$@("`@("`@("`@("`@("`@("`@(#9:($%X:7,D
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
%(#$P,`H@
`
end
STOP_CAT
echo "  Generating =====> [ ./axisnum1.f ]"
cat <<"STOP_CAT"> ././axisnum1.f
C     PROGRAM AXISNUM1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISNUM_EXPX,
C              AXISNUM_EXPY and AXISNUM_EXPZ
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISNUM object access program
      EXTERNAL AXISNUM_EXPX, AXISNUM_EXPY, AXISNUM_EXPZ
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT3D_DEFINE, VIEWPT_SETBU, WORKBOX_DEFINE
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3, AXISLBL_DEFZ3
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISNUM.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
      LOGICAL TMP101
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axisnum_expx.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISNUM Object Demo Program #1'/
     * ' This program tests the AXISNUM object access program'/
     * ' AXISNUM_EXPX, AXISNUM_EXPY and AXISNUM_EXPZ.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.19)
      CALL WORKBOX_DEFINE (1., 1., 1.)
      CALL VIEWPT_SETBU (1.0, -2.0, 1.5)
      CALL AXISLBL_DEFX3 ('X Axis$',100)
      CALL AXISLBL_DEFY3 ('Y Axis$',100)
      CALL AXISLBL_DEFZ3 ('Z Axis$',100)
C
C     ------------------------------------------------------------------
C
C                       Test AXISNUM_EXPX,Y,Z object access programs
C
C                       Force exponential numbering on X axis
      CALL AXISNUM_EXPX ()
C
C                       Force exponential numbering on Y axis
      CALL AXISNUM_EXPY ()
C
C                       Force exponential numbering on Z axis
      CALL AXISNUM_EXPZ ()
C
      CALL PLOT3D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (IXAXSF .NEQV. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) IXAXSF
  502 FORMAT (L7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISNUM Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axisnum2.f ]"
cat <<"STOP_CAT"> ././axisnum2.f
C     PROGRAM AXISNUM2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISNUM_ROTX and
C              AXISNUM_ROTY
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISNUM object access program
      EXTERNAL AXISNUM_ROTX, AXISNUM_ROTY
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  2)
      PARAMETER (NVV202 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISNUM.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, ANGLE, TMP102
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV102(NVV102)
      REAL    VV202(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /0.0, 60.0/
C
      DATA VV202 /0.0, 60.0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axisnum_rotx.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISNUM Object Demo Program #2'/
     * ' This program tests the AXISNUM object access program'/
     * ' AXISNUM_ROTX and AXISNUM_ROTY.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISNUM_ROTX object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        ANGLE = VV102(IVV102)
C
      DO 588 IVV202 = 1,NVV202
        ANGLY = VV202(IVV202)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.25)
C
C                       Set rotation angle for X axis numbers
      CALL AXISNUM_ROTX (ANGLE)
C
C                       Set rotation angle for Y axis numbers
      CALL AXISNUM_ROTY (ANGLY)
C
      CALL PLOT2D_DEFINE (0.0, 0., 1.0, 0.0, 0., 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(ZZXLBA ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ZZXLBA,ANGLE
  502 FORMAT (E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISNUM Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axisnum3.f ]"
cat <<"STOP_CAT"> ././axisnum3.f
C     PROGRAM AXISNUM3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISNUM_INTX,
C              AXISNUM_INTY and AXISNUM_INTZ
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISNUM object access program
      EXTERNAL AXISNUM_INTX, AXISNUM_INTY, AXISNUM_INTZ
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT3D_DEFINE, VIEWPT_SETBU, WORKBOX_DEFINE
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3, AXISLBL_DEFZ3
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISNUM.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axisnum_intx.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISNUM Object Demo Program #3'/
     * ' This program tests the AXISNUM object access program'/
     * ' AXISNUM_INTX, AXISNUM_INTY and AXISNUM_INTZ.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISNUM_INTX,Y,Z object access program
C
C                       Loop for each combination of access programs
      DO 589 IVV1=1,2
      DO 588 IVV2=1,2
      DO 587 IVV3=1,2
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL WORKBOX_DEFINE (10., 10., 10.)
      CALL VIEWPT_SETBU (10.0, -20.0, 15.)
      CALL AXISLBL_DEFX3 ('X Axis$',100)
      CALL AXISLBL_DEFY3 ('Y Axis$',100)
      CALL AXISLBL_DEFZ3 ('Z Axis$',100)
      CALL TEXT2D_SETHT (.25)
C
C                       Set integer numbering on X axis
      IF (IVV1 .EQ. 1) THEN
        CALL AXISNUM_INTX ()
      ENDIF
C                       Set integer numbering on Y axis
      IF (IVV2 .EQ. 1) THEN
        CALL AXISNUM_INTY ()
      ENDIF
C                       Set integer numbering on Z axis
      IF (IVV3 .EQ. 1) THEN
        CALL AXISNUM_INTZ ()
      ENDIF
C
      CALL PLOT3D_DEFINE (0.0, 0., 10.0, 0.0, 0., 10.0, 0.0, 0., 10.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZXTYP .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZXTYP
  502 FORMAT (I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next combination
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISNUM Demo Program #3 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axisnum4.f ]"
cat <<"STOP_CAT"> ././axisnum4.f
C     PROGRAM AXISNUM4
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISNUM_INTALL
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISNUM object access program
      EXTERNAL AXISNUM_INTALL
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT3D_DEFINE, VIEWPT_SETBU, WORKBOX_DEFINE
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3, AXISLBL_DEFZ3
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISNUM.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101, TMP102, TMP103
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axisnum_intall.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISNUM Object Demo Program #4'/
     * ' This program tests the AXISNUM object access program'/
     * ' AXISNUM_INTALL.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL WORKBOX_DEFINE (10., 10., 10.)
      CALL VIEWPT_SETBU (10.0, -20.0, 15.)
      CALL AXISLBL_DEFX3 ('X Axis$',100)
      CALL AXISLBL_DEFY3 ('Y Axis$',100)
      CALL AXISLBL_DEFZ3 ('Z Axis$',100)
      CALL TEXT2D_SETHT (.25)
C
C     ------------------------------------------------------------------
C
C                       Test AXISNUM_INTALL object access program
C
C                       Loop for each input variable of access program
C                       Set integer numbering on all axes
      CALL AXISNUM_INTALL ()
C
      CALL PLOT3D_DEFINE (0.0, 0., 10.0, 0.0, 0., 10.0, 0.0, 0., 10.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZXTYP .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZYTYP .NE. TMP102 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZZTYP .NE. TMP103 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZXTYP,KZYTYP,KZZTYP
  502 FORMAT (I21,I21,I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISNUM Demo Program #4 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axisnum5.f ]"
cat <<"STOP_CAT"> ././axisnum5.f
C     PROGRAM AXISNUM5
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISNUM_XOFF,
C              AXISNUM_YOFF and AXISNUM_ZOFF
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISNUM object access program
      EXTERNAL AXISNUM_XOFF, AXISNUM_YOFF, AXISNUM_ZOFF
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT3D_DEFINE, VIEWPT_SETBU, WORKBOX_DEFINE
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3, AXISLBL_DEFZ3
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISNUM.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axisnum_xoff.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISNUM Object Demo Program #5'/
     * ' This program tests the AXISNUM object access program'/
     * ' AXISNUM_XOFF.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISNUM_XOFF object access program
C
C                       Loop for each combination of access programs
      DO 589 IVV1=1,2
      DO 588 IVV2=1,2
      DO 587 IVV3=1,2
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.25)
      CALL WORKBOX_DEFINE (1., 1., 1.)
      CALL VIEWPT_SETBU (1.0, -2.0, 1.5)
      CALL AXISLBL_DEFX3 ('X Axis$',100)
      CALL AXISLBL_DEFY3 ('Y Axis$',100)
      CALL AXISLBL_DEFZ3 ('Z Axis$',100)
C
C                       Suppress numbering on X axis
      IF (IVV1 .EQ. 1) THEN
        CALL AXISNUM_XOFF ()
      ENDIF
C
C                       Suppress numbering on Y axis
      IF (IVV2 .EQ. 1) THEN
        CALL AXISNUM_YOFF ()
      ENDIF
C
C                       Suppress numbering on Z axis
      IF (IVV3 .EQ. 1) THEN
        CALL AXISNUM_ZOFF ()
      ENDIF
C
      CALL PLOT3D_DEFINE (0.0, 0., 1.0, 0.0, 0., 1.0, 0.0, 0., 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZXNON .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZXNON
  502 FORMAT (I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next combination
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISNUM Demo Program #5 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axisnum_expx.dat ]"
cat <<"STOP_CAT"> ././axisnum_expx.uuu
begin 660 ./axisnum_expx.dat
(("`@("`@5`H(
`
end
STOP_CAT
echo "  Generating =====> [ ./axisnum_intall.dat ]"
cat <<"STOP_CAT"> ././axisnum_intall.uuu
begin 660 ./axisnum_intall.dat
M("`@("`@("`@("`@("`@("`@("`Q("`@("`@("`@("`@("`@("`@("`Q("`@
3("`@("`@("`@("`@("`@("`Q"B`Q
`
end
STOP_CAT
echo "  Generating =====> [ ./axisnum_intx.dat ]"
cat <<"STOP_CAT"> ././axisnum_intx.uuu
begin 660 ./axisnum_intx.dat
M("`@("`@("`@("`@("`@("`@("`Q"B`@("`@("`@("`@("`@("`@("`@,0H@
M("`@("`@("`@("`@("`@("`@(#$*("`@("`@("`@("`@("`@("`@("`Q"B`@
M("`@("`@("`@("`@("`@("`@,@H@("`@("`@("`@("`@("`@("`@(#(*("`@
I("`@("`@("`@("`@("`@("`R"B`@("`@("`@("`@("`@("`@("`@,@H*
`
end
STOP_CAT
echo "  Generating =====> [ ./axisnum_rotx.dat ]"
cat <<"STOP_CAT"> ././axisnum_rotx.uuu
begin 660 ./axisnum_rotx.dat
M("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P"B`@("XP,#`P,#`P12LP
M,"`@("XP,#`P,#`P12LP,`H@("`N-C`P,#`P,$4K,#(@("`N-C`P,#`P,$4K
B,#(*("`@+C8P,#`P,#!%*S`R("`@+C8P,#`P,#!%*S`R"B`N
`
end
STOP_CAT
echo "  Generating =====> [ ./axisnum_xoff.dat ]"
cat <<"STOP_CAT"> ././axisnum_xoff.uuu
begin 660 ./axisnum_xoff.dat
M("`@("`@("`@("`@("`@("`@,3$Q"B`@("`@("`@("`@("`@("`@(#$Q,0H@
M("`@("`@("`@("`@("`@("`Q,3$*("`@("`@("`@("`@("`@("`@,3$Q"B`@
M("`@("`@("`@("`@("`@(#(R,@H@("`@("`@("`@("`@("`@("`R,C(*("`@
I("`@("`@("`@("`@("`@,C(R"B`@("`@("`@("`@("`@("`@(#(R,@H*
`
end
STOP_CAT
echo "  Generating =====> [ ./axisscale1.f ]"
cat <<"STOP_CAT"> ././axisscale1.f
C     PROGRAM AXISSCALE1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISSCALE_ALGOR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISSCALE object access program
      EXTERNAL AXISSCALE_ALGOR
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  4)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISSCALE.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101, IALGOR, TMP102
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /1, 2, 3, 4/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axisscale_algor.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISSCALE Object Demo Program #1'/
     * ' This program tests the AXISSCALE object access program'/
     * ' AXISSCALE_ALGOR.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISSCALE_ALGOR object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        IALGOR = VV102(IVV102)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.25)
C
C                       Select algorithm for axes autoscaling
      CALL AXISSCALE_ALGOR (IALGOR)
C
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZASCL .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZASCL,IALGOR
  502 FORMAT (I21,I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISSCALE Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axisscale2.f ]"
cat <<"STOP_CAT"> ././axisscale2.f
C     PROGRAM AXISSCALE2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISSCALE_SAUTO
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISSCALE object access program
      EXTERNAL AXISSCALE_SAUTO
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE, PLOTLOG_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
      PARAMETER (NVV103 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER LTYPE, TMP101
C
C                       Real variables and arrays
      REAL    DLOW, TMP102, DHIGH, TMP103, AMIN, TMP104, DELV, TMP105
     *      , AMAX, TMP106
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
      REAL    VV102(NVV102)
      REAL    VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /0, 1/
C
      DATA VV102 /0.0, 0.99/
C
      DATA VV103 /0.99, 9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axisscale_sauto.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISSCALE Object Demo Program #2'/
     * ' This program tests the AXISSCALE object access program'/
     * ' AXISSCALE_SAUTO.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISSCALE_SAUTO object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        LTYPE = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        DLOW = VV102(IVV102)
C
      DO 587 IVV103 = 1,NVV103
        DHIGH = VV103(IVV103)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
C
C                       Automatically scale a step size for axes in
C                       world cooordinate system
      CALL AXISSCALE_SAUTO (LTYPE,DLOW,DHIGH,6,AMIN,DELV,AMAX)
C
      IF (LTYPE .EQ. 0) THEN
        CALL PLOT2D_DEFINE (AMIN,DELV,AMAX,AMIN,DELV,AMAX)
      ELSE
        CALL AXISSCALE_SAUTO (2,DLOW,DHIGH,6,AMINY,DELVY,AMAXY)
        CALL PLOTLOG_DEFINE (AMIN,DELV,AMINY,DELVY)
      ENDIF
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(AMIN ,TMP104 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(DELV ,TMP105 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(AMAX ,TMP106 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) LTYPE,DLOW,DHIGH,AMIN,DELV,AMAX
  502 FORMAT (I21,E15.7,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISSCALE Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axisscale3.f ]"
cat <<"STOP_CAT"> ././axisscale3.f
C     PROGRAM AXISSCALE3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISSCALE_MAUTO
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISSCALE object access program
      EXTERNAL AXISSCALE_MAUTO
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    DLOW, TMP101, DHIGH, TMP102, AMAX, TMP103, AMIN, TMP104
     *      , DSTEP, TMP105, RAXIS, TMP106
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-33.33, 0.99/
C
      DATA VV102 /0.99, 99.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axisscale_mauto.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISSCALE Object Demo Program #3'/
     * ' This program tests the AXISSCALE object access program'/
     * ' AXISSCALE_MAUTO.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISSCALE_MAUTO object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        DLOW = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        DHIGH = VV102(IVV102)
        AMAX = DHIGH
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
C
C                       Automatically scale a linear step size for
C                       multiple subplot axes
      CALL AXISSCALE_MAUTO (DLOW,DHIGH,AMAX,AMIN,DSTEP,RAXIS)
C
      CALL PLOT2D_DEFINE (AMIN,DSTEP,AMAX, AMIN,DSTEP,AMAX)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(AMIN ,TMP104 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(DSTEP ,TMP105 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(RAXIS ,TMP106 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) DLOW,DHIGH,AMAX,AMIN,DSTEP,RAXIS
  502 FORMAT (E15.7,E15.7,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISSCALE Demo Program #3 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axisscale4.f ]"
cat <<"STOP_CAT"> ././axisscale4.f
C     PROGRAM AXISSCALE4
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISSCALE_CROSS for
C              2D plotting
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Data for curve to be plotted
      REAL Y(5),X(5)
C
      DATA X /-100., -50.0, 0.0, 50.0, 100.0/
      DATA Y /-100., -50.0, 0.0, 50.0, 100.0/
      DATA XMIN,XMAX,YMIN,YMAX /-100.0, 100.0, -100.0, 100.0/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Set plot rotation
      CALL PAGE_ORIENT ('movie')
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin at
C                       lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Disable border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.10*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 2.0*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border drawing
C                       disabled by call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW HEADING OVER SUBPLOT AREA
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('Simple Linear Plot$',100)
C                       Compute X coord of start of string in inches
      XX = 0.50*(XPG-XX)
C                       Plot text string
      CALL TEXT2D_PDRAW ('Simple Linear Plot$',100,XX,YPG*1.05)
C
C     ------------------------------------------------------------------
C
C                       DRAW TITLE UNDER SUBPLOT AREA
C
C                       Compute text height based on page height
      XX = TEXT2D_GETLEN ('AXISSCALE4 Demo: Axes Cross at (0,0)$',100)
C                       Compute X coord of start of string in inches
      XX = 0.50*(XPG-XX)
C                       Plot text string
      CALL TEXT2D_PDRAW
     *     ('AXISSCALE4 Demo: Axes Cross at (0,0)$',100,XX,-0.5)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.8)
C                       Set text style to 'duplex'
      CALL FONT_DUPLEX
C                       Define X axis label
      CALL AXISLBL_DEFX2 ('LINEAR X-AXIS$',100)
C                       Define Y axis label
      CALL AXISLBL_DEFY2 ('LINEAR Y-AXIS$',100)
C
C     ******************************************************************
C
C                       DRAW AXES
C
C                       Draw axes through (0,0) rather than through
C                       the default of (XMIN,YMIN)
      CALL AXISSCALE_CROSS
C                       Define and draw linear axis, numbers and labels
      CALL PLOT2D_DEFINE (XMIN,25.0,XMAX,YMIN,25.0,YMAX)
C
C                       Draw grid line at each major axes tick mark
      CALL GRID_DRAW (1,1)
C
C     ------------------------------------------------------------------
C
C                       DRAW CURVE ON AXES
C
      CALL CURVE2D_DRAW (X,Y,5,1)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axisscale5.f ]"
cat <<"STOP_CAT"> ././axisscale5.f
C     PROGRAM AXISSCALE5
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISSCALE_CROSS for
C              3D plotting
C
C     LOCAL VARIABLES:
C
C
C     NOTES:
C       This is the same program as PLOT3D1 with a few small changes;
C       just add a call to AXISSCALE_CROSS to get axis to cross at zero
C
C     ******************************************************************
C
C                       Number of horizontal slices (constant Z)
C                       defining the 3D object to be plotted
      PARAMETER (NLEVEL=8)
C                       Number of radial slices (constant angle in X-Y)
C                       defining the 3D object to be plotted
      PARAMETER (NSLICE=18)
C                       Arrays for storing 3D coordinates of points
C                       defining the 3D object to be plotted
      DIMENSION X(200),Y(200),Z(200)
C                       Arrays for storing indicies of points that
C                       define vectors (3D line segments)
      DIMENSION M(1000),N(1000)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Radius of the object to be plotted
      DATA RADIUS / 5.0 /
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       COMPUTE COORDINATES OF THE OBJECT TO BE PLOTTED
C
C     ------------------------------------------------------------------
C
C                       INITIALIZE VARIABLES
C
C                       Get value for pi
      PI = REAL_GETPI()
C                       Compute degrees-to-radians conversion divisor
      DTR = 360.0/2.0/PI
C                       Compute angle between radial slices in degrees
      DELTA = 360.0/NSLICE
C                       Initialize distance between horizontal slices
      DELZ = 1.0
C                       Initialize radius of conical top of object
      XYRAD = RADIUS
C                       Initialize Z coord of first horizontal slice
      ZTEM = 0.0
C                       Initialize counter for number of vectors
C                       (3D straight line segments)
      NVEC = 0
C
C     ------------------------------------------------------------------
C
C                       HORIZONTAL SLICE LOOP
C
C                       Loop for each horizontal (constant Z) slice
      DO 20 I=1,NLEVEL
C                       Determine Z coord of this horizontal slice:
C                         First 5 slices are 1.0 units apart
      ZTEM = ZTEM + DELZ
C                         Slices 6-8 are 29 deg apart on conical top
      IF(I .GT. 5) THEN
        ZTEM  = 5.0 + RADIUS*SIN(29.0*(I-5)/DTR)
C                       Compute radius of conical top at this Z coord
        XYRAD = RADIUS*COS(29.0*(I-5)/DTR)
      ENDIF
C
C     ..................................................................
C
C                       RADIAL SLICE LOOP
C
C                       Loop for each radial (constant X-Y angle) slice
      DO 10 J=1,NSLICE
C                       Compute angle of this radial slice in radians
      ANG = DELTA*(J-1)/DTR
C                       Compute index number of this point
C                       (intersection of horizontal and vertical slices)
      NPTS = NSLICE*(I-1) + J
C                       Compute and store X,Y,Z coords of this point
      X(NPTS) = XYRAD*COS(ANG)
      Y(NPTS) = XYRAD*SIN(ANG)
      Z(NPTS) = ZTEM
C
C                       Define horizontal vector:
C                         Increment number of vectors
      NVEC = NVEC + 1
C                         Store index of point at vector tail
      M(NVEC) = NPTS
C                         Store index of point at vector head
      N(NVEC) = NPTS + 1
C                         Adjust index of point at vector head due to
C                         wrap-around if this is the last slice
      IF(J .EQ. NSLICE) N(NVEC) = NPTS - NSLICE + 1
C
C                       Define vertical vector if not last horiz slice:
      IF(I .LT. NLEVEL) THEN
C                         Increment number of vectors
        NVEC = NVEC + 1
C                         Store index of point at vector tail
        M(NVEC) = NPTS
C                         Store index of point at vector head
        N(NVEC) = NPTS + NSLICE
      ENDIF
C                       Repeat for next radial slice
   10 CONTINUE
C
C     ..................................................................
C
C                       END OF HORIZONTAL SLICE LOOP
C
C                       Repeat for next horizontal slice
   20 CONTINUE
C
C     ------------------------------------------------------------------
C
C                       DETERMINE MINIMUM AND MAXIMUM COORDINATES
C                       OF OBJECT TO BE PLOTTED
C
C                       Initialize min and max X coordinates
      XMIN=X(1)
      XMAX=X(1)
C                       Initialize min and max Y coordinates
      YMIN=Y(1)
      YMAX=Y(1)
C                       Initialize min and max Z coordinates
      ZMIN=Z(1)
      ZMAX=Z(1)
C                       Loop for each point defining the object
      DO 100 I=2,NPTS
C                       Update min X if this point has a smaller X
        IF (X(I).LT.XMIN) XMIN=X(I)
C                       Update max X if this point has a larger X
        IF (X(I).GT.XMAX) XMAX=X(I)
C                       Update min Y if this point has a smaller Y
        IF (Y(I).LT.YMIN) YMIN=Y(I)
C                       Update max Y if this point has a larger Y
        IF (Y(I).GT.YMAX) YMAX=Y(I)
C                       Update min Z if this point has a smaller Z
        IF (Z(I).LT.ZMIN) ZMIN=Z(I)
C                       Update max Z if this point has a larger Z
        IF (Z(I).GT.ZMAX) ZMAX=Z(I)
C                       Repeat for next point
 100  CONTINUE
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Disable border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C
      CALL PAGE_ORIENT ('AUTO')
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.20*XPAGE
      YRL = 0.10*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 3.0*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plotting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       PLOT TITLE BELOW SUBPLOT AREA
C
C                       Set current drawing color to 'magenta'
      CALL COLOR_SETNAM ('FORE')
C                       Set text font to 'cartog'
      CALL FONT_CARTOG
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN
     *     ('AXISSCALE5 Demo: 3D Plot Crossing at (0,0,0)$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw title centered below subplot area
      YY = -.07*YPG
      CALL TEXT2D_PDRAW
     *     ('AXISSCALE5 Demo: 3D Plot Crossing at (0,0,0)$',100,XX,YY)
C
C     ------------------------------------------------------------------
C
C                       PLOT FIRST LINE OF HEADING:
C                       "3-Dimensional Plot"
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Enable character area fill
      CALL FONT_SETPAT (0.0,1,0.05,1)
C                       Enable hardware area fill (solid fill pattern)
      CALL DEVICE_FILLON
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*2.)
C                       Set text font to 'romanl'
      CALL FONT_ROMANL
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('3-Dimensional Plot$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw string centered high in subplot area
C                       in solid area-filled romanl font
      CALL TEXT2D_PDRAW ('3-Dimensional Plot$',100,XX,1.18*YPG)
C
C     ------------------------------------------------------------------
C
C                       PLOT SECOND LINE OF HEADING:
C                       "AND"
C
C                       Set current drawing color to 'red'
      CALL COLOR_SETNAM ('RED')
C                       Set text font to 'clasic'
      CALL FONT_CLASIC
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('AND$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw string centered just below first string
C                       in solid area-filled clasic font
      CALL TEXT2D_PDRAW ('AND$',100,XX,1.13*YPG)
C
C     ------------------------------------------------------------------
C
C                       PLOT THIRD LINE OF HEADING:
C                       "Shaded Fonts"
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*2.)
C                       Set current drawing color to 'yellow'
      CALL COLOR_SETNAM ('YELLOW')
C                       Set text font to 'stylex'
      CALL FONT_STYLEX
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('Shaded Fonts$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw string centered just below second string
C                       in solid area-filled stylex font
      CALL TEXT2D_PDRAW ('Shaded Fonts$',100,XX,1.05*YPG)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Set text font to 'duplex'
      CALL FONT_DUPLEX
C                       Set X axis label for 3-D plot
      CALL AXISLBL_DEFX3 ('XLAB',4)
C                       Set Y axis label for 3-D plot
      CALL AXISLBL_DEFY3 ('YLAB',4)
C                       Set Z axis label for 3-D plot
      CALL AXISLBL_DEFZ3 ('ZLAB',4)
C                       Set drawing color to 'foreground' (white)
      CALL COLOR_SETNAM ('FOREGROUND')
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Draw axes through (0,0,0) rather than through
C                       the default of (XMIN,YMIN,ZMIN)
      CALL AXISSCALE_CROSS
C                       Define dimensions of 3D workbox
      CALL WORKBOX_DEFINE (10.0,10.0,10.0)
C                       Set 3D viewpoint location in 3D workbox units
      CALL VIEWPT_SETBS (45.0,45.0,9999.0)
C                       Define 3D coordinate system with
C                       X=-5.0 to 5.0, Y=-5.0 to 5.0, Z=0.0 to 10.0,
C                       and draw axes, axes labels
      CALL PLOT3D_DEFINE (-5.0,2.5,5.0,-5.0,2.5,5.0,0.0,2.5,10.0)
C
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Loop for each vector of the object to be drawn
      DO 40 I=1,NVEC
C                       Draw 3D vector without arrowhead
C                       (i.e., a 3D straight line segment)
        CALL VEC3_DRAW (X(M(I)),Y(M(I)),Z(M(I)),
     *                      X(N(I)),Y(N(I)),Z(N(I)),0)
C                       Repeat for next vector
   40 CONTINUE
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axisscale_algor.dat ]"
cat <<"STOP_CAT"> ././axisscale_algor.uuu
begin 660 ./axisscale_algor.dat
M("`@("`@("`@("`@("`@("`@("`Q("`@("`@("`@("`@("`@("`@("`Q"B`@
M("`@("`@("`@("`@("`@("`@,B`@("`@("`@("`@("`@("`@("`@,@H@("`@
M("`@("`@("`@("`@("`@(#,@("`@("`@("`@("`@("`@("`@(#,*("`@("`@
E("`@("`@("`@("`@("`T("`@("`@("`@("`@("`@("`@("`T"C,*
`
end
STOP_CAT
echo "  Generating =====> [ ./axisscale_mauto.dat ]"
cat <<"STOP_CAT"> ././axisscale_mauto.uuu
begin 660 ./axisscale_mauto.dat
M("`M+C,S,S,P,#!%*S`R("`@+CDY,#`P,#!%*S`P("`@+CDY,#`P,#!%*S`P
M("`M+C0P,#`P,#!%*S`R("`@+C0P,#`P,#!%*S`R("`@+C(P,#`P,#!%*S`Q
M"B`@+2XS,S,S,#`P12LP,B`@("XY.3DY,#`P12LP,B`@("XY.3DY,#`P12LP
M,B`@+2XT-3`P,#`P12LP,B`@("XW-3`P,#`P12LP,2`@("XR,#`P,#`P12LP
M,@H@("`N.3DP,#`P,$4K,#`@("`N.3DP,#`P,$4K,#`@("`N.3DP,#`P,$4K
M,#`@("`N,#`P,#`P,$4K,#`@("`N-S4P,#`P,$4K,#`@("`N,C`P,#`P,$4K
M,#$*("`@+CDY,#`P,#!%*S`P("`@+CDY.3DP,#!%*S`R("`@+CDY.3DP,#!%
M*S`R("`@+C`P,#`P,#!%*S`P("`@+C4P,#`P,#!%*S`Q("`@+C(P,#`P,#!%
$*S`R"B`@
`
end
STOP_CAT
echo "  Generating =====> [ ./axisscale_sauto.dat ]"
cat <<"STOP_CAT"> ././axisscale_sauto.uuu
begin 660 ./axisscale_sauto.dat
M("`@("`@("`@("`@("`@("`@("`P("`@+C`P,#`P,#!%*S`P("`@+CDY,#`P
M,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@+C(P,#`P,#!%*S`P("`@+C$P,#`P
M,#!%*S`Q"B`@("`@("`@("`@("`@("`@("`@,"`@("XP,#`P,#`P12LP,"`@
M("XY.3DY.3DP12LP-"`@("XP,#`P,#`P12LP,"`@("XR,#`P,#`P12LP-"`@
M("XQ,#`P,#`P12LP-0H@("`@("`@("`@("`@("`@("`@(#`@("`N.3DP,#`P
M,$4K,#`@("`N.3DP,#`P,$4K,#`@("`N-#`P,#`P,$4K,#`@("`N,C`P,#`P
M,$4K,#`@("`N,38P,#`P,$4K,#$*("`@("`@("`@("`@("`@("`@("`P("`@
M+CDY,#`P,#!%*S`P("`@+CDY.3DY.3!%*S`T("`@+C`P,#`P,#!%*S`P("`@
M+C(P,#`P,#!%*S`T("`@+C$P,#`P,#!%*S`U"B`@("`@("`@("`@("`@("`@
M("`@,2`@("XP,#`P,#`P12LP,"`@("XY.3`P,#`P12LP,"`@("XQ,#`P,#`P
M12LP,"`@("XQ,38Y,#`P12LP,B`@("XQ,#`P,#`P12LP,0H@("`@("`@("`@
M("`@("`@("`@(#$@("`N,#`P,#`P,$4K,#`@("`N.3DY.3DY,$4K,#0@("`N
M,3`P,#`P,$4K,#`@("`N,C,S.#`P,$4K,#$@("`N,3`P,#`P,$4K,#4*("`@
M("`@("`@("`@("`@("`@("`Q("`@+CDY,#`P,#!%*S`P("`@+CDY,#`P,#!%
M*S`P("`@+C$P,#`P,#!%*S`P("`@+C4X-#4P,#!%*S`Q("`@+C$P,#`P,#!%
M*S`R"B`@("`@("`@("`@("`@("`@("`@,2`@("XY.3`P,#`P12LP,"`@("XY
M.3DY.3DP12LP-"`@("XQ,#`P,#`P12LP,"`@("XR,S,X,#`P12LP,2`@("XQ
+,#`P,#`P12LP-0H@
`
end
STOP_CAT
echo "  Generating =====> [ ./axistick1.f ]"
cat <<"STOP_CAT"> ././axistick1.f
C     PROGRAM AXISTICK1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISTICK_LOFF
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISTICK object access program
      EXTERNAL AXISTICK_LOFF
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOTLOG_DEFINE, AXISSCALE_SAUTO
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV103 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISTICK.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
      LOGICAL TMP101, TMP102
C
C                       Character variables and arrays
      CHARACTER CFLAG*1, TMP103*1
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*1 VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV103 /'X', 'Y', 'B'/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axistick_loff.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISTICK Object Demo Program #1'/
     * ' This program tests the AXISTICK object access program'/
     * ' AXISTICK_LOFF.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISTICK_LOFF object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV103 = 1,NVV103
        CFLAG = VV103(IVV103)
C
C                       Suppress drawing minor tick marks on log axis
      CALL AXISTICK_LOFF (CFLAG)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL AXISSCALE_SAUTO (2,0.5,1.0,6,AMIN,DELV,AMAX)
      CALL AXISSCALE_SAUTO (2,0.5,1.0,6,AMINY,DELVY,AMAXY)
      CALL PLOTLOG_DEFINE (AMIN,DELV,AMINY,DELVY)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (XLOGTK .NEQV. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (YLOGTK .NEQV. TMP102 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) XLOGTK,YLOGTK,CFLAG
  502 FORMAT (L7,L7,A)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISTICK Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axistick2.f ]"
cat <<"STOP_CAT"> ././axistick2.f
C     PROGRAM AXISTICK2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISTICK_REVX,
C              AXISTICK_REVY, AXISTICK_REVZ
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISTICK object access program
      EXTERNAL AXISTICK_REVX, AXISTICK_REVY, AXISTICK_REVZ
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT3D_DEFINE, VIEWPT_SETBU, WORKBOX_DEFINE
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3, AXISLBL_DEFZ3
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISTICK.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axistick_revx.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISTICK Object Demo Program #2'/
     * ' This program tests the AXISTICK object access program'/
     * ' AXISTICK_REVX.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISTICK_REVX object access program
C
C                       Loop for each combination of access programs
      DO 589 IVV1=1,2
      DO 588 IVV2=1,2
      DO 587 IVV3=1,2
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.19)
      CALL WORKBOX_DEFINE (1., 1., 1.)
      CALL VIEWPT_SETBU (1.0, -2.0, 1.5)
      CALL AXISLBL_DEFX3 ('X Axis$',100)
      CALL AXISLBL_DEFY3 ('Y Axis$',100)
      CALL AXISLBL_DEFZ3 ('Z Axis$',100)
C
C                       Enable drawing of ticks on opposite (inner) edge
C                       of X axis
      IF (IVV1 .EQ. 2) THEN
        CALL AXISTICK_REVX ()
      ENDIF
C
C                       Enable drawing of ticks on opposite (inner) edge
C                       of Y axis
      IF (IVV2 .EQ. 2) THEN
        CALL AXISTICK_REVY ()
      ENDIF
C
C                       Enable drawing of ticks on opposite (inner) edge
C                       of Z axis
      IF (IVV3 .EQ. 2) THEN
        CALL AXISTICK_REVZ ()
      ENDIF
C
      CALL PLOT3D_DEFINE (0.0, 0., 1.0, 0.0, 0., 1.0, 0.0, 0., 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZXRTK .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZXRTK
  502 FORMAT (I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next combination
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISTICK Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axistick3.f ]"
cat <<"STOP_CAT"> ././axistick3.f
C     PROGRAM AXISTICK3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISTICK_SETMAX
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISTICK object access program
      EXTERNAL AXISTICK_SETMAX
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISTICK.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101, MTICKS, TMP102
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /0, 1, 25/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axistick_setmax.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISTICK Object Demo Program #3'/
     * ' This program tests the AXISTICK object access program'/
     * ' AXISTICK_SETMAX.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISTICK_SETMAX object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        MTICKS = VV102(IVV102)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
C
C                       Set maximum number of major tick marks
      CALL AXISTICK_SETMAX (MTICKS)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
C
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZMXTK .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZMXTK,MTICKS
  502 FORMAT (I21,I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISTICK Demo Program #3 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axistick4.f ]"
cat <<"STOP_CAT"> ././axistick4.f
C     PROGRAM AXISTICK4
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISTICK_SETX
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISTICK object access program
      EXTERNAL AXISTICK_SETX
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT3D_DEFINE, VIEWPT_SETBU, WORKBOX_DEFINE
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3, AXISLBL_DEFZ3
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  4)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISTICK.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101, ITICKS, TMP102
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /0, 1, 3, 10/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axistick_setx.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISTICK Object Demo Program #4'/
     * ' This program tests the AXISTICK object access program'/
     * ' AXISTICK_SETX.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISTICK_SETX object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        ITICKS = VV102(IVV102)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.19)
      CALL WORKBOX_DEFINE (1., 1., 1.)
      CALL VIEWPT_SETBU (1.0, -2.0, 1.5)
      CALL AXISLBL_DEFX3 ('X Axis$',100)
      CALL AXISLBL_DEFY3 ('Y Axis$',100)
      CALL AXISLBL_DEFZ3 ('Z Axis$',100)
C
C                       Set number of ticks per step on X axis
      CALL AXISTICK_SETX (ITICKS)
C
      CALL PLOT3D_DEFINE (0.0, 0., 1.0, 0.0, 0., 1.0, 0.0, 0., 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZXTCK .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZXTCK,ITICKS
  502 FORMAT (I21,I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISTICK Demo Program #4 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axistick5.f ]"
cat <<"STOP_CAT"> ././axistick5.f
C     PROGRAM AXISTICK5
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISTICK_SETY
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISTICK object access program
      EXTERNAL AXISTICK_SETY
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT3D_DEFINE, VIEWPT_SETBU, WORKBOX_DEFINE
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3, AXISLBL_DEFZ3
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  4)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISTICK.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101, ITICKS, TMP102
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /0, 1, 3, 10/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axistick_sety.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISTICK Object Demo Program #5'/
     * ' This program tests the AXISTICK object access program'/
     * ' AXISTICK_SETY.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISTICK_SETY object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        ITICKS = VV102(IVV102)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.19)
      CALL WORKBOX_DEFINE (1., 1., 1.)
      CALL VIEWPT_SETBU (1.0, -2.0, 1.5)
      CALL AXISLBL_DEFX3 ('X Axis$',100)
      CALL AXISLBL_DEFY3 ('Y Axis$',100)
      CALL AXISLBL_DEFZ3 ('Z Axis$',100)
C
C                       Set number of ticks per step on X axis
      CALL AXISTICK_SETY (ITICKS)
C
      CALL PLOT3D_DEFINE (0.0, 0., 1.0, 0.0, 0., 1.0, 0.0, 0., 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZXTCK .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZXTCK,ITICKS
  502 FORMAT (I21,I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISTICK Demo Program #5 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axistick6.f ]"
cat <<"STOP_CAT"> ././axistick6.f
C     PROGRAM AXISTICK6
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program AXISTICK_SETZ
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       AXISTICK object access program
      EXTERNAL AXISTICK_SETZ
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT3D_DEFINE, VIEWPT_SETBU, WORKBOX_DEFINE
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3, AXISLBL_DEFZ3
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  4)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'AXISTICK.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101, ITICKS, TMP102
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /0, 1, 3, 10/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'axistick_setz.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              AXISTICK Object Demo Program #6'/
     * ' This program tests the AXISTICK object access program'/
     * ' AXISTICK_SETZ.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test AXISTICK_SETZ object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        ITICKS = VV102(IVV102)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.19)
      CALL WORKBOX_DEFINE (1., 1., 1.)
      CALL VIEWPT_SETBU (1.0, -2.0, 1.5)
      CALL AXISLBL_DEFX3 ('X Axis$',100)
      CALL AXISLBL_DEFY3 ('Y Axis$',100)
      CALL AXISLBL_DEFZ3 ('Z Axis$',100)
C
C                       Set number of ticks per step on X axis
      CALL AXISTICK_SETZ (ITICKS)
C
      CALL PLOT3D_DEFINE (0.0, 0., 1.0, 0.0, 0., 1.0, 0.0, 0., 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZXTCK .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZXTCK,ITICKS
  502 FORMAT (I21,I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              AXISTICK Demo Program #6 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./axistick_loff.dat ]"
cat <<"STOP_CAT"> ././axistick_loff.uuu
begin 660 ./axistick_loff.dat
M("`@("`@1B`@("`@(%18"B`@("`@(%0@("`@("!&60H@("`@("!&("`@("`@
#1D(*
`
end
STOP_CAT
echo "  Generating =====> [ ./axistick_revx.dat ]"
cat <<"STOP_CAT"> ././axistick_revx.uuu
begin 660 ./axistick_revx.dat
M("`@("`@("`@("`@("`@("`@,C(R"B`@("`@("`@("`@("`@("`@(#(R,@H@
M("`@("`@("`@("`@("`@("`R,C(*("`@("`@("`@("`@("`@("`@,C(R"B`@
M("`@("`@("`@("`@("`@(#$Q,0H@("`@("`@("`@("`@("`@("`Q,3$*("`@
I("`@("`@("`@("`@("`@,3$Q"B`@("`@("`@("`@("`@("`@(#$Q,0H*
`
end
STOP_CAT
echo "  Generating =====> [ ./axistick_setmax.dat ]"
cat <<"STOP_CAT"> ././axistick_setmax.uuu
begin 660 ./axistick_setmax.dat
M("`@("`@("`@("`@("`@("`@("`P("`@("`@("`@("`@("`@("`@("`P"B`@
M("`@("`@("`@("`@("`@("`@,2`@("`@("`@("`@("`@("`@("`@,0H@("`@
G("`@("`@("`@("`@("`@,C4@("`@("`@("`@("`@("`@("`@,C4*
`
end
STOP_CAT
echo "  Generating =====> [ ./axistick_setx.dat ]"
cat <<"STOP_CAT"> ././axistick_setx.uuu
begin 660 ./axistick_setx.dat
M("`@("`@("`@("`@("`@("`@("`P("`@("`@("`@("`@("`@("`@("`P"B`@
M("`@("`@("`@("`@("`@("`@,2`@("`@("`@("`@("`@("`@("`@,0H@("`@
M("`@("`@("`@("`@("`@(#,@("`@("`@("`@("`@("`@("`@(#,*("`@("`@
E("`@("`@("`@("`@(#$P("`@("`@("`@("`@("`@("`@(#$P"C,*
`
end
STOP_CAT
echo "  Generating =====> [ ./axistick_sety.dat ]"
cat <<"STOP_CAT"> ././axistick_sety.uuu
begin 660 ./axistick_sety.dat
M("`@("`@("`@("`@("`@("`@("`Q("`@("`@("`@("`@("`@("`@("`P"B`@
M("`@("`@("`@("`@("`@("`@,2`@("`@("`@("`@("`@("`@("`@,0H@("`@
M("`@("`@("`@("`@("`@(#$@("`@("`@("`@("`@("`@("`@(#,*("`@("`@
E("`@("`@("`@("`@("`Q("`@("`@("`@("`@("`@("`@(#$P"C,*
`
end
STOP_CAT
echo "  Generating =====> [ ./axistick_setz.dat ]"
cat <<"STOP_CAT"> ././axistick_setz.uuu
begin 660 ./axistick_setz.dat
M("`@("`@("`@("`@("`@("`@("`Q("`@("`@("`@("`@("`@("`@("`P"B`@
M("`@("`@("`@("`@("`@("`@,2`@("`@("`@("`@("`@("`@("`@,0H@("`@
M("`@("`@("`@("`@("`@(#$@("`@("`@("`@("`@("`@("`@(#,*("`@("`@
E("`@("`@("`@("`@("`Q("`@("`@("`@("`@("`@("`@(#$P"C,*
`
end
STOP_CAT
echo "  Generating =====> [ ./barchart1.f ]"
cat <<"STOP_CAT"> ././barchart1.f
C     PROGRAM BARCHART1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program BARCHART_BLNKON
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      DIMENSION XBOT(5),YBOT(5)
      DIMENSION YTOP(5),YTOP2(5),YTOP3(5),YTOP4(5)
      DIMENSION IBARCL(5)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Coordinates for 5 bars of bar chart
      DATA XBOT / 1.5, 3.5, 5.5, 7.5, 9.5/
      DATA YBOT / 0.0, 0.0, 0.0, 0.0, 0.0/
      DATA YTOP / 3.1, 6.8, 4.0, 0.9, 1.6/
      DATA YTOP2/ 4.1, 7.8, 5.0, 1.9, 2.6/
      DATA YTOP3/ 5.1, 8.8, 6.0, 2.9, 3.6/
      DATA YTOP4/ 6.1, 9.8, 7.0, 3.9, 4.6/
C                       Bar colors for bar chart
C                   green magenta yellow blue red
      DATA IBARCL / 3,    6,      5,     4,   2/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Loop for each blanking option
      DO 100 IBL=1,2
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Turns border off
C                       (so it is not plotted by SUBPLOT_DEFINE)
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.12*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 2.5*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (previous call
C                       to FRAME_OFF keeps border from being drawn)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of title in inches
      XLEN = TEXT2D_GETLEN
     *       ('BARCHART1 Demo: Bar Chart Bar Blanking$',100)
C                       Determine X location in inches needed
C                       to center the title
      RLEN = (XPG-XLEN)*0.5
C                       Draw plot title under the subplot area
      CALL TEXT2D_PDRAW
     *    ('BARCHART1 Demo: Bar Chart Bar Blanking$',100,RLEN,-0.90*YRL)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Turn off numbering on X axis
      CALL AXISNUM_XOFF
C                       Set X axis label for 2-D plot
C                         "(No Numbering)" in italic (preceeded by
C                         '(' per mixed alphabet defined below)
      CALL AXISLBL_DEFX2 ('X-AXIS ((No Numbering))$',100)
C                       Set Y axis label for 2-D plot
      CALL AXISLBL_DEFY2 ('Y-AXIS',6)
C                       Set X axis tick density to zero (no tick marks)
      CALL AXISTICK_SETX (0)
C                       Set Y axis tick density to 2 tick marks per
C                       step increment
      CALL AXISTICK_SETY (2)
C                       Set angle of Y axis numbers to 60 degrees
C                       from horizontal
      CALL AXISNUM_ROTY (60.0)
C
C     ------------------------------------------------------------------
C
C                       DRAW PLOT HEADING
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.5)
C
      IF (IBL .EQ. 2) THEN
        CALL HEADING_DRAW ('Bar Blanking On$',100,2.0,1)
      ELSE
        CALL HEADING_DRAW ('Bar Blanking Off$',100,2.0,1)
      ENDIF
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system with
C                       X = 0.0 to 11.0 and Y = 0.0 to 11.0, and
C                       draw axes, axes labels with mixed alphabet
C                       still active (will italicize part of X label)
      CALL PLOT2D_DEFINE (0.0,1.0,11.0,0.0,1.0,10.0)
C                       Reset text font to standard font
      CALL GRAPHICS_RESET ('FONT_TRIPLX')
C                       Reset basic alphabet set to 'standard'
      CALL GRAPHICS_RESET ('FONT_ALPHA1')
C                       Deactivate 2nd alphabet set (was 'italic')
      CALL GRAPHICS_RESET ('FONT_ALPHA2')
C                       Deactivate 3rd alphabet set (was 'greek')
      CALL GRAPHICS_RESET ('FONT_ALPHA3')
C                       Deactivate 4th alphabet set (was 'script')
      CALL GRAPHICS_RESET ('FONT_ALPHA4')
C
C     ------------------------------------------------------------------
C
C                       DRAW BAR CHART IN CURRENT SUBPLOT AREA
C
C                       Draw horizontal grid lines at each Y increment
      CALL GRID_DRAW (0,1)
C                       Enable solid area fill pattern
      CALL FILLAREA_SETPAT (16)
C                       Set bar chart colors
      CALL BARCHART_SETCLR (5,IBARCL)
C                       Set bar thickness to a full X increment
      CALL BARCHART_THICK (-1.0)
C                       Draw 4 bars per group with gap between
C                       bars of 35% group thickness (bars will overlap)
      CALL BARCHART_SETGRP (4,-0.35)
C                       Enable bar area blanking
      IF (IBL .EQ. 2) THEN
        CALL BARCHART_BLNKON
      ENDIF
C                       Label bars with YTOP value above each bar
      CALL BARCHART_DEFLBL ('TOP','ABO-LEFT-PRP',1,0,0)
C
C                       Draw 1st bar in each of 5 groups of vert bars
      CALL BARCHART_DRAW (XBOT,YBOT,YTOP ,5,'V')
C                       Draw 2nd bar in each of 5 groups of vert bars
      CALL BARCHART_DRAW (XBOT,YBOT,YTOP2,5,'V')
C                       Draw 3rd bar in each of 5 groups of vert bars
      CALL BARCHART_DRAW (XBOT,YBOT,YTOP3,5,'V')
C                       Draw 4th bar in each of 5 groups of vert bars
      CALL BARCHART_DRAW (XBOT,YBOT,YTOP4,5,'V')
C
C                       Reset default drawing color (white)
      CALL GRAPHICS_RESET ('COLOR_SETNAM')
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  100 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./barchart2.f ]"
cat <<"STOP_CAT"> ././barchart2.f
C     PROGRAM BARCHART2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program BARCHART_DEFLBL
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (N108=6)
      PARAMETER (N109=30)
C
      DIMENSION XBOT(5),YBOT(5),YTOP(5),NBCLR(5)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
      CHARACTER*3  VV108(N108)
      CHARACTER*12 VV109(N109)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Coordinates for 5 bars of bar chart
      DATA XBOT / 1.0, 3.0, 5.0, 7.0, 9.0/
      DATA YBOT / 0.0, 0.0, 0.0, 0.0, 0.0/
      DATA YTOP / 3.1, 6.8, 4.0, 0.9, 1.6/
C
C                       Bar custom color numbers
      DATA NBCLR /8,9,10,11,12/
C
C                       Input variable test values
      DATA VV108 /'BOT', 'TOP', 'MAX', 'MIN', 'DEL', 'LOC'/
C
      DATA VV109 /'ABO-LEFT-PAR', 'ABO-LEFT-PRP', 'ABO-CENT-PAR',
     *            'ABO-CENT-PRP', 'ABO-RIGH-PAR', 'ABO-RIGH-PRP',
     *            'TOP-LEFT-PAR', 'TOP-LEFT-PRP', 'TOP-CENT-PAR',
     *            'TOP-CENT-PRP', 'TOP-RIGH-PAR', 'TOP-RIGH-PRP',
     *            'MID-LEFT-PAR', 'MID-LEFT-PRP', 'MID-CENT-PAR',
     *            'MID-CENT-PRP', 'MID-RIGH-PAR', 'MID-RIGH-PRP',
     *            'BOT-LEFT-PAR', 'BOT-LEFT-PRP', 'BOT-CENT-PAR',
     *            'BOT-CENT-PRP', 'BOT-RIGH-PAR', 'BOT-RIGH-PRP',
     *            'BEL-LEFT-PAR', 'BEL-LEFT-PRP', 'BEL-CENT-PAR',
     *            'BEL-CENT-PRP', 'BEL-RIGH-PAR', 'BEL-RIGH-PRP'/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Loop for each labeling option
      I108 = 0
      DO 100 ILBL=1,N109
      I109 = ILBL
      I108 = I108+1
      IF (I108 .GT. N108) I108=1
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUB-PLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Turns border off
C                       (so it is not plotted by SUBPLOT_DEFINE)
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.12*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 2.5*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define sub-plot area in terms of length
C                       of X and Y axis in inches (previous call
C                       to FRAME_OFF keeps border from being drawn)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of title in inches
      XLEN = TEXT2D_GETLEN
     *       ('BARCHART2 Demo: Bar Chart Labeling$',100)
C                       Determine X location in inches needed
C                       to center the title
      RLEN = (XPG-XLEN)*0.5
C                       Draw plot title under the sub-plot area
      CALL TEXT2D_PDRAW ('BARCHART2 Demo: Bar Chart Labeling$',
     *     100,RLEN,-0.90*YRL)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Turn off numbering on X axis
      CALL AXISNUM_XOFF
C                       Set X axis label for 2-D plot
C                       "(No Numbering)" in italic (preceeded by
C                       '(' per mixed alphabet defined below)
      CALL AXISLBL_DEFX2 ('X-AXIS ((No Numbering))$',100)
C                       Set Y axis label for 2-D plot
      CALL AXISLBL_DEFY2 ('Y-AXIS',6)
C                       Set X axis tick density to zero (no tick marks)
      CALL AXISTICK_SETX (0)
C                       Set Y axis tick density to 2 tick marks per
C                       step increment
      CALL AXISTICK_SETY (2)
C                       Set angle of Y axis numbers to 60 degrees
C                       from horizontal
      CALL AXISNUM_ROTY (60.0)
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.75)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Set color to white
      CALL COLOR_SETNAM ('WHIT')
C                       Define 2D coordinate system with
C                       X = 0.0 to 11.0 and Y = 0.0 to 11.0, and
C                       draw axes, axes labels with mixed alphabet
C                       still active (will italicize part of X label)
      CALL PLOT2D_DEFINE (0.0,1.0,11.0,0.0,1.0,10.0)
C
C     ------------------------------------------------------------------
C
C                       DRAW BAR CHART IN CURRENT SUB-PLOT AREA
C
C                       Label bars with current option set
      CALL BARCHART_DEFLBL (VV108(I108),VV109(I109),1,1,MOD(ILBL,2))
C
C                       Draw horizontal grid lines at each Y increment
      CALL GRID_DRAW (0,1)
C                       Define custom colors for bars
      CALL COLOR_DEFRGB ( 8, 15.,50.,85.,IERR)
      CALL COLOR_DEFRGB ( 9,85.,50., 15.,IERR)
      CALL COLOR_DEFRGB (10, 15.,85.,50.,IERR)
      CALL COLOR_DEFRGB (11,50.,50.,85.,IERR)
      CALL COLOR_DEFRGB (12,85., 15., 15.,IERR)
C
C                       Enable custom bar colors
      CALL BARCHART_SETCLR (5,NBCLR)
C                       Enable solid area fill pattern
      CALL FILLAREA_SETPAT (16)
C                       Set bar thickness to a full X increment
      CALL BARCHART_THICK (-1.0)
C                       Draw 1st bar in each of 5 groups of vert bars
      CALL BARCHART_DRAW (XBOT,YBOT,YTOP ,5,'V')
C
C     ******************************************************************
C
C                       END THE SUB-PLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  100 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./barchart3.f ]"
cat <<"STOP_CAT"> ././barchart3.f
C     PROGRAM BARCHART3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program BARCHART_DRAW and
C              BARCHART_SETGRP
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      DIMENSION XBOT(5),YBOT(5)
      DIMENSION YTOP(5),YTOP2(5),YTOP3(5),YTOP4(5)
      DIMENSION X6(4),Y6(4),IBARCL(5)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Coordinates for 5 bars of bar chart
      DATA XBOT / 1.5, 3.5, 5.5, 7.5, 9.5/
      DATA YBOT / 0.0, 0.0, 0.0, 0.0, 0.0/
      DATA YTOP / 3.1, 6.8, 4.0, 0.9, 1.6/
      DATA YTOP2/ 4.1, 7.8, 5.0, 1.9, 2.6/
      DATA YTOP3/ 5.1, 8.8, 6.0, 2.9, 3.6/
      DATA YTOP4/ 6.1, 9.8, 7.0, 3.9, 4.6/
C                       Coordinates for B-spline curve
      DATA X6,Y6 /1.0, 2.0, 3.0, 4.0,   1.0, 2.0, 1.0, 4.0/
C                       Bar colors for bar chart
C                   green magenta yellow blue red
      DATA IBARCL / 3,    6,      5,     4,   2/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Turns border off
C                       (so it is not plotted by SUBPLOT_DEFINE)
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.12*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 2.5*YRL
C                       Compute origin of area reserved for subplot
C                       as a fraction of axes lengths
      XLL = 0.60*XPG
      YLL = 0.43*YPG
C                       Compute width and height of reserved area
C                       as a fraction of axes lengths
      XWD = 0.42*XPG
      YHI = 0.54*YPG
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (previous call
C                       to FRAME_OFF keeps border from being drawn)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of title in inches
      XLEN = TEXT2D_GETLEN
     *       ('BARCHART3 Demo: Bar Chart and Subplot$',100)
C                       Determine X location in inches needed
C                       to center the title
      RLEN = (XPG-XLEN)*0.5
C                       Draw plot title under the subplot area
      CALL TEXT2D_PDRAW
     *     ('BARCHART3 Demo: Bar Chart and Subplot$',100,RLEN,-0.90*YRL)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Turn off numbering on X axis
      CALL AXISNUM_XOFF
C                       Set X axis label for 2-D plot
C                         "(No Numbering)" in italic (preceeded by
C                         '(' per mixed alphabet defined below)
      CALL AXISLBL_DEFX2 ('X-AXIS ((No Numbering))$',100)
C                       Set Y axis label for 2-D plot
      CALL AXISLBL_DEFY2 ('Y-AXIS',6)
C                       Set X axis tick density to zero (no tick marks)
      CALL AXISTICK_SETX (0)
C                       Set Y axis tick density to 2 tick marks per
C                       step increment
      CALL AXISTICK_SETY (2)
C                       Set angle of Y axis numbers to 60 degrees
C                       from horizontal
      CALL AXISNUM_ROTY (60.0)
C
C     ------------------------------------------------------------------
C
C                       DRAW PLOT HEADING
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.75)
C                       Set text font to 'triplx'
      CALL FONT_TRIPLX
C                       Set basic alphabet set to 'standard'
C                       with ')' as the change indicator character
      CALL FONT_ALPHA1 ('STAND',')')
C                       Set 2nd alphabet set to 'italic'
C                       with '(' as the change indicator character
      CALL FONT_ALPHA2 ('ITALIC','(')
C                       Set 3rd alphabet set to 'greek'
C                       with '[' as the change indicator character
      CALL FONT_ALPHA3 ('GREEK','[')
C                       Set 4th alphabet set to 'script'
C                       with ']' as the change indicator character
      CALL FONT_ALPHA4 ('SCRIPT',']')
C                       Draw 1st line of 4-line heading in mixed font
C                       at 2x height and underline twice
C                         "Bar Chart" in italic (preceeded by '(' )
C                         "and" in standard (preceeded by ')' )
C                         "Subplot" in script (preceeded by ']' )
      CALL HEADING_DRAW ('(Bar Chart )and ]Subplot)$',-100,-2.0,4)
C                       Make 2nd line of heading blank at 1x height
      CALL HEADING_DRAW (' $',100,1.0,4)
C                       Draw 3rd line of heading in mixed font at
C                       1.5x height and underline once
C                         "Integer" in standard font
C                         "Real Axis" in italic (preceeded by '(' )
      CALL HEADING_DRAW('Integer / (Real Axis)$',-100,1.5,4)
C                       Set text font to 'duplex'
      CALL FONT_DUPLEX
C                       Draw 4th line of heading in duplex font
      CALL HEADING_DRAW ('Ticks and Text Angle Variations$',100,1.0,4)
C                       Reset text font to standard font
      CALL GRAPHICS_RESET ('FONT_DUPLEX')
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system with
C                       X = 0.0 to 11.0 and Y = 0.0 to 11.0, and
C                       draw axes, axes labels with mixed alphabet
C                       still active (will italicize part of X label)
      CALL PLOT2D_DEFINE (0.0,1.0,11.0,0.0,1.0,10.0)
C                       Reset text font to standard font
      CALL GRAPHICS_RESET ('FONT_TRIPLX')
C                       Reset basic alphabet set to 'standard'
      CALL GRAPHICS_RESET ('FONT_ALPHA1')
C                       Deactivate 2nd alphabet set (was 'italic')
      CALL GRAPHICS_RESET ('FONT_ALPHA2')
C                       Deactivate 3rd alphabet set (was 'greek')
      CALL GRAPHICS_RESET ('FONT_ALPHA3')
C                       Deactivate 4th alphabet set (was 'script')
      CALL GRAPHICS_RESET ('FONT_ALPHA4')
C
C     ------------------------------------------------------------------
C
C                       DRAW BAR CHART IN CURRENT SUBPLOT AREA
C
C                       Enable blanking of recangular area
C                       reserved for second subplot
      CALL BLNKAREA_DEF (XLL,YLL,XWD,YHI,0.03)
C                       Draw horizontal grid lines at each Y increment
      CALL GRID_DRAW (0,1)
C                       Enable solid area fill pattern
      CALL FILLAREA_SETPAT (16)
C                       Set bar chart colors
      CALL BARCHART_SETCLR (5,IBARCL)
C                       Set bar thickness to a full X increment
      CALL BARCHART_THICK (-1.0)
C                       Draw 4 bars per group with gap between
C                       bars of 35% group thickness (bars will overlap)
      CALL BARCHART_SETGRP (4,-0.35)
C                       Enable bar area blanking
      CALL BARCHART_BLNKON
C                       Label bars with YTOP value above each bar
      CALL BARCHART_DEFLBL ('TOP','ABO-LEFT-PRP',1,0,0)
C
C                       Draw 1st bar in each of 5 groups of vert bars
      CALL BARCHART_DRAW (XBOT,YBOT,YTOP ,5,'V')
C                       Draw 2nd bar in each of 5 groups of vert bars
      CALL BARCHART_DRAW (XBOT,YBOT,YTOP2,5,'V')
C                       Draw 3rd bar in each of 5 groups of vert bars
      CALL BARCHART_DRAW (XBOT,YBOT,YTOP3,5,'V')
C                       Draw 4th bar in each of 5 groups of vert bars
      CALL BARCHART_DRAW (XBOT,YBOT,YTOP4,5,'V')
C
C                       Reset default drawing color (white)
      CALL GRAPHICS_RESET ('COLOR_SETNAM')
C                       Disable area blanking
      CALL GRAPHICS_RESET ('BLNKAL')
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA FOR SECOND SUBPLOT
C
C                       Reduce text height to 60% of height
C                       used for 1st subplot
      SIZE = 0.6*SIZE
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Compute location of origin of subplot axis
C                       to be 20% of width & height of reserved area
C                       from lower left corner of reserved area
      XLL = XLL + 0.20*XWD
      YLL = YLL + 0.20*YHI
C                       Compute length of subplot axis to be 60%
C                       of width and height of reserved area
      XWD = 0.60*XWD
      YHI = 0.60*YHI
C                       Move physical origin to origin of subplot
C                       axis (distance in inches)
      CALL ORIGIN_MOVE (XLL,YLL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border drawing
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XWD,YHI)
C
C     ******************************************************************
C
C                       DEFINE PLOT HEADING AND LABELS
C
C                       Re-enable X axis numbering
      CALL GRAPHICS_RESET ('AXISNUM_XOFF')
C                       Set X axis numering to integer
      CALL AXISNUM_INTX
C                       Set X axis tick density to 4 ticks/step
      CALL AXISTICK_SETX (4)
C                       Define X axis label
      CALL AXISLBL_DEFX2 ('INTEGER X-AXIS$',100)
C                       Define Y axis label
      CALL AXISLBL_DEFY2 ('REAL Y-AXIS$',100)
C                       Reset axis numbering text angle to default
C                       (parallel to given axis)
      CALL GRAPHICS_RESET ('AXISNUM_ROTY')
C                       Set font to 'cartog'
      CALL FONT_CARTOG
C                       Set basic alphabet set to 'standard'
C                       with ']' as the change indicator character
      CALL FONT_ALPHA1 ('STAND',']')
C                       Set 2nd alphabet set to 'greek'
C                       with '[' as the change indicator character
      CALL FONT_ALPHA2 ('GREEK','[')
C                       Draw 1st line of 2-line subplot title
      CALL HEADING_DRAW ('SUB PLOT$',100,-1.0,2)
C                       Draw 2nd line of 2-line subplot title
C                         with "2qp" in greek
      CALL HEADING_DRAW ('(circ = [2qp])$',100,1.0,2)
C                       Reset text font to standard font
      CALL GRAPHICS_RESET ('FONT_CARTOG')
C                       Reset basic alphabet set to 'standard'
      CALL GRAPHICS_RESET ('FONT_ALPHA1')
C                       Deactivate 2nd alphabet set (was 'greek')
      CALL GRAPHICS_RESET ('FONT_ALPHA2')
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system with
C                       X = 0.0 to 4.0 and Y = 0.0 to 4.0, and
C                       draw axes, axes labels
      CALL PLOT2D_DEFINE (1.0,1.0,4.0,0.0,1.0,4.0)
C
C     ------------------------------------------------------------------
C
C                       DRAW SPLINE CURVE
C
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Set spline interpolation
      CALL CURVE2D_CUBIC
C                       Draw curve using cubic spline interpolation
C                       with symbol at each data point
      CALL CURVE2D_DRAW (X6,Y6,4,1)
C
C     ------------------------------------------------------------------
C
C                       DRAW VECTOR AND LABEL IDENTIFYING CURVE
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Draw vector from (3,3) to (3.5,2.5)
      CALL VEC2_WDRAW (3.0,3.0,3.5,2.5,1221)
C                       Set basic alphabet set to 'italic'
      CALL FONT_ALPHA ('ITALI')
C                       Set secondary alphabet set to 'greek'
      CALL FONT_ALPHAB ('GREEK')
C                       Compute X coordinate of vector tail
C                       and convert to inches
      XX = PAGE_CVXWC (3.0,3.0) - TEXT2D_GETLEN('B-SPLINE$',100)
C                       Convert Y coord of vector tail from
C                       world coordinates to inches
      YY = PAGE_CVYWC (3.0,3.0)
C                       Draw vector label
      CALL TEXT2D_PDRAW ('B-spline$',100,XX,YY)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./barchart4.f ]"
cat <<"STOP_CAT"> ././barchart4.f
C     PROGRAM BARCHART4
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program BARCHART_SETCLR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      DIMENSION XBOT(5),YBOT(5),YTOP(5),NBCLR(5)
      REAL X6(4),Y6(4)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Coordinates for 5 bars of bar chart
      DATA XBOT / 1.0, 3.0, 5.0, 7.0, 9.0/
      DATA YBOT / 0.0, 0.0, 0.0, 0.0, 0.0/
      DATA YTOP / 3.1, 6.8, 4.0, 0.9, 1.6/
C
C                       Bar custom color numbers
      DATA NBCLR /8,9,10,11,12/
C
C                       Coordinates for B-spline curve
      DATA X6,Y6 /1.0, 2.0, 3.0, 4.0,   1.0, 2.0, 1.0, 4.0/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUB-PLOT AREA FOR FIRST SUB-PLOT
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Turns border off
C                       (so it is not plotted by SUBPLOT_DEFINE)
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.12*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 2.5*YRL
C                       Compute origin of area reserved for sub-plot
C                       as a fraction of axes lengths
      XLL = 0.60*XPG
      YLL = 0.43*YPG
C                       Compute width and height of reserved area
C                       as a fraction of axes lengths
      XWD = 0.42*XPG
      YHI = 0.54*YPG
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define sub-plot area in terms of length
C                       of X and Y axis in inches (previous call
C                       to FRAME_OFF keeps border from being drawn)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of title in inches
      XLEN = TEXT2D_GETLEN
     *       ('BARCHART4 Demo: Bar Chart with User Colors$',100)
C                       Determine X location in inches needed
C                       to center the title
      RLEN = (XPG-XLEN)*0.5
C                       Draw plot title under the sub-plot area
      CALL TEXT2D_PDRAW ('BARCHART4 Demo: Bar Chart with User Colors$',
     *     100,RLEN,-0.90*YRL)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Turn off numbering on X axis
      CALL AXISNUM_XOFF
C                       Set X axis label for 2-D plot
C                       "(No Numbering)" in italic (preceeded by
C                       '(' per mixed alphabet defined below)
      CALL AXISLBL_DEFX2 ('X-AXIS ((No Numbering))$',100)
C                       Set Y axis label for 2-D plot
      CALL AXISLBL_DEFY2 ('Y-AXIS',6)
C                       Set X axis tick density to zero (no tick marks)
      CALL AXISTICK_SETX (0)
C                       Set Y axis tick density to 2 tick marks per
C                       step increment
      CALL AXISTICK_SETY (2)
C                       Set angle of Y axis numbers to 60 degrees
C                       from horizontal
      CALL AXISNUM_ROTY (60.0)
C
C     ------------------------------------------------------------------
C
C                       DRAW PLOT HEADING
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.75)
C                       Set text font to 'triplx'
      CALL FONT_TRIPLX
C                       Set basic alphabet set to 'standard'
C                       with ')' as the change indicator character
      CALL FONT_ALPHA1 ('STAND',')')
C                       Set 2nd alphabet set to 'italic'
C                       with '(' as the change indicator character
      CALL FONT_ALPHA2 ('ITALIC','(')
C                       Set 3rd alphabet set to 'greek'
C                       with '[' as the change indicator character
      CALL FONT_ALPHA3 ('GREEK','[')
C                       Set 4th alphabet set to 'script'
C                       with ']' as the change indicator character
      CALL FONT_ALPHA4 ('SCRIPT',']')
C                       Set color to green
      CALL COLOR_SETNAM ('GREE')
C                       Draw 1st line of 4-line heading in mixed font
C                       at 2x height and underline twice
C                       "Bar Chart" in italic (preceeded by '(' )
C                       "and" in standard (preceeded by ')' )
C                       "Sub-plot" in script (preceeded by ']' )
      CALL HEADING_DRAW ('(Bar Chart )and ]Sub-plot)$',-100,-2.0,4)
C                       Make 2nd line of heading blank at 1x height
      CALL HEADING_DRAW (' $',100,1.0,4)
C                       Draw 3rd line of heading in mixed font at
C                       1.5x height and underline once
C                         "Integer" in standard font
C                         "Real Axis" in italic (preceeded by '(' )
      CALL HEADING_DRAW ('Integer / (Real Axis)$',-100,1.5,4)
C                       Set text font to 'duplex'
      CALL FONT_DUPLEX
C                       Draw 4th line of heading in duplex font
      CALL HEADING_DRAW ('Ticks and Text Angle Variations$',100,1.0,4)
C                       Reset text font to standard font
      CALL GRAPHICS_RESET ('FONT_DUPLEX')
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Set color to white
      CALL COLOR_SETNAM ('WHIT')
C                       Define 2D coordinate system with
C                       X = 0.0 to 11.0 and Y = 0.0 to 11.0, and
C                       draw axes, axes labels with mixed alphabet
C                       still active (will italicize part of X label)
      CALL PLOT2D_DEFINE (0.0,1.0,11.0,0.0,1.0,10.0)
C                       Reset text font to standard font
      CALL GRAPHICS_RESET ('FONT_TRIPLX')
C                       Reset basic alphabet set to 'standard'
      CALL GRAPHICS_RESET ('FONT_ALPHA1')
C                       Deactivate 2nd alphabet set (was 'italic')
      CALL GRAPHICS_RESET ('FONT_ALPHA2')
C                       Deactivate 3rd alphabet set (was 'greek')
      CALL GRAPHICS_RESET ('FONT_ALPHA3')
C                       Deactivate 4th alphabet set (was 'script')
      CALL GRAPHICS_RESET ('FONT_ALPHA4')
C
C     ------------------------------------------------------------------
C
C                       DRAW BAR CHART IN CURRENT SUB-PLOT AREA
C
C                       Enable blanking of recangular area
C                       reserved for second sub-plot
      CALL BLNKAREA_DEF (XLL,YLL,XWD,YHI,0.03)
C                       Draw horizontal grid lines at each Y increment
      CALL GRID_DRAW (0,1)
C                       Define custom colors for bars
      CALL COLOR_DEFRGB ( 8, 15.,50.,85.,IERR)
      CALL COLOR_DEFRGB ( 9,85.,50., 15.,IERR)
      CALL COLOR_DEFRGB (10, 15.,85.,50.,IERR)
      CALL COLOR_DEFRGB (11,50.,50.,85.,IERR)
      CALL COLOR_DEFRGB (12,85., 15., 15.,IERR)
C
C                       Enable custom bar colors
      CALL BARCHART_SETCLR (5,NBCLR)
C                       Enable solid area fill pattern
      CALL FILLAREA_SETPAT (16)
C                       Set bar thickness to a full X increment
      CALL BARCHART_THICK (-1.0)
C                       Draw 1st bar in each of 5 groups of vert bars
      CALL BARCHART_DRAW (XBOT,YBOT,YTOP ,5,'V')
C
C                       Disable area blanking
      CALL GRAPHICS_RESET ('BLNKAL')
C
C     ******************************************************************
C
C                       END THE SUB-PLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       DEFINE SUB-PLOT AREA FOR SECOND SUB-PLOT
C
C
C                       Reduce text height to 60% of height
C                       used for 1st sub-plot
      SIZE = 0.6*SIZE
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Compute location of origin of sub-plot axis
C                       to be 20% of width & height of reserved area
C                       from lower left corner of reserved area
      XLL = XLL + 0.20*XWD
      YLL = YLL + 0.20*YHI
C                       Compute length of sub-plot axis to be 60%
C                       of width and height of reserved area
      XWD = 0.60*XWD
      YHI = 0.60*YHI
C                       Move physical origin to origin of sub-plot
C                       axis (distance in inches)
      CALL ORIGIN_MOVE (XLL,YLL)
C                       Define sub-plot area in terms of length
C                       of X and Y axis in inches (border drawing
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XWD,YHI)
C
C     ******************************************************************
C
C                       DEFINE PLOT HEADING AND LABELS
C
C                       Re-enable X axis numbering
      CALL GRAPHICS_RESET ('AXISNUM_XOFF')
C                       Set X axis numering to integer
      CALL AXISNUM_INTX
C                       Set X axis tick density to 4 ticks/step
      CALL AXISTICK_SETX (4)
C                       Define X axis label
      CALL AXISLBL_DEFX2 ('INTEGER X-AXIS$',100)
C                       Define Y axis label
      CALL AXISLBL_DEFY2 ('REAL Y-AXIS$',100)
C                       Reset axis numbering text angle to default
C                       (parallel to given axis)
      CALL GRAPHICS_RESET ('AXISNUM_ROTY')
C                       Set font to 'cartog'
      CALL FONT_CARTOG
C                       Set basic alphabet set to 'standard'
C                       with ']' as the change indicator character
      CALL FONT_ALPHA1 ('STAND',']')
C                       Set 2nd alphabet set to 'greek'
C                       with '[' as the change indicator character
      CALL FONT_ALPHA2 ('GREEK','[')
C                       Draw 1st line of 2-line sub-plot title
      CALL HEADING_DRAW ('SUB PLOT$',100,-1.0,2)
C                       Draw 2nd line of 2-line sub-plot title
C                         with "2qp" in greek
      CALL HEADING_DRAW ('(circ = [2qp])$',100,1.0,2)
C                       Reset text font to standard font
      CALL GRAPHICS_RESET ('FONT_CARTOG')
C                       Reset basic alphabet set to 'standard'
      CALL GRAPHICS_RESET ('FONT_ALPHA1')
C                       Deactivate 2nd alphabet set (was 'greek')
      CALL GRAPHICS_RESET ('FONT_ALPHA2')
C
C     ******************************************************************
C
C                       DRAW THE PLOT AXES
C
C                       Define 2D coordinate system with
C                       X = 0.0 to 4.0 and Y = 0.0 to 4.0, and
C                       draw axes, axes labels
      CALL PLOT2D_DEFINE (1.0,1.0,4.0,0.0,1.0,4.0)
C
C     ------------------------------------------------------------------
C
C                       DRAW SPLINE CURVE
C
C                       Set current drawing color
      CALL COLOR_DEFRGB (13,0.0,100.0,100.0,IERR)
      CALL COLOR_SETNUM (13,IERR)
C                       Set spline interpolation
      CALL CURVE2D_CUBIC
C                       Draw curve using cubic spline interpolation
C                       with symbol at each data point
      CALL CURVE2D_DRAW (X6,Y6,4,1)
C
C     ------------------------------------------------------------------
C
C                       DRAW VECTOR AND LABEL IDENTIFYING CURVE
C
C                       Set current drawing color
      CALL COLOR_DEFRGB (14,0.0,100.0,0.0,IERR)
      CALL COLOR_SETNUM (14,IERR)
C                       Draw vector from (3,3) to (3.5,2.5)
      CALL VEC2_WDRAW (3.0,3.0,3.5,2.5,1221)
C                       Set basic alphabet set to 'italic'
      CALL FONT_ALPHA ('ITALI')
C                       Set secondary alphabet set to 'greek'
      CALL FONT_ALPHAB ('GREEK')
C                       Compute X coordinate of vector tail
C                       and convert to inches
      XX = PAGE_CVXWC (3.0,3.0) - TEXT2D_GETLEN('B-SPLINE$',100)
C                       Convert Y coord of vector tail from
C                       world coordinates to inches
      YY = PAGE_CVYWC (3.0,3.0)
C                       Draw vector label
      CALL TEXT2D_PDRAW ('B-spline$',100,XX,YY)
C
C     ******************************************************************
C
C                       END THE SUB-PLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
 
STOP_CAT
echo "  Generating =====> [ ./barchart5.f ]"
cat <<"STOP_CAT"> ././barchart5.f
C     PROGRAM BARCHART5
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program BARCHART_SETGRP
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       BARCHART object access program
      EXTERNAL BARCHART_SETGRP
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV104 =  3)
      PARAMETER (NVV105 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'BARCHART.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101, TMP102, NBPG, TMP104
C
C                       Real variables and arrays
      REAL    TMP103, GAP, TMP105
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV104(NVV104)
      REAL    VV105(NVV105)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV104 /4, 3, 2/
C
      DATA VV105 /-0.0001, .5, -.5/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'barchart_setgrp.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              BARCHART Object Demo Program #5'/
     * ' This program tests the BARCHART object access program'/
     * ' BARCHART_SETGRP.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A//
     * ' This demo generates a blank plot.'/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test BARCHART_SETGRP object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV104 = 1,NVV104
        NBPG = VV104(IVV104)
C
      DO 588 IVV105 = 1,NVV105
        GAP = VV105(IVV105)
C
C                       Specify bar grouping for a bar chart
      CALL BARCHART_SETGRP (NBPG,GAP)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZBRGP .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (KZBRGI .NE. TMP102 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZBRGP ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZBRGP,KZBRGI,ZZBRGP,NBPG,GAP
  502 FORMAT (I21,I21,E15.7,I21,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  589 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              BARCHART Demo Program #5 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./barchart6.f ]"
cat <<"STOP_CAT"> ././barchart6.f
C     PROGRAM BARCHART6
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program BARCHART_THICK
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (NTHK=6)
C
      DIMENSION XBOT(5),YBOT(5),YTOP(5),NBCLR(5)
      DIMENSION THICK(NTHK)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Coordinates for 5 bars of bar chart
      DATA XBOT / 1.0, 3.0, 5.0, 7.0, 9.0/
      DATA YBOT / 0.0, 0.0, 0.0, 0.0, 0.0/
      DATA YTOP / 3.1, 6.8, 4.0, 0.9, 1.6/
C
C                       Bar custom color numbers
      DATA NBCLR /8,9,10,11,12/
C
C                       Bar thickness values
      DATA THICK /-0.1,-0.5, -1.0, 0.010, 0.100, 1.0/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Loop for each each bar thickness
      DO 100 ITHK=1,NTHK
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUB-PLOT AREA FOR FIRST SUB-PLOT
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Turns border off
C                       (so it is not plotted by SUBPLOT_DEFINE)
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.12*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 2.5*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define sub-plot area in terms of length
C                       of X and Y axis in inches (previous call
C                       to FRAME_OFF keeps border from being drawn)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of title in inches
      XLEN = TEXT2D_GETLEN
     *       ('BARCHART6 Demo: Bar Chart Bar Thickness$',100)
C                       Determine X location in inches needed
C                       to center the title
      RLEN = (XPG-XLEN)*0.5
C                       Draw plot title under the sub-plot area
      CALL TEXT2D_PDRAW ('BARCHART6 Demo: Bar Chart Bar Thickness$',
     *     100,RLEN,-0.90*YRL)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Turn off numbering on X axis
      CALL AXISNUM_XOFF
C                       Set X axis label for 2-D plot
C                       "(No Numbering)" in italic (preceeded by
C                       '(' per mixed alphabet defined below)
      CALL AXISLBL_DEFX2 ('X-AXIS ((No Numbering))$',100)
C                       Set Y axis label for 2-D plot
      CALL AXISLBL_DEFY2 ('Y-AXIS',6)
C                       Set X axis tick density to zero (no tick marks)
      CALL AXISTICK_SETX (0)
C                       Set Y axis tick density to 2 tick marks per
C                       step increment
      CALL AXISTICK_SETY (2)
C                       Set angle of Y axis numbers to 60 degrees
C                       from horizontal
      CALL AXISNUM_ROTY (60.0)
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.75)
C
C     ******************************************************************
C
C                       DRAW BAR CHART IN CURRENT SUB-PLOT AREA
C
C                       Define 2D coordinate system with
C                       X = 0.0 to 11.0 and Y = 0.0 to 11.0, and
C                       draw axes, axes labels with mixed alphabet
C                       still active (will italicize part of X label)
      CALL PLOT2D_DEFINE (0.0,1.0,11.0,0.0,1.0,10.0)
C
C                       Draw horizontal grid lines at each Y increment
      CALL GRID_DRAW (0,1)
C                       Define custom colors for bars
      CALL COLOR_DEFRGB ( 8, 15.,50.,85.,IERR)
      CALL COLOR_DEFRGB ( 9,85.,50., 15.,IERR)
      CALL COLOR_DEFRGB (10, 15.,85.,50.,IERR)
      CALL COLOR_DEFRGB (11,50.,50.,85.,IERR)
      CALL COLOR_DEFRGB (12,85., 15., 15.,IERR)
C
C                       Enable custom bar colors
      CALL BARCHART_SETCLR (5,NBCLR)
C                       Enable solid area fill pattern
      CALL FILLAREA_SETPAT (16)
C                       Set bar thickness to a full X increment
      CALL BARCHART_THICK (THICK(ITHK))
C                       Draw 1st bar in each of 5 groups of vert bars
      CALL BARCHART_DRAW (XBOT,YBOT,YTOP ,5,'V')
C
C                       Disable area blanking
      CALL GRAPHICS_RESET ('BLNKAL')
C
C     ******************************************************************
C
C                       END THE SUB-PLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  100 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./barchart_setgrp.dat ]"
cat <<"STOP_CAT"> ././barchart_setgrp.uuu
begin 660 ./barchart_setgrp.dat
M("`@("`@("`@("`@("`@("`@("`T("`@("`@("`@("`@("`@("`@("`P("`M
M+C$P,#`P,#!%+3`S("`@("`@("`@("`@("`@("`@("`T("`M+C$P,#`P,#!%
M+3`S"B`@("`@("`@("`@("`@("`@("`@-"`@("`@("`@("`@("`@("`@("`@
M,"`@("XU,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@("`@-"`@("XU,#`P
M,#`P12LP,`H@("`@("`@("`@("`@("`@("`@(#0@("`@("`@("`@("`@("`@
M("`@(#`@("TN-3`P,#`P,$4K,#`@("`@("`@("`@("`@("`@("`@(#0@("TN
M-3`P,#`P,$4K,#`*("`@("`@("`@("`@("`@("`@("`S("`@("`@("`@("`@
M("`@("`@("`P("`M+C$P,#`P,#!%+3`S("`@("`@("`@("`@("`@("`@("`S
M("`M+C$P,#`P,#!%+3`S"B`@("`@("`@("`@("`@("`@("`@,R`@("`@("`@
M("`@("`@("`@("`@,"`@("XU,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@
M("`@,R`@("XU,#`P,#`P12LP,`H@("`@("`@("`@("`@("`@("`@(#,@("`@
M("`@("`@("`@("`@("`@(#`@("TN-3`P,#`P,$4K,#`@("`@("`@("`@("`@
M("`@("`@(#,@("TN-3`P,#`P,$4K,#`*("`@("`@("`@("`@("`@("`@("`R
M("`@("`@("`@("`@("`@("`@("`P("`M+C$P,#`P,#!%+3`S("`@("`@("`@
M("`@("`@("`@("`R("`M+C$P,#`P,#!%+3`S"B`@("`@("`@("`@("`@("`@
M("`@,B`@("`@("`@("`@("`@("`@("`@,"`@("XU,#`P,#`P12LP,"`@("`@
M("`@("`@("`@("`@("`@,B`@("XU,#`P,#`P12LP,`H@("`@("`@("`@("`@
M("`@("`@(#(@("`@("`@("`@("`@("`@("`@(#`@("TN-3`P,#`P,$4K,#`@
D("`@("`@("`@("`@("`@("`@(#(@("TN-3`P,#`P,$4K,#`*
`
end
STOP_CAT
echo "  Generating =====> [ ./curve2d1.f ]"
cat <<"STOP_CAT"> ././curve2d1.f
C     PROGRAM CURVE2D1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access programs CURVE2D_CUBIC,
C              CURVE2D_POLY and CURVE2D_SPLINE
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (NCRV=6)
C
      DIMENSION X(NCRV),Y(NCRV)
      DIMENSION XV(NCRV),YV(NCRV)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Arrays defining data for curve to be drawn
      DATA X / 0.0, 2.0, 4.0, 6.0, 8.0, 10. /
      DATA Y / 0.0, 1.0, 2.0, 8.0, 9.0, 10. /
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Loop for each curve type
      DO 100 ICRV=1,4
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Compute length of X and Y axis in inches
C                       for a square plot
      IF (XPAGE .GT. YPAGE) THEN
        YPG = YPAGE * 0.75
        XPG = YPG
      ELSE
        XPG = XPAGE * 0.75
        YPG = XPG
      END IF
C                       Compute location of physical origin in inches
C                       so that plot will be centered on the page
      XRL = 0.5 * (XPAGE-XPG)
      YRL = 0.75 * (YPAGE-YPG)
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (XRL,YRL)
C                       Disable border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plotting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DEFINE PLOT HEADING AND AXES LABELS
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*.8)
C                       Set X axis label for 2-D plot
      CALL AXISLBL_DEFX2 ('X Axis',6)
C                       Set Y axis label for 2-D plot
      CALL AXISLBL_DEFY2 ('Y Axis',6)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Store X lower and upper limits of data
C                       for plot scaling purposes
      XMIN = X(1) * 1.1
      XMAX = X(NCRV) * 1.1
C                       Store Y lower and upper limits of data
C                       for plot scaling purposes
      YMIN = Y(1) * 1.1
      YMAX = Y(NCRV) * 1.1
C                       Define and draw linear axis and
C                       axis numbers, labels
      CALL PLOT2D_DEFINE (XMIN,1.0,XMAX,YMIN,1.0,YMAX)
C
C     ------------------------------------------------------------------
C
C                       DRAW TITLE UNDER SUBPLOT AREA
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('CURVE2D1 Demo: 2D Curve$',100)
C                       Compute X coord of start of string in inches
      XX = 0.50*(XPG-XX)
C                       Convert X coord from inches to world coords
      XX = WCOORD2_2XPU (XX,-1.25)
C                       Plot text string
      CALL TEXT2D_WDRAW ('CURVE2D1 Demo: 2D Curve$',100,XX,-2.0)
C
C     ------------------------------------------------------------------
C
C                       DRAW 2D CURVE
C
C                       Enable curve interpolation type
      GOTO (110,101,102,103), ICRV
C                       Cubic spline interpolation
  101 CALL CURVE2D_CUBIC ()
      GOTO 110
C                       Polynomial interpolation
  102 CALL CURVE2D_POLY ()
      GOTO 110
C                       Parameteric spline interpolation
  103 CALL CURVE2D_SPLINE ()
  110 CONTINUE
C
C                       Draw grid line at every other step increment
C                       in X and Y directions
      CALL GRID_DRAW (-2,-2)
C
C                       Copy curve data to scratch arrays since
C                       the input data is changed by CURVE3D_DRAW
      DO 120 I=1,NCRV
        XV(I) = X(I)
        YV(I) = Y(I)
  120 CONTINUE
C                       Draw curve using default (linear) interpolation
      CALL CURVE2D_DRAW (XV,YV,NCRV,0)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  100 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./curve2d2.f ]"
cat <<"STOP_CAT"> ././curve2d2.f
C     PROGRAM CURVE2D2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program CURVE2D_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (NCRV=2)
C
      DIMENSION X(NCRV),Y(NCRV)
      DIMENSION XV(NCRV),YV(NCRV)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Arrays defining data for curve to be drawn
      DATA X / 0.0, 10. /
      DATA Y / 0.0, 10. /
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Loop for each curve drawing option
      DO 100 ICRV=-1,1
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Compute length of X and Y axis in inches
C                       for a square plot
      IF (XPAGE .GT. YPAGE) THEN
        YPG = YPAGE * 0.75
        XPG = YPG
      ELSE
        XPG = XPAGE * 0.75
        YPG = XPG
      END IF
C                       Compute location of physical origin in inches
C                       so that plot will be centered on the page
      XRL = 0.5 * (XPAGE-XPG)
      YRL = 0.75 * (YPAGE-YPG)
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (XRL,YRL)
C                       Disable border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plotting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DEFINE PLOT HEADING AND AXES LABELS
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*.8)
C                       Set X axis label for 2-D plot
      CALL AXISLBL_DEFX2 ('X Axis',6)
C                       Set Y axis label for 2-D plot
      CALL AXISLBL_DEFY2 ('Y Axis',6)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Store X lower and upper limits of data
C                       for plot scaling purposes
      XMIN = X(1) * 1.1
      XMAX = X(2) * 1.1
C                       Store Y lower and upper limits of data
C                       for plot scaling purposes
      YMIN = Y(1) * 1.1
      YMAX = Y(2) * 1.1
C                       Define and draw linear axis and
C                       axis numbers, labels
      CALL PLOT2D_DEFINE (XMIN,1.0,XMAX,YMIN,1.0,YMAX)
C
C     ------------------------------------------------------------------
C
C                       DRAW TITLE UNDER SUBPLOT AREA
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('CURVE2D2 Demo: Simple Linear Plot$',100)
C                       Compute X coord of start of string in inches
      XX = 0.50*(XPG-XX)
C                       Convert X coord from inches to world coords
      XX = WCOORD2_2XPU (XX,-1.25)
C                       Plot text string
      CALL TEXT2D_WDRAW
     *      ('CURVE2D2 Demo: Simple Linear Plot$',100,XX,-2.0)
C
C     ------------------------------------------------------------------
C
C                       DRAW 45 DEGREE STRAIGHT LINE
C
C                       Draw grid line at every other step increment
C                       in X and Y directions
      CALL GRID_DRAW (-2,-2)
C                       Enlarge size of marker symbols
      CALL MARKER_SIZE (3.5)
C
C                       Copy curve data to scratch arrays since
C                       the input data is changed by CURVE3D_DRAW
      DO 120 I=1,NCRV
        XV(I) = X(I)
        YV(I) = Y(I)
  120 CONTINUE
C                       Draw curve using default (linear) interpolation
      CALL CURVE2D_DRAW (XV,YV,NCRV,ICRV)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  100 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./curve2d3.f ]"
cat <<"STOP_CAT"> ././curve2d3.f
C     PROGRAM CURVE2D3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program CURVE2D_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (MAXVIB=1001)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
      COMMON /VIBCOM/ TIME(MAXVIB), RESP(MAXVIB)
C
C     ******************************************************************
C
C                       INITIALIZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C                       Load data to be plotted
      CALL VIBDAT (TIME,RESP)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C                       Enable hardware clipping
      CALL DEVICE_CLIPON
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE, YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Compute location of physical origin in
C                       inches from current location
      XRL = 0.20*XPAGE
      YRL = 0.25*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = 0.6*XPAGE
      YPG = 0.5*YPAGE
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (XRL,YRL)
C
C                       Define subplot area in terms of length
C                       of X and Y axis in inches and plot border
C                       around subplot
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DEFINE AXES LABELS
C
C                       Set default alphabet set
      CALL GRAPHICS_RESET ('FONT_ALPHA')
C                       X axis label
      CALL AXISLBL_DEFX2 ('TIME (SEC)$',100)
C                       Y axis label
      CALL AXISLBL_DEFY2 ('ACCELERATION (MULTIPLE OF g)$',100)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Set text style to 'cartog'
      CALL FONT_CARTOG
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.7)
C                       Define 2D coordinate system
      CALL PLOT2D_DEFINE (5.0, 0.1, 5.5, 0.0, 2.0, 10.0)
C
C     ------------------------------------------------------------------
C
C                       DRAW TITLE UNDER SUBPLOT AREA
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('CURVE2D3 Demo: Brake Vibration Curve$',100)
C                       Compute X coord of start of string in inches
      XX = 0.50*(XPG-XX)
C                       Convert X coord from inches to world coords
      XX = WCOORD2_2XPU (XX,-1.25)
C                       Plot text string
      CALL TEXT2D_WDRAW
     *     ('CURVE2D3 Demo: Brake Vibration Curve$',100,XX,-4.0)
C
C     ------------------------------------------------------------------
C
C                       DRAW THE VIBRATION GRAPH
C
C                       Set drawing color to red
      CALL COLOR_SETNAM ('RED')
C                       Draw brake vibration pattern
      CALL CURVE2D_DRAW (TIME,RESP,MAXVIB,0)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
      SUBROUTINE VIBDAT (T,R)
      SAVE
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: INITIALIZE BRAKE VIBRATION DEMO ARRAYS
C
C     ARGUMENT LIST INPUT:  None
C
C     ARGUMENT LIST OUTPUT:
C       T() = time axis of vibration data
C       R() = response (amplitude) axis of vibration data
C
C     GLOBAL INPUT:  None
C
C     GLOBAL OUTPUT:  None
C
C     EXCEPTIONS:  None
C
C     LOCAL VARIABLES:
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (MAXD=1001)
C
      DIMENSION T(*),R(*)
      DIMENSION TIME(MAXD), RESP(MAXD)
C
      DATA (TIME(I),RESP(I),I=1,20) /
     +5.05189133, 4.11514807, 5.05229092, 3.58588696,
     +5.05269098, 4.17621660, 5.05309105, 4.72583389,
     +5.05349112, 5.35687590, 5.05389071, 5.76400042,
     +5.05429077, 4.92939615, 5.05469084, 3.83016133,
     +5.05509090, 3.91158605, 5.05549049, 4.92939615,
     +5.05589056, 6.06934309, 5.05629063, 6.02863073,
     +5.05669069, 5.07188940, 5.05709028, 4.66476536,
     +5.05749035, 4.94975233, 5.05789042, 5.66221905,
     +5.05829048, 6.55789185, 5.05869007, 6.80216599,
     +5.05909014, 6.57824802, 5.05949020, 6.06934309/
      DATA (TIME(I),RESP(I),I=21,40) /
     +5.05988979, 5.72328758, 5.06028986, 6.45611095,
     +5.06068993, 7.59605789, 5.06108999, 7.90140057,
     +5.06148958, 7.27035856, 5.06188965, 5.98791838,
     +5.06228971, 5.56043816, 5.06268978, 6.47646713,
     +5.06308937, 6.80216599, 5.06348944, 6.11005545,
     +5.06388950, 5.88613701, 5.06428957, 6.78180981,
     +5.06468916, 7.37213993, 5.06508923, 5.98791838,
     +5.06548929, 4.09479189, 5.06588936, 4.33906651,
     +5.06628942, 6.39504242, 5.06668901, 7.22964621,
     +5.06708908, 5.82506847, 5.06748915, 5.23473930/
      DATA (TIME(I),RESP(I),I=41,60) /
     +5.06788921, 6.61896038, 5.06828880, 6.61896038,
     +5.06868887, 4.84797096, 5.06908894, 4.29835367,
     +5.06948900, 5.98791838, 5.06988859, 7.94211340,
     +5.07028866, 7.25000238, 5.07068872, 4.88868380,
     +5.07108879, 4.01336718, 5.07148838, 5.07188940,
     +5.07188845, 5.98791838, 5.07228851, 5.49936962,
     +5.07268858, 5.29580736, 5.07308817, 6.13041162,
     +5.07348824, 6.74109793, 5.07388830, 6.41539860,
     +5.07428789, 5.29580736, 5.07468796, 4.88868380,
     +5.07508802, 6.41539860, 5.07548809, 7.94211340/
      DATA (TIME(I),RESP(I),I=61,80) /
     +5.07588768, 7.61641407, 5.07628775, 6.37468576,
     +5.07668781, 6.21183681, 5.07708788, 6.53753567,
     +5.07748747, 5.29580736, 5.07788754, 3.87087369,
     +5.07828760, 4.56298447, 5.07868767, 6.53753567,
     +5.07908726, 7.22964621, 5.07948732, 5.86578131,
     +5.07988739, 4.27799749, 5.08028746, 4.13550425,
     +5.08068752, 4.74619007, 5.08108711, 5.21438313,
     +5.08148718, 5.39758873, 5.08188725, 5.47901344,
     +5.08228731, 6.17112398, 5.08268690, 6.08969927,
     +5.08308697, 4.84797096, 5.08348703, 4.72583389/
      DATA (TIME(I),RESP(I),I=81,100) /
     +5.08388710, 5.49936962, 5.08428669, 6.06934309,
     +5.08468676, 6.19148016, 5.08508682, 5.96756220,
     +5.08548689, 5.37723207, 5.08588648, 4.68512201,
     +5.08628654, 4.29835367, 5.08668661, 4.82761478,
     +5.08708620, 5.29580736, 5.08748627, 5.21438313,
     +5.08788633, 5.35687590, 5.08828640, 5.23473930,
     +5.08868599, 4.64440918, 5.08908606, 4.42049122,
     +5.08948612, 4.78690290, 5.08988619, 5.51972580,
     +5.09028578, 5.94720602, 5.09068584, 5.96756220,
     +5.09108591, 6.23219299, 5.09148598, 6.04898691/
      DATA (TIME(I),RESP(I),I=101,120) /
     +5.09188557, 5.72328758, 5.09228563, 5.72328758,
     +5.09268570, 4.90903950, 5.09308577, 4.29835367,
     +5.09348536, 5.21438313, 5.09388542, 5.84542513,
     +5.09428549, 4.97010851, 5.09468555, 3.97265482,
     +5.09508562, 3.97265482, 5.09548521, 4.76654673,
     +5.09588528, 5.51972580, 5.09628534, 5.78435659,
     +5.09668541, 6.08969927, 5.09708500, 6.15076780,
     +5.09748507, 5.27545118, 5.09788513, 4.88868380,
     +5.09828520, 5.62150669, 5.09868479, 6.29326153,
     +5.09908485, 6.94465971, 5.09948492, 7.35178328/
      DATA (TIME(I),RESP(I),I=121,140) /
     +5.09988499, 6.65967274, 5.10028458, 5.92684937,
     +5.10068464, 6.41539860, 5.10108471, 7.20929003,
     +5.10148430, 6.84287882, 5.10188437, 6.37468576,
     +5.10228443, 7.00572824, 5.10268450, 7.57570171,
     +5.10308409, 6.53753567, 5.10348415, 5.17367029,
     +5.10388422, 4.99046469, 5.10428429, 5.68257523,
     +5.10468388, 6.08969927, 5.10508394, 5.82506847,
     +5.10548401, 5.21438313, 5.10588408, 5.07188940,
     +5.10628366, 5.15331411, 5.10668373, 4.46120358,
     +5.10708380, 3.93194246, 5.10748386, 4.52227211/
      DATA (TIME(I),RESP(I),I=141,160) /
     +5.10788345, 5.54008198, 5.10828352, 5.39758873,
     +5.10868359, 3.83016133, 5.10908365, 3.32125640,
     +5.10948372, 4.66476536, 5.10988331, 5.88613701,
     +5.11028337, 6.45611095, 5.11068344, 6.59860420,
     +5.11108351, 6.57824802, 5.11148310, 6.39504242,
     +5.11188316, 5.68257523, 5.11228323, 5.51972580,
     +5.11268330, 6.53753567, 5.11308289, 7.69783878,
     +5.11348295, 7.81997633, 5.11388302, 6.61896038,
     +5.11428308, 5.62150669, 5.11468267, 5.94720602,
     +5.11508274, 6.25254869, 5.11548281, 5.82506847/
      DATA (TIME(I),RESP(I),I=161,180) /
     +5.11588240, 5.72328758, 5.11628246, 6.45611095,
     +5.11668253, 6.80216599, 5.11708260, 5.49936962,
     +5.11748219, 3.36196876, 5.11788225, 2.97520113,
     +5.11828232, 5.09224558, 5.11868238, 6.63931656,
     +5.11908197, 5.56043816, 5.11948204, 3.52481842,
     +5.11988211, 3.36196876, 5.12028217, 4.56298447,
     +5.12068176, 4.99046469, 5.12108183, 4.48155975,
     +5.12148190, 4.11514807, 5.12188196, 4.50191593,
     +5.12228203, 4.09479189, 5.12268162, 3.34161258,
     +5.12308168, 4.23728561, 5.12348175, 5.70293140/
      DATA (TIME(I),RESP(I),I=181,200) /
     +5.12388182, 5.64186287, 5.12428141, 4.44084740,
     +5.12468147, 4.11514807, 5.12508154, 4.54262829,
     +5.12548161, 4.56298447, 5.12588120, 4.88868380,
     +5.12628126, 5.86578131, 5.12668133, 6.19148016,
     +5.12708139, 5.21438313, 5.12748098, 4.09479189,
     +5.12788105, 4.21692944, 5.12828112, 5.66221905,
     +5.12868118, 6.84287882, 5.12908077, 6.53753567,
     +5.12948084, 5.88613701, 5.12988091, 5.39758873,
     +5.13028049, 5.15331411, 5.13068056, 5.64186287,
     +5.13108063, 6.55789185, 5.13148069, 7.22964621/
      DATA (TIME(I),RESP(I),I=201,220) /
     +5.13188028, 7.33142710, 5.13228035, 6.43575430,
     +5.13268042, 5.51972580, 5.13308048, 5.37723207,
     +5.13348007, 5.94720602, 5.13388014, 6.84287882,
     +5.13428020, 6.94465971, 5.13468027, 6.49682331,
     +5.13507986, 6.59860420, 5.13547993, 6.78180981,
     +5.13587999, 6.74109793, 5.13628006, 6.04898691,
     +5.13668013, 5.25509501, 5.13707972, 5.92684937,
     +5.13747978, 7.22964621, 5.13787985, 6.90394688,
     +5.13827991, 5.49936962, 5.13867950, 5.21438313,
     +5.13907957, 5.72328758, 5.13947964, 5.25509501/
      DATA (TIME(I),RESP(I),I=221,240) /
     +5.13987970, 4.99046469, 5.14027929, 6.04898691,
     +5.14067936, 7.22964621, 5.14107943, 7.35178328,
     +5.14147949, 6.43575430, 5.14187908, 6.02863073,
     +5.14227915, 6.72074127, 5.14267921, 7.08715296,
     +5.14307928, 7.08715296, 5.14347887, 7.59605789,
     +5.14387894, 8.06425095, 5.14427900, 7.45356417,
     +5.14467859, 5.70293140, 5.14507866, 4.54262829,
     +5.14547873, 4.97010851, 5.14587879, 5.86578131,
     +5.14627838, 6.23219299, 5.14667845, 5.66221905,
     +5.14707851, 4.78690290, 5.14747858, 4.60369682/
      DATA (TIME(I),RESP(I),I=241,260) /
     +5.14787817, 4.48155975, 5.14827824, 3.97265482,
     +5.14867830, 3.60624313, 5.14907837, 4.40013456,
     +5.14947796, 5.74364424, 5.14987803, 5.54008198,
     +5.15027809, 4.05407953, 5.15067816, 3.50446224,
     +5.15107822, 4.60369682, 5.15147781, 6.55789185,
     +5.15187788, 6.94465971, 5.15227795, 5.41794491,
     +5.15267801, 4.09479189, 5.15307760, 4.15586042,
     +5.15347767, 4.94975233, 5.15387774, 5.80471230,
     +5.15427780, 6.43575430, 5.15467739, 6.65967274,
     +5.15507746, 5.62150669, 5.15547752, 4.25764179/
      DATA (TIME(I),RESP(I),I=261,280) /
     +5.15587759, 4.64440918, 5.15627718, 6.19148016,
     +5.15667725, 6.53753567, 5.15707731, 4.52227211,
     +5.15747738, 3.03626966, 5.15787697, 3.83016133,
     +5.15827703, 4.19657278, 5.15867710, 3.48410606,
     +5.15907669, 3.56553078, 5.15947676, 4.70547819,
     +5.15987682, 4.88868380, 5.16027689, 3.13805056,
     +5.16067648, 2.38487124, 5.16107655, 4.44084740,
     +5.16147661, 6.23219299, 5.16187668, 5.37723207,
     +5.16227627, 3.85051751, 5.16267633, 4.35942221,
     +5.16307640, 6.17112398, 5.16347647, 7.12786531/
      DATA (TIME(I),RESP(I),I=281,300) /
     +5.16387606, 6.55789185, 5.16427612, 5.98791838,
     +5.16467619, 6.11005545, 5.16507626, 6.04898691,
     +5.16547632, 5.33652020, 5.16587591, 5.62150669,
     +5.16627598, 7.08715296, 5.16667604, 7.92175722,
     +5.16707611, 7.27035856, 5.16747570, 5.88613701,
     +5.16787577, 5.82506847, 5.16827583, 6.78180981,
     +5.16867590, 7.61641407, 5.16907549, 7.41285181,
     +5.16947556, 6.84287882, 5.16987562, 6.68002892,
     +5.17027569, 6.74109793, 5.17067528, 5.92684937,
     +5.17107534, 4.82761478, 5.17147541, 5.19402647/
      DATA (TIME(I),RESP(I),I=301,320) /
     +5.17187500, 6.35432959, 5.17227507, 7.00572824,
     +5.17267513, 6.72074127, 5.17307520, 5.49936962,
     +5.17347479, 4.80725861, 5.17387486, 5.03117704,
     +5.17427492, 5.09224558, 5.17467499, 5.31616402,
     +5.17507458, 6.37468576, 5.17547464, 6.72074127,
     +5.17587471, 5.25509501, 5.17627478, 3.89122987,
     +5.17667437, 4.52227211, 5.17707443, 6.25254869,
     +5.17747450, 6.96501589, 5.17787457, 6.45611095,
     +5.17827415, 5.56043816, 5.17867422, 4.46120358,
     +5.17907429, 4.23728561, 5.17947435, 4.82761478/
      DATA (TIME(I),RESP(I),I=321,340) /
     +5.17987442, 5.88613701, 5.18027401, 6.96501589,
     +5.18067408, 6.88359070, 5.18107414, 5.86578131,
     +5.18147421, 4.78690290, 5.18187380, 4.40013456,
     +5.18227386, 4.88868380, 5.18267393, 5.56043816,
     +5.18307400, 6.23219299, 5.18347359, 6.37468576,
     +5.18387365, 6.35432959, 5.18427372, 5.66221905,
     +5.18467379, 4.58334064, 5.18507338, 4.66476536,
     +5.18547344, 5.43830109, 5.18587351, 6.23219299,
     +5.18627310, 6.17112398, 5.18667316, 5.72328758,
     +5.18707323, 5.60115051, 5.18747330, 5.01082087/
      DATA (TIME(I),RESP(I),I=341,360) /
     +5.18787289, 4.27799749, 5.18827295, 4.05407953,
     +5.18867302, 5.19402647, 5.18907309, 6.74109793,
     +5.18947268, 6.25254869, 5.18987274, 4.62405300,
     +5.19027281, 4.17621660, 5.19067287, 5.01082087,
     +5.19107246, 5.45865726, 5.19147253, 5.03117704,
     +5.19187260, 5.13295794, 5.19227266, 5.82506847,
     +5.19267225, 5.88613701, 5.19307232, 4.80725861,
     +5.19347239, 3.62659931, 5.19387245, 4.31871033,
     +5.19427252, 5.88613701, 5.19467211, 5.64186287,
     +5.19507217, 4.70547819, 5.19547224, 4.78690290/
      DATA (TIME(I),RESP(I),I=361,380) /
     +5.19587231, 5.09224558, 5.19627190, 4.74619007,
     +5.19667196, 4.33906651, 5.19707203, 4.99046469,
     +5.19747210, 6.45611095, 5.19787169, 6.57824802,
     +5.19827175, 4.74619007, 5.19867182, 3.42303753,
     +5.19907188, 4.66476536, 5.19947147, 6.74109793,
     +5.19987154, 6.47646713, 5.20027161, 5.07188940,
     +5.20067120, 4.97010851, 5.20107126, 5.60115051,
     +5.20147133, 5.15331411, 5.20187140, 4.42049122,
     +5.20227098, 5.45865726, 5.20267105, 7.04644060,
     +5.20307112, 6.86323500, 5.20347118, 5.25509501/
      DATA (TIME(I),RESP(I),I=381,400) /
     +5.20387077, 4.31871033, 5.20427084, 5.35687590,
     +5.20467091, 7.04644060, 5.20507097, 7.35178328,
     +5.20547056, 6.08969927, 5.20587063, 5.21438313,
     +5.20627069, 5.56043816, 5.20667076, 5.82506847,
     +5.20707083, 5.58079433, 5.20747042, 5.66221905,
     +5.20787048, 6.57824802, 5.20827055, 6.76145411,
     +5.20867062, 5.58079433, 5.20907021, 4.62405300,
     +5.20947027, 5.35687590, 5.20987034, 6.86323500,
     +5.21027040, 7.45356417, 5.21066999, 6.80216599,
     +5.21107006, 5.78435659, 5.21147013, 5.15331411/
      DATA (TIME(I),RESP(I),I=401,420) /
     +5.21187019, 5.41794491, 5.21226978, 6.31361771,
     +5.21266985, 6.74109793, 5.21306992, 6.33397341,
     +5.21346998, 5.39758873, 5.21386957, 4.78690290,
     +5.21426964, 4.92939615, 5.21466970, 5.58079433,
     +5.21506929, 6.25254869, 5.21546936, 6.21183681,
     +5.21586943, 5.66221905, 5.21626949, 5.25509501,
     +5.21666908, 5.21438313, 5.21706915, 4.50191593,
     +5.21746922, 3.66731191, 5.21786928, 4.84797096,
     +5.21826887, 7.06679678, 5.21866894, 7.53498936,
     +5.21906900, 5.39758873, 5.21946907, 3.85051751/
      DATA (TIME(I),RESP(I),I=421,440) /
     +5.21986866, 5.29580736, 5.22026873, 7.47392082,
     +5.22066879, 7.25000238, 5.22106886, 5.82506847,
     +5.22146893, 5.90649319, 5.22186852, 7.77926350,
     +5.22226858, 8.28816891, 5.22266865, 5.86578131,
     +5.22306871, 4.21692944, 5.22346830, 5.23473930,
     +5.22386837, 6.88359070, 5.22426844, 7.04644060,
     +5.22466850, 5.80471230, 5.22506809, 5.31616402,
     +5.22546816, 6.31361771, 5.22586823, 6.39504242,
     +5.22626829, 4.33906651, 5.22666788, 3.07698202,
     +5.22706795, 4.58334064, 5.22746801, 6.86323500/
      DATA (TIME(I),RESP(I),I=441,460) /
     +5.22786808, 6.70038509, 5.22826767, 4.80725861,
     +5.22866774, 4.56298447, 5.22906780, 5.31616402,
     +5.22946739, 4.54262829, 5.22986746, 3.42303753,
     +5.23026752, 3.74873662, 5.23066759, 5.68257523,
     +5.23106718, 6.76145411, 5.23146725, 5.41794491,
     +5.23186731, 3.78944898, 5.23226738, 3.80980515,
     +5.23266697, 4.82761478, 5.23306704, 5.19402647,
     +5.23346710, 5.07188940, 5.23386717, 5.70293140,
     +5.23426676, 6.00827456, 5.23466682, 4.94975233,
     +5.23506689, 3.11769438, 5.23546696, 2.91413260/
      DATA (TIME(I),RESP(I),I=461,480) /
     +5.23586702, 4.88868380, 5.23626661, 6.41539860,
     +5.23666668, 5.90649319, 5.23706675, 4.90903950,
     +5.23746681, 4.40013456, 5.23786640, 4.56298447,
     +5.23826647, 4.94975233, 5.23866653, 5.31616402,
     +5.23906660, 6.49682331, 5.23946619, 7.41285181,
     +5.23986626, 6.39504242, 5.24026632, 5.35687590,
     +5.24066639, 5.68257523, 5.24106598, 6.51717949,
     +5.24146605, 6.72074127, 5.24186611, 6.15076780,
     +5.24226570, 6.17112398, 5.24266577, 6.70038509,
     +5.24306583, 6.25254869, 5.24346590, 5.78435659/
      DATA (TIME(I),RESP(I),I=481,500) /
     +5.24386549, 6.39504242, 5.24426556, 6.80216599,
     +5.24466562, 6.86323500, 5.24506569, 6.78180981,
     +5.24546528, 6.06934309, 5.24586535, 5.19402647,
     +5.24626541, 5.03117704, 5.24666548, 4.50191593,
     +5.24706507, 4.68512201, 5.24746513, 6.55789185,
     +5.24786520, 7.08715296, 5.24826527, 4.99046469,
     +5.24866486, 3.32125640, 5.24906492, 4.25764179,
     +5.24946499, 6.65967274, 5.24986506, 7.25000238,
     +5.25026512, 5.90649319, 5.25066471, 5.31616402,
     +5.25106478, 5.80471230, 5.25146484, 6.33397341/
      DATA (TIME(I),RESP(I),I=501,520) /
     +5.25186491, 6.08969927, 5.25226450, 5.84542513,
     +5.25266457, 6.70038509, 5.25306463, 7.51463318,
     +5.25346470, 6.90394688, 5.25386429, 5.13295794,
     +5.25426435, 4.27799749, 5.25466442, 5.51972580,
     +5.25506449, 6.90394688, 5.25546408, 6.68002892,
     +5.25586414, 5.54008198, 5.25626421, 4.74619007,
     +5.25666380, 4.56298447, 5.25706387, 4.74619007,
     +5.25746393, 5.31616402, 5.25786400, 5.72328758,
     +5.25826359, 5.66221905, 5.25866365, 4.78690290,
     +5.25906372, 3.74873662, 5.25946379, 3.66731191/
      DATA (TIME(I),RESP(I),I=521,540) /
     +5.25986338, 4.88868380, 5.26026344, 6.19148016,
     +5.26066351, 5.76400042, 5.26106358, 4.01336718,
     +5.26146317, 3.72838044, 5.26186323, 4.97010851,
     +5.26226330, 5.47901344, 5.26266336, 4.82761478,
     +5.26306295, 4.33906651, 5.26346302, 4.50191593,
     +5.26386309, 4.03372335, 5.26426315, 3.21947551,
     +5.26466322, 4.15586042, 5.26506281, 6.17112398,
     +5.26546288, 6.21183681, 5.26586294, 4.19657278,
     +5.26626301, 3.26018786, 5.26666260, 4.29835367,
     +5.26706266, 5.21438313, 5.26746273, 5.27545118/
      DATA (TIME(I),RESP(I),I=541,560) /
     +5.26786280, 5.17367029, 5.26826239, 5.64186287,
     +5.26866245, 5.60115051, 5.26906252, 4.44084740,
     +5.26946259, 3.87087369, 5.26986217, 5.05153322,
     +5.27026224, 6.29326153, 5.27066231, 5.66221905,
     +5.27106190, 4.35942221, 5.27146196, 4.07443571,
     +5.27186203, 4.72583389, 5.27226210, 5.25509501,
     +5.27266169, 5.66221905, 5.27306175, 6.59860420,
     +5.27346182, 7.37213993, 5.27386189, 6.98537207,
     +5.27426147, 6.23219299, 5.27466154, 6.13041162,
     +5.27506161, 7.02608442, 5.27546167, 7.41285181/
      DATA (TIME(I),RESP(I),I=561,580) /
     +5.27586126, 7.18893385, 5.27626133, 7.45356417,
     +5.27666140, 8.20674324, 5.27706146, 8.26781273,
     +5.27746105, 6.53753567, 5.27786112, 5.01082087,
     +5.27826118, 5.88613701, 5.27866125, 7.49427700,
     +5.27906132, 7.51463318, 5.27946091, 6.43575430,
     +5.27986097, 6.23219299, 5.28026104, 7.18893385,
     +5.28066111, 7.31107140, 5.28106070, 6.08969927,
     +5.28146076, 5.47901344, 5.28186083, 5.88613701,
     +5.28226089, 6.59860420, 5.28266048, 7.43320799,
     +5.28306055, 7.67748260, 5.28346062, 6.86323500/
      DATA (TIME(I),RESP(I),I=581,600) /
     +5.28386068, 5.98791838, 5.28426027, 5.66221905,
     +5.28466034, 5.94720602, 5.28506041, 6.19148016,
     +5.28546000, 5.84542513, 5.28586006, 5.74364424,
     +5.28626013, 6.08969927, 5.28666019, 5.62150669,
     +5.28705978, 4.54262829, 5.28745985, 4.46120358,
     +5.28785992, 5.84542513, 5.28825998, 6.88359070,
     +5.28865957, 6.63931656, 5.28905964, 6.00827456,
     +5.28945971, 5.66221905, 5.28985977, 5.47901344,
     +5.29025936, 5.37723207, 5.29065943, 5.94720602,
     +5.29105949, 6.98537207, 5.29145956, 6.80216599/
      DATA (TIME(I),RESP(I),I=601,620) /
     +5.29185963, 5.37723207, 5.29225922, 4.66476536,
     +5.29265928, 5.39758873, 5.29305935, 6.70038509,
     +5.29345942, 7.41285181, 5.29385900, 6.74109793,
     +5.29425907, 5.15331411, 5.29465914, 4.56298447,
     +5.29505920, 5.07188940, 5.29545879, 5.35687590,
     +5.29585886, 5.45865726, 5.29625893, 5.19402647,
     +5.29665899, 4.52227211, 5.29705858, 4.19657278,
     +5.29745865, 4.56298447, 5.29785872, 5.01082087,
     +5.29825878, 4.88868380, 5.29865837, 4.42049122,
     +5.29905844, 3.46374989, 5.29945850, 3.09733820/
      DATA (TIME(I),RESP(I),I=621,640) /
     +5.29985809, 4.48155975, 5.30025816, 5.58079433,
     +5.30065823, 5.05153322, 5.30105829, 3.95229864,
     +5.30145788, 4.13550425, 5.30185795, 4.88868380,
     +5.30225801, 5.17367029, 5.30265808, 5.43830109,
     +5.30305767, 5.78435659, 5.30345774, 5.27545118,
     +5.30385780, 3.97265482, 5.30425787, 3.83016133,
     +5.30465746, 5.17367029, 5.30505753, 6.25254869,
     +5.30545759, 5.56043816, 5.30585766, 4.13550425,
     +5.30625772, 3.95229864, 5.30665731, 4.56298447,
     +5.30705738, 4.78690290, 5.30745745, 4.86832762/
      DATA (TIME(I),RESP(I),I=641,660) /
     +5.30785751, 5.47901344, 5.30825710, 5.35687590,
     +5.30865717, 4.44084740, 5.30905724, 3.93194246,
     +5.30945730, 4.72583389, 5.30985689, 6.13041162,
     +5.31025696, 6.11005545, 5.31065702, 5.21438313,
     +5.31105709, 4.82761478, 5.31145668, 5.17367029,
     +5.31185675, 5.51972580, 5.31225681, 5.43830109,
     +5.31265688, 5.60115051, 5.31305647, 5.98791838,
     +5.31345654, 5.84542513, 5.31385660, 4.66476536,
     +5.31425619, 3.78944898, 5.31465626, 4.72583389,
     +5.31505632, 6.65967274, 5.31545639, 6.98537207/
      DATA (TIME(I),RESP(I),I=661,680) /
     +5.31585598, 5.29580736, 5.31625605, 4.09479189,
     +5.31665611, 4.94975233, 5.31705618, 5.64186287,
     +5.31745577, 5.17367029, 5.31785583, 5.01082087,
     +5.31825590, 6.11005545, 5.31865597, 7.22964621,
     +5.31905556, 6.68002892, 5.31945562, 5.21438313,
     +5.31985569, 5.01082087, 5.32025576, 6.63931656,
     +5.32065582, 7.79961967, 5.32105541, 7.27035856,
     +5.32145548, 6.39504242, 5.32185555, 6.21183681,
     +5.32225561, 6.41539860, 5.32265520, 5.88613701,
     +5.32305527, 5.03117704, 5.32345533, 5.19402647/
      DATA (TIME(I),RESP(I),I=681,700) /
     +5.32385540, 6.25254869, 5.32425499, 6.92430353,
     +5.32465506, 6.39504242, 5.32505512, 5.72328758,
     +5.32545519, 5.80471230, 5.32585478, 6.06934309,
     +5.32625484, 5.88613701, 5.32665491, 5.47901344,
     +5.32705450, 5.62150669, 5.32745457, 6.65967274,
     +5.32785463, 7.14822149, 5.32825470, 6.25254869,
     +5.32865429, 5.35687590, 5.32905436, 5.27545118,
     +5.32945442, 5.64186287, 5.32985449, 5.47901344,
     +5.33025408, 4.80725861, 5.33065414, 4.86832762,
     +5.33105421, 5.72328758, 5.33145428, 5.60115051/
      DATA (TIME(I),RESP(I),I=701,720) /
     +5.33185387, 4.94975233, 5.33225393, 4.86832762,
     +5.33265400, 4.82761478, 5.33305407, 4.97010851,
     +5.33345366, 6.02863073, 5.33385372, 7.16857767,
     +5.33425379, 6.74109793, 5.33465385, 5.54008198,
     +5.33505392, 5.11260176, 5.33545351, 5.82506847,
     +5.33585358, 6.06934309, 5.33625364, 5.09224558,
     +5.33665371, 4.46120358, 5.33705330, 5.27545118,
     +5.33745337, 6.78180981, 5.33785343, 7.16857767,
     +5.33825350, 5.74364424, 5.33865309, 4.42049122,
     +5.33905315, 5.13295794, 5.33945322, 6.98537207/
      DATA (TIME(I),RESP(I),I=721,740) /
     +5.33985329, 7.51463318, 5.34025288, 6.37468576,
     +5.34065294, 5.33652020, 5.34105301, 5.60115051,
     +5.34145260, 6.25254869, 5.34185266, 5.72328758,
     +5.34225273, 4.78690290, 5.34265280, 5.68257523,
     +5.34305239, 7.55534554, 5.34345245, 7.18893385,
     +5.34385252, 4.82761478, 5.34425259, 3.80980515,
     +5.34465218, 5.47901344, 5.34505224, 7.02608442,
     +5.34545231, 5.98791838, 5.34585238, 4.72583389,
     +5.34625196, 5.70293140, 5.34665203, 6.74109793,
     +5.34705210, 5.25509501, 5.34745216, 3.42303753/
      DATA (TIME(I),RESP(I),I=741,760) /
     +5.34785175, 4.11514807, 5.34825182, 6.06934309,
     +5.34865189, 6.29326153, 5.34905195, 4.50191593,
     +5.34945202, 3.50446224, 5.34985161, 4.40013456,
     +5.35025167, 5.09224558, 5.35065174, 4.42049122,
     +5.35105181, 4.60369682, 5.35145140, 6.31361771,
     +5.35185146, 6.84287882, 5.35225153, 4.56298447,
     +5.35265160, 2.97520113, 5.35305119, 5.09224558,
     +5.35345125, 7.45356417, 5.35385132, 7.14822149,
     +5.35425138, 5.41794491, 5.35465097, 5.01082087,
     +5.35505104, 5.60115051, 5.35545111, 5.27545118/
      DATA (TIME(I),RESP(I),I=761,780) /
     +5.35585070, 5.01082087, 5.35625076, 5.94720602,
     +5.35665083, 7.37213993, 5.35705090, 7.88104439,
     +5.35745049, 6.78180981, 5.35785055, 5.51972580,
     +5.35825062, 5.49936962, 5.35865068, 6.19148016,
     +5.35905027, 6.45611095, 5.35945034, 6.39504242,
     +5.35985041, 6.41539860, 5.36025047, 6.15076780,
     +5.36065006, 5.41794491, 5.36105013, 4.52227211,
     +5.36145020, 4.50191593, 5.36185026, 5.72328758,
     +5.36225033, 6.55789185, 5.36264992, 5.92684937,
     +5.36304998, 5.31616402, 5.36345005, 5.45865726/
      DATA (TIME(I),RESP(I),I=781,800) /
     +5.36385012, 5.92684937, 5.36424971, 5.74364424,
     +5.36464977, 5.35687590, 5.36504984, 6.41539860,
     +5.36544991, 7.69783878, 5.36584949, 6.92430353,
     +5.36624956, 5.33652020, 5.36664963, 4.78690290,
     +5.36704969, 5.86578131, 5.36744928, 7.18893385,
     +5.36784935, 7.04644060, 5.36824942, 5.88613701,
     +5.36864948, 5.29580736, 5.36904907, 5.94720602,
     +5.36944914, 6.31361771, 5.36984921, 5.76400042,
     +5.37024879, 5.64186287, 5.37064886, 6.19148016,
     +5.37104893, 6.06934309, 5.37144899, 4.37977839/
      DATA (TIME(I),RESP(I),I=801,820) /
     +5.37184858, 3.19911933, 5.37224865, 4.29835367,
     +5.37264872, 5.76400042, 5.37304878, 4.94975233,
     +5.37344837, 2.40522766, 5.37384844, 1.95739126,
     +5.37424850, 3.74873662, 5.37464857, 4.40013456,
     +5.37504816, 3.03626966, 5.37544823, 1.77418542,
     +5.37584829, 2.26273417, 5.37624836, 3.17876315,
     +5.37664843, 3.80980515, 5.37704802, 4.31871033,
     +5.37744808, 4.35942221, 5.37784815, 4.19657278,
     +5.37824821, 4.78690290, 5.37864780, 5.84542513,
     +5.37904787, 6.59860420, 5.37944794, 6.84287882/
      DATA (TIME(I),RESP(I),I=821,840) /
     +5.37984800, 6.59860420, 5.38024759, 6.17112398,
     +5.38064766, 6.47646713, 5.38104773, 7.16857767,
     +5.38144779, 7.39249611, 5.38184738, 7.37213993,
     +5.38224745, 7.43320799, 5.38264751, 6.74109793,
     +5.38304758, 5.43830109, 5.38344717, 4.82761478,
     +5.38384724, 5.54008198, 5.38424730, 6.86323500,
     +5.38464689, 7.45356417, 5.38504696, 6.84287882,
     +5.38544703, 5.72328758, 5.38584709, 5.37723207,
     +5.38624668, 5.68257523, 5.38664675, 6.11005545,
     +5.38704681, 6.55789185, 5.38744688, 6.90394688/
      DATA (TIME(I),RESP(I),I=841,860) /
     +5.38784647, 7.27035856, 5.38824654, 6.72074127,
     +5.38864660, 5.11260176, 5.38904667, 4.48155975,
     +5.38944626, 5.64186287, 5.38984632, 7.20929003,
     +5.39024639, 7.43320799, 5.39064646, 6.17112398,
     +5.39104652, 5.31616402, 5.39144611, 5.98791838,
     +5.39184618, 6.80216599, 5.39224625, 6.45611095,
     +5.39264631, 6.27290487, 5.39304590, 7.33142710,
     +5.39344597, 8.02353764, 5.39384604, 7.18893385,
     +5.39424610, 5.82506847, 5.39464569, 5.39758873,
     +5.39504576, 6.59860420, 5.39544582, 7.39249611/
      DATA (TIME(I),RESP(I),I=861,880) /
     +5.39584589, 6.31361771, 5.39624548, 5.25509501,
     +5.39664555, 5.25509501, 5.39704561, 5.27545118,
     +5.39744568, 4.70547819, 5.39784527, 4.64440918,
     +5.39824533, 5.82506847, 5.39864540, 7.02608442,
     +5.39904499, 6.25254869, 5.39944506, 3.80980515,
     +5.39984512, 3.17876315, 5.40024519, 4.94975233,
     +5.40064478, 6.02863073, 5.40104485, 5.35687590,
     +5.40144491, 4.50191593, 5.40184498, 4.50191593,
     +5.40224457, 4.90903950, 5.40264463, 4.76654673,
     +5.40304470, 4.40013456, 5.40344477, 5.09224558/
      DATA (TIME(I),RESP(I),I=881,900) /
     +5.40384436, 6.70038509, 5.40424442, 7.04644060,
     +5.40464449, 5.09224558, 5.40504456, 3.46374989,
     +5.40544462, 4.70547819, 5.40584421, 6.68002892,
     +5.40624428, 6.70038509, 5.40664434, 5.51972580,
     +5.40704441, 5.25509501, 5.40744400, 5.82506847,
     +5.40784407, 5.39758873, 5.40824413, 4.62405300,
     +5.40864420, 4.94975233, 5.40904379, 6.13041162,
     +5.40944386, 6.51717949, 5.40984392, 5.82506847,
     +5.41024399, 5.43830109, 5.41064358, 5.74364424,
     +5.41104364, 5.80471230, 5.41144371, 5.37723207/
      DATA (TIME(I),RESP(I),I=901,920) /
     +5.41184330, 5.94720602, 5.41224337, 7.59605789,
     +5.41264343, 7.96246910, 5.41304350, 6.43575430,
     +5.41344309, 5.47901344, 5.41384315, 5.60115051,
     +5.41424322, 5.51972580, 5.41464329, 4.94975233,
     +5.41504288, 4.82761478, 5.41544294, 5.70293140,
     +5.41584301, 6.45611095, 5.41624308, 5.60115051,
     +5.41664267, 4.15586042, 5.41704273, 4.09479189,
     +5.41744280, 5.21438313, 5.41784286, 5.78435659,
     +5.41824245, 5.51972580, 5.41864252, 5.25509501,
     +5.41904259, 5.27545118, 5.41944265, 5.13295794/
      DATA (TIME(I),RESP(I),I=921,940) /
     +5.41984272, 4.29835367, 5.42024231, 3.91158605,
     +5.42064238, 5.13295794, 5.42104244, 6.65967274,
     +5.42144251, 6.47646713, 5.42184210, 4.78690290,
     +5.42224216, 4.11514807, 5.42264223, 5.41794491,
     +5.42304230, 6.39504242, 5.42344189, 5.88613701,
     +5.42384195, 5.41794491, 5.42424202, 5.60115051,
     +5.42464209, 5.82506847, 5.42504168, 5.15331411,
     +5.42544174, 4.46120358, 5.42584181, 5.49936962,
     +5.42624140, 7.25000238, 5.42664146, 6.96501589,
     +5.42704153, 5.15331411, 5.42744160, 4.48155975/
      DATA (TIME(I),RESP(I),I=941,960) /
     +5.42784119, 5.56043816, 5.42824125, 6.72074127,
     +5.42864132, 6.98537207, 5.42904139, 6.61896038,
     +5.42944098, 6.21183681, 5.42984104, 5.90649319,
     +5.43024111, 5.37723207, 5.43064117, 5.09224558,
     +5.43104076, 6.00827456, 5.43144083, 7.41285181,
     +5.43184090, 7.63677025, 5.43224096, 6.65967274,
     +5.43264055, 5.76400042, 5.43304062, 5.68257523,
     +5.43344069, 5.94720602, 5.43384075, 5.90649319,
     +5.43424082, 5.54008198, 5.43464041, 5.96756220,
     +5.43504047, 7.12786531, 5.43544054, 6.76145411/
      DATA (TIME(I),RESP(I),I=961,980) /
     +5.43584061, 4.72583389, 5.43624020, 4.50191593,
     +5.43664026, 6.23219299, 5.43704033, 6.72074127,
     +5.43744040, 5.45865726, 5.43783998, 4.46120358,
     +5.43824005, 4.90903950, 5.43864012, 5.51972580,
     +5.43904018, 5.41794491, 5.43943977, 5.51972580,
     +5.43983984, 5.84542513, 5.44023991, 6.19148016,
     +5.44063950, 6.17112398, 5.44103956, 5.21438313,
     +5.44143963, 4.78690290, 5.44183969, 6.21183681,
     +5.44223928, 7.33142710, 5.44263935, 6.19148016,
     +5.44303942, 5.17367029, 5.44343948, 5.98791838/
      DATA (TIME(I),RESP(I),I=981,1001) /
     +5.44383907, 6.17112398, 5.44423914, 4.29835367,
     +5.44463921, 3.58588696, 5.44503927, 5.64186287,
     +5.44543886, 7.04644060, 5.44583893, 5.62150669,
     +5.44623899, 4.11514807, 5.44663906, 4.78690290,
     +5.44703913, 6.27290487, 5.44743872, 6.25254869,
     +5.44783878, 5.35687590, 5.44823885, 5.11260176,
     +5.44863892, 5.58079433, 5.44903851, 5.80471230,
     +5.44943857, 4.80725861, 5.44983864, 4.17621660,
     +5.45023870, 5.23473930, 5.45063829, 6.74109793,
     +5.45103836, 6.76145411, 5.45143843, 5.45865726,
     +5.45183849, 4.99046469/
C
C     ******************************************************************
C
      DO 100 I=1,MAXD
        T(I) = TIME(I)
        R(I) = RESP(I)
  100 CONTINUE
      RETURN
      END
STOP_CAT
echo "  Generating =====> [ ./curve3d1.f ]"
cat <<"STOP_CAT"> ././curve3d1.f
C     PROGRAM CURVE3D1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program CURVE3D_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (NCRV=6)
C
      DIMENSION X(NCRV),Y(NCRV),Z(NCRV)
      DIMENSION XV(NCRV),YV(NCRV),ZV(NCRV)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Arrays defining data for curve to be drawn
      DATA X / 0.0, 2.0, 4.0, 6.0, 8.0, 10. /
      DATA Y / 0.0, 1.0, 2.0, 8.0, 9.0, 10. /
      DATA Z / 0.0, 1.0, 2.0, 8.0, 9.0, 10. /
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Loop for each curve type
      DO 100 ICRV=1,4
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Compute length of X and Y axis in inches
C                       for a square plot
      IF (XPAGE .GT. YPAGE) THEN
        YPG = YPAGE * 0.75
        XPG = YPG
      ELSE
        XPG = XPAGE * 0.75
        YPG = XPG
      END IF
C                       Compute location of physical origin in inches
C                       so that plot will be centered on the page
      XRL = 0.5 * (XPAGE-XPG)
      YRL = 0.75 * (YPAGE-YPG)
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (XRL,YRL)
C                       Disable border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Define subplot area in terms of length
C                       of X and Y axis in inches
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW TITLE UNDER SUBPLOT AREA
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('CURVE3D1 Demo: 3D Curve$',100)
C                       Compute X coord of start of string in inches
      XX = 0.50*(XPG-XX)
C                       Plot text string
      CALL TEXT2D_PDRAW ('CURVE3D1 Demo: 3D Curve$',100,XX,-1.0)
C
C     ******************************************************************
C
C                       DEFINE PLOT HEADING AND AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*.8)
C                       Set X axis label for 3D plot
      CALL AXISLBL_DEFX3 ('X Axis',6)
C                       Set Y axis label for 3D plot
      CALL AXISLBL_DEFY3 ('Y Axis',6)
C                       Set Z axis label for 3D plot
      CALL AXISLBL_DEFZ3 ('Z Axis',6)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Store X lower and upper limits of data
C                       for plot scaling purposes
      XMIN = X(1) * 1.1
      XMAX = X(NCRV) * 1.1
C                       Store Y lower and upper limits of data
C                       for plot scaling purposes
      YMIN = Y(1) * 1.1
      YMAX = Y(NCRV) * 1.1
C                       Store Z lower and upper limits of data
C                       for plot scaling purposes
      ZMIN = Z(1) * 1.1
      ZMAX = Z(NCRV) * 1.1
C                       Set 3D workbox size
      CALL WORKBOX_DEFINE (XMAX-XMIN,YMAX-YMIN,ZMAX-ZMIN)
C                       Set viewpoint
      CALL VIEWPT_SETBU (10.0, -20.0, 15.)
C                       Define and draw linear axis and
C                       axis numbers, labels
      CALL PLOT3D_DEFINE (XMIN,1.0,XMAX,YMIN,1.0,YMAX,ZMIN,1.0,ZMAX)
C
C     ------------------------------------------------------------------
C
C                       DRAW 2D CURVE
C
C                       Enable curve interpolation type
      GOTO (110,101,102,103), ICRV
C                       Cubic spline interpolation
  101 CALL CURVE2D_CUBIC ()
      GOTO 110
C                       Polynomial interpolation
  102 CALL CURVE2D_POLY ()
      GOTO 110
C                       Parameteric spline interpolation
  103 CALL CURVE2D_SPLINE ()
  110 CONTINUE
C
C                       Copy curve data to scratch arrays since
C                       the input data is changed by CURVE3D_DRAW
      DO 120 I=1,NCRV
        XV(I) = X(I)
        YV(I) = Y(I)
        ZV(I) = Z(I)
  120 CONTINUE
C
C                       Draw curve using current interpolation
      CALL CURVE3D_DRAW (XV,YV,ZV,NCRV,0)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  100 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./device1.f ]"
cat <<"STOP_CAT"> ././device1.f
C     PROGRAM DEVICE3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access programs DEVICE_SELECT and
C              DEVICE_RELEASE
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       DEVICE object access program
      EXTERNAL DEVICE_SELECT, DEVICE_RELEASE
C
C                       DEVICE object access programs
      EXTERNAL DEVICE_INIT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 = 26)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER KTYPQ, TMP101
C
C                       Real variables and arrays
      REAL    XPAGE, TMP102, YPAGE, TMP103
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 / 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15,
     *            -2,-3,-4,-5,-6,-7,-8,-10,-11,-12,-13,-14,-15/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL DEVICE_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'device_select.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              DEVICE Object Demo Program #3'/
     * ' This program tests the DEVICE object access programs'/
     * ' DEVICE_SELECT and DEVICE_RELEASE.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A//
     * ' This program will generate several files with names such as'/
     * ' POSTSC_LIS.  These are empty graphics output files that are'/
     * ' produced when testing the initialization of the various'/
     * ' graphics output devices.  These files may be deleted after'/
     * ' demo program has finished.'//
     * '                      Press <CR> to continue')
      READ (IN,811) PAUS
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-only
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Test DEVICE_SELECT object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        KTYPQ = VV101(IVV101)
C
C                       Non-interactively select a graphics output
C                       device
      CALL DEVICE_SELECT (KTYPQ,XPAGE,YPAGE)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XPAGE ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(YPAGE ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KTYPQ,XPAGE,YPAGE
  502 FORMAT (I21,E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
      CALL DEVICE_RELEASE ()
  589 CONTINUE
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * ' Note:'/
     * ' In the above output, occasional strings of "garbage"'/
     * ' characters are normal,  They are the result of printing'/
     * ' Tektronix control code sequences to a non-Tektronix'/
     * ' terminal while exercising the Tektronix drivers.'//
     * '              DEVICE Demo Program #3 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./device_select.dat ]"
cat <<"STOP_CAT"> ././device_select.uuu
begin 660 ./device_select.dat
M("`@("`@("`@("`@("`@("`@("`R("`@+C$T,C@P,#!%*S`R("`@+C$P.#<P
M,#!%*S`R"B`@("`@("`@("`@("`@("`@("`@,R`@("XQ,3`P,#`P12LP,B`@
M("XX-3`P,#`P12LP,0H@("`@("`@("`@("`@("`@("`@(#0@("`N,3$P,#`P
M,$4K,#(@("`N.#4P,#`P,$4K,#$*("`@("`@("`@("`@("`@("`@("`U("`@
M+C$T,#`P,#!%*S`R("`@+C$P-3`P,#!%*S`R"B`@("`@("`@("`@("`@("`@
M("`@-B`@("XQ,3`P,#`P12LP,B`@("XX-3`P,#`P12LP,0H@("`@("`@("`@
M("`@("`@("`@(#<@("`N,30R.#`P,$4K,#(@("`N,3`X-S`P,$4K,#(*("`@
M("`@("`@("`@("`@("`@("`X("`@+C$T,C@P,#!%*S`R("`@+C$P.#<P,#!%
M*S`R"B`@("`@("`@("`@("`@("`@("`Q,"`@("XQ,S8Y,#`P12LP,B`@("XQ
M,#DU,#`P12LP,@H@("`@("`@("`@("`@("`@("`@,3$@("`N,3`P,#`P,$4K
M,#(@("`N-S4Y,#`P,$4K,#$*("`@("`@("`@("`@("`@("`@(#$R("`@+C$P
M,C4P,#!%*S`R("`@+C<W-3`P,#!%*S`Q"B`@("`@("`@("`@("`@("`@("`Q
M,R`@("XQ,S8Y,#`P12LP,B`@("XQ,#DU,#`P12LP,@H@("`@("`@("`@("`@
M("`@("`@,30@("`N,3`R-3`P,$4K,#(@("`N-S<U,#`P,$4K,#$*("`@("`@
M("`@("`@("`@("`@(#$U("`@+C$Q,#`P,#!%*S`R("`@+C@U,#`P,#!%*S`Q
M"B`@("`@("`@("`@("`@("`@("`M,B`@("XQ-#(X,#`P12LP,B`@("XQ,#@W
M,#`P12LP,@H@("`@("`@("`@("`@("`@("`@+3,@("`N,3$P,#`P,$4K,#(@
M("`N.#4P,#`P,$4K,#$*("`@("`@("`@("`@("`@("`@("TT("`@+C$Q,#`P
M,#!%*S`R("`@+C@U,#`P,#!%*S`Q"B`@("`@("`@("`@("`@("`@("`M-2`@
M("XQ-#`P,#`P12LP,B`@("XQ,#4P,#`P12LP,@H@("`@("`@("`@("`@("`@
M("`@+38@("`N,3$P,#`P,$4K,#(@("`N.#4P,#`P,$4K,#$*("`@("`@("`@
M("`@("`@("`@("TW("`@+C$T,C@P,#!%*S`R("`@+C$P.#<P,#!%*S`R"B`@
M("`@("`@("`@("`@("`@("`M."`@("XQ-#(X,#`P12LP,B`@("XQ,#@W,#`P
M12LP,@H@("`@("`@("`@("`@("`@("`M,3`@("`N,3,V.3`P,$4K,#(@("`N
M,3`Y-3`P,$4K,#(*("`@("`@("`@("`@("`@("`@+3$Q("`@+C$P,#`P,#!%
M*S`R("`@+C<U.3`P,#!%*S`Q"B`@("`@("`@("`@("`@("`@("TQ,B`@("XQ
M,#(U,#`P12LP,B`@("XW-S4P,#`P12LP,0H@("`@("`@("`@("`@("`@("`M
M,3,@("`N,3,V.3`P,$4K,#(@("`N,3`Y-3`P,$4K,#(*("`@("`@("`@("`@
M("`@("`@+3$T("`@+C$P,C4P,#!%*S`R("`@+C<W-3`P,#!%*S`Q"B`@("`@
M("`@("`@("`@("`@("TQ-2`@("XQ,3`P,#`P12LP,B`@("XX-3`P,#`P12LP
",0H@
`
end
STOP_CAT
echo "  Generating =====> [ ./fillarea1.f ]"
cat <<"STOP_CAT"> ././fillarea1.f
C     PROGRAM FILLAREA1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program FILLAREA_2AXIS
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       FILLAREA object access program
      EXTERNAL FILLAREA_2AXIS
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV103 =  2)
      PARAMETER (NVV104 =  2)
      PARAMETER (NVV105 =  1)
      PARAMETER (NVV106 =  6)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 1)
      PARAMETER (MX102 = 1)
      PARAMETER (MX103 = 2)
      PARAMETER (MX104 = 2)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'FILLAREA.INC'
C
C                       Integer variables and arrays
      INTEGER NPTS1, TMP105
C
C                       Real variables and arrays
      REAL    TMP101(MX101), TMP102(MX102), XCV2(MX103), TMP103(MX103)
     *      , YCV2(MX104), TMP104(MX104)
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER CFILL*4, TMP106*4
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV103(NVV103)
      REAL    VV104(NVV104)
      INTEGER VV105(NVV105)
      CHARACTER*4 VV106(NVV106)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV103 /0.0, 1.0/
C
      DATA VV104 /1.0, 0.0/
C
      DATA VV105 /2/
C
      DATA VV106 /'ABOV', 'BELO', 'RIGH', 'LEFT', 'XAXI', 'YAXI'/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'fillarea_2axis.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              FILLAREA Object Demo Program #1'/
     * ' This program tests the FILLAREA object access program'/
     * ' FILLAREA_2AXIS.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test FILLAREA_2AXIS object access program
C
      DO 586 IVV106 = 1,NVV106
        CFILL = VV106(IVV106)
C
        XCV2(1) = VV103(1)
        XCV2(2) = VV103(2)
C
        YCV2(1) = VV104(1)
        YCV2(2) = VV104(2)
C
        NPTS1 = VV105(1)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL PLOT2D_DEFINE (0.0, 0., 1.0, 0.0, 0., 1.0)
C
C                       Fill area between a curve and an axis using
C                       current fill pattern
      CALL FILLAREA_2AXIS (XCV2,YCV2,NPTS1,CFILL)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103(1),TMP104(1),
     *       TMP105,TMP106
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(GX(1) ,TMP101(1) )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(GY(1) ,TMP102(1) )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) GX(1),GY(1),XCV2(1),YCV2(1),NPTS1,CFILL
  502 FORMAT (E15.7,E15.7,E15.7,E15.7,I21,A)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  586 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              FILLAREA Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./fillarea2.f ]"
cat <<"STOP_CAT"> ././fillarea2.f
C     PROGRAM FILLAREA2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program FILLAREA_2CRV
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       FILLAREA object access program
      EXTERNAL FILLAREA_2CRV
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV103 =  2)
      PARAMETER (NVV105 =  2)
      PARAMETER (NVV107 =  1)
      PARAMETER (NVV108 =  2)
      PARAMETER (NVV109 =  2)
      PARAMETER (NVV110 =  1)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 1)
      PARAMETER (MX102 = 1)
      PARAMETER (MX103 = 2)
      PARAMETER (MX105 = 2)
      PARAMETER (MX108 = 2)
      PARAMETER (MX109 = 2)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'FILLAREA.INC'
C
C                       Integer variables and arrays
      INTEGER NPTS1, TMP107, NPTS2, TMP110
C
C                       Real variables and arrays
      REAL    TMP101(MX101), TMP102(MX102), XC1(MX103), TMP103(MX103)
     *      , YC1(MX105), TMP105(MX105), XCV2(MX108), TMP108(MX108)
     *      , YCV2(MX109), TMP109(MX109)
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV103(NVV103)
      REAL    VV105(NVV105)
      INTEGER VV107(NVV107)
      REAL    VV108(NVV108)
      REAL    VV109(NVV109)
      INTEGER VV110(NVV110)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV103 /0.0, 1.0/
C
      DATA VV105 /1.0, 0.0/
C
      DATA VV107 /2/
C
      DATA VV108 /0.0, 1.0/
C
      DATA VV109 /0.0, 1.0/
C
      DATA VV110 /2/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'fillarea_2crv.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              FILLAREA Object Demo Program #2'/
     * ' This program tests the FILLAREA object access program'/
     * ' FILLAREA_2CRV.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test FILLAREA_2CRV object access program
C
        XC1(1) = VV103(1)
        XC1(2) = VV103(2)
        YC1(1) = VV105(1)
        YC1(2) = VV105(2)
        NPTS1 = VV107(1)
C
        XCV2(1) = VV108(1)
        XCV2(2) = VV108(2)
        YCV2(1) = VV109(1)
        YCV2(2) = VV109(2)
        NPTS2 = VV110(1)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C                       Fill area between two curves using current fill
C                       pattern
      CALL FILLAREA_2CRV (XC1,YC1,NPTS1,XCV2,YCV2,NPTS2)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103(1),TMP105(1),
     *       TMP107,TMP108(1),TMP109(1),TMP110
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(GX(1) ,TMP101(1) )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(GY(1) ,TMP102(1) )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(XC1(1) ,TMP103(1) )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(YC1(1) ,TMP105(1) )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) GX(1),GY(1),XC1(1),YC1(1),NPTS1,XCV2(1),
     *                       YCV2(1),NPTS2
  502 FORMAT (E15.7,E15.7,E15.7,E15.7,I21,E15.7,E15.7,I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              FILLAREA Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./fillarea3.f ]"
cat <<"STOP_CAT"> ././fillarea3.f
C     PROGRAM FILLAREA3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program FILLAREA_POLYG
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       FILLAREA object access program
      EXTERNAL FILLAREA_POLYG
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
      PARAMETER (NVV102 =  3)
      PARAMETER (NVV103 =  1)
      PARAMETER (NVV104 =  2)
      PARAMETER (NVV105 =  3)
      PARAMETER (NVV106 =  1)
      PARAMETER (NVV107 =  1)
      PARAMETER (NVV108 =  1)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 3)
      PARAMETER (MX102 = 3)
      PARAMETER (MX105 = 3)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER NPTSP, TMP103, NGAPS, TMP106, ISPARE, TMP107, JSPARE
     *      , TMP108
C
C                       Real variables and arrays
      REAL    XP(MX101), TMP101(MX101), YP(MX102), TMP102(MX102), HANGLE
     *      , TMP104, GARAY(MX105), TMP105(MX105)
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV102(NVV102)
      INTEGER VV103(NVV103)
      REAL    VV104(NVV104)
      REAL    VV105(NVV105)
      INTEGER VV106(NVV106)
      INTEGER VV107(NVV107)
      INTEGER VV108(NVV108)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /0.0, 1.0, 0.5/
C
      DATA VV102 /0.0, 0.0, 1.0/
C
      DATA VV103 /3/
C
      DATA VV104 /0.0, 45.0/
C
      DATA VV105 /.15, .30, .45/
C
      DATA VV106 /3/
C
      DATA VV107 /-32768/
C
      DATA VV108 /32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'fillarea_polyg.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              FILLAREA Object Demo Program #3'/
     * ' This program tests the FILLAREA object access program'/
     * ' FILLAREA_POLYG.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test FILLAREA_POLYG object access program
C
C                       Loop for each input variable of access program
      DO 586 IVV104 = 1,NVV104
        HANGLE = VV104(IVV104)
C
        XP(1) = VV101(1)
        XP(2) = VV101(2)
        XP(3) = VV101(3)
C
        YP(1) = VV102(1)
        YP(2) = VV102(2)
        YP(3) = VV102(3)
C
        NPTSP = VV103(1)
C
        GARAY(1) = VV105(1)
        GARAY(2) = VV105(2)
        GARAY(3) = VV105(3)
C
        NGAPS = VV106(1)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C                       Fill area within a polygon using current fill
C                       pattern
      ISPARE = VV107(1)
      JSPARE = VV108(1)
      CALL FILLAREA_POLYG (XP,YP,NPTSP,HANGLE,GARAY,NGAPS,ISPARE,JSPARE)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=510) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106,TMP107,TMP108
        GOTO 523
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=512) XP,YP,NPTSP,HANGLE,GARAY,NGAPS,ISPARE,
     *       JSPARE
  502 FORMAT (3E15.7,3E15.7,I21,E15.7,3E15.7,I21,I21,I21)
      GOTO 523
C                       Print file I/O error messages
  510 WRITE (IER,511) FILNAM
  511 FORMAT (' Error reading file ',A)
      GOTO 523
C
  512 WRITE (IER,513) FILNAM
  513 FORMAT (' Error writing file ',A)
C
  523 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  586 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
      CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              FILLAREA Demo Program #3 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./fillarea4.f ]"
cat <<"STOP_CAT"> ././fillarea4.f
C     PROGRAM FILLAREA4
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program FILLAREA_SETPAT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      EXTERNAL CHAR_LENBT
      INTEGER  CHAR_LENBT
C
      CHARACTER*80 KODE
      DIMENSION X(5),Y(5)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Arrays defining a square box
      DATA X /0.1, 0.1, 0.9, 0.9, 0.1/
      DATA Y /0.1, 0.9, 0.9, 0.1, 0.1/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Turn off border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.05*XPAGE
      YRL = 0.10*YPAGE
C                       Compute length of X and Y axis in inches
C                       for entire plot
      XPGT = XPAGE - 1.5*XRL
      YPGT = YPAGE - 1.5*YRL
C                       Compute length of X and Y axis in inches
C                       for a single fill pattern subplot
      XPG = XPGT/5.0
      YPG = YPGT/4.0
C                       Loop for each of 4 horizontal rows
C                       of fill patterns
      DO 10 I=1,4
C                       Loop for each of 5 vertical columns
C                       of fill patterns
      DO 10 J=1,5
C                       Compute number of the fill pattern to be
C                       displayed (1-20)
      ITEM = 5*(I-1) + J
C                       Quit at 20th fill pattern
C                       (are only 19 fill patterns)
      IF (ITEM .EQ. 20) GO TO 10
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Compute next location of physical origin in
C                       inches from current location
      XRL = XPG
      YRL = 0.0
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border drawing
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW TITLE UNDER SUBPLOT AREA
C
C                       Draw on 1st pass only
      IF (I .EQ. 1 .AND. J .EQ. 1) THEN
C                       Compute text height based on page height
        SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
        CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
        XX = TEXT2D_GETLEN ('FILLAREA4 Demo: Fill Patterns$',100)
C                       Compute X coord of start of string in inches
        XX = 0.50*(XPGT-XX)
C                       Plot text string
        CALL TEXT2D_PDRAW
     *       ('FILLAREA4 Demo: Fill Patterns$',100,XX,-YPGT*0.07)
      ENDIF
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Activiate integer numbering of X axis
      CALL AXISNUM_INTX
C                       Activiate integer numbering of Y axis
      CALL AXISNUM_INTY
C                       Disable drawing of X axis, label and ticks
      CALL AXISLBL_DEFX2 (' ',0)
C                       Disable drawing of Y axis, label and ticks
      CALL AXISLBL_DEFY2 (' ',0)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system with
C                       X = 0.0 to 1.0 and Y = 0.0 to 1.0
C                       (axes drawing disabled by calls to
C                       AXISLBL_DEFX2, AXISLBL_DEFY2)
      CALL PLOT2D_DEFINE (0.0, 0.1, 1.0, 0.0, 0.1, 1.0)
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C
C     ------------------------------------------------------------------
C
C                       DRAW BORDERS AND FRAMES
C
C                       Define, and draw border around, long narrow
C                       blank area near bottom of subplot area for
C                       labeling fill pattern
      CALL BLNKAREA_DEF1 (0.2*XPG,0.8*XPG,0.1*YPG,0.2*YPG,3)
C                       Draw square box around area to be shaded
C                       with fill pattern
      CALL CURVE2D_DRAW (X,Y,5,0)
C                       Draw frame around subplot area
      CALL GRID_DRAW (0,0)
C
C     ------------------------------------------------------------------
C
C                       DRAW FILL PATTERN
C
C                       Enable fill pattern for this subplot
      CALL FILLAREA_SETPAT (ITEM)
C                       Draw fill pattern in area enclosed by box
C                       drawn by CURVE2D_DRAW
      CALL FILLAREA_2CRV (X,Y,5,X,Y,0)
C
C     ------------------------------------------------------------------
C
C                       DRAW FILL PATTERN LABEL
C
C                       Set character style to 'duplex'
      CALL FONT_DUPLEX
C                       Deactivate blanking of narrow rectangular
C                       area reserved for fill pattern label
      CALL GRAPHICS_RESET ('BLNKAREA_DEF1')
C                       Write string 'Pattern nn' to internal file
C                       KODE, where nn is the fill pattern number
      WRITE (KODE,100) ITEM
  100 FORMAT ('Pattern ',I2)
C                       Get number of characters in fill pattern label
      NC = CHAR_LENBT (KODE)
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.75)
C                       Draw fill pattern label in narrow rectangular
C                       area reserved for this purpose
      CALL TEXT2D_PDRAW (KODE,NC,0.25*XPG,0.1*YPG)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C                       Move physical origin relative to current
C                       location (distance in inches) in preparation
C                       for next fill pattern subplot
      IF (J .EQ. 5) CALL ORIGIN_MOVE(-5.0*XRL,YPG)
C                       Repeat loop for next fill pattern
   10 CONTINUE
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./fillarea_2axis.dat ]"
cat <<"STOP_CAT"> ././fillarea_2axis.uuu
begin 660 ./fillarea_2axis.dat
M("`@+C`P,#`P,#!%*S`P("`@+C$P,#`P,#!%*S`Q("`@+C`P,#`P,#!%*S`P
M("`@+C$P,#`P,#!%*S`Q("`@("`@("`@("`@("`@("`@("`R04)/5@H@("`N
M,#`P,#`P,$4K,#`@("`N,3`P,#`P,$4K,#$@("`N,#`P,#`P,$4K,#`@("`N
M,3`P,#`P,$4K,#$@("`@("`@("`@("`@("`@("`@(#)"14Q/"B`@("XP,#`P
M,#`P12LP,"`@("XQ,#`P,#`P12LP,2`@("XP,#`P,#`P12LP,"`@("XQ,#`P
M,#`P12LP,2`@("`@("`@("`@("`@("`@("`@,E))1T@*("`@+C`P,#`P,#!%
M*S`P("`@+C$P,#`P,#!%*S`Q("`@+C`P,#`P,#!%*S`P("`@+C$P,#`P,#!%
M*S`Q("`@("`@("`@("`@("`@("`@("`R3$5&5`H@("`N,#`P,#`P,$4K,#`@
M("`N,3`P,#`P,$4K,#$@("`N,#`P,#`P,$4K,#`@("`N,3`P,#`P,$4K,#$@
M("`@("`@("`@("`@("`@("`@(#)805A)"B`@("XP,#`P,#`P12LP,"`@("XQ
M,#`P,#`P12LP,2`@("XP,#`P,#`P12LP,"`@("XQ,#`P,#`P12LP,2`@("`@
5("`@("`@("`@("`@("`@,EE!6$D*
`
end
STOP_CAT
echo "  Generating =====> [ ./fillarea_2crv.dat ]"
cat <<"STOP_CAT"> ././fillarea_2crv.uuu
begin 660 ./fillarea_2crv.dat
M("`@+C`P,#`P,#!%*S`P("`@+C$P,#`P,#!%*S`Q("`@+C`P,#`P,#!%*S`P
M("`@+C$P,#`P,#!%*S`Q("`@("`@("`@("`Q,#8U,S4S,C$V("`@+C`P,#`P
M,#!%*S`P("`@+C(X,#(U.3=%+30T("`@("`@("`@("`@("`@("`@("`P"B`@
M("XQ,#`P,#`P12LP,2`@("XP,#`P,#`P12LP,"`@("XQ,#`P,#`P12LP,2`@
.("XR.#`R-3DW12TT-`H@
`
end
STOP_CAT
echo "  Generating =====> [ ./fillarea_polyg.dat ]"
cat <<"STOP_CAT"> ././fillarea_polyg.uuu
begin 660 ./fillarea_polyg.dat
M("`@+C`P,#`P,#!%*S`P("`@+C$P,#`P,#!%*S`Q("`@+C4P,#`P,#!%*S`P
M("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@+C$P,#`P,#!%*S`Q
M("`@("`@("`@("`@("`@("`@("`S("`@+C`P,#`P,#!%*S`P("`@+C$U,#`P
M,#!%*S`P("`@+C,P,#`P,#!%*S`P("`@+C0U,#`P,#!%*S`P("`@("`@("`@
M("`@("`@("`@("`S("`@("`@("`@("`@("`@+3,R-S8X("`@("`@("`@("`@
M("`@(#,R-S8W"B`@("XP,#`P,#`P12LP,"`@("XQ,#`P,#`P12LP,2`@("XU
M,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XQ
M,#`P,#`P12LP,2`@("`@("`@("`@("`@("`@("`@,R`@("XT-3`P,#`P12LP
M,B`@("XQ-3`P,#`P12LP,"`@("XS,#`P,#`P12LP,"`@("XT-3`P,#`P12LP
M,"`@("`@("`@("`@("`@("`@("`@,R`@("`@("`@("`@("`@("TS,C<V."`@
4("`@("`@("`@("`@("`S,C<V-PH@
`
end
STOP_CAT
echo "  Generating =====> [ ./grid1.f ]"
cat <<"STOP_CAT"> ././grid1.f
C     PROGRAM GRID1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program GRID_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       GRID object access program
      EXTERNAL GRID_DRAW
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
      PARAMETER (NVV102 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IXGRID, TMP101, IYGRID, TMP102
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /1, 3, 0/
C
      DATA VV102 /-1, -3, 0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'grid_draw.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              GRID Object Demo Program #1'/
     * ' This program tests the GRID object access program'/
     * ' GRID_DRAW.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test GRID_DRAW object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        IXGRID = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        IYGRID = VV102(IVV102)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C                       Draw grid lines within, and frame around,
C                       subplot area
      CALL GRID_DRAW (IXGRID,IYGRID)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) IXGRID,IYGRID
  502 FORMAT (I21,I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              GRID Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./grid_draw.dat ]"
cat <<"STOP_CAT"> ././grid_draw.uuu
begin 660 ./grid_draw.dat
M("`@("`@("`@("`@("`@("`@("`Q("`@("`@("`@("`@("`@("`@("TQ"B`@
M("`@("`@("`@("`@("`@("`@,2`@("`@("`@("`@("`@("`@("`M,PH@("`@
M("`@("`@("`@("`@("`@(#$@("`@("`@("`@("`@("`@("`@(#`*("`@("`@
M("`@("`@("`@("`@("`S("`@("`@("`@("`@("`@("`@("TQ"B`@("`@("`@
M("`@("`@("`@("`@,R`@("`@("`@("`@("`@("`@("`M,PH@("`@("`@("`@
M("`@("`@("`@(#,@("`@("`@("`@("`@("`@("`@(#`*("`@("`@("`@("`@
M("`@("`@("`P("`@("`@("`@("`@("`@("`@("TQ"B`@("`@("`@("`@("`@
M("`@("`@,"`@("`@("`@("`@("`@("`@("`M,PH@("`@("`@("`@("`@("`@
;("`@(#`@("`@("`@("`@("`@("`@("`@(#`*
`
end
STOP_CAT
echo "  Generating =====> [ ./int1.f ]"
cat <<"STOP_CAT"> ././int1.f
C     PROGRAM INT1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program INT_WDRAWR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       INT object access program
      EXTERNAL INT_WDRAWR
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  4)
      PARAMETER (NVV102 =  1)
      PARAMETER (NVV103 =  1)
      PARAMETER (NVV104 =  4)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IVAL, TMP101, LREL, TMP104
C
C                       Real variables and arrays
      REAL    XVAL, TMP102, YVAL, TMP103
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
      REAL    VV102(NVV102)
      REAL    VV103(NVV103)
      INTEGER VV104(NVV104)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-99999, -1, 0, 99999/
C
      DATA VV102 /0.2/
C
      DATA VV103 /0.2/
C
      DATA VV104 /0, 1, 2, 3/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'intnum_wdrawr.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              INT Object Demo Program #1'/
     * ' This program tests the INT object access program'/
     * ' INT_WDRAWR.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test INT_WDRAWR object access program
C                       Loop for each input variable of access program
      DO 588 IVV102 = 1,NVV102
        XVAL = VV102(IVV102)
C
      DO 587 IVV103 = 1,NVV103
        YVAL = VV103(IVV103)
C
      DO 586 IVV104 = 1,NVV104
        LREL = VV104(IVV104)
        IVAL = VV101(IVV104)
C
C                       Draw integer number relative to current location
C                       or origin in world coordinates
      CALL INT_WDRAWR (IVAL,XVAL,YVAL,LREL)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) IVAL,XVAL,YVAL,LREL
  502 FORMAT (I21,E15.7,E15.7,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  586 CONTINUE
  587 CONTINUE
  588 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              INT Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./int2.f ]"
cat <<"STOP_CAT"> ././int2.f
C     PROGRAM INT2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program INT_WDRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       INT object access program
      EXTERNAL INT_WDRAW
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  4)
      PARAMETER (NVV102 =  2)
      PARAMETER (NVV103 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IVAL, TMP101
C
C                       Real variables and arrays
      REAL    XVAL, TMP102, YVAL, TMP103
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
      REAL    VV102(NVV102)
      REAL    VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-99999, -1, 0, 99999/
C
      DATA VV102 /0.2, 0.8/
C
      DATA VV103 /0.2, 0.8/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'intnum_wdraw.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              INT Object Demo Program #2'/
     * ' This program tests the INT object access program'/
     * ' INT_WDRAW.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test INT_WDRAW object access program
C
C                       Loop for each input variable of access program
C
      IVV101 = 0
      DO 588 IVV102 = 1,NVV102
        XVAL = VV102(IVV102)
C
      DO 587 IVV103 = 1,NVV103
        YVAL = VV103(IVV103)
        IVV101 = IVV101+1
        IVAL = VV101(IVV101)
C
C                       Draw integer number relative to origin in world
C                       coordinates
      CALL INT_WDRAW (IVAL,XVAL,YVAL)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) IVAL,XVAL,YVAL
  502 FORMAT (I21,E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  587 CONTINUE
  588 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              INT Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./intnum_wdraw.dat ]"
cat <<"STOP_CAT"> ././intnum_wdraw.uuu
begin 660 ./intnum_wdraw.dat
M("`@("`@("`@("`@("`@+3DY.3DY("`@+C(P,#`P,#!%*S`P("`@+C(P,#`P
M,#!%*S`P"B`@("`@("`@("`@("`@("`@("`M,2`@("XR,#`P,#`P12LP,"`@
M("XX,#`P,#`P12LP,`H@("`@("`@("`@("`@("`@("`@(#`@("`N.#`P,#`P
M,$4K,#`@("`N,C`P,#`P,$4K,#`*("`@("`@("`@("`@("`@(#DY.3DY("`@
<+C@P,#`P,#!%*S`P("`@+C@P,#`P,#!%*S`P"B`@
`
end
STOP_CAT
echo "  Generating =====> [ ./intnum_wdrawr.dat ]"
cat <<"STOP_CAT"> ././intnum_wdrawr.uuu
begin 660 ./intnum_wdrawr.dat
M("`@("`@("`@("`@("`@+3DY.3DY("`@+C(P,#`P,#!%*S`P("`@+C(P,#`P
M,#!%*S`P("`@("`@("`@("`@("`@("`@("`P"B`@("`@("`@("`@("`@("`@
M("`M,2`@("XR,#`P,#`P12LP,"`@("XR,#`P,#`P12LP,"`@("`@("`@("`@
M("`@("`@("`@,0H@("`@("`@("`@("`@("`@("`@(#`@("`N,C`P,#`P,$4K
M,#`@("`N,C`P,#`P,$4K,#`@("`@("`@("`@("`@("`@("`@(#(*("`@("`@
M("`@("`@("`@(#DY.3DY("`@+C(P,#`P,#!%*S`P("`@+C(P,#`P,#!%*S`P
6("`@("`@("`@("`@("`@("`@("`S"C`P
`
end
STOP_CAT
echo "  Generating =====> [ ./legend1.f ]"
cat <<"STOP_CAT"> ././legend1.f
C     PROGRAM LEGEND1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program LEGEND_DRAW and
C              LEGEND_ON, LEGEND_HT, LEGEND_WIDTH
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      REAL  LEGEND_WIDTH, LEGEND_HT
C
C                       Array for storing custom line style data
      REAL RAY(12)
C                       Arrays for storing curve coordinates
      REAL Y1(10),Y2(10),Y3(10),Y4(10),Y5(10),Y6(10),X1(10)
      REAL Z1(10),Z2(10),Z3(10),Z4(10),Z5(10),Z6(10),Z7(10)
C                       Array for storing legend block packed text
      INTEGER IP(200)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       CALCULATE COORDINATES FOR CURVES
C
C                       Four points per curve
      DO 100 I=1,4
C                       Fourth point has
        IF (I.EQ.4) THEN
C                         large X (is on right side of plot)
          X1(I)=8.0
C                         and zero slope (flat line segment)
          Z7(I)=Z7(3)
        ELSE
C                       Points 1,2,3 have X = 1., 2., 3.
          X1(I)=REAL(I)
C                         and 22.5 degree (1:2) slope
C                       Z7 is "thick user defined" - lowest curve
          Z7(I)=X1(I)/2.0
        ENDIF
C                       Each succeeding curve is 1 unit higher in Y
C                       Z6 is "thick chndsh"
        Z6(I)=Z7(I)+1.0
C                       Z5 is "thick chndot"
        Z5(I)=Z6(I)+1.0
C                       Z4 is "thick dash"
        Z4(I)=Z5(I)+1.0
C                       Z3 is "thick dot"
        Z3(I)=Z4(I)+1.0
C                       Z2 is "thick solid"
        Z2(I)=Z3(I)+1.0
C                       Z1 is "symbols only"
        Z1(I)=Z2(I)+1.0
C                       Y6 is "user defined"
        Y6(I)=Z1(I)+1.0
C                       Y5 is "chndsh"
        Y5(I)=Y6(I)+1.0
C                       Y4 is "chndot, no symbol"
        Y4(I)=Y5(I)+1.0
C                       Y3 is "dash, big symbols"
        Y3(I)=Y4(I)+1.0
C                       Y2 is "dot, blanked @ symbols"
        Y2(I)=Y3(I)+1.0
C                       Y1 is "solid"
        Y1(I)=Y2(I)+1.0
 100  CONTINUE
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Turn off border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.15*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 1.5*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plotting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('LEGEND1 Demo: Line Styles and Legend$',100)
C                       Compute X coord of start of text string in
C                       world coordinates
      XX = 0.50*(XPG-XX)
C                       Plot text string
      YMSG = -0.15*YPG
      CALL TEXT2D_PDRAW
     *     ('LEGEND1 Demo: Line Styles and Legend$',100,XX,YMSG)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.8)
C                       Set X axis label
      CALL AXISLBL_DEFX2 ('X-AXIS$',100)
C                       Set Y axis label
      CALL AXISLBL_DEFY2 ('Y-AXIS$',100)
C                       Set angle of Y axis label
C                       to be parallel to Y axis
      CALL AXISNUM_ROTY (0.0)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system with
C                       X = 0.0 to 1.0 and Y = 0.0 to 1.0, and
C                       draw axes, axes labels, and plot title, if any
      CALL PLOT2D_DEFINE (0.0,2.0,10.0,0.0,2.0,14.0)
C
C     ------------------------------------------------------------------
C
C                       PREPARE FOR DRAWING OF LEGEND BLOCK
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.5)
C                       Enable saving of line style by CURVE
      CALL LEGEND_ON
C                       Set text font to "cartog"
      CALL FONT_CARTOG
C                       Set space between characters in legend block
C                       to 0.8 of character height
      CALL LEGEND_SETVSP (1.8)
C                       Define heading for legend block
      CALL LEGEND_SETHDG ('LINES AND SYMBOLS$',100)
C                       Store label for 1st entry of legend block
      CALL PACKARY_SETENT ('SOLID$',IP,1)
C                       Store label for 2nd entry of legend block
      CALL PACKARY_SETENT ('DOT, BLANKED @ SYMBOLS$',IP,2)
C                       Store label for 3rd entry of legend block
      CALL PACKARY_SETENT ('DASH, BIG SYMBOLS$',IP,3)
C                       Store label for 4th entry of legend block
      CALL PACKARY_SETENT ('CHNDOT, NO SYMBOL$',IP,4)
C                       Store label for 5th entry of legend block
      CALL PACKARY_SETENT ('CHDASH$',IP,5)
C                       Store label for 6th entry of legend block
      CALL PACKARY_SETENT ('USER DEFINED$',IP,6)
C                       Store label for 7th entry of legend block
      CALL PACKARY_SETENT ('SYMBOLS ONLY$',IP,7)
C                       Increase space between characters in legend
C                       block to 1.0 of character height
      CALL LEGEND_SETVSP (2.0)
C                       Store label for 8th entry of legend block
      CALL PACKARY_SETENT ('THICK SOLID$',IP,8)
C                       Store label for 9th entry of legend block
      CALL PACKARY_SETENT ('THICK DOT$',IP,9)
C                       Store label for 10th entry of legend block
      CALL PACKARY_SETENT ('THICK DASH$',IP,10)
C                       Store label for 11th entry of legend block
      CALL PACKARY_SETENT ('THICK CHNDOT$',IP,11)
C                       Store label for 12th entry of legend block
      CALL PACKARY_SETENT ('THICK CHNDSH$',IP,12)
C                       Store label for 13th entry of legend block
      CALL PACKARY_SETENT ('THICK USER DEFINED$',IP,13)
C                       Set default text font
      CALL GRAPHICS_RESET ('FONT_CARTOG')
C                       Get X length of legend block in inches
      XLEN = LEGEND_WIDTH (IP,13)
C                       Get Y length of legend block in inches
      YLEN = LEGEND_HT (IP,13)
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Draw blank rectangle at location of
C                       legend block with border .01 inches wide
      XLEG = XPG*.7
      YLEG = YPG*.2
      CALL BLNKAREA_DEF (XLEG,YLEG,XLEN+0.2,YLEN+0.2,0.01)
C                       Set color to "foreground" color (white)
      CALL COLOR_SETNAM ('FOREGROUND')
C                       Draw frame around plot
      CALL FRAME_DRAW
C
C     ------------------------------------------------------------------
C                       (13 CURVES PLUS LEGEND BLOCK
C                        SHOWING DIFFERENT LINE STYLES)
C     ------------------------------------------------------------------
C
C                        PLOT CURVE 1 - "SOLID"
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Plot curve 1 ("solid") in green
      CALL CURVE2D_DRAW (X1,Y1,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 2 - "DOT, BLANKED @ SYMBOLS"
C
C                       Enable blanking of symbols
      CALL MARKER_BLANK
C                       Set current drawing color to 'magenta'
      CALL COLOR_SETNAM ('MAGENTA')
C                       Set line style to 'dot'
      CALL LINE2D_DOT
C                       Plot curve 2 ("dot, blanked @ symbols")
C                       in magenta
      CALL CURVE2D_DRAW (X1,Y2,4,1)
C                       Reset drawing of symbols without blanking
      CALL GRAPHICS_RESET ('MARKER_BLANK')
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 3 - "DASH, BIG SYMBOLS"
C
C                       Set symbol size to 3x normal
      CALL MARKER_SIZE (3.0)
C                       Set current drawing color to 'yellow'
      CALL COLOR_SETNAM ('YELLOW')
C                       Set line style to 'dash'
      CALL LINE2D_DASH
C                       Plot curve 3 ("dash, big symbols") in yellow
      CALL CURVE2D_DRAW (X1,Y3,4,1)
C                       Reset normal symbol size of .08 inches
      CALL GRAPHICS_RESET ('MARKER_SIZE')
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 4 - "CHNDOT, NO SYMBOL"
C
C                       Set line style to 'chndot'
      CALL LINE2D_CHNDOT
C                       Set current drawing color to 'blue'
      CALL COLOR_SETNAM ('BLUE')
C                       Plot curve 4 ("chndot, no symbol") in blue
      CALL CURVE2D_DRAW (X1,Y4,4,0)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 5 - "CHDASH"
C
C                       Set line style to 'chndsh'
      CALL LINE2D_CHNDSH
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Plot curve 5 ("chdash") in white
      CALL CURVE2D_DRAW (X1,Y5,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 6 - "USER DEFINED"
C
C                       Set non-dimen length of line style mark
      RAY(1)=1.0
C                       Set non-dimen length of line style space
      RAY(2)=3.0
C                       Set user-defined line style: "--......"
      CALL LINE2D_CUSTOM (0.2,2,RAY)
C                       Set current drawing color to 'red'
      CALL COLOR_SETNAM ('RED')
C                       Plot curve 6 ("user defined") in red
      CALL CURVE2D_DRAW (X1,Y6,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 7 - "SYMBOLS ONLY"
C
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Plot curve 7 ("symbols only") in cyan
      CALL CURVE2D_DRAW (X1,Z1,4,-1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 8 - "THICK SOLID"
C
C                       Set curve thickness in inches
      CALL LINE2D_THICK (0.04)
C                       Set symbol size to 1.5x normal
      CALL MARKER_SIZE (1.5)
C                       Reset default line style, i.e., solid
      CALL GRAPHICS_RESET ('LINE2D_CUSTOM')
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Plot curve 8 ("thick solid") in green
      CALL CURVE2D_DRAW (X1,Z2,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 9 - "THICK DOT"
C
C                       Set current drawing color to 'magenta'
      CALL COLOR_SETNAM ('MAGENTA')
C                       Set line style to 'dot'
      CALL LINE2D_DOT
C                       Plot curve 9 ("thick dot") in magenta
      CALL CURVE2D_DRAW (X1,Z3,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 10 - "THICK DASH"
C
C                       Set current drawing color to 'yellow'
      CALL COLOR_SETNAM ('YELLOW')
C                       Set line style to 'dash'
      CALL LINE2D_DASH
C                       Plot curve 10 ("thick dash") in yellow
      CALL CURVE2D_DRAW (X1,Z4,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 11 - "THICK CHNDOT"
C
C                       Set line style to 'chndot'
      CALL LINE2D_CHNDOT
C                       Set current drawing color to 'blue'
      CALL COLOR_SETNAM ('BLUE')
C                       Plot curve 1 ("thick chndot") in blue
      CALL CURVE2D_DRAW (X1,Z5,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 12 - "THICK CHNDSH"
C
C                       Set line style to 'chndsh'
      CALL LINE2D_CHNDSH
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Plot curve 12 ("thick chndsh") in white
      CALL CURVE2D_DRAW (X1,Z6,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 13 - "THICK USER DEFINED"
C
C                       Store non-dimen length of 1st line style mark
      RAY(1)=25.0
C                       Store non-dimen length of 1st line style space
      RAY(2)=5.0
C                       Store non-dimen length of 2nd line style mark
      RAY(3)=3.0
C                       Store non-dimen length of 2nd line style space
      RAY(4)=5.0
C                       Store non-dimen length of 3rd line style mark
      RAY(5)=3.0
C                       Store non-dimen length of 3rd line style space
      RAY(6)=5.0
C                       Store non-dimen length of 4th line style mark
      RAY(7)=3.0
C                       Store non-dimen length of 4th line style space
      RAY(8)=5.0
C                       Set user defined line style: "-----.-.-.-."
      CALL LINE2D_CUSTOM (0.9,8,RAY)
C                       Set current drawing color to 'red'
      CALL COLOR_SETNAM ('RED')
C                       Plot curve 13 ("thick user defined") in red
      CALL CURVE2D_DRAW (X1,Z7,4,1)
C                       Reset default curve thickness
      CALL GRAPHICS_RESET ('LINE2D_THICK')
C
C     ------------------------------------------------------------------
C
C                       DRAW LEGEND BLOCK
C
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Deactivate blanking of rectangular areas
      CALL GRAPHICS_RESET ('BLNKAL')
C                       Plot the legend block of 13 lines
      CALL LEGEND_DRAW (IP,13,XLEG*1.025,YLEG*1.05)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./legend2.f ]"
cat <<"STOP_CAT"> ././legend2.f
C     PROGRAM LEGEND2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program LEGEND_DRAWR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      REAL  LEGEND_WIDTH, LEGEND_HT
C
C                       Array for storing custom line style data
      REAL RAY(12)
C                       Arrays for storing curve coordinates
      REAL Y1(10),Y2(10),Y3(10),Y4(10),Y5(10),Y6(10),X1(10)
      REAL Z1(10),Z2(10),Z3(10),Z4(10),Z5(10),Z6(10),Z7(10)
C                       Array for storing legend block packed text
      INTEGER IP(200)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       CALCULATE COORDINATES FOR CURVES
C
C                       Four points per curve
      DO 100 I=1,4
C                       Fourth point has
        IF (I.EQ.4) THEN
C                         large X (is on right side of plot)
          X1(I)=8.0
C                         and zero slope (flat line segment)
          Z7(I)=Z7(3)
        ELSE
C                       Points 1,2,3 have X = 1., 2., 3.
          X1(I)=REAL(I)
C                         and 22.5 degree (1:2) slope
C                       Z7 is "thick user defined" - lowest curve
          Z7(I)=X1(I)/2.0
        ENDIF
C                       Each succeeding curve is 1 unit higher in Y
C                       Z6 is "thick chndsh"
        Z6(I)=Z7(I)+1.0
C                       Z5 is "thick chndot"
        Z5(I)=Z6(I)+1.0
C                       Z4 is "thick dash"
        Z4(I)=Z5(I)+1.0
C                       Z3 is "thick dot"
        Z3(I)=Z4(I)+1.0
C                       Z2 is "thick solid"
        Z2(I)=Z3(I)+1.0
C                       Z1 is "symbols only"
        Z1(I)=Z2(I)+1.0
C                       Y6 is "user defined"
        Y6(I)=Z1(I)+1.0
C                       Y5 is "chndsh"
        Y5(I)=Y6(I)+1.0
C                       Y4 is "chndot, no symbol"
        Y4(I)=Y5(I)+1.0
C                       Y3 is "dash, big symbols"
        Y3(I)=Y4(I)+1.0
C                       Y2 is "dot, blanked @ symbols"
        Y2(I)=Y3(I)+1.0
C                       Y1 is "solid"
        Y1(I)=Y2(I)+1.0
 100  CONTINUE
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Turn off border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.15*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 1.5*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plotting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN
     *     ('LEGEND2 Demo: Legend at Relative Location$',100)
C                       Compute X coord of start of text string in
C                       world coordinates
      XX = 0.50*(XPG-XX)
C                       Plot text string
      YMSG = -0.15*YPG
      CALL TEXT2D_PDRAW
     *     ('LEGEND2 Demo: Legend at Relative Location$',100,XX,YMSG)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.8)
C                       Set X axis label
      CALL AXISLBL_DEFX2 ('X-AXIS$',100)
C                       Set Y axis label
      CALL AXISLBL_DEFY2 ('Y-AXIS$',100)
C                       Set angle of Y axis label
C                       to be parallel to Y axis
      CALL AXISNUM_ROTY (0.0)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system with
C                       X = 0.0 to 1.0 and Y = 0.0 to 1.0, and
C                       draw axes, axes labels, and plot title, if any
      CALL PLOT2D_DEFINE (0.0,2.0,10.0,0.0,2.0,14.0)
C
C     ------------------------------------------------------------------
C
C                       PREPARE FOR DRAWING OF LEGEND BLOCK
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.5)
C                       Enable saving of line style by CURVE
      CALL LEGEND_ON
C                       Set text font to "cartog"
      CALL FONT_CARTOG
C                       Set space between characters in legend block
C                       to 0.8 of character height
      CALL LEGEND_SETVSP (1.8)
C                       Define heading for legend block
      CALL LEGEND_SETHDG ('LINES AND SYMBOLS$',100)
C                       Store label for 1st entry of legend block
      CALL PACKARY_SETENT ('SOLID$',IP,1)
C                       Store label for 2nd entry of legend block
      CALL PACKARY_SETENT ('DOT, BLANKED @ SYMBOLS$',IP,2)
C                       Store label for 3rd entry of legend block
      CALL PACKARY_SETENT ('DASH, BIG SYMBOLS$',IP,3)
C                       Store label for 4th entry of legend block
      CALL PACKARY_SETENT ('CHNDOT, NO SYMBOL$',IP,4)
C                       Store label for 5th entry of legend block
      CALL PACKARY_SETENT ('CHDASH$',IP,5)
C                       Store label for 6th entry of legend block
      CALL PACKARY_SETENT ('USER DEFINED$',IP,6)
C                       Store label for 7th entry of legend block
      CALL PACKARY_SETENT ('SYMBOLS ONLY$',IP,7)
C                       Increase space between characters in legend
C                       block to 1.0 of character height
      CALL LEGEND_SETVSP (2.0)
C                       Store label for 8th entry of legend block
      CALL PACKARY_SETENT ('THICK SOLID$',IP,8)
C                       Store label for 9th entry of legend block
      CALL PACKARY_SETENT ('THICK DOT$',IP,9)
C                       Store label for 10th entry of legend block
      CALL PACKARY_SETENT ('THICK DASH$',IP,10)
C                       Store label for 11th entry of legend block
      CALL PACKARY_SETENT ('THICK CHNDOT$',IP,11)
C                       Store label for 12th entry of legend block
      CALL PACKARY_SETENT ('THICK CHNDSH$',IP,12)
C                       Store label for 13th entry of legend block
      CALL PACKARY_SETENT ('THICK USER DEFINED$',IP,13)
C                       Set default text font
      CALL GRAPHICS_RESET ('FONT_CARTOG')
C                       Get X length of legend block in inches
      XLEN = LEGEND_WIDTH (IP,13)
C                       Get Y length of legend block in inches
      YLEN = LEGEND_HT (IP,13)
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Draw blank rectangle at location of
C                       legend block in upper right corner
      CALL LOGPEN2_SETP (XPG,YPG,0)
      XLEG = -(XLEN+0.2)
      YLEG = -(YLEN+0.2)
      CALL BLNKAREA_DEFR (XLEG,YLEG,XLEN+0.2,YLEN+0.2,0.01,3)
C                       Set color to "foreground" color (white)
      CALL COLOR_SETNAM ('FOREGROUND')
C                       Draw frame around plot
      CALL FRAME_DRAW
C
C     ------------------------------------------------------------------
C                       (13 CURVES PLUS LEGEND BLOCK
C                        SHOWING DIFFERENT LINE STYLES)
C     ------------------------------------------------------------------
C
C                        PLOT CURVE 1 - "SOLID"
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Plot curve 1 ("solid") in green
      CALL CURVE2D_DRAW (X1,Y1,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 2 - "DOT, BLANKED @ SYMBOLS"
C
C                       Enable blanking of symbols
      CALL MARKER_BLANK
C                       Set current drawing color to 'magenta'
      CALL COLOR_SETNAM ('MAGENTA')
C                       Set line style to 'dot'
      CALL LINE2D_DOT
C                       Plot curve 2 ("dot, blanked @ symbols")
C                       in magenta
      CALL CURVE2D_DRAW (X1,Y2,4,1)
C                       Reset drawing of symbols without blanking
      CALL GRAPHICS_RESET ('MARKER_BLANK')
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 3 - "DASH, BIG SYMBOLS"
C
C                       Set symbol size to 3x normal
      CALL MARKER_SIZE (3.0)
C                       Set current drawing color to 'yellow'
      CALL COLOR_SETNAM ('YELLOW')
C                       Set line style to 'dash'
      CALL LINE2D_DASH
C                       Plot curve 3 ("dash, big symbols") in yellow
      CALL CURVE2D_DRAW (X1,Y3,4,1)
C                       Reset normal symbol size of .08 inches
      CALL GRAPHICS_RESET ('MARKER_SIZE')
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 4 - "CHNDOT, NO SYMBOL"
C
C                       Set line style to 'chndot'
      CALL LINE2D_CHNDOT
C                       Set current drawing color to 'blue'
      CALL COLOR_SETNAM ('BLUE')
C                       Plot curve 4 ("chndot, no symbol") in blue
      CALL CURVE2D_DRAW (X1,Y4,4,0)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 5 - "CHDASH"
C
C                       Set line style to 'chndsh'
      CALL LINE2D_CHNDSH
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Plot curve 5 ("chdash") in white
      CALL CURVE2D_DRAW (X1,Y5,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 6 - "USER DEFINED"
C
C                       Set non-dimen length of line style mark
      RAY(1)=1.0
C                       Set non-dimen length of line style space
      RAY(2)=3.0
C                       Set user-defined line style: "--......"
      CALL LINE2D_CUSTOM (0.2,2,RAY)
C                       Set current drawing color to 'red'
      CALL COLOR_SETNAM ('RED')
C                       Plot curve 6 ("user defined") in red
      CALL CURVE2D_DRAW (X1,Y6,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 7 - "SYMBOLS ONLY"
C
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Plot curve 7 ("symbols only") in cyan
      CALL CURVE2D_DRAW (X1,Z1,4,-1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 8 - "THICK SOLID"
C
C                       Set curve thickness in inches
      CALL LINE2D_THICK (0.04)
C                       Set symbol size to 1.5x normal
      CALL MARKER_SIZE (1.5)
C                       Reset default line style, i.e., solid
      CALL GRAPHICS_RESET ('LINE2D_CUSTOM')
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Plot curve 8 ("thick solid") in green
      CALL CURVE2D_DRAW (X1,Z2,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 9 - "THICK DOT"
C
C                       Set current drawing color to 'magenta'
      CALL COLOR_SETNAM ('MAGENTA')
C                       Set line style to 'dot'
      CALL LINE2D_DOT
C                       Plot curve 9 ("thick dot") in magenta
      CALL CURVE2D_DRAW (X1,Z3,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 10 - "THICK DASH"
C
C                       Set current drawing color to 'yellow'
      CALL COLOR_SETNAM ('YELLOW')
C                       Set line style to 'dash'
      CALL LINE2D_DASH
C                       Plot curve 10 ("thick dash") in yellow
      CALL CURVE2D_DRAW (X1,Z4,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 11 - "THICK CHNDOT"
C
C                       Set line style to 'chndot'
      CALL LINE2D_CHNDOT
C                       Set current drawing color to 'blue'
      CALL COLOR_SETNAM ('BLUE')
C                       Plot curve 1 ("thick chndot") in blue
      CALL CURVE2D_DRAW (X1,Z5,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 12 - "THICK CHNDSH"
C
C                       Set line style to 'chndsh'
      CALL LINE2D_CHNDSH
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Plot curve 12 ("thick chndsh") in white
      CALL CURVE2D_DRAW (X1,Z6,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 13 - "THICK USER DEFINED"
C
C                       Store non-dimen length of 1st line style mark
      RAY(1)=25.0
C                       Store non-dimen length of 1st line style space
      RAY(2)=5.0
C                       Store non-dimen length of 2nd line style mark
      RAY(3)=3.0
C                       Store non-dimen length of 2nd line style space
      RAY(4)=5.0
C                       Store non-dimen length of 3rd line style mark
      RAY(5)=3.0
C                       Store non-dimen length of 3rd line style space
      RAY(6)=5.0
C                       Store non-dimen length of 4th line style mark
      RAY(7)=3.0
C                       Store non-dimen length of 4th line style space
      RAY(8)=5.0
C                       Set user defined line style: "-----.-.-.-."
      CALL LINE2D_CUSTOM (0.9,8,RAY)
C                       Set current drawing color to 'red'
      CALL COLOR_SETNAM ('RED')
C                       Plot curve 13 ("thick user defined") in red
      CALL CURVE2D_DRAW (X1,Z7,4,1)
C                       Reset default curve thickness
      CALL GRAPHICS_RESET ('LINE2D_THICK')
C
C     ------------------------------------------------------------------
C
C                       DRAW LEGEND BLOCK
C
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Deactivate blanking of rectangular areas
      CALL GRAPHICS_RESET ('BLNKAL')
C                       Plot the legend block of 13 lines
      CALL LOGPEN2_SETP (XPG,YPG,0)
      CALL LEGEND_DRAWR (IP,13,XLEG*0.975,YLEG*0.975,3)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./legend3.f ]"
cat <<"STOP_CAT"> ././legend3.f
C     PROGRAM LEGEND3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program LEGEND_ENTOFF and
C              LEGEND_ENTON
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      REAL  LEGEND_WIDTH, LEGEND_HT
C
C                       Array for storing custom line style data
      REAL RAY(12)
C                       Arrays for storing curve coordinates
      REAL Y1(10),Y2(10),Y3(10),Y4(10),Y5(10),Y6(10),X1(10)
      REAL Z1(10),Z2(10),Z3(10),Z4(10),Z5(10),Z6(10),Z7(10)
C                       Array for storing legend block packed text
      INTEGER IP(200)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       CALCULATE COORDINATES FOR CURVES
C
C                       Four points per curve
      DO 100 I=1,4
C                       Fourth point has
        IF (I.EQ.4) THEN
C                         large X (is on right side of plot)
          X1(I)=8.0
C                         and zero slope (flat line segment)
          Z7(I)=Z7(3)
        ELSE
C                       Points 1,2,3 have X = 1., 2., 3.
          X1(I)=REAL(I)
C                         and 22.5 degree (1:2) slope
C                       Z7 is "thick user defined" - lowest curve
          Z7(I)=X1(I)/2.0
        ENDIF
C                       Each succeeding curve is 1 unit higher in Y
C                       Z6 is "thick chndsh"
        Z6(I)=Z7(I)+1.0
C                       Z5 is "thick chndot"
        Z5(I)=Z6(I)+1.0
C                       Z4 is "thick dash"
        Z4(I)=Z5(I)+1.0
C                       Z3 is "thick dot"
        Z3(I)=Z4(I)+1.0
C                       Z2 is "thick solid"
        Z2(I)=Z3(I)+1.0
C                       Z1 is "symbols only"
        Z1(I)=Z2(I)+1.0
C                       Y6 is "user defined"
        Y6(I)=Z1(I)+1.0
C                       Y5 is "chndsh"
        Y5(I)=Y6(I)+1.0
C                       Y4 is "chndot, no symbol"
        Y4(I)=Y5(I)+1.0
C                       Y3 is "dash, big symbols"
        Y3(I)=Y4(I)+1.0
C                       Y2 is "dot, blanked @ symbols"
        Y2(I)=Y3(I)+1.0
C                       Y1 is "solid"
        Y1(I)=Y2(I)+1.0
 100  CONTINUE
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
      DO 400 IPLT=1,2
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Turn off border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.15*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 1.5*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plotting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN
     *     ('LEGEND3 Demo: Legend Entry Disable/Enable$',100)
C                       Compute X coord of start of text string in
C                       world coordinates
      XX = 0.50*(XPG-XX)
C                       Plot text string
      YMSG = -0.15*YPG
      CALL TEXT2D_PDRAW
     *     ('LEGEND3 Demo: Legend Entry Disable/Enable$',100,XX,YMSG)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.8)
C                       Set X axis label
      CALL AXISLBL_DEFX2 ('X-AXIS$',100)
C                       Set Y axis label
      CALL AXISLBL_DEFY2 ('Y-AXIS$',100)
C                       Set angle of Y axis label
C                       to be parallel to Y axis
      CALL AXISNUM_ROTY (0.0)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system with
C                       X = 0.0 to 1.0 and Y = 0.0 to 1.0, and
C                       draw axes, axes labels, and plot title, if any
      CALL PLOT2D_DEFINE (0.0,2.0,10.0,0.0,2.0,14.0)
C
C     ------------------------------------------------------------------
C
C                       PREPARE FOR DRAWING OF LEGEND BLOCK
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.5)
C                       Enable saving of line style by CURVE
      CALL LEGEND_ON
C                       Set text font to "cartog"
      CALL FONT_CARTOG
C                       Set space between characters in legend block
C                       to 0.8 of character height
      CALL LEGEND_SETVSP (1.8)
C                       Define heading for legend block
      CALL LEGEND_SETHDG ('LINES AND SYMBOLS$',100)
C                       Store label for 1st entry of legend block
      CALL PACKARY_SETENT ('SOLID$',IP,1)
C                       Store label for 2nd entry of legend block
      CALL PACKARY_SETENT ('DOT, BLANKED @ SYMBOLS$',IP,2)
C                       Store label for 3rd entry of legend block
      CALL PACKARY_SETENT ('DASH, BIG SYMBOLS$',IP,3)
C                       Store label for 4th entry of legend block
      CALL PACKARY_SETENT ('CHNDOT, NO SYMBOL$',IP,4)
C                       Store label for 5th entry of legend block
      CALL PACKARY_SETENT ('CHDASH$',IP,5)
C                       Store label for 6th entry of legend block
      CALL PACKARY_SETENT ('USER DEFINED$',IP,6)
C                       Store label for 7th entry of legend block
      CALL PACKARY_SETENT ('SYMBOLS ONLY$',IP,7)
C                       Increase space between characters in legend
C                       block to 1.0 of character height
      CALL LEGEND_SETVSP (2.0)
C                       Store label for 8th entry of legend block
      CALL PACKARY_SETENT ('THICK SOLID$',IP,8)
C                       Store label for 9th entry of legend block
      CALL PACKARY_SETENT ('THICK DOT$',IP,9)
C                       Store label for 10th entry of legend block
      CALL PACKARY_SETENT ('THICK DASH$',IP,10)
C                       Store label for 11th entry of legend block
      CALL PACKARY_SETENT ('THICK CHNDOT$',IP,11)
C                       Store label for 12th entry of legend block
      CALL PACKARY_SETENT ('THICK CHNDSH$',IP,12)
C                       Store label for 13th entry of legend block
      CALL PACKARY_SETENT ('THICK USER DEFINED$',IP,13)
C                       Set default text font
      CALL GRAPHICS_RESET ('FONT_CARTOG')
C                       Get X length of legend block in inches
      XLEN = LEGEND_WIDTH (IP,13)
C                       Get Y length of legend block in inches
      YLEN = LEGEND_HT (IP,13)
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Draw blank rectangle at location of
C                       legend block with border .01 inches wide
      XLEG = XPG*.7
      YLEG = YPG*.2
      CALL BLNKAREA_DEF (XLEG,YLEG,XLEN+0.2,YLEN+0.2,0.01)
C                       Set color to "foreground" color (white)
      CALL COLOR_SETNAM ('FOREGROUND')
C                       Draw frame around plot
      CALL FRAME_DRAW
C
C     ------------------------------------------------------------------
C                       (13 CURVES PLUS LEGEND BLOCK
C                        SHOWING DIFFERENT LINE STYLES)
C     ------------------------------------------------------------------
C
C                        PLOT CURVE 1 - "SOLID"
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Plot curve 1 ("solid") in green
      CALL CURVE2D_DRAW (X1,Y1,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 2 - "DOT, BLANKED @ SYMBOLS"
C
C                       Enable blanking of symbols
      CALL MARKER_BLANK
C                       Set current drawing color to 'magenta'
      CALL COLOR_SETNAM ('MAGENTA')
C                       Set line style to 'dot'
      CALL LINE2D_DOT
C                       Plot curve 2 ("dot, blanked @ symbols")
C                       in magenta
      CALL CURVE2D_DRAW (X1,Y2,4,1)
C                       Reset drawing of symbols without blanking
      CALL GRAPHICS_RESET ('MARKER_BLANK')
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 3 - "DASH, BIG SYMBOLS"
C
C                       Set symbol size to 3x normal
      CALL MARKER_SIZE (3.0)
C                       Set current drawing color to 'yellow'
      CALL COLOR_SETNAM ('YELLOW')
C                       Set line style to 'dash'
      CALL LINE2D_DASH
C                       Plot curve 3 ("dash, big symbols") in yellow
      CALL CURVE2D_DRAW (X1,Y3,4,1)
C                       Reset normal symbol size of .08 inches
      CALL GRAPHICS_RESET ('MARKER_SIZE')
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 4 - "CHNDOT, NO SYMBOL"
C
C                       Set line style to 'chndot'
      CALL LINE2D_CHNDOT
C                       Set current drawing color to 'blue'
      CALL COLOR_SETNAM ('BLUE')
C                       Plot curve 4 ("chndot, no symbol") in blue
      CALL CURVE2D_DRAW (X1,Y4,4,0)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 5 - "CHDASH"
C
C                       Set line style to 'chndsh'
      CALL LINE2D_CHNDSH
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Plot curve 5 ("chdash") in white
      CALL CURVE2D_DRAW (X1,Y5,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 6 - "USER DEFINED"
C
C                       Set non-dimen length of line style mark
      RAY(1)=1.0
C                       Set non-dimen length of line style space
      RAY(2)=3.0
C                       Set user-defined line style: "--......"
      CALL LINE2D_CUSTOM (0.2,2,RAY)
C                       Set current drawing color to 'red'
      CALL COLOR_SETNAM ('RED')
C                       Plot curve 6 ("user defined") in red
      CALL CURVE2D_DRAW (X1,Y6,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 7 - "SYMBOLS ONLY"
C
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Plot curve 7 ("symbols only") in cyan
      CALL CURVE2D_DRAW (X1,Z1,4,-1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 8 - "THICK SOLID"
C
C                       Set curve thickness in inches
      CALL LINE2D_THICK (0.04)
C                       Set symbol size to 1.5x normal
      CALL MARKER_SIZE (1.5)
C                       Reset default line style, i.e., solid
      CALL GRAPHICS_RESET ('LINE2D_CUSTOM')
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Plot curve 8 ("thick solid") in green
      CALL CURVE2D_DRAW (X1,Z2,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 9 - "THICK DOT"
C
C                       Set current drawing color to 'magenta'
      CALL COLOR_SETNAM ('MAGENTA')
C                       Set line style to 'dot'
      CALL LINE2D_DOT
C                       Plot curve 9 ("thick dot") in magenta
      CALL CURVE2D_DRAW (X1,Z3,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 10 - "THICK DASH"
C
C                       Set current drawing color to 'yellow'
      CALL COLOR_SETNAM ('YELLOW')
C                       Set line style to 'dash'
      CALL LINE2D_DASH
C                       Plot curve 10 ("thick dash") in yellow
      CALL CURVE2D_DRAW (X1,Z4,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 11 - "THICK CHNDOT"
C
C                       Set line style to 'chndot'
      CALL LINE2D_CHNDOT
C                       Set current drawing color to 'blue'
      CALL COLOR_SETNAM ('BLUE')
C                       Plot curve 1 ("thick chndot") in blue
      CALL CURVE2D_DRAW (X1,Z5,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 12 - "THICK CHNDSH"
C
C                       Set line style to 'chndsh'
      CALL LINE2D_CHNDSH
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Plot curve 12 ("thick chndsh") in white
      CALL CURVE2D_DRAW (X1,Z6,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 13 - "THICK USER DEFINED"
C
C                       Store non-dimen length of 1st line style mark
      RAY(1)=25.0
C                       Store non-dimen length of 1st line style space
      RAY(2)=5.0
C                       Store non-dimen length of 2nd line style mark
      RAY(3)=3.0
C                       Store non-dimen length of 2nd line style space
      RAY(4)=5.0
C                       Store non-dimen length of 3rd line style mark
      RAY(5)=3.0
C                       Store non-dimen length of 3rd line style space
      RAY(6)=5.0
C                       Store non-dimen length of 4th line style mark
      RAY(7)=3.0
C                       Store non-dimen length of 4th line style space
      RAY(8)=5.0
C                       Set user defined line style: "-----.-.-.-."
      CALL LINE2D_CUSTOM (0.9,8,RAY)
C                       Set current drawing color to 'red'
      CALL COLOR_SETNAM ('RED')
C                       Plot curve 13 ("thick user defined") in red
      CALL CURVE2D_DRAW (X1,Z7,4,1)
C                       Reset default curve thickness
      CALL GRAPHICS_RESET ('LINE2D_THICK')
C
C     ------------------------------------------------------------------
C
C                       DRAW LEGEND BLOCK
C
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Deactivate blanking of rectangular areas
      CALL GRAPHICS_RESET ('BLNKAL')
C                       Disable all legend entries for 2nd plot
      DO 300 JPLT=1,13
      CALL LEGEND_ENTOFF (JPLT)
  300 CONTINUE
C                       Enable all legend entries for 2nd plot
      IF (IPLT .EQ. 2) THEN
        DO 310 JPLT=1,13
        CALL LEGEND_ENTON (JPLT)
  310   CONTINUE
      ENDIF
C                       Plot the legend block of 13 lines
      CALL LEGEND_DRAW (IP,13,XLEG*1.025,YLEG*1.05)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  400 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./legend4.f ]"
cat <<"STOP_CAT"> ././legend4.f
C     PROGRAM LEGEND4
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program LEGEND_SETHDG
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      REAL  LEGEND_WIDTH, LEGEND_HT
C
C                       Array for storing custom line style data
      REAL RAY(12)
C                       Arrays for storing curve coordinates
      REAL Y1(10),Y2(10),Y3(10),Y4(10),Y5(10),Y6(10),X1(10)
      REAL Z1(10),Z2(10),Z3(10),Z4(10),Z5(10),Z6(10),Z7(10)
C                       Array for storing legend block packed text
      INTEGER IP(200)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       CALCULATE COORDINATES FOR CURVES
C
C                       Four points per curve
      DO 100 I=1,4
C                       Fourth point has
        IF (I.EQ.4) THEN
C                         large X (is on right side of plot)
          X1(I)=8.0
C                         and zero slope (flat line segment)
          Z7(I)=Z7(3)
        ELSE
C                       Points 1,2,3 have X = 1., 2., 3.
          X1(I)=REAL(I)
C                         and 22.5 degree (1:2) slope
C                       Z7 is "thick user defined" - lowest curve
          Z7(I)=X1(I)/2.0
        ENDIF
C                       Each succeeding curve is 1 unit higher in Y
C                       Z6 is "thick chndsh"
        Z6(I)=Z7(I)+1.0
C                       Z5 is "thick chndot"
        Z5(I)=Z6(I)+1.0
C                       Z4 is "thick dash"
        Z4(I)=Z5(I)+1.0
C                       Z3 is "thick dot"
        Z3(I)=Z4(I)+1.0
C                       Z2 is "thick solid"
        Z2(I)=Z3(I)+1.0
C                       Z1 is "symbols only"
        Z1(I)=Z2(I)+1.0
C                       Y6 is "user defined"
        Y6(I)=Z1(I)+1.0
C                       Y5 is "chndsh"
        Y5(I)=Y6(I)+1.0
C                       Y4 is "chndot, no symbol"
        Y4(I)=Y5(I)+1.0
C                       Y3 is "dash, big symbols"
        Y3(I)=Y4(I)+1.0
C                       Y2 is "dot, blanked @ symbols"
        Y2(I)=Y3(I)+1.0
C                       Y1 is "solid"
        Y1(I)=Y2(I)+1.0
 100  CONTINUE
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
      DO 400 IHD=1,2
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Turn off border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.15*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 1.5*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plotting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('LEGEND4 Demo: Legend Heading$',100)
C                       Compute X coord of start of text string in
C                       world coordinates
      XX = 0.50*(XPG-XX)
C                       Plot text string
      YMSG = -0.15*YPG
      CALL TEXT2D_PDRAW
     *     ('LEGEND4 Demo: Legend Heading$',100,XX,YMSG)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.8)
C                       Set X axis label
      CALL AXISLBL_DEFX2 ('X-AXIS$',100)
C                       Set Y axis label
      CALL AXISLBL_DEFY2 ('Y-AXIS$',100)
C                       Set angle of Y axis label
C                       to be parallel to Y axis
      CALL AXISNUM_ROTY (0.0)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system with
C                       X = 0.0 to 1.0 and Y = 0.0 to 1.0, and
C                       draw axes, axes labels, and plot title, if any
      CALL PLOT2D_DEFINE (0.0,2.0,10.0,0.0,2.0,14.0)
C
C     ------------------------------------------------------------------
C
C                       PREPARE FOR DRAWING OF LEGEND BLOCK
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.5)
C                       Enable saving of line style by CURVE
      CALL LEGEND_ON
C                       Set text font to "cartog"
      CALL FONT_CARTOG
C                       Set space between characters in legend block
C                       to 0.8 of character height
      CALL LEGEND_SETVSP (1.8)
C                       Define heading for legend block
      IF (IHD .EQ. 2) THEN
        CALL LEGEND_SETHDG ('Maximum Size Heading$',100)
      ELSE
        CALL LEGEND_SETHDG ('Short Heading$',100)
      ENDIF
C                       Store label for 1st entry of legend block
      CALL PACKARY_SETENT ('SOLID$',IP,1)
C                       Store label for 2nd entry of legend block
      CALL PACKARY_SETENT ('DOT, BLANKED @ SYMBOLS$',IP,2)
C                       Store label for 3rd entry of legend block
      CALL PACKARY_SETENT ('DASH, BIG SYMBOLS$',IP,3)
C                       Store label for 4th entry of legend block
      CALL PACKARY_SETENT ('CHNDOT, NO SYMBOL$',IP,4)
C                       Store label for 5th entry of legend block
      CALL PACKARY_SETENT ('CHDASH$',IP,5)
C                       Store label for 6th entry of legend block
      CALL PACKARY_SETENT ('USER DEFINED$',IP,6)
C                       Store label for 7th entry of legend block
      CALL PACKARY_SETENT ('SYMBOLS ONLY$',IP,7)
C                       Increase space between characters in legend
C                       block to 1.0 of character height
      CALL LEGEND_SETVSP (2.0)
C                       Store label for 8th entry of legend block
      CALL PACKARY_SETENT ('THICK SOLID$',IP,8)
C                       Store label for 9th entry of legend block
      CALL PACKARY_SETENT ('THICK DOT$',IP,9)
C                       Store label for 10th entry of legend block
      CALL PACKARY_SETENT ('THICK DASH$',IP,10)
C                       Store label for 11th entry of legend block
      CALL PACKARY_SETENT ('THICK CHNDOT$',IP,11)
C                       Store label for 12th entry of legend block
      CALL PACKARY_SETENT ('THICK CHNDSH$',IP,12)
C                       Store label for 13th entry of legend block
      CALL PACKARY_SETENT ('THICK USER DEFINED$',IP,13)
C                       Set default text font
      CALL GRAPHICS_RESET ('FONT_CARTOG')
C                       Get X length of legend block in inches
      XLEN = LEGEND_WIDTH (IP,13)
C                       Get Y length of legend block in inches
      YLEN = LEGEND_HT (IP,13)
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Draw blank rectangle at location of
C                       legend block with border .01 inches wide
      XLEG = XPG*.7
      YLEG = YPG*.2
      CALL BLNKAREA_DEF (XLEG,YLEG,XLEN+0.2,YLEN+0.2,0.01)
C                       Set color to "foreground" color (white)
      CALL COLOR_SETNAM ('FOREGROUND')
C                       Draw frame around plot
      CALL FRAME_DRAW
C
C     ------------------------------------------------------------------
C                       (13 CURVES PLUS LEGEND BLOCK
C                        SHOWING DIFFERENT LINE STYLES)
C     ------------------------------------------------------------------
C
C                        PLOT CURVE 1 - "SOLID"
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Plot curve 1 ("solid") in green
      CALL CURVE2D_DRAW (X1,Y1,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 2 - "DOT, BLANKED @ SYMBOLS"
C
C                       Enable blanking of symbols
      CALL MARKER_BLANK
C                       Set current drawing color to 'magenta'
      CALL COLOR_SETNAM ('MAGENTA')
C                       Set line style to 'dot'
      CALL LINE2D_DOT
C                       Plot curve 2 ("dot, blanked @ symbols")
C                       in magenta
      CALL CURVE2D_DRAW (X1,Y2,4,1)
C                       Reset drawing of symbols without blanking
      CALL GRAPHICS_RESET ('MARKER_BLANK')
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 3 - "DASH, BIG SYMBOLS"
C
C                       Set symbol size to 3x normal
      CALL MARKER_SIZE (3.0)
C                       Set current drawing color to 'yellow'
      CALL COLOR_SETNAM ('YELLOW')
C                       Set line style to 'dash'
      CALL LINE2D_DASH
C                       Plot curve 3 ("dash, big symbols") in yellow
      CALL CURVE2D_DRAW (X1,Y3,4,1)
C                       Reset normal symbol size of .08 inches
      CALL GRAPHICS_RESET ('MARKER_SIZE')
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 4 - "CHNDOT, NO SYMBOL"
C
C                       Set line style to 'chndot'
      CALL LINE2D_CHNDOT
C                       Set current drawing color to 'blue'
      CALL COLOR_SETNAM ('BLUE')
C                       Plot curve 4 ("chndot, no symbol") in blue
      CALL CURVE2D_DRAW (X1,Y4,4,0)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 5 - "CHDASH"
C
C                       Set line style to 'chndsh'
      CALL LINE2D_CHNDSH
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Plot curve 5 ("chdash") in white
      CALL CURVE2D_DRAW (X1,Y5,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 6 - "USER DEFINED"
C
C                       Set non-dimen length of line style mark
      RAY(1)=1.0
C                       Set non-dimen length of line style space
      RAY(2)=3.0
C                       Set user-defined line style: "--......"
      CALL LINE2D_CUSTOM (0.2,2,RAY)
C                       Set current drawing color to 'red'
      CALL COLOR_SETNAM ('RED')
C                       Plot curve 6 ("user defined") in red
      CALL CURVE2D_DRAW (X1,Y6,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 7 - "SYMBOLS ONLY"
C
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Plot curve 7 ("symbols only") in cyan
      CALL CURVE2D_DRAW (X1,Z1,4,-1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 8 - "THICK SOLID"
C
C                       Set curve thickness in inches
      CALL LINE2D_THICK (0.04)
C                       Set symbol size to 1.5x normal
      CALL MARKER_SIZE (1.5)
C                       Reset default line style, i.e., solid
      CALL GRAPHICS_RESET ('LINE2D_CUSTOM')
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Plot curve 8 ("thick solid") in green
      CALL CURVE2D_DRAW (X1,Z2,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 9 - "THICK DOT"
C
C                       Set current drawing color to 'magenta'
      CALL COLOR_SETNAM ('MAGENTA')
C                       Set line style to 'dot'
      CALL LINE2D_DOT
C                       Plot curve 9 ("thick dot") in magenta
      CALL CURVE2D_DRAW (X1,Z3,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 10 - "THICK DASH"
C
C                       Set current drawing color to 'yellow'
      CALL COLOR_SETNAM ('YELLOW')
C                       Set line style to 'dash'
      CALL LINE2D_DASH
C                       Plot curve 10 ("thick dash") in yellow
      CALL CURVE2D_DRAW (X1,Z4,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 11 - "THICK CHNDOT"
C
C                       Set line style to 'chndot'
      CALL LINE2D_CHNDOT
C                       Set current drawing color to 'blue'
      CALL COLOR_SETNAM ('BLUE')
C                       Plot curve 1 ("thick chndot") in blue
      CALL CURVE2D_DRAW (X1,Z5,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 12 - "THICK CHNDSH"
C
C                       Set line style to 'chndsh'
      CALL LINE2D_CHNDSH
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Plot curve 12 ("thick chndsh") in white
      CALL CURVE2D_DRAW (X1,Z6,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 13 - "THICK USER DEFINED"
C
C                       Store non-dimen length of 1st line style mark
      RAY(1)=25.0
C                       Store non-dimen length of 1st line style space
      RAY(2)=5.0
C                       Store non-dimen length of 2nd line style mark
      RAY(3)=3.0
C                       Store non-dimen length of 2nd line style space
      RAY(4)=5.0
C                       Store non-dimen length of 3rd line style mark
      RAY(5)=3.0
C                       Store non-dimen length of 3rd line style space
      RAY(6)=5.0
C                       Store non-dimen length of 4th line style mark
      RAY(7)=3.0
C                       Store non-dimen length of 4th line style space
      RAY(8)=5.0
C                       Set user defined line style: "-----.-.-.-."
      CALL LINE2D_CUSTOM (0.9,8,RAY)
C                       Set current drawing color to 'red'
      CALL COLOR_SETNAM ('RED')
C                       Plot curve 13 ("thick user defined") in red
      CALL CURVE2D_DRAW (X1,Z7,4,1)
C                       Reset default curve thickness
      CALL GRAPHICS_RESET ('LINE2D_THICK')
C
C     ------------------------------------------------------------------
C
C                       DRAW LEGEND BLOCK
C
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Deactivate blanking of rectangular areas
      CALL GRAPHICS_RESET ('BLNKAL')
C                       Plot the legend block of 13 lines
      CALL LEGEND_DRAW (IP,13,XLEG*1.025,YLEG*1.05)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  400 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./legend5.f ]"
cat <<"STOP_CAT"> ././legend5.f
C     PROGRAM LEGEND5
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program LEGEND_SETVSP
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      REAL  LEGEND_WIDTH, LEGEND_HT
C
C                       Array for storing custom line style data
      REAL RAY(12)
C                       Arrays for storing curve coordinates
      REAL Y1(10),Y2(10),Y3(10),Y4(10),Y5(10),Y6(10),X1(10)
      REAL Z1(10),Z2(10),Z3(10),Z4(10),Z5(10),Z6(10),Z7(10)
C                       Array for storing legend block packed text
      INTEGER IP(200)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       CALCULATE COORDINATES FOR CURVES
C
C                       Four points per curve
      DO 100 I=1,4
C                       Fourth point has
        IF (I.EQ.4) THEN
C                         large X (is on right side of plot)
          X1(I)=8.0
C                         and zero slope (flat line segment)
          Z7(I)=Z7(3)
        ELSE
C                       Points 1,2,3 have X = 1., 2., 3.
          X1(I)=REAL(I)
C                         and 22.5 degree (1:2) slope
C                       Z7 is "thick user defined" - lowest curve
          Z7(I)=X1(I)/2.0
        ENDIF
C                       Each succeeding curve is 1 unit higher in Y
C                       Z6 is "thick chndsh"
        Z6(I)=Z7(I)+1.0
C                       Z5 is "thick chndot"
        Z5(I)=Z6(I)+1.0
C                       Z4 is "thick dash"
        Z4(I)=Z5(I)+1.0
C                       Z3 is "thick dot"
        Z3(I)=Z4(I)+1.0
C                       Z2 is "thick solid"
        Z2(I)=Z3(I)+1.0
C                       Z1 is "symbols only"
        Z1(I)=Z2(I)+1.0
C                       Y6 is "user defined"
        Y6(I)=Z1(I)+1.0
C                       Y5 is "chndsh"
        Y5(I)=Y6(I)+1.0
C                       Y4 is "chndot, no symbol"
        Y4(I)=Y5(I)+1.0
C                       Y3 is "dash, big symbols"
        Y3(I)=Y4(I)+1.0
C                       Y2 is "dot, blanked @ symbols"
        Y2(I)=Y3(I)+1.0
C                       Y1 is "solid"
        Y1(I)=Y2(I)+1.0
 100  CONTINUE
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
      DO 400 IVSP=1,2
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Turn off border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.15*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 1.5*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plotting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('LEGEND5 Demo: Legend Spacing$',100)
C                       Compute X coord of start of text string in
C                       world coordinates
      XX = 0.50*(XPG-XX)
C                       Plot text string
      YMSG = -0.15*YPG
      CALL TEXT2D_PDRAW
     *     ('LEGEND5 Demo: Legend Spacing$',100,XX,YMSG)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.8)
C                       Set X axis label
      CALL AXISLBL_DEFX2 ('X-AXIS$',100)
C                       Set Y axis label
      CALL AXISLBL_DEFY2 ('Y-AXIS$',100)
C                       Set angle of Y axis label
C                       to be parallel to Y axis
      CALL AXISNUM_ROTY (0.0)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system with
C                       X = 0.0 to 1.0 and Y = 0.0 to 1.0, and
C                       draw axes, axes labels, and plot title, if any
      CALL PLOT2D_DEFINE (0.0,2.0,10.0,0.0,2.0,14.0)
C
C     ------------------------------------------------------------------
C
C                       PREPARE FOR DRAWING OF LEGEND BLOCK
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.5)
C                       Enable saving of line style by CURVE
      CALL LEGEND_ON
C                       Set text font to "cartog"
      CALL FONT_CARTOG
C                       Set space between characters in legend block
C                       to 0.8 of character height
      IF (IVSP .EQ. 2) THEN
        CALL LEGEND_SETVSP (3.0)
      ELSE
        CALL LEGEND_SETVSP (1.0)
      ENDIF
C                       Define heading for legend block
      CALL LEGEND_SETHDG ('LINES AND SYMBOLS$',100)
C                       Store label for 1st entry of legend block
      CALL PACKARY_SETENT ('SOLID$',IP,1)
C                       Store label for 2nd entry of legend block
      CALL PACKARY_SETENT ('DOT, BLANKED @ SYMBOLS$',IP,2)
C                       Store label for 3rd entry of legend block
      CALL PACKARY_SETENT ('DASH, BIG SYMBOLS$',IP,3)
C                       Store label for 4th entry of legend block
      CALL PACKARY_SETENT ('CHNDOT, NO SYMBOL$',IP,4)
C                       Store label for 5th entry of legend block
      CALL PACKARY_SETENT ('CHDASH$',IP,5)
C                       Store label for 6th entry of legend block
      CALL PACKARY_SETENT ('USER DEFINED$',IP,6)
C                       Store label for 7th entry of legend block
      CALL PACKARY_SETENT ('SYMBOLS ONLY$',IP,7)
C                       Store label for 8th entry of legend block
      CALL PACKARY_SETENT ('THICK SOLID$',IP,8)
C                       Store label for 9th entry of legend block
      CALL PACKARY_SETENT ('THICK DOT$',IP,9)
C                       Store label for 10th entry of legend block
      CALL PACKARY_SETENT ('THICK DASH$',IP,10)
C                       Store label for 11th entry of legend block
      CALL PACKARY_SETENT ('THICK CHNDOT$',IP,11)
C                       Store label for 12th entry of legend block
      CALL PACKARY_SETENT ('THICK CHNDSH$',IP,12)
C                       Store label for 13th entry of legend block
      CALL PACKARY_SETENT ('THICK USER DEFINED$',IP,13)
C                       Set default text font
      CALL GRAPHICS_RESET ('FONT_CARTOG')
C                       Get X length of legend block in inches
      XLEN = LEGEND_WIDTH (IP,13)
C                       Get Y length of legend block in inches
      YLEN = LEGEND_HT (IP,13)
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Draw blank rectangle at location of
C                       legend block with border .01 inches wide
      XLEG = XPG*.7
      YLEG = YPG*.2
      CALL BLNKAREA_DEF (XLEG,YLEG,XLEN+0.2,YLEN+0.2,0.01)
C                       Set color to "foreground" color (white)
      CALL COLOR_SETNAM ('FOREGROUND')
C                       Draw frame around plot
      CALL FRAME_DRAW
C
C     ------------------------------------------------------------------
C                       (13 CURVES PLUS LEGEND BLOCK
C                        SHOWING DIFFERENT LINE STYLES)
C     ------------------------------------------------------------------
C
C                        PLOT CURVE 1 - "SOLID"
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Plot curve 1 ("solid") in green
      CALL CURVE2D_DRAW (X1,Y1,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 2 - "DOT, BLANKED @ SYMBOLS"
C
C                       Enable blanking of symbols
      CALL MARKER_BLANK
C                       Set current drawing color to 'magenta'
      CALL COLOR_SETNAM ('MAGENTA')
C                       Set line style to 'dot'
      CALL LINE2D_DOT
C                       Plot curve 2 ("dot, blanked @ symbols")
C                       in magenta
      CALL CURVE2D_DRAW (X1,Y2,4,1)
C                       Reset drawing of symbols without blanking
      CALL GRAPHICS_RESET ('MARKER_BLANK')
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 3 - "DASH, BIG SYMBOLS"
C
C                       Set symbol size to 3x normal
      CALL MARKER_SIZE (3.0)
C                       Set current drawing color to 'yellow'
      CALL COLOR_SETNAM ('YELLOW')
C                       Set line style to 'dash'
      CALL LINE2D_DASH
C                       Plot curve 3 ("dash, big symbols") in yellow
      CALL CURVE2D_DRAW (X1,Y3,4,1)
C                       Reset normal symbol size of .08 inches
      CALL GRAPHICS_RESET ('MARKER_SIZE')
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 4 - "CHNDOT, NO SYMBOL"
C
C                       Set line style to 'chndot'
      CALL LINE2D_CHNDOT
C                       Set current drawing color to 'blue'
      CALL COLOR_SETNAM ('BLUE')
C                       Plot curve 4 ("chndot, no symbol") in blue
      CALL CURVE2D_DRAW (X1,Y4,4,0)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 5 - "CHDASH"
C
C                       Set line style to 'chndsh'
      CALL LINE2D_CHNDSH
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Plot curve 5 ("chdash") in white
      CALL CURVE2D_DRAW (X1,Y5,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 6 - "USER DEFINED"
C
C                       Set non-dimen length of line style mark
      RAY(1)=1.0
C                       Set non-dimen length of line style space
      RAY(2)=3.0
C                       Set user-defined line style: "--......"
      CALL LINE2D_CUSTOM (0.2,2,RAY)
C                       Set current drawing color to 'red'
      CALL COLOR_SETNAM ('RED')
C                       Plot curve 6 ("user defined") in red
      CALL CURVE2D_DRAW (X1,Y6,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 7 - "SYMBOLS ONLY"
C
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Plot curve 7 ("symbols only") in cyan
      CALL CURVE2D_DRAW (X1,Z1,4,-1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 8 - "THICK SOLID"
C
C                       Set curve thickness in inches
      CALL LINE2D_THICK (0.04)
C                       Set symbol size to 1.5x normal
      CALL MARKER_SIZE (1.5)
C                       Reset default line style, i.e., solid
      CALL GRAPHICS_RESET ('LINE2D_CUSTOM')
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Plot curve 8 ("thick solid") in green
      CALL CURVE2D_DRAW (X1,Z2,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 9 - "THICK DOT"
C
C                       Set current drawing color to 'magenta'
      CALL COLOR_SETNAM ('MAGENTA')
C                       Set line style to 'dot'
      CALL LINE2D_DOT
C                       Plot curve 9 ("thick dot") in magenta
      CALL CURVE2D_DRAW (X1,Z3,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 10 - "THICK DASH"
C
C                       Set current drawing color to 'yellow'
      CALL COLOR_SETNAM ('YELLOW')
C                       Set line style to 'dash'
      CALL LINE2D_DASH
C                       Plot curve 10 ("thick dash") in yellow
      CALL CURVE2D_DRAW (X1,Z4,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 11 - "THICK CHNDOT"
C
C                       Set line style to 'chndot'
      CALL LINE2D_CHNDOT
C                       Set current drawing color to 'blue'
      CALL COLOR_SETNAM ('BLUE')
C                       Plot curve 1 ("thick chndot") in blue
      CALL CURVE2D_DRAW (X1,Z5,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 12 - "THICK CHNDSH"
C
C                       Set line style to 'chndsh'
      CALL LINE2D_CHNDSH
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Plot curve 12 ("thick chndsh") in white
      CALL CURVE2D_DRAW (X1,Z6,4,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 13 - "THICK USER DEFINED"
C
C                       Store non-dimen length of 1st line style mark
      RAY(1)=25.0
C                       Store non-dimen length of 1st line style space
      RAY(2)=5.0
C                       Store non-dimen length of 2nd line style mark
      RAY(3)=3.0
C                       Store non-dimen length of 2nd line style space
      RAY(4)=5.0
C                       Store non-dimen length of 3rd line style mark
      RAY(5)=3.0
C                       Store non-dimen length of 3rd line style space
      RAY(6)=5.0
C                       Store non-dimen length of 4th line style mark
      RAY(7)=3.0
C                       Store non-dimen length of 4th line style space
      RAY(8)=5.0
C                       Set user defined line style: "-----.-.-.-."
      CALL LINE2D_CUSTOM (0.9,8,RAY)
C                       Set current drawing color to 'red'
      CALL COLOR_SETNAM ('RED')
C                       Plot curve 13 ("thick user defined") in red
      CALL CURVE2D_DRAW (X1,Z7,4,1)
C                       Reset default curve thickness
      CALL GRAPHICS_RESET ('LINE2D_THICK')
C
C     ------------------------------------------------------------------
C
C                       DRAW LEGEND BLOCK
C
C                       Set current drawing color to 'white'
      CALL COLOR_SETNAM ('WHITE')
C                       Deactivate blanking of rectangular areas
      CALL GRAPHICS_RESET ('BLNKAL')
C                       Plot the legend block of 13 lines
      CALL LEGEND_DRAW (IP,13,XLEG*1.025,YLEG*1.05)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  400 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./locator1.f ]"
cat <<"STOP_CAT"> ././locator1.f
C     PROGRAM LOCATOR1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program LOCATOR_GET
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       LOCATOR object access program
      EXTERNAL LOCATOR_GET
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    XDATA, TMP101, YDATA, TMP102
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'locator_get.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              LOCATOR Object Demo Program #1'/
     * ' This program tests the LOCATOR object access program'/
     * ' LOCATOR_GET.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test LOCATOR_GET object access program
C
C                       Get coordinates of locator graphics input device
      CALL LOCATOR_GET (XDATA,YDATA)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XDATA ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(YDATA ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) XDATA,YDATA
  502 FORMAT (E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              LOCATOR Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./locator_get.dat ]"
cat <<"STOP_CAT"> ././locator_get.uuu
begin 660 ./locator_get.dat
?("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P"F`\
`
end
STOP_CAT
echo "  Generating =====> [ ./logpen21.f ]"
cat <<"STOP_CAT"> ././logpen21.f
C     PROGRAM LOGPEN21
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program LOGPEN2_GETW2
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       LOGPEN2 object access program
      EXTERNAL LOGPEN2_GETW2
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'LOGPEN2.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, TMP102, XCURR, TMP103, YCURR, TMP104
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-3333.33, 9999.99/
C
      DATA VV102 /-3333.33, 9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'logpen2_getw2.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              LOGPEN2 Object Demo Program #1'/
     * ' This program tests the LOGPEN2 object access program'/
     * ' LOGPEN2_GETW2.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test LOGPEN2_GETW2 object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        XVPOS = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        YVPOS = VV102(IVV102)
C
C                       Get coordinates of logical pen in 2D world
C                       coordinate system
      CALL LOGPEN2_GETW2 (XCURR,YCURR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XCURR ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(YCURR ,TMP104 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) XVPOS,YVPOS,XCURR,YCURR
  502 FORMAT (E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  589 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              LOGPEN2 Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./logpen2_getw2.dat ]"
cat <<"STOP_CAT"> ././logpen2_getw2.uuu
begin 660 ./logpen2_getw2.dat
M("`M+C,S,S,S,S!%*S`T("`M+C,S,S,S,S!%*S`T("`M+C$W,S$T,3!%*S`S
M("`M+C(S-S,X-S9%*S`S"B`@+2XS,S,S,S,P12LP-"`@("XY.3DY.3DP12LP
M-"`@+2XQ-S,Q-#$P12LP,R`@("XW,3$U-3@S12LP,PH@("`N.3DY.3DY,$4K
M,#0@("TN,S,S,S,S,$4K,#0@("`N-3$X-S@V.$4K,#,@("TN,C,W,S@W-D4K
M,#,*("`@+CDY.3DY.3!%*S`T("`@+CDY.3DY.3!%*S`T("`@+C4Q.#<X-CA%
3*S`S("`@+C<Q,34U.#-%*S`S"B`@
`
end
STOP_CAT
echo "  Generating =====> [ ./origin1.f ]"
cat <<"STOP_CAT"> ././origin1.f
C     PROGRAM ORIGIN2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program ORIGIN_SET
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       ORIGIN object access program
      EXTERNAL ORIGIN_SET
C
C                       DEVICE object access programs
      EXTERNAL DEVICE_SELECT, DEVICE_RELEASE
C
C                       GRAPHICS object access programs
      EXTERNAL GRAPHICS_INIT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV104 =  2)
      PARAMETER (NVV105 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'ORIGIN.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101
C
C                       Real variables and arrays
      REAL    TMP102, TMP103, XOABS, TMP104, YOABS, TMP105
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV104(NVV104)
      REAL    VV105(NVV105)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV104 /-3333.33, 9999.99/
C
      DATA VV105 /-3333.33, 9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL GRAPHICS_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'origin_set.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              ORIGIN Object Demo Program #2'/
     * ' This program tests the ORIGIN object access program'/
     * ' ORIGIN_SET.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 2
      CALL DEVICE_SELECT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       Test ORIGIN_SET object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV104 = 1,NVV104
        XOABS = VV104(IVV104)
C
      DO 588 IVV105 = 1,NVV105
        YOABS = VV105(IVV105)
C
C                       Set location of origin relative to lower left
C                       corner of page
      CALL ORIGIN_SET (XOABS,YOABS)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZOR .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(UUXOR ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(UUYOR ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZOR,UUXOR,UUYOR,XOABS,YOABS
  502 FORMAT (I21,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  589 CONTINUE
C
C     ******************************************************************
C
C                       Clean up environment
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              ORIGIN Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./origin_set.dat ]"
cat <<"STOP_CAT"> ././origin_set.uuu
begin 660 ./origin_set.dat
M("`@("`@("`@("`@("`@("`@,3$Q("`M+C@T-C8V-3A%*S`T("`M+C@T-C8V
M-3A%*S`T("`M+C,S,S,S,S!%*S`T("`M+C,S,S,S,S!%*S`T"B`@("`@("`@
M("`@("`@("`@(#$Q,2`@+2XX-#8V-C4X12LP-"`@("XR-3,Y.3DW12LP-2`@
M+2XS,S,S,S,P12LP-"`@("XY.3DY.3DP12LP-`H@("`@("`@("`@("`@("`@
M("`Q,3$@("`N,C4S.3DY-T4K,#4@("TN.#0V-C8U.$4K,#0@("`N.3DY.3DY
M,$4K,#0@("TN,S,S,S,S,$4K,#0*("`@("`@("`@("`@("`@("`@,3$Q("`@
M+C(U,SDY.3=%*S`U("`@+C(U,SDY.3=%*S`U("`@+CDY.3DY.3!%*S`T("`@
-+CDY.3DY.3!%*S`T"B`@
`
end
STOP_CAT
echo "  Generating =====> [ ./packary1.f ]"
cat <<"STOP_CAT"> ././packary1.f
C     PROGRAM PACKARY1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PACKARY_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PACKARY object access program
      EXTERNAL PACKARY_DRAW
      EXTERNAL PACKARY_SETENT
      EXTERNAL PACKARY_GETMAX
      INTEGER  PACKARY_GETMAX
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
      PARAMETER (NVV101 = 2)
C
C                       Argument maximum array sizes
      PARAMETER (MX102 = 32)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IP(MX102), TMP102(MX102), ISEQ, TMP104
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER STRNG*32, TMP101*32
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*32 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'This is test string number one. ',
     *            'This is test string number two. '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'packary_draw.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PACKARY Object Demo Program #1'/
     * ' This program tests the PACKARY object access program'/
     * ' PACKARY_DRAW.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.25)
C
C     ------------------------------------------------------------------
C
C                       Test PACKARY_SETENT object access program
C
C                       Get maximum number of lines that can be placed
C                       in a packed array
      MAXL   = PACKARY_GETMAX (IP,32,32)
      DO 589 IVV101 = 1,MAXL
        STRNG = VV101(IVV101)
        ISEQ = IVV101
        CALL PACKARY_SETENT (STRNG,IP,ISEQ)
  589 CONTINUE
C
C                       Draw packed array text relative to origin
      XPOS = (XPAGE-2.0)*0.125
      YPOS = (YPAGE-2.0)*0.5
      CALL PACKARY_DRAW (IP,MAXL,XPOS,YPOS)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102(1),TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (IP(1) .NE. TMP102(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) STRNG,IP(1),ISEQ
  502 FORMAT (A,I21,I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PACKARY Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./packary2.f ]"
cat <<"STOP_CAT"> ././packary2.f
C     PROGRAM PACKARY2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PACKARY_DRAWR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PACKARY object access program
      EXTERNAL PACKARY_DRAWR
      EXTERNAL PACKARY_SETENT
      EXTERNAL PACKARY_GETMAX
      INTEGER  PACKARY_GETMAX
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL TEXT2D_SETHT, LOGPEN2_SETP
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
      PARAMETER (NVV101 = 2)
C
C                       Argument maximum array sizes
      PARAMETER (MX102 = 32)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IP(MX102), TMP102(MX102), ISEQ, TMP104
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER STRNG*32, TMP101*32
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*32 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'This is test string number one. ',
     *            'This is test string number two. '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'packary_draw.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PACKARY Object Demo Program #2'/
     * ' This program tests the PACKARY object access program'/
     * ' PACKARY_DRAWR.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.25)
C
C     ------------------------------------------------------------------
C
C                       Test PACKARY_SETENT object access program
C
C                       Get maximum number of lines that can be placed
C                       in a packed array
      MAXL   = PACKARY_GETMAX (IP,32,32)
      DO 589 IVV101 = 1,MAXL
        STRNG = VV101(IVV101)
        ISEQ = IVV101
        CALL PACKARY_SETENT (STRNG,IP,ISEQ)
  589 CONTINUE
C
C                       Move logical pen to draw location
      XPOS = (XPAGE-2.0)*0.125
      YPOS = (YPAGE-2.0)*0.5
      CALL LOGPEN2_SETP (XPOS,YPOS,0)
C
C                       Draw packed array text relative to
C                       current location
      CALL PACKARY_DRAWR (IP,MAXL,0.0,0.0,3)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102(1),TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (IP(1) .NE. TMP102(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) STRNG,IP(1),ISEQ
  502 FORMAT (A,I21,I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PACKARY Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./packary3.f ]"
cat <<"STOP_CAT"> ././packary3.f
C     PROGRAM PACKARY3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PACKARY_GETMAX
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PACKARY object access program
      EXTERNAL PACKARY_GETMAX
      INTEGER  PACKARY_GETMAX
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  1)
      PARAMETER (NVV103 =  3)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 32)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IP(MX101), TMP101(MX101), IPLEN, TMP102, LLEN, TMP103
     *      , XRETRN, TMP104
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV102(NVV102)
      INTEGER VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /32/
C
      DATA VV103 /1, 16, 32/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'packary_getmax.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PACKARY Object Demo Program #3'/
     * ' This program tests the PACKARY object access program'/
     * ' PACKARY_GETMAX.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test PACKARY_GETMAX object access program
C
C                       Loop for each input variable of access program
      DO 588 IVV102 = 1,NVV102
        IPLEN = VV102(IVV102)
C
      DO 587 IVV103 = 1,NVV103
        LLEN = VV103(IVV103)
C
C                       Get maximum number of lines that can be placed
C                       in a packed array
      XRETRN = PACKARY_GETMAX (IP,IPLEN,LLEN)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101(1),TMP102,TMP103,TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (XRETRN .NE. TMP104 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) IP(1),IPLEN,LLEN,XRETRN
  502 FORMAT (I12,I21,I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  587 CONTINUE
  588 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PACKARY Demo Program #3 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./packary4.f ]"
cat <<"STOP_CAT"> ././packary4.f
C     PROGRAM PACKARY4
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PACKARY_HT and
C              PACKARY_WIDTH
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PACKARY object access program
      EXTERNAL PACKARY_HT, PACKARY_WIDTH
      REAL     PACKARY_HT, PACKARY_WIDTH
      EXTERNAL PACKARY_DRAW
      EXTERNAL PACKARY_SETENT
      EXTERNAL PACKARY_GETMAX
      INTEGER  PACKARY_GETMAX
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
      PARAMETER (NVV101 = 2)
C
C                       Argument maximum array sizes
      PARAMETER (MX102 = 32)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IP(MX102), TMP102(MX102), ISEQ, TMP104
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER STRNG*32, TMP101*32
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*32 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'This is test string number one. ',
     *            'This is test string number two. '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'packary_draw.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PACKARY Object Demo Program #4'/
     * ' This program tests the PACKARY object access program'/
     * ' PACKARY_HT and PACKARY_WIDTH.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.25)
C
C     ------------------------------------------------------------------
C
C                       Test PACKARY_SETENT object access program
C
C                       Get maximum number of lines that can be placed
C                       in a packed array
      MAXL   = PACKARY_GETMAX (IP,32,32)
      DO 589 IVV101 = 1,MAXL
        STRNG = VV101(IVV101)
        ISEQ = IVV101
        CALL PACKARY_SETENT (STRNG,IP,ISEQ)
  589 CONTINUE
C
C                       Compute plotted height of packed array text in
C                       page units
      YLEN = PACKARY_HT (IP,MAXL)
C
C                       Compute plotted width of packed array text in
C                       page units
      XLEN = PACKARY_WIDTH (IP,MAXL)
C
      XPOS = (XPAGE-2.0)*0.125
      YPOS = (YPAGE-2.0)*0.5
      CALL BLNKAREA_DEF (XPOS,YPOS,XLEN,YLEN,0.01)
      CALL GRAPHICS_RESET ('BLNKAL')
C
      CALL PACKARY_DRAW (IP,MAXL,XPOS,YPOS)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102(1),TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (IP(1) .NE. TMP102(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) STRNG,IP(1),ISEQ
  502 FORMAT (A,I21,I21)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PACKARY Demo Program #4 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./packary5.f ]"
cat <<"STOP_CAT"> ././packary5.f
C     PROGRAM PACKARY5
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PACKARY_SETENT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PACKARY object access program
      EXTERNAL PACKARY_SETENT
      EXTERNAL PACKARY_GETMAX
      INTEGER  PACKARY_GETMAX
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
C
C                       Argument maximum array sizes
      PARAMETER (MX102 = 32)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IP(MX102), TMP102(MX102), ISEQ, TMP104
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER STRNG*32, TMP101*32
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*32 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'This is test string number one. ',
     *            'This is test string number two. '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'packary_setent.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PACKARY Object Demo Program #5'/
     * ' This program tests the PACKARY object access program'/
     * ' PACKARY_SETENT.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test PACKARY_SETENT object access program
C
C                       Get maximum number of lines that can be placed
C                       in a packed array
      MAXL   = PACKARY_GETMAX (IP,32,32)
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,MAXL
        STRNG = VV101(IVV101)
        ISEQ = IVV101
C
C                       Insert a character string into a packed array
      CALL PACKARY_SETENT (STRNG,IP,ISEQ)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102(1),TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (IP(1) .NE. TMP102(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) STRNG,IP(1),ISEQ
  502 FORMAT (A,I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PACKARY Demo Program #5 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./packary_draw.dat ]"
cat <<"STOP_CAT"> ././packary_draw.uuu
begin 660 ./packary_draw.dat
M5&AI<R!I<R!T97-T('-T<FEN9R!N=6UB97(@='=O+B`@("`@("`@("`@("`@
>("`@("`Q,3$@("`@("`@("`@("`@("`@("`@(#(*
`
end
STOP_CAT
echo "  Generating =====> [ ./packary_getmax.dat ]"
cat <<"STOP_CAT"> ././packary_getmax.uuu
begin 660 ./packary_getmax.dat
M("`@("`@("`@,3$Q("`@("`@("`@("`@("`@("`@(#,R("`@("`@("`@("`@
M("`@("`@("`Q("`@("`@("`@("`@("`@("`@("`V"B`@("`@("`@(#$Q,2`@
M("`@("`@("`@("`@("`@("`S,B`@("`@("`@("`@("`@("`@("`Q-B`@("`@
M("`@("`@("`@("`@("`@,PH@("`@("`@("`Q,3$@("`@("`@("`@("`@("`@
M("`@,S(@("`@("`@("`@("`@("`@("`@,S(@("`@("`@("`@("`@("`@("`@
#(#(*
`
end
STOP_CAT
echo "  Generating =====> [ ./packary_setent.dat ]"
cat <<"STOP_CAT"> ././packary_setent.uuu
begin 660 ./packary_setent.dat
M5&AI<R!I<R!T97-T('-T<FEN9R!N=6UB97(@;VYE+B`@("`@("`@("`@("`@
M("`@("`Q,3$@("`@("`@("`@("`@("`@("`@(#$*5&AI<R!I<R!T97-T('-T
M<FEN9R!N=6UB97(@='=O+B`@("`@("`@("`@("`@("`@("`Q,3$@("`@("`@
/("`@("`@("`@("`@(#(*
`
end
STOP_CAT
echo "  Generating =====> [ ./page1.f ]"
cat <<"STOP_CAT"> ././page1.f
C     PROGRAM PAGE1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PAGE_CVXWC
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PAGE object access program
      EXTERNAL PAGE_CVXWC
      REAL     PAGE_CVXWC
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV104 =  3)
      PARAMETER (NVV105 =  1)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'PAGE.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, TMP102, TMP103, XVAL, TMP104, YVAL, TMP105, XRETRN
     *      , TMP106
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV104(NVV104)
      REAL    VV105(NVV105)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV104 /-3333.33, 0.0, 9999.99/
C
      DATA VV105 /0.0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'page_cvxwc.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PAGE Object Demo Program #1'/
     * ' This program tests the PAGE object access program'/
     * ' PAGE_CVXWC.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test PAGE_CVXWC object access program
C
C                       Loop for each input variable of access program
      DO 586 IVV104 = 1,NVV104
        XVAL = VV104(IVV104)
C
      DO 585 IVV105 = 1,NVV105
        YVAL = VV105(IVV105)
C
C                       Convert X world coordinate to page units
      XRETRN = PAGE_CVXWC (XVAL,YVAL)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XRETRN ,TMP106 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ZZPAGR,XCM0,ZZUNIT,XVAL,YVAL,XRETRN
  502 FORMAT (E15.7,E15.7,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  585 CONTINUE
  586 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PAGE Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./page2.f ]"
cat <<"STOP_CAT"> ././page2.f
C     PROGRAM PAGE2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PAGE_CVYWC
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PAGE object access program
      EXTERNAL PAGE_CVYWC
      REAL     PAGE_CVYWC
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV104 =  1)
      PARAMETER (NVV105 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'PAGE.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, TMP102, TMP103, XVAL, TMP104, YVAL, TMP105, XRETRN
     *      , TMP106
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV104(NVV104)
      REAL    VV105(NVV105)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV104 /0.0/
C
      DATA VV105 /-3333.33, 0.0, 9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'page_cvywc.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PAGE Object Demo Program #2'/
     * ' This program tests the PAGE object access program'/
     * ' PAGE_CVYWC.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test PAGE_CVYWC object access program
C
C                       Loop for each input variable of access program
      DO 586 IVV104 = 1,NVV104
        XVAL = VV104(IVV104)
C
      DO 585 IVV105 = 1,NVV105
        YVAL = VV105(IVV105)
C
C                       Convert Y world coordinate to page units
      XRETRN = PAGE_CVYWC (XVAL,YVAL)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XRETRN ,TMP106 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ZZPAGR,YCM0,ZZUNIT,XVAL,YVAL,XRETRN
  502 FORMAT (E15.7,E15.7,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  585 CONTINUE
  586 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PAGE Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./page3.f ]"
cat <<"STOP_CAT"> ././page3.f
C     PROGRAM PAGE1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PAGE_END
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PAGE object access program
      EXTERNAL PAGE_END
C
C                       GRAPHICS object access programs
      EXTERNAL GRAPHICS_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, ORIGIN_SET, SUBPLOT_DEFINE, SUBPLOT_END
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  1)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER ISPARE
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER
C
      DOUBLE PRECISION  DTOLER
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
      DATA TOLER /1.0E-5/
      DATA DTOLER /1.0D-13/
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL GRAPHICS_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
      WRITE (IOUT,301)
  301 FORMAT (
     * '              PAGE Object Demo Program #1'/
     * ' This program tests the PAGE object access program'/
     * ' PAGE_END.'/
     * ' This demo first queries for a graphics device to initialize.'/
     * ' It then uses PAGE_END to clear the screen or otherwise'/
     * ' obtain a new drawing surface.  There is no input to'/
     * ' PAGE_END.'//
     * ' Note: selecting a Tektronix terminal driver may result in'/
     * ' "garbage" characters being written to the screen if you have'/
     * ' a non-Tektronix terminal.'//
     * '                      Press <CR> to continue')
      READ (IN,811) PAUS
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Test PAGE_END object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        ISPARE = 0
C
C     ------------------------------------------------------------------
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (0.0,0.0)
      CALL SUBPLOT_DEFINE (XPAGE,YPAGE)
      CALL SUBPLOT_END(0)
C
C     ------------------------------------------------------------------
C
C                       End plotting on current page
      CALL PAGE_END (ISPARE)
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C                       Repeat for next variable value
  589 CONTINUE
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PAGE Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./page4.f ]"
cat <<"STOP_CAT"> ././page4.f
C     PROGRAM PAGE4
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PAGE_SIZE
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PAGE object access program
      EXTERNAL PAGE_SIZE
C
C                       GRAPHICS object access programs
      EXTERNAL GRAPHICS_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
      PARAMETER (NVV105 =  3)
      PARAMETER (NVV106 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'PAGE.INC'
C
C                       Integer variables and arrays
      INTEGER TMP102
C
C                       Real variables and arrays
      REAL    TMP101, TMP103, TMP104, PAGEX, TMP105, PAGEY, TMP106
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV105(NVV105)
      REAL    VV106(NVV106)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /2.54, 0.1, 1.0/
C
      DATA VV105 /.000001, 9999.99, 8.5/
C
      DATA VV106 /.000001, 9999.99, 11.0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL GRAPHICS_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'page_size.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PAGE Object Demo Program #4'/
     * ' This program tests the PAGE object access program'/
     * ' PAGE_SIZE.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       Test PAGE_SIZE object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        ZZUNIT = VV101(IVV101)
C
      DO 588 IVV105 = 1,NVV105
        PAGEX = VV105(IVV105)
C
      DO 587 IVV106 = 1,NVV106
        PAGEY = VV106(IVV106)
C
C                       Set page size for plot
      CALL PAGE_SIZE (PAGEX,PAGEY)
C
      CALL ORIGIN_SET (0.0,0.0)
      CALL SUBPLOT_DEFINE (PAGEX,PAGEY)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZPAGE .NE. TMP102 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(UUPAGX ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(UUPAGY ,TMP104 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ZZUNIT,KZPAGE,UUPAGX,UUPAGY,PAGEX,PAGEY
  502 FORMAT (E15.7,I21,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
      CALL SUBPLOT_END(0)
      CALL PAGE_END (ISPARE)
C
C                       Repeat for next variable value
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C     ******************************************************************
C
C                       Clean up environment
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PAGE Demo Program #4 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./page_cvxwc.dat ]"
cat <<"STOP_CAT"> ././page_cvxwc.uuu
begin 660 ./page_cvxwc.dat
M("`@+C8T.#DW-S%%*S`P("`@+C$T,38V.3!%*S`Q("`@+C(U-#`P,#!%*S`Q
M("`M+C,S,S,S,S!%*S`T("`@+C`P,#`P,#!%*S`P("`M+C,X.38V-C)%*S`U
M"B`@("XV-#@Y-S<Q12LP,"`@("XQ-#$V-CDP12LP,2`@("XR-30P,#`P12LP
M,2`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@+2XW,C,Q.#$P12TP
M-PH@("`N-C0X.3<W,44K,#`@("`N,30Q-C8Y,$4K,#$@("`N,C4T,#`P,$4K
M,#$@("`N.3DY.3DY,$4K,#0@("`N,#`P,#`P,$4K,#`@("`N,3$V.#DY.44K
#,#8*
`
end
STOP_CAT
echo "  Generating =====> [ ./page_cvywc.dat ]"
cat <<"STOP_CAT"> ././page_cvywc.uuu
begin 660 ./page_cvywc.dat
M("`@+C8T.#DW-S%%*S`P("`@+C0W-3`P,#1%*S`P("`@+C(U-#`P,#!%*S`Q
M("`@+C`P,#`P,#!%*S`P("`M+C,S,S,S,S!%*S`T("`M+C(X-#$R-C=%*S`U
M"B`@("XV-#@Y-S<Q12LP,"`@("XT-S4P,#`T12LP,"`@("XR-30P,#`P12LP
M,2`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@+2XW,C,Q.#$P12TP
M-PH@("`N-C0X.3<W,44K,#`@("`N-#<U,#`P-$4K,#`@("`N,C4T,#`P,$4K
M,#$@("`N,#`P,#`P,$4K,#`@("`N.3DY.3DY,$4K,#0@("`N.#4R,S@P,D4K
#,#4*
`
end
STOP_CAT
echo "  Generating =====> [ ./page_size.dat ]"
cat <<"STOP_CAT"> ././page_size.uuu
begin 660 ./page_size.dat
M("`@+C(U-#`P,#!%*S`Q("`@("`@("`@("`@("`@("`@,3$Q("`@+C(U-#`P
M,#!%+3`U("`@+C(U-#`P,#!%+3`U("`@+C$P,#`P,#!%+3`U("`@+C$P,#`P
M,#!%+3`U"B`@("XR-30P,#`P12LP,2`@("`@("`@("`@("`@("`@(#$Q,2`@
M("XR-30P,#`P12TP-2`@("XR-3,Y.3DW12LP-2`@("XQ,#`P,#`P12TP-2`@
M("XY.3DY.3DP12LP-`H@("`N,C4T,#`P,$4K,#$@("`@("`@("`@("`@("`@
M("`Q,3$@("`N,C4T,#`P,$4M,#4@("`N,C<Y-#`P,$4K,#(@("`N,3`P,#`P
M,$4M,#4@("`N,3$P,#`P,$4K,#(*("`@+C(U-#`P,#!%*S`Q("`@("`@("`@
M("`@("`@("`@,3$Q("`@+C(U,SDY.3=%*S`U("`@+C(U-#`P,#!%+3`U("`@
M+CDY.3DY.3!%*S`T("`@+C$P,#`P,#!%+3`U"B`@("XR-30P,#`P12LP,2`@
M("`@("`@("`@("`@("`@(#$Q,2`@("XR-3,Y.3DW12LP-2`@("XR-3,Y.3DW
M12LP-2`@("XY.3DY.3DP12LP-"`@("XY.3DY.3DP12LP-`H@("`N,C4T,#`P
M,$4K,#$@("`@("`@("`@("`@("`@("`Q,3$@("`N,C4S.3DY-T4K,#4@("`N
M,C<Y-#`P,$4K,#(@("`N.3DY.3DY,$4K,#0@("`N,3$P,#`P,$4K,#(*("`@
M+C(U-#`P,#!%*S`Q("`@("`@("`@("`@("`@("`@,3$Q("`@+C(Q-3DP,#!%
M*S`R("`@+C(U-#`P,#!%+3`U("`@+C@U,#`P,#!%*S`Q("`@+C$P,#`P,#!%
M+3`U"B`@("XR-30P,#`P12LP,2`@("`@("`@("`@("`@("`@(#$Q,2`@("XR
M,34Y,#`P12LP,B`@("XR-3,Y.3DW12LP-2`@("XX-3`P,#`P12LP,2`@("XY
M.3DY.3DP12LP-`H@("`N,C4T,#`P,$4K,#$@("`@("`@("`@("`@("`@("`Q
M,3$@("`N,C$U.3`P,$4K,#(@("`N,C<Y-#`P,$4K,#(@("`N.#4P,#`P,$4K
M,#$@("`N,3$P,#`P,$4K,#(*("`@+C$P,#`P,#!%*S`P("`@("`@("`@("`@
M("`@("`@,3$Q("`@+C$P,#`P,#!%+3`V("`@+C$P,#`P,#!%+3`V("`@+C$P
M,#`P,#!%+3`U("`@+C$P,#`P,#!%+3`U"B`@("XR-30P,#`P12LP,2`@("`@
M("`@("`@("`@("`@(#$Q,2`@("XR-30P,#`P12TP-2`@("XR-3,Y.3DW12LP
M-2`@("XQ,#`P,#`P12TP-2`@("XY.3DY.3DP12LP-`H@("`N,C4T,#`P,$4K
M,#$@("`@("`@("`@("`@("`@("`Q,3$@("`N,C4T,#`P,$4M,#4@("`N,C<Y
M-#`P,$4K,#(@("`N,3`P,#`P,$4M,#4@("`N,3$P,#`P,$4K,#(*("`@+C(U
M-#`P,#!%*S`Q("`@("`@("`@("`@("`@("`@,3$Q("`@+C(U,SDY.3=%*S`U
M("`@+C(U-#`P,#!%+3`U("`@+CDY.3DY.3!%*S`T("`@+C$P,#`P,#!%+3`U
M"B`@("XR-30P,#`P12LP,2`@("`@("`@("`@("`@("`@(#$Q,2`@("XR-3,Y
M.3DW12LP-2`@("XR-3,Y.3DW12LP-2`@("XY.3DY.3DP12LP-"`@("XY.3DY
M.3DP12LP-`H@("`N,C4T,#`P,$4K,#$@("`@("`@("`@("`@("`@("`Q,3$@
M("`N,C4S.3DY-T4K,#4@("`N,C<Y-#`P,$4K,#(@("`N.3DY.3DY,$4K,#0@
M("`N,3$P,#`P,$4K,#(*("`@+C(U-#`P,#!%*S`Q("`@("`@("`@("`@("`@
M("`@,3$Q("`@+C(Q-3DP,#!%*S`R("`@+C(U-#`P,#!%+3`U("`@+C@U,#`P
M,#!%*S`Q("`@+C$P,#`P,#!%+3`U"B`@("XR-30P,#`P12LP,2`@("`@("`@
M("`@("`@("`@(#$Q,2`@("XR,34Y,#`P12LP,B`@("XR-3,Y.3DW12LP-2`@
M("XX-3`P,#`P12LP,2`@("XY.3DY.3DP12LP-`H@("`N,C4T,#`P,$4K,#$@
M("`@("`@("`@("`@("`@("`Q,3$@("`N,C$U.3`P,$4K,#(@("`N,C<Y-#`P
M,$4K,#(@("`N.#4P,#`P,$4K,#$@("`N,3$P,#`P,$4K,#(*("`@+C$P,#`P
M,#!%*S`Q("`@("`@("`@("`@("`@("`@,3$Q("`@+C$P,#`P,#!%+3`U("`@
M+C$P,#`P,#!%+3`U("`@+C$P,#`P,#!%+3`U("`@+C$P,#`P,#!%+3`U"B`@
M("XR-30P,#`P12LP,2`@("`@("`@("`@("`@("`@(#$Q,2`@("XR-30P,#`P
M12TP-2`@("XR-3,Y.3DW12LP-2`@("XQ,#`P,#`P12TP-2`@("XY.3DY.3DP
M12LP-`H@("`N,C4T,#`P,$4K,#$@("`@("`@("`@("`@("`@("`Q,3$@("`N
M,C4T,#`P,$4M,#4@("`N,C<Y-#`P,$4K,#(@("`N,3`P,#`P,$4M,#4@("`N
M,3$P,#`P,$4K,#(*("`@+C(U-#`P,#!%*S`Q("`@("`@("`@("`@("`@("`@
M,3$Q("`@+C(U,SDY.3=%*S`U("`@+C(U-#`P,#!%+3`U("`@+CDY.3DY.3!%
M*S`T("`@+C$P,#`P,#!%+3`U"B`@("XR-30P,#`P12LP,2`@("`@("`@("`@
M("`@("`@(#$Q,2`@("XR-3,Y.3DW12LP-2`@("XR-3,Y.3DW12LP-2`@("XY
M.3DY.3DP12LP-"`@("XY.3DY.3DP12LP-`H@("`N,C4T,#`P,$4K,#$@("`@
M("`@("`@("`@("`@("`Q,3$@("`N,C4S.3DY-T4K,#4@("`N,C<Y-#`P,$4K
M,#(@("`N.3DY.3DY,$4K,#0@("`N,3$P,#`P,$4K,#(*("`@+C(U-#`P,#!%
M*S`Q("`@("`@("`@("`@("`@("`@,3$Q("`@+C(Q-3DP,#!%*S`R("`@+C(U
M-#`P,#!%+3`U("`@+C@U,#`P,#!%*S`Q("`@+C$P,#`P,#!%+3`U"B`@("XR
M-30P,#`P12LP,2`@("`@("`@("`@("`@("`@(#$Q,2`@("XR,34Y,#`P12LP
M,B`@("XR-3,Y.3DW12LP-2`@("XX-3`P,#`P12LP,2`@("XY.3DY.3DP12LP
M-`H@("`N,C4T,#`P,$4K,#$@("`@("`@("`@("`@("`@("`Q,3$@("`N,C$U
M.3`P,$4K,#(@("`N,C<Y-#`P,$4K,#(@("`N.#4P,#`P,$4K,#$@("`N,3$P
),#`P,$4K,#(*
`
end
STOP_CAT
echo "  Generating =====> [ ./piechart1.f ]"
cat <<"STOP_CAT"> ././piechart1.f
C     PROGRAM PIECHART1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PIECHART_DEFLBL
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (CENTX=400.0)
      PARAMETER (CENTY=400.0)
      PARAMETER (NPARTS=5)
      PARAMETER (N108=3)
      PARAMETER (N109=9)
C
      REAL PART(NPARTS),OFFS(NPARTS)
      CHARACTER*16 LBLS(NPARTS)
      INTEGER  ICOL(6)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
      CHARACTER*4  VV108(N108)
      CHARACTER*8  VV109(N109)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                 green magenta yellow blue red cyan
      DATA ICOL / 3,    6,      5,     4,   2,  7/
      DATA PART /26.0,32.0,12.0,15.0,10.0/
      DATA OFFS /0.0, 0.2, 0.0, 0.0, 0.0/
      DATA LBLS / 'Defense', 'Benefits', 'Other',
     1            'Interest on debt', 'Social services'/
C
C                       Input variable test values
      DATA VV108 /'PERC', 'DATA', 'BOTH'/
C
      DATA VV109 /'ABO-HORI', 'ABO-RADI', 'ABO-CIRC',
     *            'TOP-HORI', 'TOP-RADI', 'TOP-CIRC',
     *            'MID-HORI', 'MID-RADI', 'MID-CIRC'/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE, XPAGE, YPAGE)
C
C                       Enable hardware clipping
      CALL DEVICE_CLIPON
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Loop for each labeling option
      I108 = 0
      DO 100 ILBL=1,N109
      I109 = ILBL
      I108 = I108+1
      IF (I108 .GT. N108) I108=1
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE, YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.20*XPAGE,0.15*YPAGE)
C
C                       Reduce margin to subplot boundary
      CALL MARGIN_SET (0.0)
C
C                       Compute length of X and Y axis in inches
      IF (XPAGE .GT. YPAGE) THEN
        XPG = 0.7*YPAGE
        YPG = 0.7*YPAGE
      ELSE
        XPG = 0.7*XPAGE
        YPG = 0.7*XPAGE
      ENDIF
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (smallest)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set character height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of title in inches
      XLEN = TEXT2D_GETLEN ('PIECHART1 Demo: Pie Labels$',100)
C                       Determine X location in inches needed
C                       to center the title
      RLEN = (XPG-XLEN)*0.5
C                       Draw plot title under the subplot area
      CALL TEXT2D_PDRAW
     *     ('PIECHART1 Demo: Pie Labels$',100,RLEN,-.10*YPG)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system
      CALL PLOT2D_DEFINE (0.0,0.0,2.0*CENTX,0.0,0.0,2.0*CENTY)
C
C                       Set character height in inches
      CALL TEXT2D_SETHT (SIZE*0.9)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C                       Set pie chart diameter to 90% of subplot
      CALL PIECHART_SETDIA (0.8,0.5,0.5)
C                       Wedge offsets
      CALL PIECHART_SETROF (OFFS,NPARTS)
C                       Set pie chart reference angle to -103 degrees
      CALL PIECHART_SETANG (-103.)
C                       Set pie chart colors
      CALL PIECHART_SETCLR (6,ICOL)
C                       Enable solid area fill pattern
      CALL FILLAREA_SETPAT (16)
C                       Define wedge labels
      CALL PIECHART_DEFLBL
     *     (VV108(I108),VV109(I109),1,LBLS,NPARTS,16,1,1)
c    *     (VV108(I108),VV109(I109),1,LBLS,NPARTS,16,1,MOD(ILBL,2))
C                       Draw pie chart
      CALL PIECHART_DRAW (PART,NPARTS)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  100 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./piechart2.f ]"
cat <<"STOP_CAT"> ././piechart2.f
C     PROGRAM PIECHART2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PIECHART_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (CENTX=400.0)
      PARAMETER (CENTY=400.0)
      PARAMETER (NPARTS=10)
C
      REAL PART(NPARTS),OFFS(NPARTS)
      CHARACTER*16 LBLS(NPARTS)
      INTEGER  ICOL(6)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                 green magenta yellow blue red cyan
      DATA ICOL / 3,    6,      5,     4,   2,  7/
      DATA PART /26.0,1.0,32.0,1.0,12.0,1.0,15.0,1.0,10.0,1.0/
      DATA OFFS /0.0, 0.0, 0.2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0/
      DATA LBLS / 'Defense', 'NASA','Benefits', 'Education', 'Other',
     1            'Law enforcement','Interest on debt', 'Housing',
     2            'Social services','Foreign affairs'/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE, XPAGE, YPAGE)
C
C                       Enable hardware clipping
      CALL DEVICE_CLIPON
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE, YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.20*XPAGE,0.15*YPAGE)
C
C                       Reduce margin to subplot boundary
      CALL MARGIN_SET (0.0)
C
C                       Compute length of X and Y axis in inches
      IF (XPAGE .GT. YPAGE) THEN
        XPG = 0.7*YPAGE
        YPG = 0.7*YPAGE
      ELSE
        XPG = 0.7*XPAGE
        YPG = 0.7*XPAGE
      ENDIF
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (smallest)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT HEADING
C
C                       Set color to green
      CALL COLOR_SETNUM (3,IERR)
C                       Set text style to cmplx2
      CALL FONT_CMPLX2
C                       Write heading in yellow
      CALL HEADING_DRAW ('FEDERAL SPENDING$',-100,2.0,3)
      CALL HEADING_DRAW (' ',1,1.0,3)
      CALL HEADING_DRAW ('FY 1989$',100,1.3,3)
C                       Reset default test style
      CALL GRAPHICS_RESET ('FONT_CMPLX2')
C
C     ------------------------------------------------------------------
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set character height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of title in inches
      XLEN = TEXT2D_GETLEN ('PIECHART2 Demo: Pie Chart$',100)
C                       Determine X location in inches needed
C                       to center the title
      RLEN = (XPG-XLEN)*0.5
C                       Draw plot title under the subplot area
      CALL TEXT2D_PDRAW ('PIECHART2 Demo: Pie Chart$',100,RLEN,-.10*YPG)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system
      CALL PLOT2D_DEFINE (0.0,0.0,2.0*CENTX,0.0,0.0,2.0*CENTY)
C
C                       Set character height in inches
      CALL TEXT2D_SETHT (SIZE*0.9)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C                       Set pie chart diameter to 90% of subplot
      CALL PIECHART_SETDIA (0.8,0.5,0.5)
C                       Wedge offsets
      CALL PIECHART_SETROF (OFFS,NPARTS)
C                       Set pie chart reference angle to -90 deg
      CALL PIECHART_SETANG (-103.)
C                       Set pie chart colors
      CALL PIECHART_SETCLR (6,ICOL)
C                       Enable solid area fill pattern
      CALL FILLAREA_SETPAT (16)
C                       Define wedge labels
      CALL PIECHART_DEFLBL ('PERC','MID-HORI',0,LBLS,NPARTS,16,0,0)
C                       Draw pie chart
      CALL PIECHART_DRAW (PART,NPARTS)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./piechart3.f ]"
cat <<"STOP_CAT"> ././piechart3.f
C     PROGRAM PIECHART3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PIECHART_SETANG
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (CENTX=400.0)
      PARAMETER (CENTY=400.0)
      PARAMETER (NPARTS=5)
C
      REAL PART(NPARTS),OFFS(NPARTS)
      CHARACTER*16 LBLS(NPARTS)
      INTEGER  ICOL(6)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                 green magenta yellow blue red cyan
      DATA ICOL / 3,    6,      5,     4,   2,  7/
      DATA PART /26.0,32.0,12.0,15.0,10.0/
      DATA OFFS /0.0, 0.2, 0.0, 0.0, 0.0/
      DATA LBLS / 'Defense', 'Benefits', 'Other',
     1            'Interest on debt', 'Social services'/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE, XPAGE, YPAGE)
C
C                       Enable hardware clipping
      CALL DEVICE_CLIPON
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
      DO 100 IANG=0,270,90
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE, YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.20*XPAGE,0.15*YPAGE)
C
C                       Reduce margin to subplot boundary
      CALL MARGIN_SET (0.0)
C
C                       Compute length of X and Y axis in inches
      IF (XPAGE .GT. YPAGE) THEN
        XPG = 0.7*YPAGE
        YPG = 0.7*YPAGE
      ELSE
        XPG = 0.7*XPAGE
        YPG = 0.7*XPAGE
      ENDIF
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (smallest)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT HEADING
C
C                       Set color to green
      CALL COLOR_SETNUM (3,IERR)
C                       Set text style to cmplx2
      CALL FONT_CMPLX2
C                       Write heading in yellow
      CALL HEADING_DRAW ('FEDERAL SPENDING$',-100,2.0,3)
      CALL HEADING_DRAW (' ',1,1.0,3)
      CALL HEADING_DRAW ('FY 1989$',100,1.3,3)
C                       Reset default test style
      CALL GRAPHICS_RESET ('FONT_CMPLX2')
C
C     ------------------------------------------------------------------
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set character height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of title in inches
      XLEN = TEXT2D_GETLEN ('PIECHART3 Demo: Pie Angle$',100)
C                       Determine X location in inches needed
C                       to center the title
      RLEN = (XPG-XLEN)*0.5
C                       Draw plot title under the subplot area
      CALL TEXT2D_PDRAW ('PIECHART3 Demo: Pie Angle$',100,RLEN,-.10*YPG)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system
      CALL PLOT2D_DEFINE (0.0,0.0,2.0*CENTX,0.0,0.0,2.0*CENTY)
C
C                       Set character height in inches
      CALL TEXT2D_SETHT (SIZE*0.9)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C                       Set pie chart diameter to 90% of subplot
      CALL PIECHART_SETDIA (0.8,0.5,0.5)
C                       Wedge offsets
      CALL PIECHART_SETROF (OFFS,NPARTS)
C                       Set pie chart reference angle
      CALL PIECHART_SETANG (FLOAT(IANG))
C                       Set pie chart colors
      CALL PIECHART_SETCLR (6,ICOL)
C                       Enable solid area fill pattern
      CALL FILLAREA_SETPAT (16)
C                       Define wedge labels
      CALL PIECHART_DEFLBL ('PERC','MID-HORI',0,LBLS,NPARTS,16,0,0)
C                       Draw pie chart
      CALL PIECHART_DRAW (PART,NPARTS)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  100 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./piechart4.f ]"
cat <<"STOP_CAT"> ././piechart4.f
C     PROGRAM PIECHART4
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PIECHART_SETCLR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (CENTX=400.0)
      PARAMETER (CENTY=400.0)
      PARAMETER (NPARTS=5)
C
      REAL PART(NPARTS),OFFS(NPARTS)
      CHARACTER*16 LBLS(NPARTS)
      INTEGER  ICOL(6)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                 green magenta yellow blue red cyan
      DATA ICOL / 3,    6,      5,     4,   2,  7/
      DATA PART /26.0,32.0,12.0,15.0,10.0/
      DATA OFFS /0.0, 0.2, 0.0, 0.0, 0.0/
      DATA LBLS / 'Defense', 'Benefits', 'Other',
     1            'Interest on debt', 'Social services'/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE, XPAGE, YPAGE)
C
C                       Enable hardware clipping
      CALL DEVICE_CLIPON
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
      DO 100 ICLR=2,6,2
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE, YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.20*XPAGE,0.15*YPAGE)
C
C                       Reduce margin to subplot boundary
      CALL MARGIN_SET (0.0)
C
C                       Compute length of X and Y axis in inches
      IF (XPAGE .GT. YPAGE) THEN
        XPG = 0.7*YPAGE
        YPG = 0.7*YPAGE
      ELSE
        XPG = 0.7*XPAGE
        YPG = 0.7*XPAGE
      ENDIF
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (smallest)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT HEADING
C
C                       Set color to green
      CALL COLOR_SETNUM (3,IERR)
C                       Set text style to cmplx2
      CALL FONT_CMPLX2
C                       Write heading in yellow
      CALL HEADING_DRAW ('FEDERAL SPENDING$',-100,2.0,3)
      CALL HEADING_DRAW (' ',1,1.0,3)
      CALL HEADING_DRAW ('FY 1989$',100,1.3,3)
C                       Reset default test style
      CALL GRAPHICS_RESET ('FONT_CMPLX2')
C
C     ------------------------------------------------------------------
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set character height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of title in inches
      XLEN = TEXT2D_GETLEN ('PIECHART4 Demo: Pie Color$',100)
C                       Determine X location in inches needed
C                       to center the title
      RLEN = (XPG-XLEN)*0.5
C                       Draw plot title under the subplot area
      CALL TEXT2D_PDRAW ('PIECHART4 Demo: Pie Color$',100,RLEN,-.10*YPG)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system
      CALL PLOT2D_DEFINE (0.0,0.0,2.0*CENTX,0.0,0.0,2.0*CENTY)
C
C                       Set character height in inches
      CALL TEXT2D_SETHT (SIZE*0.9)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C                       Set pie chart diameter to 90% of subplot
      CALL PIECHART_SETDIA (0.8,0.5,0.5)
C                       Wedge offsets
      CALL PIECHART_SETROF (OFFS,NPARTS)
C                       Set pie chart reference angle
      CALL PIECHART_SETANG (-103.)
C                       Set pie chart colors
      CALL PIECHART_SETCLR (ICLR,ICOL)
C                       Enable solid area fill pattern
      CALL FILLAREA_SETPAT (16)
C                       Define wedge labels
      CALL PIECHART_DEFLBL ('PERC','MID-HORI',0,LBLS,NPARTS,16,0,0)
C                       Draw pie chart
      CALL PIECHART_DRAW (PART,NPARTS)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  100 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./piechart5.f ]"
cat <<"STOP_CAT"> ././piechart5.f
C     PROGRAM PIECHART5
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PIECHART_SETDIA
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (CENTX=400.0)
      PARAMETER (CENTY=400.0)
      PARAMETER (NPARTS=5)
      PARAMETER (NDIA = 5)
C
      REAL PART(NPARTS),OFFS(NPARTS)
      CHARACTER*16 LBLS(NPARTS)
      INTEGER  ICOL(6)
      REAL     DIAM(NDIA)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                 green magenta yellow blue red cyan
      DATA ICOL / 3,    6,      5,     4,   2,  7/
      DATA PART /26.0,32.0,12.0,15.0,10.0/
      DATA OFFS /0.0, 0.2, 0.0, 0.0, 0.0/
      DATA LBLS / 'Defense', 'Benefits', 'Other',
     1            'Interest on debt', 'Social services'/
C
      DATA DIAM /0.4, 0.7, 4.0, 8.0, 12.0/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE, XPAGE, YPAGE)
C
C                       Enable hardware clipping
      CALL DEVICE_CLIPON
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
      DO 100 IDIA=1,NDIA
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE, YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.20*XPAGE,0.15*YPAGE)
C
C                       Reduce margin to subplot boundary
      CALL MARGIN_SET (0.0)
C
C                       Compute length of X and Y axis in inches
      IF (XPAGE .GT. YPAGE) THEN
        XPG = 0.7*YPAGE
        YPG = 0.7*YPAGE
      ELSE
        XPG = 0.7*XPAGE
        YPG = 0.7*XPAGE
      ENDIF
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (smallest)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT HEADING
C
C                       Set color to green
      CALL COLOR_SETNUM (3,IERR)
C                       Set text style to cmplx2
      CALL FONT_CMPLX2
C                       Write heading in yellow
      CALL HEADING_DRAW ('FEDERAL SPENDING$',-100,2.0,3)
      CALL HEADING_DRAW (' ',1,1.0,3)
      CALL HEADING_DRAW ('FY 1989$',100,1.3,3)
C                       Reset default test style
      CALL GRAPHICS_RESET ('FONT_CMPLX2')
C
C     ------------------------------------------------------------------
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set character height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of title in inches
      XLEN = TEXT2D_GETLEN ('PIECHART5 Demo: Pie Diameter$',100)
C                       Determine X location in inches needed
C                       to center the title
      RLEN = (XPG-XLEN)*0.5
C                       Draw plot title under the subplot area
      CALL TEXT2D_PDRAW
     *     ('PIECHART5 Demo: Pie Diameter$',100,RLEN,-.10*YPG)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system
      CALL PLOT2D_DEFINE (0.0,0.0,2.0*CENTX,0.0,0.0,2.0*CENTY)
C
C                       Set character height in inches
      CALL TEXT2D_SETHT (SIZE*0.9)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C                       Set pie chart diameter to 90% of subplot
      CALL PIECHART_SETDIA (DIAM(IDIA),0.5,0.5)
C                       Wedge offsets
      CALL PIECHART_SETROF (OFFS,NPARTS)
C                       Set pie chart reference angle
      CALL PIECHART_SETANG (-103.)
C                       Set pie chart colors
      CALL PIECHART_SETCLR (6,ICOL)
C                       Enable solid area fill pattern
      CALL FILLAREA_SETPAT (16)
C                       Define wedge labels
      CALL PIECHART_DEFLBL ('PERC','MID-HORI',0,LBLS,NPARTS,16,0,0)
C                       Draw pie chart
      CALL PIECHART_DRAW (PART,NPARTS)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  100 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./piechart6.f ]"
cat <<"STOP_CAT"> ././piechart6.f
C     PROGRAM PIECHART6
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PIECHART_SETROF
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (CENTX=400.0)
      PARAMETER (CENTY=400.0)
      PARAMETER (NPARTS=5)
      PARAMETER (NOFFS =7)
C
      REAL PART(NPARTS),OFFS(NPARTS,NOFFS)
      CHARACTER*16 LBLS(NPARTS)
      INTEGER  ICOL(6)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                 green magenta yellow blue red cyan
      DATA ICOL / 3,    6,      5,     4,   2,  7/
      DATA PART /26.0,32.0,12.0,15.0,10.0/
      DATA LBLS / 'Defense', 'Benefits', 'Other',
     1            'Interest on debt', 'Social services'/
C
      DATA OFFS /0.0, 0.0, 0.0, 0.0, 0.0,
     1           0.2, 0.0, 0.0, 0.0, 0.0,
     2           0.0, 0.2, 0.0, 0.0, 0.0,
     3           0.0, 0.0, 0.2, 0.0, 0.0,
     4           0.0, 0.0, 0.0, 0.2, 0.0,
     5           0.0, 0.0, 0.0, 0.0, 0.2,
     6           0.2, 0.2, 0.2, 0.2, 0.2/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE, XPAGE, YPAGE)
C
C                       Enable hardware clipping
      CALL DEVICE_CLIPON
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
      DO 100 IOFF=1,NOFFS
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE, YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.20*XPAGE,0.15*YPAGE)
C
C                       Reduce margin to subplot boundary
      CALL MARGIN_SET (0.0)
C
C                       Compute length of X and Y axis in inches
      IF (XPAGE .GT. YPAGE) THEN
        XPG = 0.7*YPAGE
        YPG = 0.7*YPAGE
      ELSE
        XPG = 0.7*XPAGE
        YPG = 0.7*XPAGE
      ENDIF
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (smallest)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT HEADING
C
C                       Set color to green
      CALL COLOR_SETNUM (3,IERR)
C                       Set text style to cmplx2
      CALL FONT_CMPLX2
C                       Write heading in yellow
      CALL HEADING_DRAW ('FEDERAL SPENDING$',-100,2.0,3)
      CALL HEADING_DRAW (' ',1,1.0,3)
      CALL HEADING_DRAW ('FY 1989$',100,1.3,3)
C                       Reset default test style
      CALL GRAPHICS_RESET ('FONT_CMPLX2')
C
C     ------------------------------------------------------------------
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set character height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of title in inches
      XLEN = TEXT2D_GETLEN ('PIECHART6 Demo: Pie Offsets$',100)
C                       Determine X location in inches needed
C                       to center the title
      RLEN = (XPG-XLEN)*0.5
C                       Draw plot title under the subplot area
      CALL TEXT2D_PDRAW
     *     ('PIECHART6 Demo: Pie Offsets$',100,RLEN,-.10*YPG)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system
      CALL PLOT2D_DEFINE (0.0,0.0,2.0*CENTX,0.0,0.0,2.0*CENTY)
C
C                       Set character height in inches
      CALL TEXT2D_SETHT (SIZE*0.9)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C                       Set pie chart diameter to 90% of subplot
      CALL PIECHART_SETDIA (0.7,0.5,0.5)
C                       Wedge offsets
      CALL PIECHART_SETROF (OFFS(1,IOFF),NPARTS)
C                       Set pie chart reference angle
      CALL PIECHART_SETANG (-103.)
C                       Set pie chart colors
      CALL PIECHART_SETCLR (6,ICOL)
C                       Enable solid area fill pattern
      CALL FILLAREA_SETPAT (16)
C                       Define wedge labels
      CALL PIECHART_DEFLBL ('PERC','MID-HORI',0,LBLS,NPARTS,16,0,0)
C                       Draw pie chart
      CALL PIECHART_DRAW (PART,NPARTS)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
  100 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plot1.f ]"
cat <<"STOP_CAT"> ././plot1.f
C     PROGRAM PLOT1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOT_INIT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C     ------------------------------------------------------------------
C
      CHARACTER*80 STRING
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Write demo program introduction message
C
C                       Write intro message
C                       (use * for logical unit since TERM_SETSIO will
C                       not be called in this demo)
      WRITE (*,401)
  401 FORMAT (
     * '                   PLOT Object Demo Program #1'//
     * ' PLOT_INIT must be used to initialize the PRL-PLOT'/
     * ' library prior to invoking any other PRL-PLOT subprograms.'/
     * ' Failure to initialize the library will cause erroneous'/
     * ' program operation.'/
     * ' '/
     * ' PLOT_INIT was called before printing this message.'/)
C
C     ******************************************************************
C
C                       Terminate program execution
C                       Wait until user presses a key before exiting
C
      WRITE (*,810)
  810 FORMAT (/
     * '              PLOT Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (*,811) STRING
  811 FORMAT (A)
C                       Exit demo
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plot2d1.f ]"
cat <<"STOP_CAT"> ././plot2d1.f
C     PROGRAM PLOT2D1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOT2D_DEFINE
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PLOT2D object access program
      EXTERNAL PLOT2D_DEFINE
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV103 =  2)
      PARAMETER (NVV104 =  3)
      PARAMETER (NVV105 =  2)
      PARAMETER (NVV106 =  1)
      PARAMETER (NVV107 =  1)
      PARAMETER (NVV108 =  1)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'PLOT2D.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, TMP102, XLOW, TMP103, XSTEP, TMP104, XHIGH, TMP105
     *      , YLOW, TMP106, YSTEP, TMP107, YHIGH, TMP108
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV103(NVV103)
      REAL    VV104(NVV104)
      REAL    VV105(NVV105)
      REAL    VV106(NVV106)
      REAL    VV107(NVV107)
      REAL    VV108(NVV108)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV103 /-333.33, 0.0/
C
      DATA VV104 /9.99, 99.99, 0.0/
C
      DATA VV105 /0.0, 999.99/
C
      DATA VV106 /0.0/
C
      DATA VV107 /0.0/
C
      DATA VV108 /1.0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'plot2d_define.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PLOT2D Object Demo Program #1'/
     * ' This program tests the PLOT2D object access program'/
     * ' PLOT2D_DEFINE.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test PLOT2D_DEFINE object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV103 = 1,NVV103
        XLOW = VV103(IVV103)
C
      DO 588 IVV104 = 1,NVV104
        XSTEP = VV104(IVV104)
C
      DO 587 IVV105 = 1,NVV105
        XHIGH = VV105(IVV105)
C
      DO 586 IVV106 = 1,NVV106
        YLOW = VV106(IVV106)
C
      DO 585 IVV107 = 1,NVV107
        YSTEP = VV107(IVV107)
C
      DO 584 IVV108 = 1,NVV108
        YHIGH = VV108(IVV108)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
C
C                       Define linear coordinate system and draw axes
C                       for 2D plot
      CALL PLOT2D_DEFINE (XLOW,XSTEP,XHIGH,YLOW,YSTEP,YHIGH)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106,TMP107,TMP108
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(ZZXSTP ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZYSTP ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ZZXSTP,ZZYSTP,XLOW,XSTEP,XHIGH,YLOW,YSTEP,
     *       YHIGH
  502 FORMAT (E15.7,E15.7,E15.7,E15.7,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  584 CONTINUE
  585 CONTINUE
  586 CONTINUE
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PLOT2D Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plot2d2.f ]"
cat <<"STOP_CAT"> ././plot2d2.f
C     PROGRAM PLOT2D2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOT2D_DEF2X
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PLOT2D object access program
      EXTERNAL PLOT2D_DEF2X
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  2)
      PARAMETER (NVV103 =  2)
      PARAMETER (NVV104 =  2)
      PARAMETER (NVV106 =  1)
      PARAMETER (NVV107 =  1)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'PLOT2D.INC'
C
C                       Integer variables and arrays
      INTEGER LABN2, TMP107
C
C                       Real variables and arrays
      REAL    TMP101, XLOW, TMP102, XSTEP, TMP103, XHIGH, TMP104, XAXIS
     *      , TMP105, XPOS, TMP108, YPOS, TMP109
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER XLABEL*80, TMP106*80
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV102(NVV102)
      REAL    VV103(NVV103)
      REAL    VV104(NVV104)
      CHARACTER*80 VV106(NVV106)
      INTEGER VV107(NVV107)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /-33.33, 0.0/
C
      DATA VV103 /9.99, 0.0/
C
      DATA VV104 /0.0, 99.99/
C
      DATA VV106 /'Secondary X Axis$'/
C
      DATA VV107 /100/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'plot2d_def2x.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PLOT2D Object Demo Program #2'/
     * ' This program tests the PLOT2D object access program'/
     * ' PLOT2D_DEF2X.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test PLOT2D_DEF2X object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        XLOW = VV102(IVV102)
C
      DO 588 IVV103 = 1,NVV103
        XSTEP = VV103(IVV103)
C
      DO 587 IVV104 = 1,NVV104
        XHIGH = VV104(IVV104)
C
      DO 586 IVV106 = 1,NVV106
        XLABEL = VV106(IVV106)
C
      DO 585 IVV107 = 1,NVV107
        LABN2 = VV107(IVV107)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL PLOT2D_DEFINE (XLOW,XSTEP,XHIGH,0.0,0.0,1.0)
C
C                       Define and draw secondary linear coordinate
C                       system on X axis of 2D plot
      XAXIS = XPAGE-2.0
      XPOS = 0.0
      YPOS = YPAGE-2.0
      CALL PLOT2D_DEF2X (XLOW,XSTEP,XHIGH,XAXIS,XLABEL,LABN2,XPOS,YPOS)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=510) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106,TMP107,TMP108,TMP109
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(ZZXSTP ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(XAXIS ,TMP105 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 523
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=512) ZZXSTP,XLOW,XSTEP,XHIGH,XAXIS,XLABEL,LABN2,
     *       XPOS,YPOS
  502 FORMAT (E15.7,E15.7,E15.7,E15.7,E15.7,A,I21,E15.7,E15.7)
      GOTO 523
C                       Print file I/O error messages
  510 WRITE (IER,511) FILNAM
  511 FORMAT (' Error reading file ',A)
      GOTO 523
C
  512 WRITE (IER,513) FILNAM
  513 FORMAT (' Error writing file ',A)
C
  523 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  585 CONTINUE
  586 CONTINUE
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
      CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PLOT2D Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plot2d_def2x.dat ]"
cat <<"STOP_CAT"> ././plot2d_def2x.uuu
begin 660 ./plot2d_def2x.dat
M("`@+CDY.3`P,#!%*S`Q("`M+C,S,S,P,#!%*S`R("`@+CDY.3`P,#!%*S`Q
M("`@+C`P,#`P,#!%*S`P("`@+C$Q-CDP,#!%*S`R4V5C;VYD87)Y(%@@07AI
M<R0@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`Q,#`@("`N
M,#`P,#`P,$4K,#`@("`N.#DU,#`P,$4K,#$*("`@+CDY.3`P,#!%*S`Q("`M
M+C,S,S,P,#!%*S`R("`@+CDY.3`P,#!%*S`Q("`@+CDY.3DP,#!%*S`R("`@
M+C$Q-CDP,#!%*S`R4V5C;VYD87)Y(%@@07AI<R0@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`Q,#`@("`N,#`P,#`P,$4K,#`@("`N.#DU
M,#`P,$4K,#$*("`@+C4P,#`P,#!%*S`Q("`M+C,S,S,P,#!%*S`R("`@+C`P
M,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@+C$Q-CDP,#!%*S`R4V5C;VYD
M87)Y(%@@07AI<R0@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`Q,#`@("`N,#`P,#`P,$4K,#`@("`N.#DU,#`P,$4K,#$*("`@+C$U,#`P
M,#!%*S`R("`M+C,S,S,P,#!%*S`R("`@+C`P,#`P,#!%*S`P("`@+CDY.3DP
M,#!%*S`R("`@+C$Q-CDP,#!%*S`R4V5C;VYD87)Y(%@@07AI<R0@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`Q,#`@("`N,#`P,#`P,$4K
M,#`@("`N.#DU,#`P,$4K,#$*("`@+CDY.3`P,#!%*S`Q("`@+C`P,#`P,#!%
M*S`P("`@+CDY.3`P,#!%*S`Q("`@+C`P,#`P,#!%*S`P("`@+C$Q-CDP,#!%
M*S`R4V5C;VYD87)Y(%@@07AI<R0@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`Q,#`@("`N,#`P,#`P,$4K,#`@("`N.#DU,#`P,$4K,#$*
M("`@+CDY.3`P,#!%*S`Q("`@+C`P,#`P,#!%*S`P("`@+CDY.3`P,#!%*S`Q
M("`@+CDY.3DP,#!%*S`R("`@+C$Q-CDP,#!%*S`R4V5C;VYD87)Y(%@@07AI
M<R0@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`Q,#`@("`N
M,#`P,#`P,$4K,#`@("`N.#DU,#`P,$4K,#$*("`@+C(P,#`P,#!%*S`P("`@
M+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@
M+C$Q-CDP,#!%*S`R4V5C;VYD87)Y(%@@07AI<R0@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`Q,#`@("`N,#`P,#`P,$4K,#`@("`N.#DU
M,#`P,$4K,#$*("`@+C$P,#`P,#!%*S`R("`@+C`P,#`P,#!%*S`P("`@+C`P
M,#`P,#!%*S`P("`@+CDY.3DP,#!%*S`R("`@+C$Q-CDP,#!%*S`R4V5C;VYD
M87)Y(%@@07AI<R0@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
D("`Q,#`@("`N,#`P,#`P,$4K,#`@("`N.#DU,#`P,$4K,#$*
`
end
STOP_CAT
echo "  Generating =====> [ ./plot2d_define.dat ]"
cat <<"STOP_CAT"> ././plot2d_define.uuu
begin 660 ./plot2d_define.dat
M("`@+CDY.3`P,#!%*S`Q("`@+C$U,#`P,#!%*S`P("`M+C,S,S,S,#!%*S`S
M("`@+CDY.3`P,#!%*S`Q("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P
M("`@+C`P,#`P,#!%*S`P("`@+C$P,#`P,#!%*S`Q"B`@("XY.3DP,#`P12LP
M,2`@("XQ-3`P,#`P12LP,"`@+2XS,S,S,S`P12LP,R`@("XY.3DP,#`P12LP
M,2`@("XY.3DY.3`P12LP,R`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P12LP
M,"`@("XQ,#`P,#`P12LP,0H@("`N.3DY.3`P,$4K,#(@("`N,34P,#`P,$4K
M,#`@("TN,S,S,S,P,$4K,#,@("`N.3DY.3`P,$4K,#(@("`N,#`P,#`P,$4K
M,#`@("`N,#`P,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@("`N,3`P,#`P,$4K
M,#$*("`@+CDY.3DP,#!%*S`R("`@+C$U,#`P,#!%*S`P("`M+C,S,S,S,#!%
M*S`S("`@+CDY.3DP,#!%*S`R("`@+CDY.3DY,#!%*S`S("`@+C`P,#`P,#!%
M*S`P("`@+C`P,#`P,#!%*S`P("`@+C$P,#`P,#!%*S`Q"B`@("XU,#`P,#`P
M12LP,B`@("XQ-3`P,#`P12LP,"`@+2XS,S,S,S`P12LP,R`@("XP,#`P,#`P
M12LP,"`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P
M12LP,"`@("XQ,#`P,#`P12LP,0H@("`N,34P,#`P,$4K,#,@("`N,34P,#`P
M,$4K,#`@("TN,S,S,S,P,$4K,#,@("`N,#`P,#`P,$4K,#`@("`N.3DY.3DP
M,$4K,#,@("`N,#`P,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@("`N,3`P,#`P
M,$4K,#$*("`@+CDY.3`P,#!%*S`Q("`@+C$U,#`P,#!%*S`P("`@+C`P,#`P
M,#!%*S`P("`@+CDY.3`P,#!%*S`Q("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P
M,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@+C$P,#`P,#!%*S`Q"B`@("XY.3DP
M,#`P12LP,2`@("XQ-3`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XY.3DP
M,#`P12LP,2`@("XY.3DY.3`P12LP,R`@("XP,#`P,#`P12LP,"`@("XP,#`P
M,#`P12LP,"`@("XQ,#`P,#`P12LP,0H@("`N.3DY.3`P,$4K,#(@("`N,34P
M,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@("`N.3DY.3`P,$4K,#(@("`N,#`P
M,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@("`N,3`P
M,#`P,$4K,#$*("`@+CDY.3DP,#!%*S`R("`@+C$U,#`P,#!%*S`P("`@+C`P
M,#`P,#!%*S`P("`@+CDY.3DP,#!%*S`R("`@+CDY.3DY,#!%*S`S("`@+C`P
M,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@+C$P,#`P,#!%*S`Q"B`@("XR
M,#`P,#`P12LP,"`@("XQ-3`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XP
M,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XP
M,#`P,#`P12LP,"`@("XQ,#`P,#`P12LP,0H@("`N,3`P,#`P,$4K,#,@("`N
M,34P,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@("`N
M.3DY.3DP,$4K,#,@("`N,#`P,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@("`N
,,3`P,#`P,$4K,#$*
`
end
STOP_CAT
echo "  Generating =====> [ ./plot3d1.f ]"
cat <<"STOP_CAT"> ././plot3d1.f
C     PROGRAM PLOT3D1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOT3D_DEFINE
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       Number of horizontal slices (constant Z)
C                       defining the 3D object to be plotted
      PARAMETER (NLEVEL=8)
C                       Number of radial slices (constant angle in X-Y)
C                       defining the 3D object to be plotted
      PARAMETER (NSLICE=18)
C                       Arrays for storing 3D coordinates of points
C                       defining the 3D object to be plotted
      DIMENSION X(200),Y(200),Z(200)
C                       Arrays for storing indicies of points that
C                       define vectors (3D line segments)
      DIMENSION M(1000),N(1000)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       3D viewpoint location in 3D workbox units
      DATA VX,VY,VZ/30.0,30.0,15.0/
C                       Radius of the object to be plotted
      DATA RADIUS / 5.0 /
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       COMPUTE COORDINATES OF THE OBJECT TO BE PLOTTED
C
C     ------------------------------------------------------------------
C
C                       INITIALIZE VARIABLES
C
C                       Get value for pi
      PI = REAL_GETPI()
C                       Compute degrees-to-radians conversion divisor
      DTR = 360.0/2.0/PI
C                       Compute angle between radial slices in degrees
      DELTA = 360.0/NSLICE
C                       Initialize distance between horizontal slices
      DELZ = 1.0
C                       Initialize radius of conical top of object
      XYRAD = RADIUS
C                       Initialize Z coord of first horizontal slice
      ZTEM = 0.0
C                       Initialize counter for number of vectors
C                       (3D straight line segments)
      NVEC = 0
C
C     ------------------------------------------------------------------
C
C                       HORIZONTAL SLICE LOOP
C
C                       Loop for each horizontal (constant Z) slice
      DO 20 I=1,NLEVEL
C                       Determine Z coord of this horizontal slice:
C                         First 5 slices are 1.0 units apart
      ZTEM = ZTEM + DELZ
C                         Slices 6-8 are 29 deg apart on conical top
      IF(I .GT. 5) THEN
        ZTEM  = 5.0 + RADIUS*SIN(29.0*(I-5)/DTR)
C                       Compute radius of conical top at this Z coord
        XYRAD = RADIUS*COS(29.0*(I-5)/DTR)
      ENDIF
C
C     ..................................................................
C
C                       RADIAL SLICE LOOP
C
C                       Loop for each radial (constant X-Y angle) slice
      DO 10 J=1,NSLICE
C                       Compute angle of this radial slice in radians
      ANG = DELTA*(J-1)/DTR
C                       Compute index number of this point
C                       (intersection of horizontal and vertical slices)
      NPTS = NSLICE*(I-1) + J
C                       Compute and store X,Y,Z coords of this point
      X(NPTS) = XYRAD*COS(ANG)
      Y(NPTS) = XYRAD*SIN(ANG)
      Z(NPTS) = ZTEM
C
C                       Define horizontal vector:
C                         Increment number of vectors
      NVEC = NVEC + 1
C                         Store index of point at vector tail
      M(NVEC) = NPTS
C                         Store index of point at vector head
      N(NVEC) = NPTS + 1
C                         Adjust index of point at vector head due to
C                         wrap-around if this is the last slice
      IF(J .EQ. NSLICE) N(NVEC) = NPTS - NSLICE + 1
C
C                       Define vertical vector if not last horiz slice:
      IF(I .LT. NLEVEL) THEN
C                         Increment number of vectors
        NVEC = NVEC + 1
C                         Store index of point at vector tail
        M(NVEC) = NPTS
C                         Store index of point at vector head
        N(NVEC) = NPTS + NSLICE
      ENDIF
C                       Repeat for next radial slice
   10 CONTINUE
C
C     ..................................................................
C
C                       END OF HORIZONTAL SLICE LOOP
C
C                       Repeat for next horizontal slice
   20 CONTINUE
C
C     ------------------------------------------------------------------
C
C                       DETERMINE MINIMUM AND MAXIMUM COORDINATES
C                       OF OBJECT TO BE PLOTTED
C
C                       Initialize min and max X coordinates
      XMIN=X(1)
      XMAX=X(1)
C                       Initialize min and max Y coordinates
      YMIN=Y(1)
      YMAX=Y(1)
C                       Initialize min and max Z coordinates
      ZMIN=Z(1)
      ZMAX=Z(1)
C                       Loop for each point defining the object
      DO 100 I=2,NPTS
C                       Update min X if this point has a smaller X
        IF (X(I).LT.XMIN) XMIN=X(I)
C                       Update max X if this point has a larger X
        IF (X(I).GT.XMAX) XMAX=X(I)
C                       Update min Y if this point has a smaller Y
        IF (Y(I).LT.YMIN) YMIN=Y(I)
C                       Update max Y if this point has a larger Y
        IF (Y(I).GT.YMAX) YMAX=Y(I)
C                       Update min Z if this point has a smaller Z
        IF (Z(I).LT.ZMIN) ZMIN=Z(I)
C                       Update max Z if this point has a larger Z
        IF (Z(I).GT.ZMAX) ZMAX=Z(I)
C                       Repeat for next point
 100  CONTINUE
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Disable border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C
      CALL PAGE_ORIENT ('AUTO')
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.20*XPAGE
      YRL = 0.10*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 3.0*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plotting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       PLOT TITLE BELOW SUBPLOT AREA
C
C                       Set current drawing color to 'magenta'
      CALL COLOR_SETNAM ('FORE')
C                       Set text style to 'cartog'
      CALL FONT_CARTOG
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('PLOT3D1 Demo: 3-D Plot and Bold Fonts$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw title centered below subplot area
      YY = -.07*YPG
      CALL TEXT2D_PDRAW
     *     ('PLOT3D1 Demo: 3-D Plot and Bold Fonts$',100,XX,YY)
C
C     ------------------------------------------------------------------
C
C                       PLOT FIRST LINE OF HEADING:
C                       "3-Dimensional Plot"
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Enable character area fill
      CALL FONT_SETPAT (0.0,1,0.05,1)
C                       Enable hardware area fill (solid fill pattern)
      CALL DEVICE_FILLON
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*2.)
C                       Set text style to 'romanl'
      CALL FONT_ROMANL
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('3-Dimensional Plot$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw string centered high in subplot area
C                       in solid area-filled romanl font
      CALL TEXT2D_PDRAW ('3-Dimensional Plot$',100,XX,1.18*YPG)
C
C     ------------------------------------------------------------------
C
C                       PLOT SECOND LINE OF HEADING:
C                       "AND"
C
C                       Set current drawing color to 'red'
      CALL COLOR_SETNAM ('RED')
C                       Set text style to 'clasic'
      CALL FONT_CLASIC
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('AND$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw string centered just below first string
C                       in solid area-filled clasic font
      CALL TEXT2D_PDRAW ('AND$',100,XX,1.13*YPG)
C
C     ------------------------------------------------------------------
C
C                       PLOT THIRD LINE OF HEADING:
C                       "Shaded Fonts"
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*2.)
C                       Set current drawing color to 'yellow'
      CALL COLOR_SETNAM ('YELLOW')
C                       Set text style to 'stylex'
      CALL FONT_STYLEX
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('Shaded Fonts$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw string centered just below second string
C                       in solid area-filled stylex font
      CALL TEXT2D_PDRAW ('Shaded Fonts$',100,XX,1.05*YPG)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Set text style to 'duplex'
      CALL FONT_DUPLEX
C                       Set X axis label for 3-D plot
      CALL AXISLBL_DEFX3 ('XLAB',4)
C                       Set Y axis label for 3-D plot
      CALL AXISLBL_DEFY3 ('YLAB',4)
C                       Set Z axis label for 3-D plot
      CALL AXISLBL_DEFZ3 ('ZLAB',4)
C                       Set drawing color to 'foreground' (white)
      CALL COLOR_SETNAM ('FOREGROUND')
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Define dimensions of 3D workbox
      CALL WORKBOX_DEFINE (10.0,10.0,10.0)
C                       Set 3D viewpoint location in 3D workbox units
      CALL VIEWPT_SETBU (VX,VY,VZ)
C                       Define 3D coordinate system with
C                       X=-5.0 to 5.0, Y=-5.0 to 5.0, Z=0.0 to 10.0,
C                       and draw axes, axes labels
      CALL PLOT3D_DEFINE (-5.0,2.5,5.0,-5.0,2.5,5.0,0.0,2.5,10.0)
C
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Loop for each vector of the object to be drawn
      DO 40 I=1,NVEC
C                       Draw 3D vector without arrowhead
C                       (i.e., a 3D straight line segment)
        CALL VEC3_DRAW (X(M(I)),Y(M(I)),Z(M(I)),
     *                      X(N(I)),Y(N(I)),Z(N(I)),0)
C                       Repeat for next vector
   40 CONTINUE
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plot3d2.f ]"
cat <<"STOP_CAT"> ././plot3d2.f
C     PROGRAM PLOT3D2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOT3D_PRJON and
C              PLOT3D_PRJOFF
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       Arrays for storing plot curve data
      DIMENSION XXX(10),YYY(10),ZZZ(10)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
      REAL         VX(2),VY(2),VZ(2)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Variables for storing viewpoint coordinates
      DATA VX(1),VY(1),VZ(1) / 30.0,-31.0,23.0/
      DATA VX(2),VY(2),VZ(2) /-25.0, -20.0, 13.0/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       COMPUTE DATA FOR 3-D CURVE
C
C                       Loop for each plot
      DO 100 IP=1,2
C                       Loop for each point of plot curve
      DO 2 I=1,10
C                       Compute Z coordinate of point on curve
        ZZZ(I) = 1.4*FLOAT(I)
C                       Compute Y coordinate of point on curve
        YYY(I) = ZZZ(I)*ZZZ(I)/65.33
C                       Compute log X coordinate of point on curve
        XXX(I) = 1.2+YYY(I)*YYY(I)*0.2
C                       Repeat for each point of plot curve
   2  CONTINUE
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Disable border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Automatically select landscape or portrait
C                       plot orientation as appropriate
      CALL PAGE_ORIENT ('AUTO')
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.15*XPAGE
      YRL = 0.10*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 2.0*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plottting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('PLOT3D2 Demo: 2-D to 3-D Projection$',100)
C                       Compute X coordinate in inches to center
C                       plot title
      XX = 0.50*(XPG-XX)
C                       Draw plot title under subplot area
      YY = -YPG*0.07
      CALL TEXT2D_PDRAW
     *     ('PLOT3D2 Demo: 2-D to 3-D Projection$',100,XX,YY)
C
C     ------------------------------------------------------------------
C
C                       DRAW PLOT HEADING
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('2-D Subplot Projection Into 3-D Space$',100)
C                       Compute X coordinate in inches to center
C                       plot heading
      XX = 0.50*(XPG-XX)
C                       Draw plot heading over subplot area
      YY = 1.05*YPG
      CALL TEXT2D_PDRAW
     *     ('2-D Subplot Projection Into 3-D Space$',100,XX,YY)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plottting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DEFINE PLOT HEADING AND LABELS
C
C                       Define axis labels
      CALL AXISLBL_DEFX3 ('LINEAR X-AXIS',13)
      CALL AXISLBL_DEFY3 ('LINEAR Y-AXIS',13)
      CALL AXISLBL_DEFZ3 ('LINEAR Z-AXIS',13)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Set current drawing color to 'blue'
      CALL COLOR_SETNAM ('BLUE')
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Define workbox dimensions for 3-D coord system
      CALL WORKBOX_DEFINE (6.0,3.0,5.0)
C                       Set 3-D viewpoint, workbox coordinates
      CALL VIEWPT_SETBU (VX(IP),VY(IP),VZ(IP))
C                       Set current drawing color to 'foreground'
      CALL COLOR_SETNAM ('FORE')
C                       Define 3D linear coordinate system and
C                       draw axes, axes labels
      CALL PLOT3D_DEFINE (0.0,1.0,3.0, 0.0,1.0,3.0, 0.0,3.0,15.0)
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREE')
C                       Draw 3-D curve in 3-D coordinate system
      CALL CURVE3D_DRAW (XXX,YYY,ZZZ,10,1)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Enable projection of 2-D subplot onto
C                       a 2-D plane in the 3-D coordinate system
C                       (arguments define 3 points on X-Y plane)
      CALL PLOT3D_PRJON (0.0,0.0,0.0, 1.0,0.0,0.0, 0.0,1.0,0.0)
C
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plotting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define log X axis and linear Y axis with
C                       log cycle length of 3.5 and linear step
C                       size of 1.0
      CALL PLOT2D_DEFINE (0.0,1.0,3.0, 0.0,1.0,3.0)
C
C     ------------------------------------------------------------------
C
C                       DRAW GRID IN SUBPLOT AREA
C
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C
C                       Set line style to 'dot'
      CALL LINE2D_DOT
C                       Draw grid lines in X and Y directions
      CALL GRID_DRAW (1,1)
C
C     ------------------------------------------------------------------
C
C                       DRAW 2-D PROJECTION OF 3-D CURVE IN X-Y PLANE
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREE')
C                       Draw curve using default (linear) interpolation
C                       on log-linear plot
      CALL CURVE2D_DRAW (XXX,YYY,10,0)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C
C                       Terminate projection of 2-D subplot onto
C                       a 2-D plane in the 3-D coordinate system
      CALL PLOT3D_PRJOFF
C                       Enable projection of 2-D subplot onto
C                       a 2-D plane in the 3-D coordinate system
C                       (arguments define 3 points on Y-Z plane
C                       with Z axis as abscissa)
      CALL PLOT3D_PRJON (0.0,0.0,0.0, 0.0,3.0,0.0, 0.0,0.0,15.0)
C
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plotting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system with
C                       X = 15.0 to 0.0 and Y = 0.0 to 3.0, and
C                       draw axes, axes labels
      CALL PLOT2D_DEFINE (0.0,1.0,3.0, 0.0,3.0,15.0)
C
C     ------------------------------------------------------------------
C
C                       DRAW GRID IN SUBPLOT AREA
C
C                       Set line style to 'dash'
      CALL LINE2D_DASH
C                       Draw grid line at each step increment
C                       in X and Y directions
      CALL GRID_DRAW (1,1)
C
C     ------------------------------------------------------------------
C
C                       DRAW 2-D PROJECTION OF 3-D CURVE IN Y-Z PLANE
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREE')
C                       Draw curve using default (linear) interpolation
      CALL CURVE2D_DRAW (YYY,ZZZ,10,0)
C                       Set default line style
      CALL GRAPHICS_RESET ('LINE2D_DASH')
C                       Terminate projection of 2-D subplot onto
C                       a 2-D plane in the 3-D coordinate system
      CALL PLOT3D_PRJOFF
C
C     ------------------------------------------------------------------
C
C                       DRAW VERTICAL AND HORIZONTAL LINES FROM
C                       CURVE TO 2-D SUBPLOT
C
C                       Loop for each point of plot curve
      DO 44 I=1,10
C                       Draw vector from point on 3-D curve to
C                       projection point on X-Y axis
      CALL VEC3_DRAW (XXX(I),YYY(I),0.0,XXX(I),YYY(I),ZZZ(I),0)
C                       Draw vector from point on 3-D curve to
C                       projection point on Y-Z axis
      CALL VEC3_DRAW (XXX(I),YYY(I),ZZZ(I),0.0,YYY(I),ZZZ(I),0)
C                       Repeat for each point of plot curve
   44 CONTINUE
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C                       Repeat for next plot
  100 CONTINUE
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plotlog1.f ]"
cat <<"STOP_CAT"> ././plotlog1.f
C     PROGRAM PLOTLOG1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOTLOG_LMAUTO
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PLOTLOG object access program
      EXTERNAL PLOTLOG_LMAUTO
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOTLOG_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    ALOW, TMP101, AHIGH, TMP102, RAXIS, TMP103, AMIN, TMP104
     *      , DELV, TMP105
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /0.99, 9.99/
C
      DATA VV102 /9.99, 99.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'plotlog_autolm.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PLOTLOG Object Demo Program #1'/
     * ' This program tests the PLOTLOG object access program'/
     * ' PLOTLOG_LMAUTO.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test PLOTLOG_LMAUTO object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        ALOW = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        AHIGH = VV102(IVV102)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
C
C                       Automatically scale a log step size for multiple
C                       subplot X axes
        RAXIS = XPAGE-2.0
        CALL PLOTLOG_LMAUTO (1,ALOW,AHIGH,RAXIS,AMIN,DELV)
C                       Automatically scale a log step size for multiple
C                       subplot Y axes
        RAXIS = YPAGE-2.0
        CALL PLOTLOG_LMAUTO (2,ALOW,AHIGH,RAXIS,AMINY,DELVY)
C
        CALL PLOTLOG_DEFINE (AMIN,DELV,AMINY,DELVY)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(AMIN ,TMP104 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(DELV ,TMP105 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ALOW,AHIGH,RAXIS,AMIN,DELV
  502 FORMAT (E15.7,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PLOTLOG Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plotlog2.f ]"
cat <<"STOP_CAT"> ././plotlog2.f
C     PROGRAM PLOTLOG2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOTLOG_DEFINE
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       Arrays defining data for curve to be drawn
      DIMENSION X(5),Y(5)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
      DATA X /0.02, 0.3, 1.5, 11.2, 101.0/
      DATA Y /0.02, 0.3, 1.5, 11.2, 101.0/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Turn off border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.15*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 1.5*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border drawing
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW TITLE FOR PLOT
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Return length of text string in inches
      XX = TEXT2D_GETLEN ('PLOTLOG2 Demo: Log-Log Graph$',100)
C                       Compute X location at which to start plotting
C                       text string in world coordinates
      XX = 0.50*(XPG-XX)
C                       Plot the text string
      CALL TEXT2D_PDRAW
     *     ('PLOTLOG2 Demo: Log-Log Graph$',100,XX,-YPG*0.15)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.8)
C                       Set X axis label for 2-D plot
      CALL AXISLBL_DEFX2 ('XXX',3)
C                       Set Y axis label for 2-D plot
      CALL AXISLBL_DEFY2 ('YYY',3)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Store X lower and upper limits of data
      XMIN = 0.02
      XMAX = 101.
C                       Store Y lower and upper limits of data
      YMIN = 0.02
      YMAX = 101.
C                       Compute origin (in world coords) and cycle
C                       length (in inches) for log X axis
      CALL PLOTLOG_LMAUTO (1,XMIN,XMAX,XPG,XORIG,XCYCLE)
C                       Compute origin (in world coords) and cycle
C                       length (in inches) for log Y axis
      CALL PLOTLOG_LMAUTO (2,YMIN,YMAX,YPG,YORIG,YCYCLE)
C                       Define and draw log-log axis and
C                       axis numbers and labels
      CALL PLOTLOG_DEFINE (XORIG,XCYCLE, YORIG,YCYCLE)
C
C                       Draw grid line at each step increment
C                       in X and Y directions
      CALL GRID_DRAW (1,1)
C                       Set thickness of curve to be drawn in inches
      CALL LINE2D_THICK (0.035)
C                       Draw curve using default (linear) interpolation
      CALL CURVE2D_DRAW (X(1),Y(1),5,0)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plotlog3.f ]"
cat <<"STOP_CAT"> ././plotlog3.f
C     PROGRAM PLOTLOG3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOTLOG_DEFSX
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PLOTLOG object access program
      EXTERNAL PLOTLOG_DEFSX
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV103 =  1)
      PARAMETER (NVV104 =  2)
      PARAMETER (NVV105 =  1)
      PARAMETER (NVV106 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'PLOTLOG.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    XLOWL, TMP103, XSTEP, TMP104, YLOWL, TMP105, YCYCLE
     *      , TMP106
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
      LOGICAL TMP101, TMP102
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV103(NVV103)
      REAL    VV104(NVV104)
      REAL    VV105(NVV105)
      REAL    VV106(NVV106)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV103 /-33.33/
C
      DATA VV104 /3.33, 9.99/
C
      DATA VV105 /33.33/
C
      DATA VV106 /3.33, 9.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'plotlog_defsx.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PLOTLOG Object Demo Program #3'/
     * ' This program tests the PLOTLOG object access program'/
     * ' PLOTLOG_DEFSX.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test PLOTLOG_DEFSX object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV103 = 1,NVV103
        XLOWL = VV103(IVV103)
C
      DO 588 IVV104 = 1,NVV104
        XSTEP = VV104(IVV104)
C
      DO 587 IVV105 = 1,NVV105
        YLOWL = VV105(IVV105)
C
      DO 586 IVV106 = 1,NVV106
        YCYCLE = VV106(IVV106)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
C
C                       Define linear X and log Y coordinate system for
C                       2D plot
      CALL PLOTLOG_DEFSX (XLOWL,XSTEP,YLOWL,YCYCLE)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (LOGX .NEQV. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (LOGY .NEQV. TMP102 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) LOGX,LOGY,XLOWL,XSTEP,YLOWL,YCYCLE
  502 FORMAT (L7,L7,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  586 CONTINUE
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PLOTLOG Demo Program #3 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plotlog4.f ]"
cat <<"STOP_CAT"> ././plotlog4.f
C     PROGRAM PLOTLOG4
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOTLOG_DEFSY
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PLOTLOG object access program
      EXTERNAL PLOTLOG_DEFSY
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV103 =  1)
      PARAMETER (NVV104 =  2)
      PARAMETER (NVV105 =  1)
      PARAMETER (NVV106 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'PLOTLOG.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    XLOWL, TMP103, XSTEP, TMP104, YLOWL, TMP105, YCYCLE
     *      , TMP106
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
      LOGICAL TMP101, TMP102
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV103(NVV103)
      REAL    VV104(NVV104)
      REAL    VV105(NVV105)
      REAL    VV106(NVV106)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV103 /33.33/
C
      DATA VV104 /3.33, 9.99/
C
      DATA VV105 /-33.33/
C
      DATA VV106 /3.33, 9.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'plotlog_defsy.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PLOTLOG Object Demo Program #4'/
     * ' This program tests the PLOTLOG object access program'/
     * ' PLOTLOG_DEFSY.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test PLOTLOG_DEFSY object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV103 = 1,NVV103
        XLOWL = VV103(IVV103)
C
      DO 588 IVV104 = 1,NVV104
        XSTEP = VV104(IVV104)
C
      DO 587 IVV105 = 1,NVV105
        YLOWL = VV105(IVV105)
C
      DO 586 IVV106 = 1,NVV106
        YCYCLE = VV106(IVV106)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
C
C                       Define linear X and log Y coordinate system for
C                       2D plot
      CALL PLOTLOG_DEFSY (XLOWL,XSTEP,YLOWL,YCYCLE)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (LOGX .NEQV. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (LOGY .NEQV. TMP102 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) LOGX,LOGY,XLOWL,XSTEP,YLOWL,YCYCLE
  502 FORMAT (L7,L7,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  586 CONTINUE
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PLOTLOG Demo Program #4 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plotlog5.f ]"
cat <<"STOP_CAT"> ././plotlog5.f
C     PROGRAM PLOTLOG5
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOTLOG_DEF2X
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PLOTLOG object access program
      EXTERNAL PLOTLOG_DEF2X
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  2)
      PARAMETER (NVV103 =  2)
      PARAMETER (NVV105 =  1)
      PARAMETER (NVV106 =  1)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'PLOTLOG.INC'
C
C                       Integer variables and arrays
      INTEGER LABN3, TMP106
C
C                       Real variables and arrays
      REAL    XLOWL, TMP102, XCYCLE, TMP103, XAXIS, TMP104, XPOS, TMP107
     *      , YPOS, TMP108
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
      LOGICAL TMP101
C
C                       Character variables and arrays
      CHARACTER XLABEL*80, TMP105*80
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV102(NVV102)
      REAL    VV103(NVV103)
      CHARACTER*80 VV105(NVV105)
      INTEGER VV106(NVV106)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /3.33, 999.99/
C
      DATA VV103 /3.33, 9.99/
C
      DATA VV105 /'Log X Axis$'/
C
      DATA VV106 /100/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'plotlog_def2x.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PLOTLOG Object Demo Program #5'/
     * ' This program tests the PLOTLOG object access program'/
     * ' PLOTLOG_DEF2X.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test PLOTLOG_DEF2X object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        XLOWL = VV102(IVV102)
C
      DO 588 IVV103 = 1,NVV103
        XCYCLE = VV103(IVV103)
C
      DO 586 IVV105 = 1,NVV105
        XLABEL = VV105(IVV105)
C
      DO 585 IVV106 = 1,NVV106
        LABN3 = VV106(IVV106)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      XHIGH = XLOWL*10.0**((XPAGE-2.0)/XCYCLE)
      CALL PLOT2D_DEFINE (XLOWL, 0.0, XHIGH, 0.0, 0.0, 1.0)
C
C                       Define and draw secondary log coordinate system
C                       on X axis of 2D plot
      XAXIS = XPAGE-2.0
      XPOS = 0.0
      YPOS = YPAGE-2.0
      CALL PLOTLOG_DEF2X (XLOWL,XCYCLE,XAXIS,XLABEL,LABN3,XPOS,YPOS)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=510) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106,TMP107,TMP108
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (LOGX .NEQV. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 523
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=512) LOGX,XLOWL,XCYCLE,XAXIS,XLABEL,LABN3,XPOS,
     *       YPOS
  502 FORMAT (L7,E15.7,E15.7,E15.7,A,I21,E15.7,E15.7)
      GOTO 523
C                       Print file I/O error messages
  510 WRITE (IER,511) FILNAM
  511 FORMAT (' Error reading file ',A)
      GOTO 523
C
  512 WRITE (IER,513) FILNAM
  513 FORMAT (' Error writing file ',A)
C
  523 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  585 CONTINUE
  586 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
      CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PLOTLOG Demo Program #5 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plotlog6.f ]"
cat <<"STOP_CAT"> ././plotlog6.f
C     PROGRAM PLOTLOG6
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOTLOG_DEF2Y
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PLOTLOG object access program
      EXTERNAL PLOTLOG_DEF2Y
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  2)
      PARAMETER (NVV103 =  2)
      PARAMETER (NVV105 =  1)
      PARAMETER (NVV106 =  1)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'PLOTLOG.INC'
C
C                       Integer variables and arrays
      INTEGER LABN3, TMP106
C
C                       Real variables and arrays
      REAL    YLOWL, TMP102, YCYCLE, TMP103, YAXIS, TMP104, XPOS, TMP107
     *      , YPOS, TMP108
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
      LOGICAL TMP101
C
C                       Character variables and arrays
      CHARACTER YLABEL*80, TMP105*80
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV102(NVV102)
      REAL    VV103(NVV103)
      CHARACTER*80 VV105(NVV105)
      INTEGER VV106(NVV106)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /3.33, 999.99/
C
      DATA VV103 /3.33, 9.99/
C
      DATA VV105 /'Log Y Axis$'/
C
      DATA VV106 /100/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'plotlog_def2y.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PLOTLOG Object Demo Program #6'/
     * ' This program tests the PLOTLOG object access program'/
     * ' PLOTLOG_DEF2Y.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test PLOTLOG_DEF2Y object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        YLOWL = VV102(IVV102)
C
      DO 588 IVV103 = 1,NVV103
        YCYCLE = VV103(IVV103)
C
      DO 586 IVV105 = 1,NVV105
        YLABEL = VV105(IVV105)
C
      DO 585 IVV106 = 1,NVV106
        LABN3 = VV106(IVV106)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      YHIGH = YLOWL*10.0**((XPAGE-2.0)/YCYCLE)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, YLOWL, 0.0, YHIGH)
C
C                       Define and draw secondary log coordinate system
C                       on X axis of 2D plot
      YAXIS = YPAGE-2.0
      XPOS = XPAGE-2.0
      YPOS = 0.0
      CALL PLOTLOG_DEF2Y (YLOWL,YCYCLE,YAXIS,YLABEL,LABN3,XPOS,YPOS)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=510) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106,TMP107,TMP108
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (LOGX .NEQV. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 523
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=512) LOGX,YLOWL,YCYCLE,YAXIS,YLABEL,LABN3,XPOS,
     *       YPOS
  502 FORMAT (L7,E15.7,E15.7,E15.7,A,I21,E15.7,E15.7)
      GOTO 523
C                       Print file I/O error messages
  510 WRITE (IER,511) FILNAM
  511 FORMAT (' Error reading file ',A)
      GOTO 523
C
  512 WRITE (IER,513) FILNAM
  513 FORMAT (' Error writing file ',A)
C
  523 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  585 CONTINUE
  586 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
      CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PLOTLOG Demo Program #6 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plotlog7.f ]"
cat <<"STOP_CAT"> ././plotlog7.f
C     PROGRAM PLOTLOG7
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOTLOG_DEF2Y
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      REAL Y(10),X(10)
C                       Array to be used as a packed array
      INTEGER ISTORY(400)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Arrays defining data for curves
      DATA X/500010.0,1000000.0,2500000.0,3500000.0,4500000.0,5*0.0/
      DATA Y/1.0, 120.0, 5.0, 500.0, 10.0, 5*0.0/
C                       Limits of X and Y curve data
C                       to be used for autoscaling the plot axis
      DATA XMIN,XMAX,YMIN,YMAX/100000.0,4600000.0,1.0,980.0/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Turn off border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.15*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 1.5*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border drawing
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW TITLE FOR PLOT
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Return length of text string in inches
      XX = TEXT2D_GETLEN
     *     ('PLOTLOG7 Demo: Semi-Log Plot$',100)
C                       Compute X location at which to start plotting
C                       text string in world coordinates
      XX = 0.50*(XPG-XX)
C                       Plot the text string
      CALL TEXT2D_PDRAW
     *     ('PLOTLOG7 Demo: Semi-Log Plot$',100,XX,-YPG*0.15)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*.75)
C                       Set text font to 'cartog'
      CALL FONT_CARTOG
C                       Set X axis label for 2-D plot
      CALL AXISLBL_DEFX2 ('LINEAR X-AXIS$',100)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define 2D coordinate system using autoscaling,
C                       and draw axes, axes labels
      CALL PLOT2D_DEFINE (XMIN,0.0,XMAX,YMIN,0.0,YMAX)
C                       Compute origin (in world coords) and cycle
C                       length (in inches) for log Y axis
      CALL PLOTLOG_LMAUTO (2,YMIN,YMAX,YPG,ORIG,CYCLE)
C                       Define Y axis as secondary log axis
C                       and draw axes, axes labels
      CALL PLOTLOG_DEF2Y (ORIG,CYCLE,YPG,'LOG Y-AXIS$',100,0.0,0.0)
C
C     ------------------------------------------------------------------
C
C                       SET UP TEXT AND BLANK AREA FOR STORY PLOTTING
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*.7)
C                       Copy 1st line to packed text block
      CALL PACKARY_SETENT ('SOLID, polynomial interpolation$',ISTORY,1)
C                       Copy 2nd line to packed text block
      CALL PACKARY_SETENT ('DOT, parametric spline interpolation$',
     *           ISTORY,2)
C                       Copy 3rd line to packed text block
      CALL PACKARY_SETENT ('CHNDOT, spline interpolation$',ISTORY,3)
C                       Copy 4th line to packed text block
      CALL PACKARY_SETENT ('DASH, no interpolation$',ISTORY,4)
C                       Determine Y length of text block in inches
      YBLANK = PACKARY_HT (ISTORY,4)
C                       Determine X length of text block in inches
      XBLANK = PACKARY_WIDTH (ISTORY,4)
C                       Create, and draw frame around,
C                       blank rectangle for plotting text block
      CALL BLNKAREA_DEF1 (XPG-XBLANK-0.7, XPG-0.5,
     *            0.025*YPG, 0.025*YPG+YBLANK+0.2, 3)
C
C     ------------------------------------------------------------------
C
C                       DRAW GRID IN SUBPLOT AREA
C
C                       Set current color to 'red'
      CALL COLOR_SETNAM ('RED')
C                       Draw grid line at each step increment
C                       in X and Y directions
      CALL GRID_DRAW (1,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 1 - SOLID POLYNOMIAL
C
C                       Set 'polynomial' interpolation
      CALL CURVE2D_POLY
C                       Set current color to 'red'
      CALL COLOR_SETNAM ('GREEN')
C                       Draw curve using polynomial interpolation
      CALL CURVE2D_DRAW (X,Y,5,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 2 - DOTTED PARAMETRIC SPLINE
C
C                       Set 'parametric spline' interpolation
      CALL CURVE2D_SPLINE
C                       Set current color to 'yellow'
      CALL COLOR_SETNAM ('YELLOW')
C                       Set line style to 'dot'
      CALL LINE2D_DOT
C                       Draw curve using parametric spline interpolation
      CALL CURVE2D_DRAW (X,Y,5,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 3 - CHNDOT SPLINE
C
C                       Set 'spline' interpolation
      CALL CURVE2D_CUBIC
C                       Set current color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Set line style to 'chndot'
      CALL LINE2D_CHNDOT
C                       Draw curve using spline interpolation
      CALL CURVE2D_DRAW (X,Y,5,1)
C
C     ------------------------------------------------------------------
C
C                       PLOT CURVE 4 - DASHED LINEAR
C
C                       Reset default curve interpolation (linear)
      CALL GRAPHICS_RESET ('CURVE2D_CUBIC')
C                       Set current color to 'magenta'
      CALL COLOR_SETNAM ('MAGENTA')
C                       Set line style to 'dash'
      CALL LINE2D_DASH
C                       Draw curve using linear interpolation
      CALL CURVE2D_DRAW (X,Y,5,1)
C
C     ------------------------------------------------------------------
C
C                       DRAW TEXT BLOCK IN RESERVED BLANK AREA
C
C                       Disable area blanking in blank area 1
      CALL GRAPHICS_RESET ('BLNKAREA_DEF1')
C                       Set current color to 'foreground' (white)
      CALL COLOR_SETNAM ('FOREGROUND')
C                       Draw text block in blank area
      CALL PACKARY_DRAW (ISTORY,4,XPG-XBLANK-0.6,0.036*YPG)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plotlog_autolm.dat ]"
cat <<"STOP_CAT"> ././plotlog_autolm.uuu
begin 660 ./plotlog_autolm.dat
M("`@+CDY,#`P,#!%*S`P("`@+CDY.3`P,#!%*S`Q("`@+C@Y-3`P,#!%*S`Q
M("`@+C$P,#`P,#!%*S`P("`@+C4X-#4P,#!%*S`Q"B`@("XY.3`P,#`P12LP
M,"`@("XY.3DY,#`P12LP,B`@("XX.34P,#`P12LP,2`@("XQ,#`P,#`P12LP
M,"`@("XS.#DV-C8W12LP,0H@("`N.3DY,#`P,$4K,#$@("`N.3DY,#`P,$4K
M,#$@("`N.#DU,#`P,$4K,#$@("`N,3`P,#`P,$4K,#$@("`N-3@T-3`P,$4K
M,#$*("`@+CDY.3`P,#!%*S`Q("`@+CDY.3DP,#!%*S`R("`@+C@Y-3`P,#!%
B*S`Q("`@+C$P,#`P,#!%*S`Q("`@+C4X-#4P,#!%*S`Q"B`@
`
end
STOP_CAT
echo "  Generating =====> [ ./plotlog_def2x.dat ]"
cat <<"STOP_CAT"> ././plotlog_def2x.uuu
begin 660 ./plotlog_def2x.dat
M("`@("`@5"`@("XS,S,P,#`P12LP,2`@("XS,S,P,#`P12LP,2`@("XQ,38Y
M,#`P12LP,DQO9R!8($%X:7,D("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@,3`P("`@+C`P,#`P,#!%*S`P("`@+C@Y-3`P,#!%
M*S`Q"B`@("`@(%0@("`N,S,S,#`P,$4K,#$@("`N.3DY,#`P,$4K,#$@("`N
M,3$V.3`P,$4K,#),;V<@6"!!>&ES)"`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@(#$P,"`@("XP,#`P,#`P12LP,"`@("XX.34P
M,#`P12LP,0H@("`@("!4("`@+CDY.3DY,#!%*S`S("`@+C,S,S`P,#!%*S`Q
M("`@+C$Q-CDP,#!%*S`R3&]G(%@@07AI<R0@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`Q,#`@("`N,#`P,#`P,$4K,#`@("`N
M.#DU,#`P,$4K,#$*("`@("`@5"`@("XY.3DY.3`P12LP,R`@("XY.3DP,#`P
M12LP,2`@("XQ,38Y,#`P12LP,DQO9R!8($%X:7,D("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@,3`P("`@+C`P,#`P,#!%*S`P
0("`@+C@Y-3`P,#!%*S`Q"B`@
`
end
STOP_CAT
echo "  Generating =====> [ ./plotlog_def2y.dat ]"
cat <<"STOP_CAT"> ././plotlog_def2y.uuu
begin 660 ./plotlog_def2y.dat
M("`@("`@1B`@("XS,S,P,#`P12LP,2`@("XS,S,P,#`P12LP,2`@("XX.34P
M,#`P12LP,4QO9R!9($%X:7,D("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@,3`P("`@+C$Q-CDP,#!%*S`R("`@+C`P,#`P,#!%
M*S`P"B`@("`@($8@("`N,S,S,#`P,$4K,#$@("`N.3DY,#`P,$4K,#$@("`N
M.#DU,#`P,$4K,#%,;V<@62!!>&ES)"`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@(#$P,"`@("XQ,38Y,#`P12LP,B`@("XP,#`P
M,#`P12LP,`H@("`@("!&("`@+CDY.3DY,#!%*S`S("`@+C,S,S`P,#!%*S`Q
M("`@+C@Y-3`P,#!%*S`Q3&]G(%D@07AI<R0@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`Q,#`@("`N,3$V.3`P,$4K,#(@("`N
M,#`P,#`P,$4K,#`*("`@("`@1B`@("XY.3DY.3`P12LP,R`@("XY.3DP,#`P
M12LP,2`@("XX.34P,#`P12LP,4QO9R!9($%X:7,D("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@,3`P("`@+C$Q-CDP,#!%*S`R
0("`@+C`P,#`P,#!%*S`P"B`@
`
end
STOP_CAT
echo "  Generating =====> [ ./plotlog_defsx.dat ]"
cat <<"STOP_CAT"> ././plotlog_defsx.uuu
begin 660 ./plotlog_defsx.dat
M("`@("`@1B`@("`@(%0@("TN,S,S,S`P,$4K,#(@("`N,S,S,#`P,$4K,#$@
M("`N,S,S,S`P,$4K,#(@("`N,S,S,#`P,$4K,#$*("`@("`@1B`@("`@(%0@
M("TN,S,S,S`P,$4K,#(@("`N,S,S,#`P,$4K,#$@("`N,S,S,S`P,$4K,#(@
M("`N.3DY,#`P,$4K,#$*("`@("`@1B`@("`@(%0@("TN,S,S,S`P,$4K,#(@
M("`N.3DY,#`P,$4K,#$@("`N,S,S,S`P,$4K,#(@("`N,S,S,#`P,$4K,#$*
M("`@("`@1B`@("`@(%0@("TN,S,S,S`P,$4K,#(@("`N.3DY,#`P,$4K,#$@
>("`N,S,S,S`P,$4K,#(@("`N.3DY,#`P,$4K,#$*
`
end
STOP_CAT
echo "  Generating =====> [ ./plotlog_defsy.dat ]"
cat <<"STOP_CAT"> ././plotlog_defsy.uuu
begin 660 ./plotlog_defsy.dat
M("`@("`@5"`@("`@($8@("`N,S,S,S`P,$4K,#(@("`N,S,S,#`P,$4K,#$@
M("TN,S,S,S`P,$4K,#(@("`N,S,S,#`P,$4K,#$*("`@("`@5"`@("`@($8@
M("`N,S,S,S`P,$4K,#(@("`N,S,S,#`P,$4K,#$@("TN,S,S,S`P,$4K,#(@
M("`N.3DY,#`P,$4K,#$*("`@("`@5"`@("`@($8@("`N,S,S,S`P,$4K,#(@
M("`N.3DY,#`P,$4K,#$@("TN,S,S,S`P,$4K,#(@("`N,S,S,#`P,$4K,#$*
M("`@("`@5"`@("`@($8@("`N,S,S,S`P,$4K,#(@("`N.3DY,#`P,$4K,#$@
>("TN,S,S,S`P,$4K,#(@("`N.3DY,#`P,$4K,#$*
`
end
STOP_CAT
echo "  Generating =====> [ ./plotpolr1.f ]"
cat <<"STOP_CAT"> ././plotpolr1.f
C     PROGRAM PLOTPOLR1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOTPOLR_DEFINE
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PLOTPOLR object access program
      EXTERNAL PLOTPOLR_DEFINE
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV103 =  2)
      PARAMETER (NVV104 =  2)
      PARAMETER (NVV105 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'PLOTPOLR.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    SPARE1, TMP102, RINCR, TMP103, XPOS, TMP104, YPOS, TMP105
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
      LOGICAL TMP101
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV103(NVV103)
      REAL    VV104(NVV104)
      REAL    VV105(NVV105)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV103 /3.33, 9.99/
C
      DATA VV104 /0.0, 4.99/
C
      DATA VV105 /0.0, 4.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'plotpolr_define.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PLOTPOLR Object Demo Program #1'/
     * ' This program tests the PLOTPOLR object access program'/
     * ' PLOTPOLR_DEFINE.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test PLOTPOLR_DEFINE object access program
C
C                       Loop for each input variable of access program
      DO 588 IVV103 = 1,NVV103
        RINCR = VV103(IVV103)
C
      DO 587 IVV104 = 1,NVV104
        XPOS = VV104(IVV104)
C
      DO 586 IVV105 = 1,NVV105
        YPOS = VV105(IVV105)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
C
C                       Define polar coordinate system and draw axes for
C                       3D plot
      SPARE1 = 0.0
      CALL PLOTPOLR_DEFINE (SPARE1,RINCR,XPOS,YPOS)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (PCOORD .NEQV. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) PCOORD,SPARE1,RINCR,XPOS,YPOS
  502 FORMAT (L7,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  586 CONTINUE
  587 CONTINUE
  588 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PLOTPOLR Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plotpolr2.f ]"
cat <<"STOP_CAT"> ././plotpolr2.f
C     PROGRAM PLOTPOLR2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOTPOLR_SETROF
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PLOTPOLR object access program
      EXTERNAL PLOTPOLR_SETROF
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  5)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'PLOTPOLR.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, ORG, TMP102
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV102(NVV102)
C
      DIMENSION THETA(101), R(101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /-1.0, -3.33, 0.0, 3.33, 4.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'plotpolr_setrof.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              PLOTPOLR Object Demo Program #2'/
     * ' This program tests the PLOTPOLR object access program'/
     * ' PLOTPOLR_SETROF.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test PLOTPOLR_SETROF object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        ORG = VV102(IVV102)
C
C                       COMPUTE THE POLAR COORDINATES OF THE CURVE
C                       TO BE DRAWN
C
C                       Loop for each point
      DO 50 I=1,100
C                       Compute angular coordinate of point
        THETA(I) = FLOAT(I)*3.6
C                       Compute radial corrdinate of point
        R(I) = ABS(SIN(THETA(I)*3.14159/360.))
C                       Repeat for next point
  50  CONTINUE
C                       Close the curve by setting the last point
C                       equal to the first
      R(101) = R(1)
      THETA(101) = THETA(1)
C
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      XPG = XPAGE-2.0
      YPG = YPAGE-2.0
      CALL SUBPLOT_DEFINE (XPG,YPG)
      CALL AXISLBL_DEFX2 (' X - AXIS $',100)
      CALL AXISLBL_DEFY2 (' Y - AXIS $',100)
C
C                       Define non-zero radius at origin of polar
C                       coordinate system
      CALL PLOTPOLR_SETROF (ORG)
C
      CALL PLOTPOLR_DEFINE (3.14159/180.0, 1.0, XPG/2.0, YPG/2.0)
      CALL GRID_DRAW (1,1)
      CALL LINE2D_THICK (.05)
      CALL CURVE2D_DRAW (THETA,R,101,10)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(PORG ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) PORG,ORG
  502 FORMAT (E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              PLOTPOLR Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plotpolr3.f ]"
cat <<"STOP_CAT"> ././plotpolr3.f
C     PROGRAM PLOTPOLR3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOTPOLR_DEFINE
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      DIMENSION THETA(101), R(101)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C     ******************************************************************
C
C                       COMPUTE THE POLAR COORDINATES OF THE CURVE
C                       TO BE DRAWN
C
C                       Loop for each point
      DO 50 I=1,100
C                       Compute angular coordinate of point
        THETA(I) = FLOAT(I)*3.6
C                       Compute radial corrdinate of point
        R(I) = ABS(SIN(THETA(I)*3.14159/360.))
C                       Repeat for next point
  50  CONTINUE
C                       Close the curve by setting the last point
C                       equal to the first
      R(101) = R(1)
      THETA(101) = THETA(1)
C
C     ******************************************************************
C
C                       INITIALIZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Set hardware clipping
      CALL DEVICE_CLIPON
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Disable border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Compute location of physical origin in inches
C                       so that plot will be centered on the page
      XRL = 0.10*XPAGE
      YRL = 0.15*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 2.0*YRL
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches (border plotting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW TITLE UNDER SUBPLOT AREA
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('PLOTPOLR3 Demo: Polar Plot$',100)
C                       Compute X coord of start of string in inches
      XX = 0.50*(XPG-XX)
C                       Plot text string
      CALL TEXT2D_PDRAW ('PLOTPOLR3 Demo: Polar Plot$',100,XX,-YPG*0.10)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.90)
C                       Set text style to 'duplex'
      CALL FONT_DUPLEX
C                       Set X axis label for 2-D plot
      CALL AXISLBL_DEFX2 (' X - AXIS $',100)
C                       Set Y axis label for 2-D plot
      CALL AXISLBL_DEFY2 (' Y - AXIS $',100)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       DRAW THE CURVE IN POLAR COORDNATES
C
C                       Define a reference radius of -1.0
C                       at the polar origin
      CALL PLOTPOLR_SETROF (-1.0)
C                       Define and draw polar axis and
C                       axis numbers, labels
      CALL PLOTPOLR_DEFINE (3.14159/180.0, 1.0, XPG/2.0, YPG/2.0)
C                       Draw grid line at every step increment radially
C                       and at every 10 degrees of angle rotationally
      CALL GRID_DRAW (1,1)
C
C                       Increase curve thickness to 0.03 inch
      CALL LINE2D_THICK (.03)
C                       Draw curve using default (linear) interpolation
      CALL CURVE2D_DRAW (THETA,R,101,10)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./plotpolr_define.dat ]"
cat <<"STOP_CAT"> ././plotpolr_define.uuu
begin 660 ./plotpolr_define.dat
M("`@("`@5"`@("XP,#`P,#`P12LP,"`@("XS,S,P,#`P12LP,2`@("XP,#`P
M,#`P12LP,"`@("XP,#`P,#`P12LP,`H@("`@("!4("`@+C`P,#`P,#!%*S`P
M("`@+C,S,S`P,#!%*S`Q("`@+C`P,#`P,#!%*S`P("`@+C0Y.3`P,#!%*S`Q
M"B`@("`@(%0@("`N,#`P,#`P,$4K,#`@("`N,S,S,#`P,$4K,#$@("`N-#DY
M,#`P,$4K,#$@("`N,#`P,#`P,$4K,#`*("`@("`@5"`@("XP,#`P,#`P12LP
M,"`@("XS,S,P,#`P12LP,2`@("XT.3DP,#`P12LP,2`@("XT.3DP,#`P12LP
M,0H@("`@("!4("`@+C`P,#`P,#!%*S`P("`@+CDY.3`P,#!%*S`Q("`@+C`P
M,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P"B`@("`@(%0@("`N,#`P,#`P,$4K
M,#`@("`N.3DY,#`P,$4K,#$@("`N,#`P,#`P,$4K,#`@("`N-#DY,#`P,$4K
M,#$*("`@("`@5"`@("XP,#`P,#`P12LP,"`@("XY.3DP,#`P12LP,2`@("XT
M.3DP,#`P12LP,2`@("XP,#`P,#`P12LP,`H@("`@("!4("`@+C`P,#`P,#!%
M*S`P("`@+CDY.3`P,#!%*S`Q("`@+C0Y.3`P,#!%*S`Q("`@+C0Y.3`P,#!%
$*S`Q"B`@
`
end
STOP_CAT
echo "  Generating =====> [ ./plotpolr_setrof.dat ]"
cat <<"STOP_CAT"> ././plotpolr_setrof.uuu
begin 660 ./plotpolr_setrof.dat
M("`M+C$P,#`P,#!%*S`Q("`M+C$P,#`P,#!%*S`Q"B`@+2XS,S,P,#`P12LP
M,2`@+2XS,S,P,#`P12LP,0H@("`N,#`P,#`P,$4K,#`@("`N,#`P,#`P,$4K
M,#`*("`@+C,S,S`P,#!%*S`Q("`@+C,S,S`P,#!%*S`Q"B`@("XT.3DP,#`P
412LP,2`@("XT.3DP,#`P12LP,0H@
`
end
STOP_CAT
echo "  Generating =====> [ ./plotspher1.f ]"
cat <<"STOP_CAT"> ././plotspher1.f
C     PROGRAM PLOTSPHER1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PLOTSPHER_DEFINE
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       Arrays for storing plot curve data
      DIMENSION P(180), T(180), R(180)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       COMPUTE DATA FOR SPHERICAL PLOT
C
C                       Initial value of X-Y projection angle, degrees
      PHI = 0.0
C                       Initial value of elevation angle, degrees
      THETA = -90.0
C                       Initial value of radius, distance units
      RAD = 180.
C                       Loop for each point of plot curve
      DO 1 I=1,180
C                       Store of X-Y projection angle of point, degrees
        P(I) = PHI
C                       Store elevation angle of point, degrees
        T(I) = THETA
C                       Store radius value of point, distance units
        R(I) = RAD
C                       Compute X-Y projection angle of next point
        PHI = PHI + 18.0
C                       Compute elevation angle of next point
        THETA = THETA + 1.0
C                       Compute radius value of next point
        RAD = RAD - 1.0
C                       Repeat for each point of plot curve
   1  CONTINUE
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Define location of physical origin relative
C                       to lower left corner of page
      CALL ORIGIN_SET (0.0,0.0)
C                       Disable border plotting by SUBPLOT_DEFINE
      CALL FRAME_OFF
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.25*XPAGE
      YRL = 0.15*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 1.0*YRL
C                       Move physical origin relative to current
C                       location  (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Set multiplication factors for subplot blowup
      CALL SUBPLOT_SCALE (1.5, 1.5)
C                       Set translation factors for subplot
      CALL SUBPLOT_SHIFT (-XPAGE*.3, -YPAGE*.3)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches  (border plottting
C                       disabled by previous call to FRAME_OFF)
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW PLOT TITLE
C
C                       Compute text height based on page height
      SIZE = 0.20*YPAGE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Set text font to 'cartog'
      CALL FONT_CARTOG
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('PLOTSPHER1 Demo: Spherical 3D Plot$',100)
C                       Compute X coordinate in inches to center title
      XX = 0.50* (XPG-XX)
C                       Draw plot title under subplot area
      CALL TEXT2D_PDRAW
     *     ('PLOTSPHER1 Demo: Spherical 3D Plot$',100,XX,YPG*.15)
C                       Restore text style to default
      CALL GRAPHICS_RESET ('FONT_CARTOG')
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.8)
C                       Define X axis label
      CALL AXISLBL_DEFX3 (' X - AXIS $',100)
C                       Define Y axis label
      CALL AXISLBL_DEFY3 (' Y - AXIS $',100)
C                       Define Z axis label
      CALL AXISLBL_DEFZ3 (' Z - AXIS $',100)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Define workbox dimensions for 3D coord system
      CALL WORKBOX_DEFINE (6.0,6.0,7.0)
C                       Set 3D viewpoint, world coordinates
C                       Phi = -135 deg, Theta = 30 deg, R = 5000
      CALL VIEWPT_SETWC (-135.0,30.0,5000.0)
C                       Set integer axis numbering for all 3 axes
      CALL AXISNUM_INTALL
C                       Define 3D sperical coordinate system with
C                       radius step size = 50., draw axes, axes labels
      CALL PLOTSPHER_DEFINE
     *     (3.14159/180.0, 3.14159/180.0, 50.0, 3.0, 3.0, 5.0)
C
C                       Set polynomial interpolation
      CALL CURVE2D_POLY
C                       Set color to green
      CALL COLOR_SETNAM ('GREE')
C                       Draw 3D curve using polynomial interpolation
C                       in 3D spherical coordinate system
      CALL CURVE3D_DRAW (P,T,R,180,0)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./prl1.f ]"
cat <<"STOP_CAT"> ././prl1.f
C     PROGRAM PRL1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PRL_LIBVER
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      INTRINSIC INDEX,LEN
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       POSIX object access programs
      EXTERNAL POSIX_INIT
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C     ------------------------------------------------------------------
C
      PARAMETER (MAXVER=9)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERSQ(MAXVER)
      CHARACTER*80 STRING
C
C                       Required PRL version number (update DATA value
C                       when program updated to new version of library)
      DATA VERSQ /'0.7     ',
     2            '0.6     ',
     3            '0.6.10  ',
     4            '0.7.1   ',
     5            '0.8     ',
     6            '0.8.1   ',
     9            '1.6     ',
     7            '1.7     ',
     8            '1.8     '/
C
C     ******************************************************************
C
C                       STEP 1 - Initialize library
C
      CALL POSIX_INIT (0)
C
C     ******************************************************************
C
C                       Write demo program introduction message
C
C                       Write intro message
C                       (use * for logical unit since TERM_SETSIO will
C                       not be called in this demo)
      WRITE (*,401)
  401 FORMAT (
     * '                   PRL "PRL1" Object Demo Program'//
     * ' PRL_LIBVER should be used to check the version of the'/
     * ' Programmer''s Reusable Library being used and print the'/
     * ' following types of WARNING or ERROR messages if the'/
     * ' version is not correct.')
C
C     ******************************************************************
C
C                       STEP 2 - Check PRL version
C
C                       Loop for each test case
      DO 200 IVER=1,MAXVER
C
C                       Get actual PRL version being used
C                       but do not perform check
      CALL PRL_LIBVER (VERAQ,' ')
C
C                       Compare actual & required major release numbers
      LOCAQ = INDEX (VERAQ,'.')
      LOCRQ = INDEX (VERSQ(IVER),'.')
      LENAQ = LEN (VERAQ)
      LENRQ = LEN (VERSQ(IVER))
      IF (VERAQ(1:LOCAQ) .NE. VERSQ(IVER)(1:LOCRQ)) THEN
        WRITE (*,213) VERAQ,VERSQ(IVER)
  213   FORMAT (/
     *  ' SAMPLE MESSAGE FOR INCORRECT LIBRARY VERSION:'/
     *  ' ERROR: Incompatible version of Programmer''s Reusable Library'
     *  /' Program is using version ',A,'but requires version ',A)
        GOTO 200
C
C                       Compare actual & reqd secondary release numbers
      ELSE IF (VERAQ(LOCAQ+1:LENAQ) .LT.
     *         VERSQ(IVER)(LOCRQ+1:LENRQ)) THEN
        WRITE (*,223) VERAQ,VERSQ(IVER)
  223   FORMAT (/
     *   ' SAMPLE MESSAGE FOR OUT-OF-DATE LIBRARY VERSION:'/
     *   ' WARNING: Old version of Programmer''s Reusable Library'/
     *   ' Program is using version ',A,'but requires version ',A)
C                       Print message for acceptable version
      ELSE
        WRITE (*,233) VERAQ,VERSQ(IVER)
  233   FORMAT (/
     *   ' NO MESSAGE PRINTED WHEN LIBRARY VERSION IS ACCEPTABLE:'/
     *   ' (Program is using version ',A,'and requires version ',A,' )')
      ENDIF
  200 CONTINUE
C
C     ******************************************************************
C
C                       STEP 5 - Terminate program execution
C                       Wait until user presses a key before exiting
C
      WRITE (*,810)
  810 FORMAT (/
     * '                 Demo Program PRL1 Execution Completed'/
     * '                         Press <CR> to exit demo')
      READ (*,811) STRING
  811 FORMAT (A)
C                       Exit demo
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./process1.f ]"
cat <<"STOP_CAT"> ././process1.f
C     PROGRAM PROCESS1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program PROCESS_EXIT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       POSIX object access programs
      EXTERNAL POSIX_INIT
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C     ------------------------------------------------------------------
C
      CHARACTER*80 STRING
C
C     ******************************************************************
C
C                       STEP 1 - Initialize library
C
      CALL POSIX_INIT (0)
C
C     ******************************************************************
C
C                       Write demo program introduction message
C
C                       Write intro message
C                       (use * for logical unit since TERM_SETSIO will
C                       not be called in this demo)
      WRITE (*,401)
  401 FORMAT (
     * '                PRL-POSIX "PROCESS" Object Demo Program #1'//
     * ' PROCESS_EXIT may be used to terminate execution of programs'/
     * ' that use the PRL-POSIX library.  PROCESS_EXIT will be used'/
     * ' to exit from this demo after you press the Carriage Return'/
     * ' or Enter key <CR>.')
C
C     ******************************************************************
C
C                       STEP 5 - Terminate program execution
C                       Wait until user presses a key before exiting
C
      WRITE (*,810)
  810 FORMAT (/
     * '                 Demo Program PROCESS1 Execution Completed'/
     * '                         Press <CR> to exit demo')
      READ (*,811) STRING
  811 FORMAT (A)
C                       Exit demo
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./real1.f ]"
cat <<"STOP_CAT"> ././real1.f
C     PROGRAM REAL1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program REAL_WDRAWR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       REAL object access program
      EXTERNAL REAL_WDRAWR
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  4)
      PARAMETER (NVV102 =  6)
      PARAMETER (NVV103 =  1)
      PARAMETER (NVV104 =  1)
      PARAMETER (NVV105 =  4)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IPLACE, TMP102, LREL, TMP105
C
C                       Real variables and arrays
      REAL    ANUM, TMP101, XVAL, TMP103, YVAL, TMP104
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      INTEGER VV102(NVV102)
      REAL    VV103(NVV103)
      REAL    VV104(NVV104)
      INTEGER VV105(NVV105)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-9.99999E-13, -9.99999, 0.0, 9.99999E13/
C
      DATA VV102 /6, 30, 106, 130, -30, -6/
C
      DATA VV103 /0.2/
C
      DATA VV104 /0.2/
C
      DATA VV105 /0, 1, 2, 3/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'realnum_wdrawr.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REAL Object Demo Program #1'/
     * ' This program tests the REAL object access program'/
     * ' REAL_WDRAWR.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test REAL_WDRAWR object access program
C
C                       Loop for each input variable of access program
      DO 588 IVV102 = 1,NVV102
        IPLACE = VV102(IVV102)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
      DO 585 IVV105 = 1,NVV105
        LREL = VV105(IVV105)
        ANUM = VV101(IVV105)
C
        XVAL = VV103(1)
        YVAL = VV104(1)
C
C                       Draw real number relative to current location or
C                       origin in world coordinates
      CALL REAL_WDRAWR (ANUM,IPLACE,XVAL,YVAL,LREL)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ANUM,IPLACE,XVAL,YVAL,LREL
  502 FORMAT (E15.7,I21,E15.7,E15.7,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  585 CONTINUE
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
  588 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              REAL Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./real2.f ]"
cat <<"STOP_CAT"> ././real2.f
C     PROGRAM REAL2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program REAL_WDRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       REAL object access program
      EXTERNAL REAL_WDRAW
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  4)
      PARAMETER (NVV102 =  6)
      PARAMETER (NVV103 =  2)
      PARAMETER (NVV104 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IPLACE, TMP102
C
C                       Real variables and arrays
      REAL    ANUM, TMP101, XVAL, TMP103, YVAL, TMP104
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      INTEGER VV102(NVV102)
      REAL    VV103(NVV103)
      REAL    VV104(NVV104)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-9.99999E-13, -9.99999, 0.0, 9.99999E13/
C
      DATA VV102 /6, 20, 106, 120, -20, -6/
C
      DATA VV103 /0.1, 0.7/
C
      DATA VV104 /0.1, 0.7/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'realnum_wdraw.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REAL Object Demo Program #2'/
     * ' This program tests the REAL object access program'/
     * ' REAL_WDRAW.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test REAL_WDRAW object access program
C
C                       Loop for each input variable of access program
      DO 588 IVV102 = 1,NVV102
        IPLACE = VV102(IVV102)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
      IVV101 = 0
C
      DO 587 IVV103 = 1,NVV103
        XVAL = VV103(IVV103)
C
      DO 586 IVV104 = 1,NVV104
        YVAL = VV104(IVV104)
        IVV101 = IVV101+1
        ANUM = VV101(IVV101)
C
C                       Draw real number relative to origin in world
C                       coordinates
      CALL REAL_WDRAW (ANUM,IPLACE,XVAL,YVAL)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ANUM,IPLACE,XVAL,YVAL
  502 FORMAT (E15.7,I21,E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  586 CONTINUE
  587 CONTINUE
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
  588 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              REAL Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./realnum_wdraw.dat ]"
cat <<"STOP_CAT"> ././realnum_wdraw.uuu
begin 660 ./realnum_wdraw.dat
M("`M+CDY.3DY.3!%+3$R("`@("`@("`@("`@("`@("`@("`V("`@+C$P,#`P
M,#!%*S`P("`@+C$P,#`P,#!%*S`P"B`@+2XY.3DY.3DP12LP,2`@("`@("`@
M("`@("`@("`@("`@-B`@("XQ,#`P,#`P12LP,"`@("XW,#`P,#`P12LP,`H@
M("`N,#`P,#`P,$4K,#`@("`@("`@("`@("`@("`@("`@(#8@("`N-S`P,#`P
M,$4K,#`@("`N,3`P,#`P,$4K,#`*("`@+CDY.3DY.3!%*S$T("`@("`@("`@
M("`@("`@("`@("`V("`@+C<P,#`P,#!%*S`P("`@+C<P,#`P,#!%*S`P"B`@
M+2XY.3DY.3DP12TQ,B`@("`@("`@("`@("`@("`@("`R,"`@("XQ,#`P,#`P
M12LP,"`@("XQ,#`P,#`P12LP,`H@("TN.3DY.3DY,$4K,#$@("`@("`@("`@
M("`@("`@("`@,C`@("`N,3`P,#`P,$4K,#`@("`N-S`P,#`P,$4K,#`*("`@
M+C`P,#`P,#!%*S`P("`@("`@("`@("`@("`@("`@(#(P("`@+C<P,#`P,#!%
M*S`P("`@+C$P,#`P,#!%*S`P"B`@("XY.3DY.3DP12LQ-"`@("`@("`@("`@
M("`@("`@("`R,"`@("XW,#`P,#`P12LP,"`@("XW,#`P,#`P12LP,`H@("TN
M.3DY.3DY,$4M,3(@("`@("`@("`@("`@("`@("`Q,#8@("`N,3`P,#`P,$4K
M,#`@("`N,3`P,#`P,$4K,#`*("`M+CDY.3DY.3!%*S`Q("`@("`@("`@("`@
M("`@("`@,3`V("`@+C$P,#`P,#!%*S`P("`@+C<P,#`P,#!%*S`P"B`@("XP
M,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@(#$P-B`@("XW,#`P,#`P12LP
M,"`@("XQ,#`P,#`P12LP,`H@("`N.3DY.3DY,$4K,30@("`@("`@("`@("`@
M("`@("`Q,#8@("`N-S`P,#`P,$4K,#`@("`N-S`P,#`P,$4K,#`*("`M+CDY
M.3DY.3!%+3$R("`@("`@("`@("`@("`@("`@,3(P("`@+C$P,#`P,#!%*S`P
M("`@+C$P,#`P,#!%*S`P"B`@+2XY.3DY.3DP12LP,2`@("`@("`@("`@("`@
M("`@(#$R,"`@("XQ,#`P,#`P12LP,"`@("XW,#`P,#`P12LP,`H@("`N,#`P
M,#`P,$4K,#`@("`@("`@("`@("`@("`@("`Q,C`@("`N-S`P,#`P,$4K,#`@
M("`N,3`P,#`P,$4K,#`*("`@+CDY.3DY.3!%*S$T("`@("`@("`@("`@("`@
M("`@,3(P("`@+C<P,#`P,#!%*S`P("`@+C<P,#`P,#!%*S`P"B`@+2XY.3DY
M.3DP12TQ,B`@("`@("`@("`@("`@("`@("TR,"`@("XQ,#`P,#`P12LP,"`@
M("XQ,#`P,#`P12LP,`H@("TN.3DY.3DY,$4K,#$@("`@("`@("`@("`@("`@
M("`M,C`@("`N,3`P,#`P,$4K,#`@("`N-S`P,#`P,$4K,#`*("`@+C`P,#`P
M,#!%*S`P("`@("`@("`@("`@("`@("`@+3(P("`@+C<P,#`P,#!%*S`P("`@
M+C$P,#`P,#!%*S`P"B`@("XY.3DY.3DP12LQ-"`@("`@("`@("`@("`@("`@
M("TR,"`@("XW,#`P,#`P12LP,"`@("XW,#`P,#`P12LP,`H@("TN.3DY.3DY
M,$4M,3(@("`@("`@("`@("`@("`@("`@+38@("`N,3`P,#`P,$4K,#`@("`N
M,3`P,#`P,$4K,#`*("`M+CDY.3DY.3!%*S`Q("`@("`@("`@("`@("`@("`@
M("TV("`@+C$P,#`P,#!%*S`P("`@+C<P,#`P,#!%*S`P"B`@("XP,#`P,#`P
M12LP,"`@("`@("`@("`@("`@("`@("`M-B`@("XW,#`P,#`P12LP,"`@("XQ
M,#`P,#`P12LP,`H@("`N.3DY.3DY,$4K,30@("`@("`@("`@("`@("`@("`@
A+38@("`N-S`P,#`P,$4K,#`@("`N-S`P,#`P,$4K,#`*
`
end
STOP_CAT
echo "  Generating =====> [ ./realnum_wdrawr.dat ]"
cat <<"STOP_CAT"> ././realnum_wdrawr.uuu
begin 660 ./realnum_wdrawr.dat
M("`M+CDY.3DY.3!%+3$R("`@("`@("`@("`@("`@("`@("`V("`@+C(P,#`P
M,#!%*S`P("`@+C(P,#`P,#!%*S`P("`@("`@("`@("`@("`@("`@("`P"B`@
M+2XY.3DY.3DP12LP,2`@("`@("`@("`@("`@("`@("`@-B`@("XR,#`P,#`P
M12LP,"`@("XR,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@("`@,0H@("`N
M,#`P,#`P,$4K,#`@("`@("`@("`@("`@("`@("`@(#8@("`N,C`P,#`P,$4K
M,#`@("`N,C`P,#`P,$4K,#`@("`@("`@("`@("`@("`@("`@(#(*("`@+CDY
M.3DY.3!%*S$T("`@("`@("`@("`@("`@("`@("`V("`@+C(P,#`P,#!%*S`P
M("`@+C(P,#`P,#!%*S`P("`@("`@("`@("`@("`@("`@("`S"B`@+2XY.3DY
M.3DP12TQ,B`@("`@("`@("`@("`@("`@("`S,"`@("XR,#`P,#`P12LP,"`@
M("XR,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@("`@,`H@("TN.3DY.3DY
M,$4K,#$@("`@("`@("`@("`@("`@("`@,S`@("`N,C`P,#`P,$4K,#`@("`N
M,C`P,#`P,$4K,#`@("`@("`@("`@("`@("`@("`@(#$*("`@+C`P,#`P,#!%
M*S`P("`@("`@("`@("`@("`@("`@(#,P("`@+C(P,#`P,#!%*S`P("`@+C(P
M,#`P,#!%*S`P("`@("`@("`@("`@("`@("`@("`R"B`@("XY.3DY.3DP12LQ
M-"`@("`@("`@("`@("`@("`@("`S,"`@("XR,#`P,#`P12LP,"`@("XR,#`P
M,#`P12LP,"`@("`@("`@("`@("`@("`@("`@,PH@("TN.3DY.3DY,$4M,3(@
M("`@("`@("`@("`@("`@("`Q,#8@("`N,C`P,#`P,$4K,#`@("`N,C`P,#`P
M,$4K,#`@("`@("`@("`@("`@("`@("`@(#`*("`M+CDY.3DY.3!%*S`Q("`@
M("`@("`@("`@("`@("`@,3`V("`@+C(P,#`P,#!%*S`P("`@+C(P,#`P,#!%
M*S`P("`@("`@("`@("`@("`@("`@("`Q"B`@("XP,#`P,#`P12LP,"`@("`@
M("`@("`@("`@("`@(#$P-B`@("XR,#`P,#`P12LP,"`@("XR,#`P,#`P12LP
M,"`@("`@("`@("`@("`@("`@("`@,@H@("`N.3DY.3DY,$4K,30@("`@("`@
M("`@("`@("`@("`Q,#8@("`N,C`P,#`P,$4K,#`@("`N,C`P,#`P,$4K,#`@
M("`@("`@("`@("`@("`@("`@(#,*("`M+CDY.3DY.3!%+3$R("`@("`@("`@
M("`@("`@("`@,3,P("`@+C(P,#`P,#!%*S`P("`@+C(P,#`P,#!%*S`P("`@
M("`@("`@("`@("`@("`@("`P"B`@+2XY.3DY.3DP12LP,2`@("`@("`@("`@
M("`@("`@(#$S,"`@("XR,#`P,#`P12LP,"`@("XR,#`P,#`P12LP,"`@("`@
M("`@("`@("`@("`@("`@,0H@("`N,#`P,#`P,$4K,#`@("`@("`@("`@("`@
M("`@("`Q,S`@("`N,C`P,#`P,$4K,#`@("`N,C`P,#`P,$4K,#`@("`@("`@
M("`@("`@("`@("`@(#(*("`@+CDY.3DY.3!%*S$T("`@("`@("`@("`@("`@
M("`@,3,P("`@+C(P,#`P,#!%*S`P("`@+C(P,#`P,#!%*S`P("`@("`@("`@
M("`@("`@("`@("`S"B`@+2XY.3DY.3DP12TQ,B`@("`@("`@("`@("`@("`@
M("TS,"`@("XR,#`P,#`P12LP,"`@("XR,#`P,#`P12LP,"`@("`@("`@("`@
M("`@("`@("`@,`H@("TN.3DY.3DY,$4K,#$@("`@("`@("`@("`@("`@("`M
M,S`@("`N,C`P,#`P,$4K,#`@("`N,C`P,#`P,$4K,#`@("`@("`@("`@("`@
M("`@("`@(#$*("`@+C`P,#`P,#!%*S`P("`@("`@("`@("`@("`@("`@+3,P
M("`@+C(P,#`P,#!%*S`P("`@+C(P,#`P,#!%*S`P("`@("`@("`@("`@("`@
M("`@("`R"B`@("XY.3DY.3DP12LQ-"`@("`@("`@("`@("`@("`@("TS,"`@
M("XR,#`P,#`P12LP,"`@("XR,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@
M("`@,PH@("TN.3DY.3DY,$4M,3(@("`@("`@("`@("`@("`@("`@+38@("`N
M,C`P,#`P,$4K,#`@("`N,C`P,#`P,$4K,#`@("`@("`@("`@("`@("`@("`@
M(#`*("`M+CDY.3DY.3!%*S`Q("`@("`@("`@("`@("`@("`@("TV("`@+C(P
M,#`P,#!%*S`P("`@+C(P,#`P,#!%*S`P("`@("`@("`@("`@("`@("`@("`Q
M"B`@("XP,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@("`M-B`@("XR,#`P
M,#`P12LP,"`@("XR,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@("`@,@H@
M("`N.3DY.3DY,$4K,30@("`@("`@("`@("`@("`@("`@+38@("`N,C`P,#`P
J,$4K,#`@("`N,C`P,#`P,$4K,#`@("`@("`@("`@("`@("`@("`@(#,*
`
end
STOP_CAT
echo "  Generating =====> [ ./skeleton.f ]"
cat <<"STOP_CAT"> ././skeleton.f
C     PROGRAM SKELETON
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate use of PRL-PLOT library
C
C     LOCAL VARIABLES:
C
C
C     NOTES:
C       1. This is a program skeleton that may be used for development
C          of any program that uses the PRL-PLOT library.  Customize
C          to your needs by retaining desired lines.
C
C       2. Steps 1 through 2 must be performed first in sequence, and
C          step 13 must be performed last.  Other steps may be mixed
C          as necessary.
C
C     ******************************************************************
C
C     INTRINSIC
C
C                       AXISLBL object access programs
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFX3, AXISLBL_DEFY2
     *        , AXISLBL_DEFY3, AXISLBL_DEFZ3
C
C                       AXISNUM object access programs
      EXTERNAL AXISNUM_EXPX, AXISNUM_EXPY, AXISNUM_EXPZ, AXISNUM_INTALL
     *        , AXISNUM_INTX, AXISNUM_INTY, AXISNUM_INTZ, AXISNUM_ROTX
     *        , AXISNUM_ROTY, AXISNUM_XOFF, AXISNUM_YOFF, AXISNUM_ZOFF
C
C                       AXISSCALE object access programs
      EXTERNAL AXISSCALE_ALGOR, AXISSCALE_SAUTO, AXISSCALE_MAUTO
     *        , AXISSCALE_CROSS
C
C                       AXISTICK object access programs
      EXTERNAL AXISTICK_LOFF, AXISTICK_REVX, AXISTICK_REVY
     *        , AXISTICK_REVZ, AXISTICK_SETMAX, AXISTICK_SETX
     *        , AXISTICK_SETY, AXISTICK_SETZ
C
C                       BARCHART object access programs
      EXTERNAL BARCHART_BLNKON, BARCHART_DEFLBL, BARCHART_DRAW
     *        , BARCHART_SETCLR, BARCHART_SETGRP, BARCHART_THICK
C
C                       CURVE2D object access programs
      EXTERNAL CURVE2D_CUBIC, CURVE2D_DRAW, CURVE2D_POLY, CURVE2D_SPLINE
C
C                       CURVE3D object access programs
      EXTERNAL CURVE3D_DRAW
C
C                       DEVICE object access programs
      EXTERNAL DEVICE_END, DEVICE_SELECT
C
C                       FILLAREA object access programs
      EXTERNAL FILLAREA_2AXIS, FILLAREA_2CRV, FILLAREA_POLYG
     *        , FILLAREA_SETPAT
C
C                       GRID object access programs
      EXTERNAL GRID_DRAW
C
C                       INT object access programs
      EXTERNAL INT_WDRAWR, INT_WDRAW
C
C                       LEGEND object access programs
      EXTERNAL LEGEND_DRAW, LEGEND_DRAWR, LEGEND_ENTOFF, LEGEND_ENTON
     *        , LEGEND_HT, LEGEND_ON, LEGEND_SETHDG, LEGEND_SETVSP
     *        , LEGEND_WIDTH
      REAL LEGEND_HT, LEGEND_WIDTH
C
C                       LOCATOR object access programs
      EXTERNAL LOCATOR_GET
C
C                       LOGPEN2 object access programs
      EXTERNAL LOGPEN2_GETW2
C
C                       ORIGIN object access programs
      EXTERNAL ORIGIN_SET
C
C                       PACKARY object access programs
      EXTERNAL PACKARY_DRAW, PACKARY_DRAWR, PACKARY_GETMAX, PACKARY_HT
     *        , PACKARY_SETENT, PACKARY_WIDTH
      INTEGER PACKARY_GETMAX
      REAL PACKARY_HT, PACKARY_WIDTH
C
C                       PAGE object access programs
      EXTERNAL PAGE_CVXWC, PAGE_CVYWC, PAGE_END, PAGE_SIZE
      REAL PAGE_CVXWC, PAGE_CVYWC
C
C                       PIECHART object access programs
      EXTERNAL PIECHART_DEFLBL, PIECHART_DRAW, PIECHART_SETANG
     *        , PIECHART_SETCLR, PIECHART_SETDIA, PIECHART_SETROF
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       PLOT2D object access programs
      EXTERNAL PLOT2D_DEFINE, PLOT2D_DEF2X, PLOT2D_DEF2Y
C
C                       PLOT3D object access programs
      EXTERNAL PLOT3D_DEFINE, PLOT3D_PRJOFF, PLOT3D_PRJON
C
C                       PLOTLOG object access programs
      EXTERNAL PLOTLOG_LMAUTO, PLOTLOG_DEFINE, PLOTLOG_DEFSX
     *        , PLOTLOG_DEFSY, PLOTLOG_DEF2X, PLOTLOG_DEF2Y
C
C                       PLOTPOLR object access programs
      EXTERNAL PLOTPOLR_DEFINE, PLOTPOLR_SETROF
C
C                       PLOTSPHER object access programs
      EXTERNAL PLOTSPHER_DEFINE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       REAL object access programs
      EXTERNAL REAL_WDRAWR, REAL_WDRAW
C
C                       SUBPLOT object access programs
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
C
C                       TEXT2D object access programs
      EXTERNAL TEXT2D_WDRAW, TEXT2D_WDRAWR
C
C                       VEC2 object access programs
      EXTERNAL VEC2_PDRAW, VEC2_PDRAWR, VEC2_WDRAW, VEC2_WDRAWR
C
C                       VEC3 object access programs
      EXTERNAL VEC3_DRAW
C
C                       VIEWPT object access programs
      EXTERNAL VIEWPT_SETBS, VIEWPT_SETBU, VIEWPT_SETWC
C
C                       WCOORD2 object access programs
      EXTERNAL WCOORD2_CVXPU, WCOORD2_CVYPU, WCOORD2_2XPU, WCOORD2_2YPU
      REAL WCOORD2_CVXPU, WCOORD2_CVYPU, WCOORD2_2XPU, WCOORD2_2YPU
C
C                       WORKBOX object access programs
      EXTERNAL WORKBOX_DEFINE
C
C     ------------------------------------------------------------------
C
C                       Maximum array sizes
      PARAMETER (MX101 = 1)
      PARAMETER (MX102 = 1)
      PARAMETER (MX103 = 1)
      PARAMETER (MX104 = 1)
      PARAMETER (MX105 = 1)
      PARAMETER (MX106 = 1)
      PARAMETER (MX107 = 1)
      PARAMETER (MX108 = 1)
      PARAMETER (MX109 = 1)
      PARAMETER (MX110 = 1)
      PARAMETER (MX111 = 1)
      PARAMETER (MX112 = 1)
      PARAMETER (MX113 = 1)
      PARAMETER (MX114 = 1)
      PARAMETER (MX115 = 1)
      PARAMETER (MX116 = 1)
      PARAMETER (MX117 = 1)
      PARAMETER (MX118 = 1)
      PARAMETER (MX119 = 1)
      PARAMETER (MX120 = 1)
      PARAMETER (MX121 = 1)
C
C                       Integer variables and arrays
      INTEGER NPTS, NPTS3, NGAPS, IXGRID, IYGRID, IVAL, IENTRY, IPLEN
     *        , LLEN, MLINES, LABN2, LABN3, IALGOR, LTYPE, MXTKS, MTICKS
     *        , ITICKS, IPLACE, LCLRB, LFRM, NBARS, NBARC, NCOLRB(MX101)
     *        , NBPG, IMARK, KTYPQ, NPTS1, NPTS2, NPTSP, ISPARE, JSPARE
     *        , NPAT, LREL, IP(MX102), NLINES, ILGCHR, ISEQ, NLBLS
     *        , NCHRS, LCLRW, NVALS, NWEGC, NCOLRW(MX103), NOFFS, ISCOPE
     *        , LTYPEL, IMESS, IVEC
      INTEGER IRETRN
C
C                       Real variables and arrays
      REAL XC2(MX104), YC2(MX105), XC3(MX106), YC3(MX107), ZC3(MX108)
     *        , HANGLE, GARAY(MX109), XDATA, YDATA, XCURR, YCURR, XLCORN
     *        , YLCORN, ZLCORN, XBASEX, YBASEX, ZBASEX, XOTHER, YOTHER
     *        , ZOTHER, XLOWL, XCYCLE, YLOWL, YCYCLE, RINCR, ANUM, XW1
     *        , YW1, XW2, YW2, X1, Y1, Z1, X2, Y2, Z2, XVOL, YVOL, ZVOL
     *        , ANGLE, DLOW, DHIGH, AMIN, DELV, AMAX, DSTEP, RAXIS
     *        , XBOT(MX110), YBOT(MX111), YTOP(MX112), GAP, BARWD, XPAGE
     *        , YPAGE, XCV2(MX113), YCV2(MX114), XC1(MX115), YC1(MX116)
     *        , XP(MX117), YP(MX118), XVAL, YVAL, XPOS, YPOS, YRATIO
     *        , XOABS, YOABS, PAGEX, PAGEY, VALS(MX119), PANGLE, DIAM
     *        , XCENT, YCENT, OFFS(MX120), XLOW, XSTEP, XHIGH, YLOW
     *        , YSTEP, YHIGH, XAXIS, YAXIS, ZLOW, ZSTEP, ZHIGH, ALOW
     *        , AHIGH, SPARE1, ORG, SPARE2, RSTEP, XDIST, YDIST, ZDIST
     *        , AX, AY, XP1, YP1, XP2, YP2, ANXYPL, ANVERT, RAD, VX, VY
     *        , VZ, VWX, VWY, VWZ, XINCH, YINCH
      REAL RRETRN
C
C                       Double precision variables and arrays
C     DOUBLE PRECISION
C
C                       Complex variables and arrays
C     COMPLEX
C
C                       Logical variables and arrays
C     LOGICAL
C
C                       Character variables and arrays
      CHARACTER ORIENT*4, OSCAL*4, VERAQ*8, LMESS*160, XLABEL*80
     *        , YLABEL*80, ZLABEL*80, CFLAG*1, LTYPEB*3, LOCB*12
     *        , CTYPE*1, CFILL*4, LEGNAM*20, STRNG*1, LTYPEW*4, LOCW*8
     *        , LBLS(MX121)*24, VERRQ*8
C
C                       Program required PRL version (update DATA value
C                       when program updated to new version of library)
      DATA VERRQ /'0.7     '/
C
C     ******************************************************************
C
C                       STEP 1  - Initialize the library
C
C     ------------------------------------------------------------------
C
C                       Use PLOT_INIT object access program
C
C                       Initialize the PRL-PLOT library
C     ISCOPE =
      CALL PLOT_INIT (ISCOPE)
C
C     ******************************************************************
C
C                       STEP 2  - Check the Programmer's Reusable
C                       Library version
C
C     ------------------------------------------------------------------
C
C                       Use PRL_LIBVER object access program
C
C                       Return the version of the Programmer's Reusable
C                       Librar
C     VERRQ =
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       STEP 3  - Use PRL-DEVICE to initialize a
C                       graphics device
C
C     ------------------------------------------------------------------
C
C                       Use DEVICE_SELECT object access program
C
C                       Non-interactively select a graphics output
C                       device
C     KTYPQ =
      CALL DEVICE_SELECT (KTYPQ,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       STEP 4  - Use PRL-GRAPHICS to define plotting
C                       page
C
C     ------------------------------------------------------------------
C
C                       Use PAGE_SIZE object access program
C
C                       Set page size for plot
C     PAGEX =
C     PAGEY =
      CALL PAGE_SIZE (PAGEX,PAGEY)
C
C     ******************************************************************
C
C                       STEP 5  - Use PRL-GRAPHICS to set origin
C                       location and and subplot properties
C
C     ------------------------------------------------------------------
C
C                       Use ORIGIN_SET object access program
C
C                       Set location of origin relative to lower left
C                       corner of page
C     XOABS =
C     YOABS =
      CALL ORIGIN_SET (XOABS,YOABS)
C
C     ******************************************************************
C
C                       STEP 6  - Use PRL-GRAPHICS to define subplot
C                       area
C
C     ------------------------------------------------------------------
C
C                       Use SUBPLOT_DEFINE object access program
C
C                       Define subplot area
C     AX =
C     AY =
      CALL SUBPLOT_DEFINE (AX,AY)
C
C     ******************************************************************
C
C                       STEP 7  - Set world coordinate reference system
C                       properties
C
C     ------------------------------------------------------------------
C
C                       Use AXISLBL object access programs
C
C                       Define X axis label for 2D plot
C     XLABEL =
C     LABN2 =
      CALL AXISLBL_DEFX2 (XLABEL,LABN2)
C
C                       Define X axis label for 3D plot
C     XLABEL =
C     LABN3 =
      CALL AXISLBL_DEFX3 (XLABEL,LABN3)
C
C                       Define Y axis label for 2D plot
C     YLABEL =
C     LABN2 =
      CALL AXISLBL_DEFY2 (YLABEL,LABN2)
C
C                       Define Y axis label for 3D plot
C     YLABEL =
C     LABN3 =
      CALL AXISLBL_DEFY3 (YLABEL,LABN3)
C
C                       Define Z axis label for 3D plot
C     ZLABEL =
C     LABN3 =
      CALL AXISLBL_DEFZ3 (ZLABEL,LABN3)
C
C     ------------------------------------------------------------------
C
C                       Use AXISNUM object access programs
C
C                       Force exponential numbering on X axis
      CALL AXISNUM_EXPX ()
C
C                       Force exponential numbering on Y axis
      CALL AXISNUM_EXPY ()
C
C                       Force exponential numbering on Z axis
      CALL AXISNUM_EXPZ ()
C
C                       Set integer numbering on all axes
      CALL AXISNUM_INTALL ()
C
C                       Set integer numbering on X axis
      CALL AXISNUM_INTX ()
C
C                       Set integer numbering on Y axis
      CALL AXISNUM_INTY ()
C
C                       Set integer numbering on Z axis
      CALL AXISNUM_INTZ ()
C
C                       Set rotation angle for X axis numbers
C     ANGLE =
      CALL AXISNUM_ROTX (ANGLE)
C
C                       Set rotation angle for Y axis numbers
C     ANGLE =
      CALL AXISNUM_ROTY (ANGLE)
C
C                       Suppress numbering on X axis
      CALL AXISNUM_XOFF ()
C
C                       Suppress numbering on Y axis
      CALL AXISNUM_YOFF ()
C
C                       Suppress numbering on Z axis
      CALL AXISNUM_ZOFF ()
C
C     ------------------------------------------------------------------
C
C                       Use AXISSCALE object access programs
C
C                       Select algorithm for axes autoscaling
C     IALGOR =
      CALL AXISSCALE_ALGOR (IALGOR)
C
C                       Automatically scale a step size for axes in
C                       world cooordinate system
C     LTYPE =
C     DLOW =
C     DHIGH =
C     MXTKS =
      CALL AXISSCALE_SAUTO (LTYPE,DLOW,DHIGH,MXTKS,AMIN,DELV,AMAX)
C
C                       Automatically scale a linear step size for
C                       multiple subplot axes
C     DLOW =
C     DHIGH =
C     AMAX =
      CALL AXISSCALE_MAUTO (DLOW,DHIGH,AMAX,AMIN,DSTEP,RAXIS)
C
C                       Enable drawing plot with axes crossing at world
C                       coordinate origin
      CALL AXISSCALE_CROSS ()
C
C     ------------------------------------------------------------------
C
C                       Use AXISTICK object access programs
C
C                       Suppress drawing minor tick marks on log axis
C     CFLAG =
      CALL AXISTICK_LOFF (CFLAG)
C
C                       Enable drawing of ticks on opposite (inner) edge
C                       of X axis
      CALL AXISTICK_REVX ()
C
C                       Enable drawing of ticks on opposite (inner) edge
C                       of Y axis
      CALL AXISTICK_REVY ()
C
C                       Enable drawing of ticks on opposite (inner) edge
C                       of Z axis
      CALL AXISTICK_REVZ ()
C
C                       Set maximum number of major tick marks
C     MTICKS =
      CALL AXISTICK_SETMAX (MTICKS)
C
C                       Set number of ticks per step on X axis
C     ITICKS =
      CALL AXISTICK_SETX (ITICKS)
C
C                       Set number of ticks per step on Y axis
C     ITICKS =
      CALL AXISTICK_SETY (ITICKS)
C
C                       Set number of ticks per step on Z axis
C     ITICKS =
      CALL AXISTICK_SETZ (ITICKS)
C
C     ------------------------------------------------------------------
C
C                       Use PLOTLOG_LMAUTO object access program
C
C                       Automatically scale a log step size for multiple
C                       subplot axes
C     LTYPEL =
C     ALOW =
C     AHIGH =
C     RAXIS =
      CALL PLOTLOG_LMAUTO (LTYPEL,ALOW,AHIGH,RAXIS,AMIN,DELV)
C
C     ------------------------------------------------------------------
C
C                       Use PLOTPOLR_SETROF object access program
C
C                       Define non-zero radius at origin of polar
C                       coordinate system
C     ORG =
      CALL PLOTPOLR_SETROF (ORG)
C
C     ------------------------------------------------------------------
C
C                       Use VIEWPT object access programs
C
C                       Set 3D viewpoint in workbox spherical
C                       coordinates
C     ANXYPL =
C     ANVERT =
C     RAD =
      CALL VIEWPT_SETBS (ANXYPL,ANVERT,RAD)
C
C                       Set 3D viewpoint in workbox Cartesian
C                       coordinates
C     VX =
C     VY =
C     VZ =
      CALL VIEWPT_SETBU (VX,VY,VZ)
C
C                       Set 3D viewpoint in world coordinates
C     VWX =
C     VWY =
C     VWZ =
      CALL VIEWPT_SETWC (VWX,VWY,VWZ)
C
C     ------------------------------------------------------------------
C
C                       Use WORKBOX object access programs
C
C                       Define workbox size for 3D plot
C     XVOL =
C     YVOL =
C     ZVOL =
      CALL WORKBOX_DEFINE (XVOL,YVOL,ZVOL)
C
C     ******************************************************************
C
C                       STEP 8  - Define world coordinate reference
C                       system for subplot and draw axes
C
C     ------------------------------------------------------------------
C
C                       Use PLOT2D_DEFINE object access program
C
C                       Define linear coordinate system and draw axes
C                       for 2D plot
C     XLOW =
C     XSTEP =
C     XHIGH =
C     YLOW =
C     YSTEP =
C     YHIGH =
      CALL PLOT2D_DEFINE (XLOW,XSTEP,XHIGH,YLOW,YSTEP,YHIGH)
C
C     ------------------------------------------------------------------
C
C                       Use PLOT3D_DEFINE object access program
C
C                       Define linear coordinate system and draw axes
C                       for 3D plot
C     XLOW =
C     XSTEP =
C     XHIGH =
C     YLOW =
C     YSTEP =
C     YHIGH =
C     ZLOW =
C     ZSTEP =
C     ZHIGH =
      CALL PLOT3D_DEFINE (XLOW,XSTEP,XHIGH,YLOW,YSTEP,YHIGH,ZLOW,ZSTEP,
     *                  ZHIGH)
C
C     ------------------------------------------------------------------
C
C                       Use PLOTLOG_DEFINE object access program
C
C                       Define log coordinate system for 2D plot
C     XLOWL =
C     XCYCLE =
C     YLOWL =
C     YCYCLE =
      CALL PLOTLOG_DEFINE (XLOWL,XCYCLE,YLOWL,YCYCLE)
C
C     ------------------------------------------------------------------
C
C                       Use PLOTLOG_DEFSX object access program
C
C                       Define linear X and log Y coordinate system for
C                       2D plot
C     XLOWL =
C     XSTEP =
C     YLOWL =
C     YCYCLE =
      CALL PLOTLOG_DEFSX (XLOWL,XSTEP,YLOWL,YCYCLE)
C
C     ------------------------------------------------------------------
C
C                       Use PLOTLOG_DEFSY object access program
C
C                       Define log X and linear Y coordinate system for
C                       2D plot
C     XLOWL =
C     XCYCLE =
C     YLOWL =
C     YSTEP =
      CALL PLOTLOG_DEFSY (XLOWL,XCYCLE,YLOWL,YSTEP)
C
C     ------------------------------------------------------------------
C
C                       Use PLOTPOLR_DEFINE object access program
C
C                       Define polar coordinate system and draw axes for
C                       3D plot
C     SPARE1 =
C     RINCR =
C     XPOS =
C     YPOS =
      CALL PLOTPOLR_DEFINE (SPARE1,RINCR,XPOS,YPOS)
C
C     ------------------------------------------------------------------
C
C                       Use PLOTSPHER_DEFINE object access program
C
C                       Define spherical coordinate system and draw axes
C                       for 3D plot
C     SPARE1 =
C     SPARE2 =
C     RSTEP =
C     XDIST =
C     YDIST =
C     ZDIST =
      CALL PLOTSPHER_DEFINE (SPARE1,SPARE2,RSTEP,XDIST,YDIST,ZDIST)
C
C     ******************************************************************
C
C                       STEP 9  - Invoke other library objects as needed
C                       to draw plot
C
C     ------------------------------------------------------------------
C
C                       Use BARCHART object access programs
C
C                       Enable area blanking for bars of a bar chart
      CALL BARCHART_BLNKON ()
C
C                       Specify bar label placement for a bar chart
C     LTYPEB =
C     LOCB =
C     IPLACE =
C     LCLRB =
C     LFRM =
      CALL BARCHART_DEFLBL (LTYPEB,LOCB,IPLACE,LCLRB,LFRM)
C
C                       Draw horizontal or vertical bars and bar labels
C                       of a bar chart
C     XBOT(1) =
C     YBOT(1) =
C     YTOP(1) =
C     NBARS =
C     CTYPE =
      CALL BARCHART_DRAW (XBOT,YBOT,YTOP,NBARS,CTYPE)
C
C                       Specify bar colors for a bar chart
C     NBARC =
C     NCOLRB(1) =
      CALL BARCHART_SETCLR (NBARC,NCOLRB)
C
C                       Specify bar grouping for a bar chart
C     NBPG =
C     GAP =
      CALL BARCHART_SETGRP (NBPG,GAP)
C
C                       Specify thickness (width) for bars of a bar
C                       chart
C     BARWD =
      CALL BARCHART_THICK (BARWD)
C
C     ------------------------------------------------------------------
C
C                       Use CURVE2D object access programs
C
C                       Set cubic spline interpolation for curve drawing
      CALL CURVE2D_CUBIC ()
C
C                       Draw 2D curve using current interpolation method
C     XC2(1) =
C     YC2(1) =
C     NPTS =
C     IMARK =
      CALL CURVE2D_DRAW (XC2,YC2,NPTS,IMARK)
C
C                       Set polynomial interpolation for curve drawing
      CALL CURVE2D_POLY ()
C
C                       Set parametric spline interpolation for curve
C                       drawing
      CALL CURVE2D_SPLINE ()
C
C     ------------------------------------------------------------------
C
C                       Use CURVE3D object access programs
C
C                       Draw 3D curve using current interpolation method
C     XC3(1) =
C     YC3(1) =
C     ZC3(1) =
C     NPTS3 =
C     IMARK =
      CALL CURVE3D_DRAW (XC3,YC3,ZC3,NPTS3,IMARK)
C
C     ------------------------------------------------------------------
C
C                       Use FILLAREA object access programs
C
C                       Fill area between a curve and an axis using
C                       current fill pattern
C     XCV2(1) =
C     YCV2(1) =
C     NPTS1 =
C     CFILL =
      CALL FILLAREA_2AXIS (XCV2,YCV2,NPTS1,CFILL)
C
C                       Fill area between two curves using current fill
C                       pattern
C     XC1(1) =
C     YC1(1) =
C     NPTS1 =
C     XCV2(1) =
C     YCV2(1) =
C     NPTS2 =
      CALL FILLAREA_2CRV (XC1,YC1,NPTS1,XCV2,YCV2,NPTS2)
C
C                       Fill area within a polygon using custom fill
C                       pattern
C     XP(1) =
C     YP(1) =
C     NPTSP =
C     HANGLE =
C     GARAY(1) =
C     NGAPS =
C     ISPARE =
C     JSPARE =
      CALL FILLAREA_POLYG (XP,YP,NPTSP,HANGLE,GARAY,NGAPS,ISPARE,JSPARE)
C
C                       Set current fill pattern
C     NPAT =
      CALL FILLAREA_SETPAT (NPAT)
C
C     ------------------------------------------------------------------
C
C                       Use GRID object access programs
C
C                       Draw grid lines within, and frame around,
C                       subplot area
C     IXGRID =
C     IYGRID =
      CALL GRID_DRAW (IXGRID,IYGRID)
C
C     ------------------------------------------------------------------
C
C                       Use INT object access programs
C
C                       Draw integer number relative to current location
C                       or origin in world coordinates
C     IVAL =
C     XVAL =
C     YVAL =
C     LREL =
      CALL INT_WDRAWR (IVAL,XVAL,YVAL,LREL)
C
C                       Draw integer number relative to origin in world
C                       coordinates
C     IVAL =
C     XVAL =
C     YVAL =
      CALL INT_WDRAW (IVAL,XVAL,YVAL)
C
C     ------------------------------------------------------------------
C
C                       Use LEGEND object access programs
C
C                       Draw a legend block relative to origin
C     IP(1) =
C     NLINES =
C     XPOS =
C     YPOS =
      CALL LEGEND_DRAW (IP,NLINES,XPOS,YPOS)
C
C                       Draw a legend block relative to current location
C                       or origin
C     IP(1) =
C     NLINES =
C     XPOS =
C     YPOS =
C     LREL =
      CALL LEGEND_DRAWR (IP,NLINES,XPOS,YPOS,LREL)
C
C                       Disable drawing of an entry in a legend block
C     IENTRY =
      CALL LEGEND_ENTOFF (IENTRY)
C
C                       Enable drawing of an entry in a legend block
C     IENTRY =
      CALL LEGEND_ENTON (IENTRY)
C
C                       Compute height of legend block in page units
C     IP(1) =
C     NLINES =
      RRETRN = LEGEND_HT (IP,NLINES)
C
C                       Enable saving of curve line styles and colors in
C                       a legend block
      CALL LEGEND_ON ()
C
C                       Define legend block heading
C     LEGNAM =
C     ILGCHR =
      CALL LEGEND_SETHDG (LEGNAM,ILGCHR)
C
C                       Set vertical text spacing for legend block
C     YRATIO =
      CALL LEGEND_SETVSP (YRATIO)
C
C                       Compute width of legend block in page units
C     IP(1) =
C     NLINES =
      RRETRN = LEGEND_WIDTH (IP,NLINES)
C
C     ------------------------------------------------------------------
C
C                       Use LOCATOR object access programs
C
C                       Get coordinates of locator graphics input device
      CALL LOCATOR_GET (XDATA,YDATA)
C
C     ------------------------------------------------------------------
C
C                       Use LOGPEN2 object access programs
C
C                       Get coordinates of logical pen in 2D world
C                       coordinate system
      CALL LOGPEN2_GETW2 (XCURR,YCURR)
C
C     ------------------------------------------------------------------
C
C                       Use PACKARY object access programs
C
C                       Draw packed array text relative to origin
C     IP(1) =
C     MLINES =
C     XPOS =
C     YPOS =
      CALL PACKARY_DRAW (IP,MLINES,XPOS,YPOS)
C
C                       Draw packed array text relative to current
C                       location or origin
C     IP(1) =
C     MLINES =
C     XPOS =
C     YPOS =
C     LREL =
      CALL PACKARY_DRAWR (IP,MLINES,XPOS,YPOS,LREL)
C
C                       Get maximum number of lines that can be placed
C                       in a packed array
C     IP(1) =
C     IPLEN =
C     LLEN =
      IRETRN = PACKARY_GETMAX (IP,IPLEN,LLEN)
C
C                       Compute plotted height of packed array text in
C                       page units
C     IP(1) =
C     MLINES =
      RRETRN = PACKARY_HT (IP,MLINES)
C
C                       Insert a character string into a packed array
C     STRNG =
C     IP(1) =
C     ISEQ =
      CALL PACKARY_SETENT (STRNG,IP,ISEQ)
C
C                       Compute plotted width of packed array text in
C                       page units
C     IP(1) =
C     MLINES =
      RRETRN = PACKARY_WIDTH (IP,MLINES)
C
C     ------------------------------------------------------------------
C
C                       Use PAGE object access programs
C
C                       Convert X world coordinate to page units
C     XVAL =
C     YVAL =
      RRETRN = PAGE_CVXWC (XVAL,YVAL)
C
C                       Convert Y world coordinate to page units
C     XVAL =
C     YVAL =
      RRETRN = PAGE_CVYWC (XVAL,YVAL)
C
C                       End plotting on current page
C     ISPARE =
      CALL PAGE_END (ISPARE)
C
C                       Set page size for plot
C     PAGEX =
C     PAGEY =
      CALL PAGE_SIZE (PAGEX,PAGEY)
C
C     ------------------------------------------------------------------
C
C                       Use PIECHART object access programs
C
C                       Specify wedge labeling for a pie chart
C     LTYPEW =
C     LOCW =
C     IPLACE =
C     LBLS(1) =
C     NLBLS =
C     NCHRS =
C     LCLRW =
C     LFRM =
      CALL PIECHART_DEFLBL (LTYPEW,LOCW,IPLACE,LBLS,NLBLS,NCHRS,LCLRW,
     *                  LFRM)
C
C                       Draw wedges and wedge labels of a pie chart
C     VALS(1) =
C     NVALS =
      CALL PIECHART_DRAW (VALS,NVALS)
C
C                       Specify reference angle for first wedge of a pie
C                       chart
C     PANGLE =
      CALL PIECHART_SETANG (PANGLE)
C
C                       Specify wedge colors for a pie chart
C     NWEGC =
C     NCOLRW(1) =
      CALL PIECHART_SETCLR (NWEGC,NCOLRW)
C
C                       Specify diameter and center coordinates for a
C                       pie chart
C     DIAM =
C     XCENT =
C     YCENT =
      CALL PIECHART_SETDIA (DIAM,XCENT,YCENT)
C
C                       Specify wedge radial offsets for a pie chart
C     OFFS(1) =
C     NOFFS =
      CALL PIECHART_SETROF (OFFS,NOFFS)
C
C     ------------------------------------------------------------------
C
C                       Use PLOT2D_DEF2X object access program
C
C                       Define and draw secondary linear coordinate
C                       system on X axis of 2D plot
C     XLOW =
C     XSTEP =
C     XHIGH =
C     XAXIS =
C     XLABEL =
C     LABN2 =
C     XPOS =
C     YPOS =
      CALL PLOT2D_DEF2X (XLOW,XSTEP,XHIGH,XAXIS,XLABEL,LABN2,XPOS,YPOS)
C
C     ------------------------------------------------------------------
C
C                       Use PLOT2D_DEF2Y object access program
C
C                       Define and draw secondary linear coordinate
C                       system on Y axis of 2D plot
C     YLOW =
C     YSTEP =
C     YHIGH =
C     YAXIS =
C     YLABEL =
C     LABN2 =
C     XPOS =
C     YPOS =
      CALL PLOT2D_DEF2Y (YLOW,YSTEP,YHIGH,YAXIS,YLABEL,LABN2,XPOS,YPOS)
C
C     ------------------------------------------------------------------
C
C                       Use PLOT3D_PRJON object access program
C
C                       Enable projection of 2D subplot onto a 3D plane
C     XLCORN =
C     YLCORN =
C     ZLCORN =
C     XBASEX =
C     YBASEX =
C     ZBASEX =
C     XOTHER =
C     YOTHER =
C     ZOTHER =
      CALL PLOT3D_PRJON (XLCORN,YLCORN,ZLCORN,XBASEX,YBASEX,ZBASEX,
     *                  XOTHER,YOTHER,ZOTHER)
C
C     ------------------------------------------------------------------
C
C                       Use PLOT3D_PRJOFF object access program
C
C                       Terminate projection of 2D subplot onto a 3D
C                       plane
      CALL PLOT3D_PRJOFF ()
C
C     ------------------------------------------------------------------
C
C                       Use PLOTLOG_DEF2X object access program
C
C                       Define and draw secondary log coordinate system
C                       on X axis of 2D plot
C     XLOWL =
C     XCYCLE =
C     XAXIS =
C     XLABEL =
C     LABN3 =
C     XPOS =
C     YPOS =
      CALL PLOTLOG_DEF2X (XLOWL,XCYCLE,XAXIS,XLABEL,LABN3,XPOS,YPOS)
C
C     ------------------------------------------------------------------
C
C                       Use PLOTLOG_DEF2Y object access program
C
C                       Define and draw secondary log coordinate system
C                       on Y axis of 2D plot
C     YLOWL =
C     YCYCLE =
C     YAXIS =
C     YLABEL =
C     LABN3 =
C     XPOS =
C     YPOS =
      CALL PLOTLOG_DEF2Y (YLOWL,YCYCLE,YAXIS,YLABEL,LABN3,XPOS,YPOS)
C
C     ------------------------------------------------------------------
C
C                       Use REAL object access programs
C
C                       Draw real number relative to current location or
C                       origin in world coordinates
C     ANUM =
C     IPLACE =
C     XVAL =
C     YVAL =
C     LREL =
      CALL REAL_WDRAWR (ANUM,IPLACE,XVAL,YVAL,LREL)
C
C                       Draw real number relative to origin in world
C                       coordinates
C     ANUM =
C     IPLACE =
C     XVAL =
C     YVAL =
      CALL REAL_WDRAW (ANUM,IPLACE,XVAL,YVAL)
C
C     ------------------------------------------------------------------
C
C                       Use TEXT2D object access programs
C
C                       Draw text string relative to origin in world
C                       coordinates
C     LMESS =
C     IMESS =
C     XVAL =
C     YVAL =
      CALL TEXT2D_WDRAW (LMESS,IMESS,XVAL,YVAL)
C
C                       Draw text string relative to current location or
C                       origin in world coordinates
C     LMESS =
C     IMESS =
C     XVAL =
C     YVAL =
C     LREL =
      CALL TEXT2D_WDRAWR (LMESS,IMESS,XVAL,YVAL,LREL)
C
C     ------------------------------------------------------------------
C
C                       Use VEC2 object access programs
C
C                       Draw 2D vector relative to origin in page
C                       coordinates
C     XP1 =
C     YP1 =
C     XP2 =
C     YP2 =
C     IVEC =
      CALL VEC2_PDRAW (XP1,YP1,XP2,YP2,IVEC)
C
C                       Draw 2D vector relative to current location or
C                       origin in page coordinates
C     XP1 =
C     YP1 =
C     XP2 =
C     YP2 =
C     IVEC =
C     LREL =
      CALL VEC2_PDRAWR (XP1,YP1,XP2,YP2,IVEC,LREL)
C
C                       Draw 2D vector relative to origin in world
C                       coordinates
C     XW1 =
C     YW1 =
C     XW2 =
C     YW2 =
C     IVEC =
      CALL VEC2_WDRAW (XW1,YW1,XW2,YW2,IVEC)
C
C                       Draw 2D vector relative to current location or
C                       origin in world coordinates
C     XW1 =
C     YW1 =
C     XW2 =
C     YW2 =
C     IVEC =
C     LREL =
      CALL VEC2_WDRAWR (XW1,YW1,XW2,YW2,IVEC,LREL)
C
C     ------------------------------------------------------------------
C
C                       Use VEC3 object access programs
C
C                       Draw 3D vector relative to origin in world
C                       coordinates
C     X1 =
C     Y1 =
C     Z1 =
C     X2 =
C     Y2 =
C     Z2 =
C     IVEC =
      CALL VEC3_DRAW (X1,Y1,Z1,X2,Y2,Z2,IVEC)
C
C     ------------------------------------------------------------------
C
C                       Use WCOORD2 object access programs
C
C                       Convert X length or distance from page units to
C                       world coordinates
C     XINCH =
      RRETRN = WCOORD2_CVXPU (XINCH)
C
C                       Convert Y length or distance from page units to
C                       world coordinates
C     YINCH =
      RRETRN = WCOORD2_CVYPU (YINCH)
C
C                       Convert X coordinate from page units to world
C                       coordinates
C     XINCH =
C     YINCH =
      RRETRN = WCOORD2_2XPU (XINCH,YINCH)
C
C                       Convert Y coordinate from page units to world
C                       coordinates
C     XINCH =
C     YINCH =
      RRETRN = WCOORD2_2YPU (XINCH,YINCH)
C
C     ******************************************************************
C
C                       STEP 10 - Use PRL-GRAPHICS to end the subplot
C
C     ------------------------------------------------------------------
C
C                       Use SUBPLOT_END object access program
C
C                       End current subplot
C     ISPARE =
      CALL SUBPLOT_END (ISPARE)
C
C     ******************************************************************
C
C                       STEP 11 - Use PRL-GRAPHICS to end plotting on
C                       the page
C
C     ------------------------------------------------------------------
C
C                       Use PAGE_END object access program
C
C                       End plotting on current page
C     ISPARE =
      CALL PAGE_END (ISPARE)
C
C     ******************************************************************
C
C                       STEP 12 - Use PRL-DEVICE to release graphics
C                       device
C
C     ------------------------------------------------------------------
C
C                       Use DEVICE_END object access program
C
C                       End plotting and release the current graphics
C                       device
      CALL DEVICE_END ()
C
C     ******************************************************************
C
C                       STEP 13 - Use PRL-POSIX to terminate program
C                       execution
C
C     ------------------------------------------------------------------
C
C                       Use PROCESS_EXIT object access program
C
C                       Silently terminate process execution
      CALL PROCESS_EXIT ()
      END
STOP_CAT
echo "  Generating =====> [ ./subplot1.f ]"
cat <<"STOP_CAT"> ././subplot1.f
C     PROGRAM SUBPLOT1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program SUBPLOT_DEFINE and
C              SUBPLOT_END
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       SUBPLOT object access program
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
C
C                       GRAPHICS object access programs
      EXTERNAL GRAPHICS_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV111 =  1)
      PARAMETER (NVV113 =  1)
      PARAMETER (NVV115 =  2)
      PARAMETER (NVV116 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'SUBPLOT.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, TMP102, TMP103, TMP104, TMP105, TMP106, TMP107
     *      , TMP108, TMP109, TMP110, TMP111, TMP113, AX, TMP115, AY
     *      , TMP116
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV111(NVV111)
      REAL    VV113(NVV113)
      REAL    VV115(NVV115)
      REAL    VV116(NVV116)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV111 /-3333.33/
C
      DATA VV113 /9999.99/
C
      DATA VV115 /.000001, 9999.99/
C
      DATA VV116 /.000001, 9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL GRAPHICS_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'subplot_define.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              SUBPLOT Object Demo Program #1'/
     * ' This program tests the SUBPLOT object access program'/
     * ' SUBPLOT_DEFINE.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A//
     * ' This demo generates several blank view surfaces.'/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test SUBPLOT_DEFINE object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV111 = 1,NVV111
        XT = VV111(IVV111)
C
      DO 588 IVV113 = 1,NVV113
        YT = VV113(IVV113)
C
      DO 587 IVV115 = 1,NVV115
        AX = VV115(IVV115)
C
      DO 586 IVV116 = 1,NVV116
        AY = VV116(IVV116)
C
C     ------------------------------------------------------------------
C
C                       Set up proper environment for access program
C                       under test
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (0.0,0.0)
C
C     ------------------------------------------------------------------
C
C                       Define subplot area
      CALL SUBPLOT_DEFINE (AX,AY)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=510) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106,TMP107,TMP108,TMP109,TMP110,TMP111,TMP113,TMP115,
     *       TMP116
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(UUXAXS ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(UUYAXS ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZXAXS ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZYAXS ,TMP104 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZXLFT ,TMP105 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZXRGT ,TMP106 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZYBOT ,TMP107 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZYTOP ,TMP108 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZXAXR ,TMP109 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZYAXR ,TMP110 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(XT ,TMP111 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(YT ,TMP113 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 523
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=512) UUXAXS,UUYAXS,ZZXAXS,ZZYAXS,ZZXLFT,ZZXRGT,
     *       ZZYBOT,ZZYTOP,ZZXAXR,ZZYAXR,XT,YT,AX,AY
  502 FORMAT (E15.7,E15.7,E15.7,E15.7,E15.7,E15.7,E15.7,E15.7,E15.7,
     *       E15.7,E15.7,E15.7,E15.7,E15.7)
      GOTO 523
C                       Print file I/O error messages
  510 WRITE (IER,511) FILNAM
  511 FORMAT (' Error reading file ',A)
      GOTO 523
C
  512 WRITE (IER,513) FILNAM
  513 FORMAT (' Error writing file ',A)
C
  523 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END(0)
C
C     ------------------------------------------------------------------
C
C                       End plotting on current page
      CALL PAGE_END (0)
C
C     ------------------------------------------------------------------
C
C                       Repeat for next variable value
  586 CONTINUE
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
      CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              SUBPLOT Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./subplot_define.dat ]"
cat <<"STOP_CAT"> ././subplot_define.uuu
begin 660 ./subplot_define.dat
M("`@+C(U-#`P,#!%+3`U("`@+C(U-#`P,#!%+3`U("`@+C$V-#@T,#)%+3`U
M("`@+C$V-#@T,#)%+3`U("`@+C$T,38V.3!%*S`Q("`@+C$T,38V.3)%*S`Q
M("`@+C0W-3`P,#1%*S`P("`@+C0W-3`P,C!%*S`P("`@+C$P,#`P,#!%*S`Q
M("`@+C$P,#`P,#!%*S`Q("`M+C(Q-C,R-35%*S`T("`@+C8T.#DW-C5%*S`T
M("`@+C$P,#`P,#!%+3`U("`@+C$P,#`P,#!%+3`U"B`@("XR-30P,#`P12TP
M-2`@("XR-3,Y.3DW12LP-2`@("XQ-C0X-#`R12TP-2`@("XQ-C0X-#`P12LP
M-2`@("XQ-#$V-CDP12LP,2`@("XQ-#$V-CDR12LP,2`@("XT-S4P,#`T12LP
M,"`@("XQ.#4R-3`P12LP,B`@("XQ,#`P,#`P12LP,2`@("XQ,#DU,#`Q12TP
M,B`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XQ,#`P,#`P12TP
M-2`@("XY.3DY.3DP12LP-`H@("`N,C4S.3DY-T4K,#4@("`N,C4T,#`P,$4M
M,#4@("`N,38T.#0P,$4K,#4@("`N,38T.#0P,D4M,#4@("`N,30Q-C8Y,$4K
M,#$@("`N,C,Y.#,S,44K,#(@("`N-#<U,#`P-$4K,#`@("`N-#<U,#`R,$4K
M,#`@("`N,3,V.3`P,44M,#(@("`N,3`P,#`P,$4K,#$@("`N,#`P,#`P,$4K
M,#`@("`N,#`P,#`P,$4K,#`@("`N.3DY.3DY,$4K,#0@("`N,3`P,#`P,$4M
M,#4*("`@+C(U,SDY.3=%*S`U("`@+C(U,SDY.3=%*S`U("`@+C$V-#@T,#!%
M*S`U("`@+C$V-#@T,#!%*S`U("`@+C$T,38V.3!%*S`Q("`@+C(S.3@S,S%%
M*S`R("`@+C0W-3`P,#1%*S`P("`@+C$X-3(U,#!%*S`R("`@+C$S-CDP,#%%
M+3`R("`@+C$P.34P,#%%+3`R("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%
B*S`P("`@+CDY.3DY.3!%*S`T("`@+CDY.3DY.3!%*S`T"B`@
`
end
STOP_CAT
echo "  Generating =====> [ ./text2d1.f ]"
cat <<"STOP_CAT"> ././text2d1.f
C     PROGRAM TEXT2D1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program TEXT2D_WDRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       TEXT2D object access program
      EXTERNAL TEXT2D_WDRAW
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  1)
      PARAMETER (NVV102 =  1)
      PARAMETER (NVV103 =  2)
      PARAMETER (NVV104 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IMESS, TMP102
C
C                       Real variables and arrays
      REAL    XVAL, TMP103, YVAL, TMP104
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER LMESS*160, TMP101*160
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*160 VV101(NVV101)
      INTEGER VV102(NVV102)
      REAL    VV103(NVV103)
      REAL    VV104(NVV104)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'Sample text string$'/
C
      DATA VV102 /100/
C
      DATA VV103 /0.11, 0.55/
C
      DATA VV104 /0.11, 0.55/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'text2d_wdraw.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              TEXT2D Object Demo Program #1'/
     * ' This program tests the TEXT2D object access program'/
     * ' TEXT2D_WDRAW.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test TEXT2D_WDRAW object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        LMESS = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        IMESS = VV102(IVV102)
C
      DO 587 IVV103 = 1,NVV103
        XVAL = VV103(IVV103)
C
      DO 586 IVV104 = 1,NVV104
        YVAL = VV104(IVV104)
C
C                       Draw text string relative to origin in world
C                       coordinates
      CALL TEXT2D_WDRAW (LMESS,IMESS,XVAL,YVAL)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=510) TMP101,TMP102,TMP103,TMP104
        GOTO 523
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=512) LMESS,IMESS,XVAL,YVAL
  502 FORMAT (A,I21,E15.7,E15.7)
      GOTO 523
C                       Print file I/O error messages
  510 WRITE (IER,511) FILNAM
  511 FORMAT (' Error reading file ',A)
      GOTO 523
C
  512 WRITE (IER,513) FILNAM
  513 FORMAT (' Error writing file ',A)
C
  523 CONTINUE
C
C                       Repeat for next variable value
  586 CONTINUE
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
      CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              TEXT2D Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./text2d2.f ]"
cat <<"STOP_CAT"> ././text2d2.f
C     PROGRAM TEXT2D2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program TEXT2D_WDRAWR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       TEXT2D object access program
      EXTERNAL TEXT2D_WDRAWR
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  1)
      PARAMETER (NVV102 =  1)
      PARAMETER (NVV103 =  1)
      PARAMETER (NVV104 =  1)
      PARAMETER (NVV105 =  4)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IMESS, TMP102, LREL, TMP105
C
C                       Real variables and arrays
      REAL    XVAL, TMP103, YVAL, TMP104
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER LMESS*160, TMP101*160
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*160 VV101(NVV101)
      INTEGER VV102(NVV102)
      REAL    VV103(NVV103)
      REAL    VV104(NVV104)
      INTEGER VV105(NVV105)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'Sample text string$'/
C
      DATA VV102 /100/
C
      DATA VV103 /0.2/
C
      DATA VV104 /0.2/
C
      DATA VV105 /0, 1, 2, 3/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'text2d_wdrawr.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              TEXT2D Object Demo Program #2'/
     * ' This program tests the TEXT2D object access program'/
     * ' TEXT2D_WDRAWR.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test TEXT2D_WDRAWR object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        LMESS = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        IMESS = VV102(IVV102)
C
      DO 587 IVV103 = 1,NVV103
        XVAL = VV103(IVV103)
C
      DO 586 IVV104 = 1,NVV104
        YVAL = VV104(IVV104)
C
      DO 585 IVV105 = 1,NVV105
        LREL = VV105(IVV105)
C
C                       Draw text string relative to current location or
C                       origin in world coordinates
      CALL TEXT2D_WDRAWR (LMESS,IMESS,XVAL,YVAL,LREL)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=510) TMP101,TMP102,TMP103,TMP104,TMP105
        GOTO 523
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=512) LMESS,IMESS,XVAL,YVAL,LREL
  502 FORMAT (A,I21,E15.7,E15.7,I21)
      GOTO 523
C                       Print file I/O error messages
  510 WRITE (IER,511) FILNAM
  511 FORMAT (' Error reading file ',A)
      GOTO 523
C
  512 WRITE (IER,513) FILNAM
  513 FORMAT (' Error writing file ',A)
C
  523 CONTINUE
C
C                       Repeat for next variable value
  585 CONTINUE
  586 CONTINUE
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
      CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              TEXT2D Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./text2d_wdraw.dat ]"
cat <<"STOP_CAT"> ././text2d_wdraw.uuu
begin 660 ./text2d_wdraw.dat
M4V%M<&QE('1E>'0@<W1R:6YG)"`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(#$P
M,"`@("XQ,3`P,#`P12LP,"`@("XQ,3`P,#`P12LP,`I386UP;&4@=&5X="!S
M=')I;F<D("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@,3`P("`@+C$Q,#`P,#!%
M*S`P("`@+C4U,#`P,#!%*S`P"E-A;7!L92!T97AT('-T<FEN9R0@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`Q,#`@("`N-34P,#`P,$4K,#`@("`N,3$P,#`P
M,$4K,#`*4V%M<&QE('1E>'0@<W1R:6YG)"`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
F("`@(#$P,"`@("XU-3`P,#`P12LP,"`@("XU-3`P,#`P12LP,`H@
`
end
STOP_CAT
echo "  Generating =====> [ ./text2d_wdrawr.dat ]"
cat <<"STOP_CAT"> ././text2d_wdrawr.uuu
begin 660 ./text2d_wdrawr.dat
M4V%M<&QE('1E>'0@<W1R:6YG)"`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(#$P
M,"`@("XR,#`P,#`P12LP,"`@("XR,#`P,#`P12LP,"`@("`@("`@("`@("`@
M("`@("`@,`I386UP;&4@=&5X="!S=')I;F<D("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@,3`P("`@+C(P,#`P,#!%*S`P("`@+C(P,#`P,#!%*S`P("`@("`@
M("`@("`@("`@("`@("`Q"E-A;7!L92!T97AT('-T<FEN9R0@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`Q,#`@("`N,C`P,#`P,$4K,#`@("`N,C`P,#`P,$4K
M,#`@("`@("`@("`@("`@("`@("`@(#(*4V%M<&QE('1E>'0@<W1R:6YG)"`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@(#$P,"`@("XR,#`P,#`P12LP,"`@("XR
@,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@("`@,PHP
`
end
STOP_CAT
echo "  Generating =====> [ ./vec21.f ]"
cat <<"STOP_CAT"> ././vec21.f
C     PROGRAM VEC21
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program VEC2_PDRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       VEC2 object access program
      EXTERNAL VEC2_PDRAW
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  24)
      PARAMETER (NVV102 =  24)
      PARAMETER (NVV103 =  24)
      PARAMETER (NVV104 =  24)
      PARAMETER (NVV105 =  24)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IVEC, TMP105
C
C                       Real variables and arrays
      REAL    XP1, TMP101, YP1, TMP102, XP2, TMP103, YP2, TMP104
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV102(NVV102)
      REAL    VV103(NVV103)
      REAL    VV104(NVV104)
      INTEGER VV105(NVV105)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
     *            0.3, 0.3, 0.3, 0.3, 0.3, 0.3,
     *            0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
     *            0.7, 0.7, 0.7, 0.7, 0.7, 0.7/
C
      DATA VV102 /0.2, 0.3, 0.4, 0.5, 0.6, 0.7,
     *            0.2, 0.3, 0.4, 0.5, 0.6, 0.7,
     *            0.2, 0.3, 0.4, 0.5, 0.6, 0.7,
     *            0.2, 0.3, 0.4, 0.5, 0.6, 0.7/
C
      DATA VV103 /0.2, 0.2, 0.2, 0.2, 0.2, 0.2,
     *            0.4, 0.4, 0.4, 0.4, 0.4, 0.4,
     *            0.6, 0.6, 0.6, 0.6, 0.6, 0.6,
     *            0.8, 0.8, 0.8, 0.8, 0.8, 0.8/
C
      DATA VV104 /0.2, 0.3, 0.4, 0.5, 0.6, 0.7,
     *            0.2, 0.3, 0.4, 0.5, 0.6, 0.7,
     *            0.2, 0.3, 0.4, 0.5, 0.6, 0.7,
     *            0.2, 0.3, 0.4, 0.5, 0.6, 0.7/
C
      DATA VV105 /0201, 1201, 2201, 3201, 4201, 5201,
     *            2001, 2101, 2301, 2401, 2501, 2601,
     *            2102, 2212, 2322, 2432, 2502, 2612,
     *            2203, 2213, 2223, 2233, 2223, 2233/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'vec2_pdraw.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              VEC2 Object Demo Program #1'/
     * ' This program tests the VEC2 object access program'/
     * ' VEC2_PDRAW.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      XPG = XPAGE-2.0
      YPG = YPAGE-2.0
      CALL SUBPLOT_DEFINE (XPG, YPG)
C
C     ------------------------------------------------------------------
C
C                       Test VEC2_PDRAW object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        XP1 = VV101(IVV101)*XPG
        YP1 = VV102(IVV101)*YPG
        XP2 = VV103(IVV101)*XPG
        YP2 = VV104(IVV101)*YPG
        IVEC = VV105(IVV101)
C
C                       Draw 2D vector relative to origin in page
C                       coordinates
      CALL VEC2_PDRAW (XP1,YP1,XP2,YP2,IVEC)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) XP1,YP1,XP2,YP2,IVEC
  502 FORMAT (E15.7,E15.7,E15.7,E15.7,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  589 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              VEC2 Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./vec22.f ]"
cat <<"STOP_CAT"> ././vec22.f
C     PROGRAM VEC22
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program VEC2_PDRAWR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       VEC2 object access program
      EXTERNAL VEC2_PDRAWR
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  24)
      PARAMETER (NVV102 =  24)
      PARAMETER (NVV103 =  24)
      PARAMETER (NVV104 =  24)
      PARAMETER (NVV105 =  24)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IVEC, TMP105
C
C                       Real variables and arrays
      REAL    XP1, TMP101, YP1, TMP102, XP2, TMP103, YP2, TMP104
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV102(NVV102)
      REAL    VV103(NVV103)
      REAL    VV104(NVV104)
      INTEGER VV105(NVV105)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /0.0, 0.1, 0.1, 0.1,
     *            -.7, 0.1, 0.1, 0.1,
     *            -.7, 0.1, 0.1, 0.1,
     *            -.7, 0.1, 0.2, 0.2,
     *            -.7, 0.1, 0.2, 0.1,
     *            -.6, 0.2, 0.2, 0.2/
C
      DATA VV102 /0.0, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0/
C
      DATA VV103 /0.1, 0.2, 0.2, 0.2,
     *            -.6, 0.2, 0.2, 0.2,
     *            -.6, 0.2, 0.2, 0.2,
     *            -.6, 0.2, 0.3, 0.3,
     *            -.6, 0.2, 0.3, 0.2,
     *            -.5, 0.3, 0.3, 0.3/
C
      DATA VV104 /0.0, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0/
C
      DATA VV105 /0201, 1201, 2201, 3201, 4201, 5201,
     *            2001, 2101, 2301, 2401, 2501, 2601,
     *            2102, 2212, 2322, 2432, 2502, 2612,
     *            2203, 2213, 2223, 2233, 2223, 2233/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'vec2_pdrawr.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              VEC2 Object Demo Program #2'/
     * ' This program tests the VEC2 object access program'/
     * ' VEC2_PDRAWR.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      XPG = XPAGE-2.0
      YPG = YPAGE-2.0
      CALL SUBPLOT_DEFINE (XPG, YPG)
C
C     ------------------------------------------------------------------
C
C                       Test VEC2_PDRAW object access program
C
C                       Loop for each input variable of access program
      CALL LOGPEN2_SETP(XPG*0.1, YPG*0.2, 0)
      DO 589 IVV101 = 1,NVV101
        XP1 = VV101(IVV101)*XPG
        YP1 = VV102(IVV101)*YPG
        XP2 = VV103(IVV101)*XPG
        YP2 = VV104(IVV101)*YPG
        IVEC = VV105(IVV101)
C
C                       Draw 2D vector relative to origin in page
C                       coordinates
      CALL VEC2_PDRAWR (XP1,YP1,XP2,YP2,IVEC,3)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) XP1,YP1,XP2,YP2,IVEC
  502 FORMAT (E15.7,E15.7,E15.7,E15.7,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  589 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              VEC2 Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./vec23.f ]"
cat <<"STOP_CAT"> ././vec23.f
C     PROGRAM VEC23
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program VEC2_WDRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (NMAX=231)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
      COMMON /FLOCOM/ X(NMAX),Y(NMAX),U(NMAX),V(NMAX)
C
C     ******************************************************************
C
C                       INITIALIZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C                       Load data to be plotted
      CALL FLODAT (X,Y,U,V)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C                       Enable hardware clipping
      CALL DEVICE_CLIPON
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE, YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.20*XPAGE
      YRL = 0.25*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = 0.6*XPAGE
      YPG = 0.5*YPAGE
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches and plot border
C                       around subplot
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       PLOT TITLE BELOW SUBPLOT AREA
C
C                       Compute text height based on page height
      SIZE = 0.30*YPAGE/11.0
C                       Set text style to 'cartog'
      CALL FONT_CARTOG
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('VEC23 Demo: Flow Vectors$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw title centered below subplot area
      YY = -0.1*YPAGE
      CALL TEXT2D_PDRAW ('VEC23 Demo: Flow Vectors$',100,XX,YY)
C
C     ******************************************************************
C
C                       DRAW THE PLOT (FLOW PATTERN)
C
C                       Set grace margin to clip at subplot boundary
      CALL MARGIN_SET (0.0)
C
C                       Disable axes labels
      CALL GRAPHICS_RESET ('AXISLBL_DEFX2')
      CALL GRAPHICS_RESET ('AXISLBL_DEFY2')
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Define 3D coordinate system with
      CALL PLOT2D_DEFINE (100.,200.,1100.,100.,200.,600.)
C
C                       Set drawing color to green
      CALL COLOR_SETNAM ('GREEN')
C                       Commpute and draw flow pattern
      DO 400 J=1,NMAX
        X1 = X(J)*50+100.0
        Y1 = Y(J)*50+100.0
        X2 = U(J)*50+X1
        Y2 = V(J)*50+Y1
        IF (X1 .NE. X2 .OR. Y1 .NE. Y2) THEN
          CALL VEC2_WDRAW (X1,Y1,X2,Y2,1131)
        ENDIF
  400 CONTINUE
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
      SUBROUTINE FLODAT (XX,YY,UU,VV)
      SAVE
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: INITIALIZE FLOW PATTERN DEMO DATA ARRAYS
C
C     ARGUMENT LIST INPUT:  None
C
C     ARGUMENT LIST OUTPUT:
C       XX,YY,UU,VV = X,Y coordinates of flow field vectors
C
C     GLOBAL INPUT:  None
C
C     GLOBAL OUTPUT:  None
C
C     EXCEPTIONS:  None
C
C     LOCAL VARIABLES:
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (NMAX=231)
C
      DIMENSION XX(*),YY(*),UU(*),VV(*)
      DIMENSION X(NMAX),Y(NMAX),U(NMAX),V(NMAX)
C
      DATA (X(I),Y(I),U(I),V(I),I=1,20) /
     + 0.0,  0.0,  0.0,  0.0,  1.0,  0.0,  0.0,  0.0,
     + 2.0,  0.0,  0.0,  0.0,  3.0,  0.0,  0.0,  0.0,
     + 4.0,  0.0,  0.0,  0.0,  5.0,  0.0,  0.0, -0.50,
     + 6.0,  0.0,  0.0, -1.0,  7.0,  0.0,  0.0, -0.50,
     + 8.0,  0.0,  0.0,  0.0,  9.0,  0.0,  0.0,  0.0,
     +10.0,  0.0,  0.0,  0.0, 11.0,  0.0,  0.0,  0.0,
     +12.0,  0.0,  0.0,  0.0, 13.0,  0.0,  0.0,  0.50,
     +14.0,  0.0,  0.0,  1.0, 15.0,  0.0,  0.0,  0.50,
     +16.0,  0.0,  0.0,  0.0, 17.0,  0.0,  0.0,  0.0,
     +18.0,  0.0,  0.0,  0.0, 19.0,  0.0,  0.0,  0.0/
      DATA (X(I),Y(I),U(I),V(I),I=21,40) /
     +20.0,  0.0,  0.0,  0.0, 20.0,  1.0,  0.0,  0.0,
     +20.0,  2.0,  0.0,  0.0, 20.0,  3.0,  0.0,  0.0,
     +20.0,  4.0,  0.0,  0.0, 20.0,  5.0,  0.0,  0.0,
     +20.0,  6.0,  0.0,  0.0, 20.0,  7.0,  0.0,  0.0,
     +20.0,  8.0,  0.0,  0.0, 20.0,  9.0,  0.0,  0.0,
     +20.0, 10.0,  0.0,  0.0, 19.0, 10.0,  0.0,  0.0,
     +18.0, 10.0,  0.0,  0.0, 17.0, 10.0,  0.0,  0.0,
     +16.0, 10.0,  0.0,  0.0, 15.0, 10.0,  0.0,  0.0,
     +14.0, 10.0,  0.0,  0.0, 13.0, 10.0,  0.0,  0.0,
     +12.0, 10.0,  0.0,  0.0, 11.0, 10.0,  0.0,  0.0/
      DATA (X(I),Y(I),U(I),V(I),I=41,60) /
     +10.0, 10.0,  0.0,  0.0,  9.0, 10.0,  0.0,  0.0,
     + 8.0, 10.0,  0.0,  0.0,  7.0, 10.0,  0.0,  0.0,
     + 6.0, 10.0,  0.0,  0.0,  5.0, 10.0,  0.0,  0.0,
     + 4.0, 10.0,  0.0,  0.0,  3.0, 10.0,  0.0,  0.0,
     + 2.0, 10.0,  0.0,  0.0,  1.0, 10.0,  0.0,  0.0,
     + 0.0, 10.0,  0.0,  0.0,  0.0,  9.0,  0.0,  0.0,
     + 0.0,  8.0,  0.0,  0.0,  0.0,  7.0,  0.0,  0.0,
     + 0.0,  6.0,  0.0,  0.0,  0.0,  5.0,  0.0,  0.0,
     + 0.0,  4.0,  0.0,  0.0,  0.0,  3.0,  0.0,  0.0,
     + 0.0,  2.0,  0.0,  0.0,  0.0,  1.0,  0.0,  0.0/
      DATA (X(I),Y(I),U(I),V(I),I=61,80) /
     + 1.0,  1.0, -0.06322,  0.09193, 1.0,  2.0,  0.02260,  0.12002,
     + 1.0,  3.0,  0.06256,  0.04876, 1.0,  4.0,  0.05467, -0.04382,
     + 1.0,  5.0,  0.02537, -0.10529, 1.0,  6.0, -0.00507, -0.12160,
     + 1.0,  7.0, -0.02856, -0.09999, 1.0,  8.0, -0.03805, -0.05653,
     + 1.0,  9.0, -0.00951, -0.01070, 2.0,  1.0, -0.15314,  0.09893,
     + 2.0,  2.0,  0.07739,  0.08502, 2.0,  3.0,  0.16749, -0.02743,
     + 2.0,  4.0,  0.13416, -0.12523, 2.0,  5.0,  0.05750, -0.17137,
     + 2.0,  6.0, -0.01372, -0.17215, 2.0,  7.0, -0.06227, -0.14426,
     + 2.0,  8.0, -0.08054, -0.10259, 2.0,  9.0, -0.06332, -0.05013,
     + 3.0,  1.0, -0.20965,  0.09701, 3.0,  2.0,  0.20996, -0.01863/
      DATA (X(I),Y(I),U(I),V(I),I=81,100) /
     + 3.0,  3.0,  0.29596, -0.19063, 3.0,  4.0,  0.19274, -0.27311,
     + 3.0,  5.0,  0.05992, -0.27791, 3.0,  6.0, -0.04375, -0.24280,
     + 3.0,  7.0, -0.10855, -0.19003, 3.0,  8.0, -0.13646, -0.12828,
     + 3.0,  9.0, -0.13560, -0.05575, 4.0,  1.0, -0.16632, -0.00455,
     + 4.0,  2.0,  0.45121, -0.27487, 4.0,  3.0,  0.41302, -0.45845,
     + 4.0,  4.0,  0.19189, -0.46202, 4.0,  5.0,  0.01022, -0.39328,
     + 4.0,  6.0, -0.10917, -0.30968, 4.0,  7.0, -0.17914, -0.22611,
     + 4.0,  8.0, -0.21182, -0.14333, 4.0,  9.0, -0.21874, -0.05812,
     + 5.0,  1.0, -0.03989, -0.43274, 5.0,  2.0,  0.74060, -0.76788,
     + 5.0,  3.0,  0.41075, -0.78498, 5.0,  4.0,  0.08446, -0.63229/
      DATA (X(I),Y(I),U(I),V(I),I=101,120) /
     + 5.0,  5.0, -0.10171, -0.47889, 5.0,  6.0, -0.21029, -0.35235,
     + 5.0,  7.0, -0.27181, -0.24496, 5.0,  8.0, -0.30052, -0.14865,
     + 5.0,  9.0, -0.30636, -0.05814, 6.0,  1.0,  0.11887, -1.10951,
     + 6.0,  2.0,  0.88351, -1.24270, 6.0,  3.0,  0.16385, -0.99497,
     + 6.0,  4.0, -0.12754, -0.70365, 6.0,  5.0, -0.25819, -0.50388,
     + 6.0,  6.0, -0.33394, -0.35802, 6.0,  7.0, -0.37655, -0.24133,
     + 6.0,  8.0, -0.39395, -0.14226, 6.0,  9.0, -0.39242, -0.05453,
     + 7.0,  1.0,  0.49289, -1.15327, 7.0,  2.0,  0.70657, -1.16402,
     + 7.0,  3.0, -0.19468, -0.88042, 7.0,  4.0, -0.35682, -0.62924,
     + 7.0,  5.0, -0.42078, -0.45469, 7.0,  6.0, -0.46024, -0.31970/
      DATA (X(I),Y(I),U(I),V(I),I=121,140) /
     + 7.0,  7.0, -0.48014, -0.21097, 7.0,  8.0, -0.48197, -0.12158,
     + 7.0,  9.0, -0.46955, -0.04605, 8.0,  1.0,  0.97833, -0.48809,
     + 8.0,  2.0,  0.50832, -0.51612, 8.0,  3.0, -0.34948, -0.48120,
     + 8.0,  4.0, -0.50562, -0.42411, 8.0,  5.0, -0.54922, -0.32742,
     + 8.0,  6.0, -0.56741, -0.23121, 8.0,  7.0, -0.56751, -0.1490,
     + 8.0,  8.0, -0.55288, -0.08332, 8.0,  9.0, -0.52882, -0.03126,
     + 9.0,  1.0,  1.18464,  0.00547, 9.0,  2.0,  0.46674,  0.03298,
     + 9.0,  3.0, -0.27039, -0.06453, 9.0,  4.0, -0.53267, -0.14113,
     + 9.0,  5.0, -0.61525, -0.13215, 9.0,  6.0, -0.63468, -0.09309,
     + 9.0,  7.0, -0.62253, -0.05452, 9.0,  8.0, -0.59391, -0.02665/
      DATA (X(I),Y(I),U(I),V(I),I=141,160) /
     + 9.0,  9.0, -0.55967, -0.00962, 10.0,  1.0,  1.08317,  0.15574,
     +10.0,  2.0,  0.45806,  0.27631, 10.0,  3.0, -0.15046,  0.22935,
     +10.0,  4.0, -0.48137,  0.14342, 10.0,  5.0, -0.61527,  0.09768,
     +10.0,  6.0, -0.64837,  0.07807, 10.0,  7.0, -0.63160,  0.06301,
     +10.0,  8.0, -0.59390,  0.04314, 10.0,  9.0, -0.55279,  0.01708,
     +11.0,  1.0,  0.84781,  0.20199, 11.0,  2.0,  0.38370,  0.40195,
     +11.0,  3.0, -0.09410,  0.44201, 11.0,  4.0, -0.41269,  0.39269,
     +11.0,  5.0, -0.56460,  0.32250, 11.0,  6.0, -0.60598,  0.25252,
     +11.0,  7.0, -0.58835,  0.18346, 11.0,  8.0, -0.54741,  0.11418,
     +11.0,  9.0, -0.50399,  0.04436, 12.0,  1.0,  0.53824,  0.31114/
      DATA (X(I),Y(I),U(I),V(I),I=161,180) /
     +12.0,  2.0,  0.24021,  0.55561, 12.0,  3.0, -0.09670,  0.63739,
     +12.0,  4.0, -0.34554,  0.60263, 12.0,  5.0, -0.47542,  0.50935,
     +12.0,  6.0, -0.51254,  0.39613, 12.0,  7.0, -0.49613,  0.28110,
     +12.0,  8.0, -0.4580,  0.17092,  12.0,  9.0, -0.41757,  0.06614,
     +13.0,  1.0,  0.26610,  0.65350, 13.0,  2.0,  0.10556,  0.79609,
     +13.0,  3.0, -0.09516,  0.82051, 13.0,  4.0, -0.25777,  0.74779,
     +13.0,  5.0, -0.35014,  0.62051, 13.0,  6.0, -0.37938,  0.47491,
     +13.0,  7.0, -0.36839,  0.33184, 13.0,  8.0, -0.33924,  0.19928,
     +13.0,  9.0, -0.30639,  0.07708, 14.0,  1.0,  0.15525,  0.89493,
     +14.0,  2.0,  0.08346,  0.91506, 14.0,  3.0, -0.03162,  0.86285/
      DATA (X(I),Y(I),U(I),V(I),I=181,200) /
     +14.0,  4.0, -0.13502,  0.75407, 14.0,  5.0, -0.20156,  0.61316,
     +14.0,  6.0, -0.22928,  0.46401, 14.0,  7.0, -0.22861,  0.32176,
     +14.0,  8.0, -0.21234,  0.19220, 14.0,  9.0, -0.18973,  0.07447,
     +15.0,  1.0,  0.08927,  0.59845, 15.0,  2.0,  0.09178,  0.6640,
     +15.0,  3.0,  0.04096,  0.65234, 15.0,  4.0, -0.02027,  0.58279,
     +15.0,  5.0, -0.06847,  0.48077, 15.0,  6.0, -0.09616,  0.36732,
     +15.0,  7.0, -0.10497,  0.25618, 15.0,  8.0, -0.10038,  0.15345,
     +15.0,  9.0, -0.08746,  0.05972, 16.0,  1.0, -0.03855,  0.15811,
     +16.0,  2.0,  0.02590,  0.26747, 16.0,  3.0,  0.04735,  0.32219,
     +16.0,  4.0,  0.03514,  0.32091, 16.0,  5.0,  0.01236,  0.28216/
      DATA (X(I),Y(I),U(I),V(I),I=201,220) /
     +16.0,  6.0, -0.00739,  0.22395, 16.0,  7.0, -0.01859,  0.15962,
     +16.0,  8.0, -0.02038,  0.09659, 16.0,  9.0, -0.01411,  0.03786,
     +17.0,  1.0, -0.12034, -0.0090,  17.0,  2.0, -0.04278,  0.03011,
     +17.0,  3.0,  0.01331,  0.07006, 17.0,  4.0,  0.0370,   0.09351,
     +17.0,  5.0,  0.03877,  0.09632, 17.0,  6.0,  0.03182,  0.08358,
     +17.0,  7.0,  0.02463,  0.06237, 17.0,  8.0,  0.02182,  0.03837,
     +17.0,  9.0,  0.02474,  0.01506, 18.0,  1.0, -0.10499, -0.03625,
     +18.0,  2.0, -0.05596, -0.06505, 18.0,  3.0, -0.00893, -0.06464,
     +18.0,  4.0,  0.02074, -0.05027, 18.0,  5.0,  0.03273, -0.03436,
     +18.0,  6.0,  0.03427, -0.02185, 18.0,  7.0,  0.03204, -0.01379/
      DATA (X(I),Y(I),U(I),V(I),I=221,231) /
     +18.0,  8.0,  0.03056, -0.00830, 18.0,  9.0,  0.03227, -0.00335,
     +19.0,  1.0, -0.04691, -0.04893, 19.0,  2.0, -0.02908, -0.10203,
     +19.0,  3.0, -0.00856, -0.12466, 19.0,  4.0,  0.00645, -0.12222,
     +19.0,  5.0,  0.01415, -0.10523, 19.0,  6.0,  0.01646, -0.08263,
     +19.0,  7.0,  0.01635, -0.05973, 19.0,  8.0,  0.01610, -0.03757,
     +19.0,  9.0,  0.01725, -0.01552/
C
C     ******************************************************************
C
      DO 100 I=1,NMAX
        XX(I) = X(I)
        YY(I) = Y(I)
        UU(I) = U(I)
        VV(I) = V(I)
  100 CONTINUE
      RETURN
      END
STOP_CAT
echo "  Generating =====> [ ./vec24.f ]"
cat <<"STOP_CAT"> ././vec24.f
C     PROGRAM VEC24
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program VEC2_WDRAWR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       VEC2 object access program
      EXTERNAL VEC2_WDRAWR
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
      EXTERNAL AXISLBL_DEFX2, AXISLBL_DEFY2
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  24)
      PARAMETER (NVV102 =  24)
      PARAMETER (NVV103 =  24)
      PARAMETER (NVV104 =  24)
      PARAMETER (NVV105 =  24)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IVEC, TMP105
C
C                       Real variables and arrays
      REAL    XP1, TMP101, YP1, TMP102, XP2, TMP103, YP2, TMP104
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV102(NVV102)
      REAL    VV103(NVV103)
      REAL    VV104(NVV104)
      INTEGER VV105(NVV105)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /0.0, 0.1, 0.1, 0.1,
     *            -.7, 0.1, 0.1, 0.1,
     *            -.7, 0.1, 0.1, 0.1,
     *            -.7, 0.1, 0.2, 0.2,
     *            -.7, 0.1, 0.2, 0.1,
     *            -.6, 0.2, 0.2, 0.2/
C
      DATA VV102 /0.0, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0/
C
      DATA VV103 /0.1, 0.2, 0.2, 0.2,
     *            -.6, 0.2, 0.2, 0.2,
     *            -.6, 0.2, 0.2, 0.2,
     *            -.6, 0.2, 0.3, 0.3,
     *            -.6, 0.2, 0.3, 0.2,
     *            -.5, 0.3, 0.3, 0.3/
C
      DATA VV104 /0.0, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0,
     *            0.1, 0.0, 0.0, 0.0/
C
      DATA VV105 /0201, 1201, 2201, 3201, 4201, 5201,
     *            2001, 2101, 2301, 2401, 2501, 2601,
     *            2102, 2212, 2322, 2432, 2502, 2612,
     *            2203, 2213, 2223, 2233, 2223, 2233/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'vec2_wdrawr.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              VEC2 Object Demo Program #4'/
     * ' This program tests the VEC2 object access program'/
     * ' VEC2_WDRAWR.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      XPG = XPAGE-2.0
      YPG = YPAGE-2.0
      CALL SUBPLOT_DEFINE (XPG, YPG)
      CALL AXISLBL_DEFX2 ('X Axis$',100)
      CALL AXISLBL_DEFY2 ('Y Axis$',100)
      CALL TEXT2D_SETHT (.19)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test VEC2_PDRAW object access program
C
C                       Loop for each input variable of access program
      CALL LOGPEN2_SETP(XPG*0.1, YPG*0.2, 0)
      DO 589 IVV101 = 1,NVV101
        XP1 = VV101(IVV101)
        YP1 = VV102(IVV101)
        XP2 = VV103(IVV101)
        YP2 = VV104(IVV101)
        IVEC = VV105(IVV101)
C
C                       Draw 2D vector relative to origin in page
C                       coordinates
      CALL VEC2_WDRAWR (XP1,YP1,XP2,YP2,IVEC,3)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) XP1,YP1,XP2,YP2,IVEC
  502 FORMAT (E15.7,E15.7,E15.7,E15.7,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  589 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              VEC2 Demo Program #4 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./vec2_pdraw.dat ]"
cat <<"STOP_CAT"> ././vec2_pdraw.uuu
begin 660 ./vec2_pdraw.dat
M("`@+C$Q-CDP,#!%*S`Q("`@+C$W.3`P,#!%*S`Q("`@+C(S,S@P,#!%*S`Q
M("`@+C$W.3`P,#!%*S`Q("`@("`@("`@("`@("`@("`@,C`Q"B`@("XQ,38Y
M,#`P12LP,2`@("XR-C@U,#`P12LP,2`@("XR,S,X,#`P12LP,2`@("XR-C@U
M,#`P12LP,2`@("`@("`@("`@("`@("`@,3(P,0H@("`N,3$V.3`P,$4K,#$@
M("`N,S4X,#`P,$4K,#$@("`N,C,S.#`P,$4K,#$@("`N,S4X,#`P,$4K,#$@
M("`@("`@("`@("`@("`@(#(R,#$*("`@+C$Q-CDP,#!%*S`Q("`@+C0T-S4P
M,#!%*S`Q("`@+C(S,S@P,#!%*S`Q("`@+C0T-S4P,#!%*S`Q("`@("`@("`@
M("`@("`@("`S,C`Q"B`@("XQ,38Y,#`P12LP,2`@("XU,S<P,#`P12LP,2`@
M("XR,S,X,#`P12LP,2`@("XU,S<P,#`P12LP,2`@("`@("`@("`@("`@("`@
M-#(P,0H@("`N,3$V.3`P,$4K,#$@("`N-C(V-3`P,$4K,#$@("`N,C,S.#`P
M,$4K,#$@("`N-C(V-3`P,$4K,#$@("`@("`@("`@("`@("`@(#4R,#$*("`@
M+C,U,#<P,#!%*S`Q("`@+C$W.3`P,#!%*S`Q("`@+C0V-S8P,#!%*S`Q("`@
M+C$W.3`P,#!%*S`Q("`@("`@("`@("`@("`@("`R,#`Q"B`@("XS-3`W,#`P
M12LP,2`@("XR-C@U,#`P12LP,2`@("XT-C<V,#`P12LP,2`@("XR-C@U,#`P
M12LP,2`@("`@("`@("`@("`@("`@,C$P,0H@("`N,S4P-S`P,$4K,#$@("`N
M,S4X,#`P,$4K,#$@("`N-#8W-C`P,$4K,#$@("`N,S4X,#`P,$4K,#$@("`@
M("`@("`@("`@("`@(#(S,#$*("`@+C,U,#<P,#!%*S`Q("`@+C0T-S4P,#!%
M*S`Q("`@+C0V-S8P,#!%*S`Q("`@+C0T-S4P,#!%*S`Q("`@("`@("`@("`@
M("`@("`R-#`Q"B`@("XS-3`W,#`P12LP,2`@("XU,S<P,#`P12LP,2`@("XT
M-C<V,#`P12LP,2`@("XU,S<P,#`P12LP,2`@("`@("`@("`@("`@("`@,C4P
M,0H@("`N,S4P-S`P,$4K,#$@("`N-C(V-3`P,$4K,#$@("`N-#8W-C`P,$4K
M,#$@("`N-C(V-3`P,$4K,#$@("`@("`@("`@("`@("`@(#(V,#$*("`@+C4X
M-#4P,#!%*S`Q("`@+C$W.3`P,#!%*S`Q("`@+C<P,30P,#!%*S`Q("`@+C$W
M.3`P,#!%*S`Q("`@("`@("`@("`@("`@("`R,3`R"B`@("XU.#0U,#`P12LP
M,2`@("XR-C@U,#`P12LP,2`@("XW,#$T,#`P12LP,2`@("XR-C@U,#`P12LP
M,2`@("`@("`@("`@("`@("`@,C(Q,@H@("`N-3@T-3`P,$4K,#$@("`N,S4X
M,#`P,$4K,#$@("`N-S`Q-#`P,$4K,#$@("`N,S4X,#`P,$4K,#$@("`@("`@
M("`@("`@("`@(#(S,C(*("`@+C4X-#4P,#!%*S`Q("`@+C0T-S4P,#!%*S`Q
M("`@+C<P,30P,#!%*S`Q("`@+C0T-S4P,#!%*S`Q("`@("`@("`@("`@("`@
M("`R-#,R"B`@("XU.#0U,#`P12LP,2`@("XU,S<P,#`P12LP,2`@("XW,#$T
M,#`P12LP,2`@("XU,S<P,#`P12LP,2`@("`@("`@("`@("`@("`@,C4P,@H@
M("`N-3@T-3`P,$4K,#$@("`N-C(V-3`P,$4K,#$@("`N-S`Q-#`P,$4K,#$@
M("`N-C(V-3`P,$4K,#$@("`@("`@("`@("`@("`@(#(V,3(*("`@+C@Q.#,P
M,#!%*S`Q("`@+C$W.3`P,#!%*S`Q("`@+CDS-3(P,#!%*S`Q("`@+C$W.3`P
M,#!%*S`Q("`@("`@("`@("`@("`@("`R,C`S"B`@("XX,3@S,#`P12LP,2`@
M("XR-C@U,#`P12LP,2`@("XY,S4R,#`P12LP,2`@("XR-C@U,#`P12LP,2`@
M("`@("`@("`@("`@("`@,C(Q,PH@("`N.#$X,S`P,$4K,#$@("`N,S4X,#`P
M,$4K,#$@("`N.3,U,C`P,$4K,#$@("`N,S4X,#`P,$4K,#$@("`@("`@("`@
M("`@("`@(#(R,C,*("`@+C@Q.#,P,#!%*S`Q("`@+C0T-S4P,#!%*S`Q("`@
M+CDS-3(P,#!%*S`Q("`@+C0T-S4P,#!%*S`Q("`@("`@("`@("`@("`@("`R
M,C,S"B`@("XX,3@S,#`P12LP,2`@("XU,S<P,#`P12LP,2`@("XY,S4R,#`P
M12LP,2`@("XU,S<P,#`P12LP,2`@("`@("`@("`@("`@("`@,C(R,PH@("`N
M.#$X,S`P,$4K,#$@("`N-C(V-3`P,$4K,#$@("`N.3,U,C`P,$4K,#$@("`N
A-C(V-3`P,$4K,#$@("`@("`@("`@("`@("`@(#(R,S,*
`
end
STOP_CAT
echo "  Generating =====> [ ./vec2_pdrawr.dat ]"
cat <<"STOP_CAT"> ././vec2_pdrawr.uuu
begin 660 ./vec2_pdrawr.dat
M("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@+C$Q-CDP,#!%*S`Q
M("`@+C`P,#`P,#!%*S`P("`@("`@("`@("`@("`@("`@,C`Q"B`@("XQ,38Y
M,#`P12LP,2`@("XP,#`P,#`P12LP,"`@("XR,S,X,#`P12LP,2`@("XP,#`P
M,#`P12LP,"`@("`@("`@("`@("`@("`@,3(P,0H@("`N,3$V.3`P,$4K,#$@
M("`N,#`P,#`P,$4K,#`@("`N,C,S.#`P,$4K,#$@("`N,#`P,#`P,$4K,#`@
M("`@("`@("`@("`@("`@(#(R,#$*("`@+C$Q-CDP,#!%*S`Q("`@+C`P,#`P
M,#!%*S`P("`@+C(S,S@P,#!%*S`Q("`@+C`P,#`P,#!%*S`P("`@("`@("`@
M("`@("`@("`S,C`Q"B`@+2XX,3@S,#`P12LP,2`@("XX.34P,#`P12LP,"`@
M+2XW,#$T,#`P12LP,2`@("XX.34P,#`P12LP,"`@("`@("`@("`@("`@("`@
M-#(P,0H@("`N,3$V.3`P,$4K,#$@("`N,#`P,#`P,$4K,#`@("`N,C,S.#`P
M,$4K,#$@("`N,#`P,#`P,$4K,#`@("`@("`@("`@("`@("`@(#4R,#$*("`@
M+C$Q-CDP,#!%*S`Q("`@+C`P,#`P,#!%*S`P("`@+C(S,S@P,#!%*S`Q("`@
M+C`P,#`P,#!%*S`P("`@("`@("`@("`@("`@("`R,#`Q"B`@("XQ,38Y,#`P
M12LP,2`@("XP,#`P,#`P12LP,"`@("XR,S,X,#`P12LP,2`@("XP,#`P,#`P
M12LP,"`@("`@("`@("`@("`@("`@,C$P,0H@("TN.#$X,S`P,$4K,#$@("`N
M.#DU,#`P,$4K,#`@("TN-S`Q-#`P,$4K,#$@("`N.#DU,#`P,$4K,#`@("`@
M("`@("`@("`@("`@(#(S,#$*("`@+C$Q-CDP,#!%*S`Q("`@+C`P,#`P,#!%
M*S`P("`@+C(S,S@P,#!%*S`Q("`@+C`P,#`P,#!%*S`P("`@("`@("`@("`@
M("`@("`R-#`Q"B`@("XQ,38Y,#`P12LP,2`@("XP,#`P,#`P12LP,"`@("XR
M,S,X,#`P12LP,2`@("XP,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@,C4P
M,0H@("`N,3$V.3`P,$4K,#$@("`N,#`P,#`P,$4K,#`@("`N,C,S.#`P,$4K
M,#$@("`N,#`P,#`P,$4K,#`@("`@("`@("`@("`@("`@(#(V,#$*("`M+C@Q
M.#,P,#!%*S`Q("`@+C@Y-3`P,#!%*S`P("`M+C<P,30P,#!%*S`Q("`@+C@Y
M-3`P,#!%*S`P("`@("`@("`@("`@("`@("`R,3`R"B`@("XQ,38Y,#`P12LP
M,2`@("XP,#`P,#`P12LP,"`@("XR,S,X,#`P12LP,2`@("XP,#`P,#`P12LP
M,"`@("`@("`@("`@("`@("`@,C(Q,@H@("`N,C,S.#`P,$4K,#$@("`N,#`P
M,#`P,$4K,#`@("`N,S4P-S`P,$4K,#$@("`N,#`P,#`P,$4K,#`@("`@("`@
M("`@("`@("`@(#(S,C(*("`@+C(S,S@P,#!%*S`Q("`@+C`P,#`P,#!%*S`P
M("`@+C,U,#<P,#!%*S`Q("`@+C`P,#`P,#!%*S`P("`@("`@("`@("`@("`@
M("`R-#,R"B`@+2XX,3@S,#`P12LP,2`@("XX.34P,#`P12LP,"`@+2XW,#$T
M,#`P12LP,2`@("XX.34P,#`P12LP,"`@("`@("`@("`@("`@("`@,C4P,@H@
M("`N,3$V.3`P,$4K,#$@("`N,#`P,#`P,$4K,#`@("`N,C,S.#`P,$4K,#$@
M("`N,#`P,#`P,$4K,#`@("`@("`@("`@("`@("`@(#(V,3(*("`@+C(S,S@P
M,#!%*S`Q("`@+C`P,#`P,#!%*S`P("`@+C,U,#<P,#!%*S`Q("`@+C`P,#`P
M,#!%*S`P("`@("`@("`@("`@("`@("`R,C`S"B`@("XQ,38Y,#`P12LP,2`@
M("XP,#`P,#`P12LP,"`@("XR,S,X,#`P12LP,2`@("XP,#`P,#`P12LP,"`@
M("`@("`@("`@("`@("`@,C(Q,PH@("TN-S`Q-#`P,$4K,#$@("`N.#DU,#`P
M,$4K,#`@("TN-3@T-3`P,$4K,#$@("`N.#DU,#`P,$4K,#`@("`@("`@("`@
M("`@("`@(#(R,C,*("`@+C(S,S@P,#!%*S`Q("`@+C`P,#`P,#!%*S`P("`@
M+C,U,#<P,#!%*S`Q("`@+C`P,#`P,#!%*S`P("`@("`@("`@("`@("`@("`R
M,C,S"B`@("XR,S,X,#`P12LP,2`@("XP,#`P,#`P12LP,"`@("XS-3`W,#`P
M12LP,2`@("XP,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@,C(R,PH@("`N
M,C,S.#`P,$4K,#$@("`N,#`P,#`P,$4K,#`@("`N,S4P-S`P,$4K,#$@("`N
A,#`P,#`P,$4K,#`@("`@("`@("`@("`@("`@(#(R,S,*
`
end
STOP_CAT
echo "  Generating =====> [ ./vec2_wdrawr.dat ]"
cat <<"STOP_CAT"> ././vec2_wdrawr.uuu
begin 660 ./vec2_wdrawr.dat
M("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@+C$P,#`P,#!%*S`P
M("`@+C`P,#`P,#!%*S`P("`@("`@("`@("`@("`@("`@,C`Q"B`@("XQ,#`P
M,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XR,#`P,#`P12LP,"`@("XP,#`P
M,#`P12LP,"`@("`@("`@("`@("`@("`@,3(P,0H@("`N,3`P,#`P,$4K,#`@
M("`N,#`P,#`P,$4K,#`@("`N,C`P,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@
M("`@("`@("`@("`@("`@(#(R,#$*("`@+C$P,#`P,#!%*S`P("`@+C`P,#`P
M,#!%*S`P("`@+C(P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@("`@("`@
M("`@("`@("`S,C`Q"B`@+2XW,#`P,#`P12LP,"`@("XQ,#`P,#`P12LP,"`@
M+2XV,#`P,#`P12LP,"`@("XQ,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@
M-#(P,0H@("`N,3`P,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@("`N,C`P,#`P
M,$4K,#`@("`N,#`P,#`P,$4K,#`@("`@("`@("`@("`@("`@(#4R,#$*("`@
M+C$P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@+C(P,#`P,#!%*S`P("`@
M+C`P,#`P,#!%*S`P("`@("`@("`@("`@("`@("`R,#`Q"B`@("XQ,#`P,#`P
M12LP,"`@("XP,#`P,#`P12LP,"`@("XR,#`P,#`P12LP,"`@("XP,#`P,#`P
M12LP,"`@("`@("`@("`@("`@("`@,C$P,0H@("TN-S`P,#`P,$4K,#`@("`N
M,3`P,#`P,$4K,#`@("TN-C`P,#`P,$4K,#`@("`N,3`P,#`P,$4K,#`@("`@
M("`@("`@("`@("`@(#(S,#$*("`@+C$P,#`P,#!%*S`P("`@+C`P,#`P,#!%
M*S`P("`@+C(P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@("`@("`@("`@
M("`@("`R-#`Q"B`@("XQ,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XR
M,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@,C4P
M,0H@("`N,3`P,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@("`N,C`P,#`P,$4K
M,#`@("`N,#`P,#`P,$4K,#`@("`@("`@("`@("`@("`@(#(V,#$*("`M+C<P
M,#`P,#!%*S`P("`@+C$P,#`P,#!%*S`P("`M+C8P,#`P,#!%*S`P("`@+C$P
M,#`P,#!%*S`P("`@("`@("`@("`@("`@("`R,3`R"B`@("XQ,#`P,#`P12LP
M,"`@("XP,#`P,#`P12LP,"`@("XR,#`P,#`P12LP,"`@("XP,#`P,#`P12LP
M,"`@("`@("`@("`@("`@("`@,C(Q,@H@("`N,C`P,#`P,$4K,#`@("`N,#`P
M,#`P,$4K,#`@("`N,S`P,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@("`@("`@
M("`@("`@("`@(#(S,C(*("`@+C(P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P
M("`@+C,P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@("`@("`@("`@("`@
M("`R-#,R"B`@+2XW,#`P,#`P12LP,"`@("XQ,#`P,#`P12LP,"`@+2XV,#`P
M,#`P12LP,"`@("XQ,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@,C4P,@H@
M("`N,3`P,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@("`N,C`P,#`P,$4K,#`@
M("`N,#`P,#`P,$4K,#`@("`@("`@("`@("`@("`@(#(V,3(*("`@+C(P,#`P
M,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@+C,P,#`P,#!%*S`P("`@+C`P,#`P
M,#!%*S`P("`@("`@("`@("`@("`@("`R,C`S"B`@("XQ,#`P,#`P12LP,"`@
M("XP,#`P,#`P12LP,"`@("XR,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@
M("`@("`@("`@("`@("`@,C(Q,PH@("TN-C`P,#`P,$4K,#`@("`N,3`P,#`P
M,$4K,#`@("TN-3`P,#`P,$4K,#`@("`N,3`P,#`P,$4K,#`@("`@("`@("`@
M("`@("`@(#(R,C,*("`@+C(P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@
M+C,P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P("`@("`@("`@("`@("`@("`R
M,C,S"B`@("XR,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XS,#`P,#`P
M12LP,"`@("XP,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@,C(R,PH@("`N
M,C`P,#`P,$4K,#`@("`N,#`P,#`P,$4K,#`@("`N,S`P,#`P,$4K,#`@("`N
A,#`P,#`P,$4K,#`@("`@("`@("`@("`@("`@(#(R,S,*
`
end
STOP_CAT
echo "  Generating =====> [ ./vec31.f ]"
cat <<"STOP_CAT"> ././vec31.f
C     PROGRAM VEC31
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program VEC3_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (NMAX=231)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
      COMMON /FLOCOM/ X(NMAX),Y(NMAX),U(NMAX),V(NMAX)
C
C     ******************************************************************
C
C                       INITIALIZE LIBRARIES
C
C                       Initialize the plot package
      CALL PLOT_INIT (0)
C                       Load data to be plotted
      CALL FLODAT (X,Y,U,V)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       INITIALZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE, YPAGE)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Compute new location of physical origin in
C                       inches from current location
      XRL = 0.10*XPAGE
      YRL = 0.15*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = 0.8*XPAGE
      YPG = 0.7*YPAGE
C                       Move physical origin relative to current
C                       location (distance in inches)
      CALL ORIGIN_MOVE (XRL,YRL)
C                       Define subplot area in terms of length
C                       of X and Y axis in inches and plot border
C                       around subplot
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       PLOT TITLE BELOW SUBPLOT AREA
C
C                       Compute text height based on page height
      SIZE = 0.30*YPAGE/11.0
C                       Set text style to 'cartog'
      CALL FONT_CARTOG
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('VEC31 Demo: 3D Flow Vectors$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw title centered below subplot area
      YY = -0.1*YPAGE
      CALL TEXT2D_PDRAW ('VEC31 Demo: 3D Flow Vectors$',100,XX,YY)
C
C     ******************************************************************
C
C                       DRAW THE PLOT (FLOW PATTERN)
C
C                       Set grace margin to clip at subplot boundary
      CALL MARGIN_SET (0.0)
C
C                       Set X axis label for 3-D plot
      CALL AXISLBL_DEFX3 ('X Axis',6)
C                       Set Y axis label for 3-D plot
      CALL AXISLBL_DEFY3 ('Y Axis',6)
C                       Set Z axis label for 3-D plot
      CALL AXISLBL_DEFZ3 ('Z Axis',6)
C                       Set drawing color to 'foreground' (white)
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Define dimensions of 3D workbox
      CALL WORKBOX_DEFINE (10.0,5.0,10.0)
C                       Set 3D viewpoint location in 3D workbox units
      CALL VIEWPT_SETBS (60.0,30.0,99.0)
C                       Define 3D coordinate system
      CALL PLOT3D_DEFINE (0.0,5.0,20.0,-5.0,2.5,5.0,0.0,2.5,10.0)
C
C                       Set drawing color to green
      CALL COLOR_SETNAM ('GREEN')
C                       Commpute and draw flow pattern
      DO 400 J=1,NMAX
        X1 = X(J)
        Y1 = Y(J)
        X2 = U(J)+X1
        Y2 = V(J)+Y1
        IF (X1 .NE. X2 .OR. Y1 .NE. Y2) THEN
          CALL VEC3_DRAW (X1,0.0,Y1,X2,0.0,Y2,1131)
        ENDIF
  400 CONTINUE
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       END THE PLOT
C
C                       End current plot and advance paper
      CALL PAGE_END (0)
C
C     ******************************************************************
C
C                       CLOSE THE OUTPUT DEVICE
C
C                       Finish plotting and release device
      CALL DEVICE_END
C                       Exit
      CALL PROCESS_EXIT
      END
      SUBROUTINE FLODAT (XX,YY,UU,VV)
      SAVE
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: INITIALIZE FLOW PATTERN DEMO DATA ARRAYS
C
C     ARGUMENT LIST INPUT:  None
C
C     ARGUMENT LIST OUTPUT:
C       XX,YY,UU,VV = X,Y coordinates of flow field vectors
C
C     GLOBAL INPUT:  None
C
C     GLOBAL OUTPUT:  None
C
C     EXCEPTIONS:  None
C
C     LOCAL VARIABLES:
C
C     NOTES:  None
C
C     ******************************************************************
C
      PARAMETER (NMAX=231)
C
      DIMENSION XX(*),YY(*),UU(*),VV(*)
      DIMENSION X(NMAX),Y(NMAX),U(NMAX),V(NMAX)
C
      DATA (X(I),Y(I),U(I),V(I),I=1,20) /
     + 0.0,  0.0,  0.0,  0.0,  1.0,  0.0,  0.0,  0.0,
     + 2.0,  0.0,  0.0,  0.0,  3.0,  0.0,  0.0,  0.0,
     + 4.0,  0.0,  0.0,  0.0,  5.0,  0.0,  0.0, -0.50,
     + 6.0,  0.0,  0.0, -1.0,  7.0,  0.0,  0.0, -0.50,
     + 8.0,  0.0,  0.0,  0.0,  9.0,  0.0,  0.0,  0.0,
     +10.0,  0.0,  0.0,  0.0, 11.0,  0.0,  0.0,  0.0,
     +12.0,  0.0,  0.0,  0.0, 13.0,  0.0,  0.0,  0.50,
     +14.0,  0.0,  0.0,  1.0, 15.0,  0.0,  0.0,  0.50,
     +16.0,  0.0,  0.0,  0.0, 17.0,  0.0,  0.0,  0.0,
     +18.0,  0.0,  0.0,  0.0, 19.0,  0.0,  0.0,  0.0/
      DATA (X(I),Y(I),U(I),V(I),I=21,40) /
     +20.0,  0.0,  0.0,  0.0, 20.0,  1.0,  0.0,  0.0,
     +20.0,  2.0,  0.0,  0.0, 20.0,  3.0,  0.0,  0.0,
     +20.0,  4.0,  0.0,  0.0, 20.0,  5.0,  0.0,  0.0,
     +20.0,  6.0,  0.0,  0.0, 20.0,  7.0,  0.0,  0.0,
     +20.0,  8.0,  0.0,  0.0, 20.0,  9.0,  0.0,  0.0,
     +20.0, 10.0,  0.0,  0.0, 19.0, 10.0,  0.0,  0.0,
     +18.0, 10.0,  0.0,  0.0, 17.0, 10.0,  0.0,  0.0,
     +16.0, 10.0,  0.0,  0.0, 15.0, 10.0,  0.0,  0.0,
     +14.0, 10.0,  0.0,  0.0, 13.0, 10.0,  0.0,  0.0,
     +12.0, 10.0,  0.0,  0.0, 11.0, 10.0,  0.0,  0.0/
      DATA (X(I),Y(I),U(I),V(I),I=41,60) /
     +10.0, 10.0,  0.0,  0.0,  9.0, 10.0,  0.0,  0.0,
     + 8.0, 10.0,  0.0,  0.0,  7.0, 10.0,  0.0,  0.0,
     + 6.0, 10.0,  0.0,  0.0,  5.0, 10.0,  0.0,  0.0,
     + 4.0, 10.0,  0.0,  0.0,  3.0, 10.0,  0.0,  0.0,
     + 2.0, 10.0,  0.0,  0.0,  1.0, 10.0,  0.0,  0.0,
     + 0.0, 10.0,  0.0,  0.0,  0.0,  9.0,  0.0,  0.0,
     + 0.0,  8.0,  0.0,  0.0,  0.0,  7.0,  0.0,  0.0,
     + 0.0,  6.0,  0.0,  0.0,  0.0,  5.0,  0.0,  0.0,
     + 0.0,  4.0,  0.0,  0.0,  0.0,  3.0,  0.0,  0.0,
     + 0.0,  2.0,  0.0,  0.0,  0.0,  1.0,  0.0,  0.0/
      DATA (X(I),Y(I),U(I),V(I),I=61,80) /
     + 1.0,  1.0, -0.06322,  0.09193, 1.0,  2.0,  0.02260,  0.12002,
     + 1.0,  3.0,  0.06256,  0.04876, 1.0,  4.0,  0.05467, -0.04382,
     + 1.0,  5.0,  0.02537, -0.10529, 1.0,  6.0, -0.00507, -0.12160,
     + 1.0,  7.0, -0.02856, -0.09999, 1.0,  8.0, -0.03805, -0.05653,
     + 1.0,  9.0, -0.00951, -0.01070, 2.0,  1.0, -0.15314,  0.09893,
     + 2.0,  2.0,  0.07739,  0.08502, 2.0,  3.0,  0.16749, -0.02743,
     + 2.0,  4.0,  0.13416, -0.12523, 2.0,  5.0,  0.05750, -0.17137,
     + 2.0,  6.0, -0.01372, -0.17215, 2.0,  7.0, -0.06227, -0.14426,
     + 2.0,  8.0, -0.08054, -0.10259, 2.0,  9.0, -0.06332, -0.05013,
     + 3.0,  1.0, -0.20965,  0.09701, 3.0,  2.0,  0.20996, -0.01863/
      DATA (X(I),Y(I),U(I),V(I),I=81,100) /
     + 3.0,  3.0,  0.29596, -0.19063, 3.0,  4.0,  0.19274, -0.27311,
     + 3.0,  5.0,  0.05992, -0.27791, 3.0,  6.0, -0.04375, -0.24280,
     + 3.0,  7.0, -0.10855, -0.19003, 3.0,  8.0, -0.13646, -0.12828,
     + 3.0,  9.0, -0.13560, -0.05575, 4.0,  1.0, -0.16632, -0.00455,
     + 4.0,  2.0,  0.45121, -0.27487, 4.0,  3.0,  0.41302, -0.45845,
     + 4.0,  4.0,  0.19189, -0.46202, 4.0,  5.0,  0.01022, -0.39328,
     + 4.0,  6.0, -0.10917, -0.30968, 4.0,  7.0, -0.17914, -0.22611,
     + 4.0,  8.0, -0.21182, -0.14333, 4.0,  9.0, -0.21874, -0.05812,
     + 5.0,  1.0, -0.03989, -0.43274, 5.0,  2.0,  0.74060, -0.76788,
     + 5.0,  3.0,  0.41075, -0.78498, 5.0,  4.0,  0.08446, -0.63229/
      DATA (X(I),Y(I),U(I),V(I),I=101,120) /
     + 5.0,  5.0, -0.10171, -0.47889, 5.0,  6.0, -0.21029, -0.35235,
     + 5.0,  7.0, -0.27181, -0.24496, 5.0,  8.0, -0.30052, -0.14865,
     + 5.0,  9.0, -0.30636, -0.05814, 6.0,  1.0,  0.11887, -1.10951,
     + 6.0,  2.0,  0.88351, -1.24270, 6.0,  3.0,  0.16385, -0.99497,
     + 6.0,  4.0, -0.12754, -0.70365, 6.0,  5.0, -0.25819, -0.50388,
     + 6.0,  6.0, -0.33394, -0.35802, 6.0,  7.0, -0.37655, -0.24133,
     + 6.0,  8.0, -0.39395, -0.14226, 6.0,  9.0, -0.39242, -0.05453,
     + 7.0,  1.0,  0.49289, -1.15327, 7.0,  2.0,  0.70657, -1.16402,
     + 7.0,  3.0, -0.19468, -0.88042, 7.0,  4.0, -0.35682, -0.62924,
     + 7.0,  5.0, -0.42078, -0.45469, 7.0,  6.0, -0.46024, -0.31970/
      DATA (X(I),Y(I),U(I),V(I),I=121,140) /
     + 7.0,  7.0, -0.48014, -0.21097, 7.0,  8.0, -0.48197, -0.12158,
     + 7.0,  9.0, -0.46955, -0.04605, 8.0,  1.0,  0.97833, -0.48809,
     + 8.0,  2.0,  0.50832, -0.51612, 8.0,  3.0, -0.34948, -0.48120,
     + 8.0,  4.0, -0.50562, -0.42411, 8.0,  5.0, -0.54922, -0.32742,
     + 8.0,  6.0, -0.56741, -0.23121, 8.0,  7.0, -0.56751, -0.1490,
     + 8.0,  8.0, -0.55288, -0.08332, 8.0,  9.0, -0.52882, -0.03126,
     + 9.0,  1.0,  1.18464,  0.00547, 9.0,  2.0,  0.46674,  0.03298,
     + 9.0,  3.0, -0.27039, -0.06453, 9.0,  4.0, -0.53267, -0.14113,
     + 9.0,  5.0, -0.61525, -0.13215, 9.0,  6.0, -0.63468, -0.09309,
     + 9.0,  7.0, -0.62253, -0.05452, 9.0,  8.0, -0.59391, -0.02665/
      DATA (X(I),Y(I),U(I),V(I),I=141,160) /
     + 9.0,  9.0, -0.55967, -0.00962, 10.0,  1.0,  1.08317,  0.15574,
     +10.0,  2.0,  0.45806,  0.27631, 10.0,  3.0, -0.15046,  0.22935,
     +10.0,  4.0, -0.48137,  0.14342, 10.0,  5.0, -0.61527,  0.09768,
     +10.0,  6.0, -0.64837,  0.07807, 10.0,  7.0, -0.63160,  0.06301,
     +10.0,  8.0, -0.59390,  0.04314, 10.0,  9.0, -0.55279,  0.01708,
     +11.0,  1.0,  0.84781,  0.20199, 11.0,  2.0,  0.38370,  0.40195,
     +11.0,  3.0, -0.09410,  0.44201, 11.0,  4.0, -0.41269,  0.39269,
     +11.0,  5.0, -0.56460,  0.32250, 11.0,  6.0, -0.60598,  0.25252,
     +11.0,  7.0, -0.58835,  0.18346, 11.0,  8.0, -0.54741,  0.11418,
     +11.0,  9.0, -0.50399,  0.04436, 12.0,  1.0,  0.53824,  0.31114/
      DATA (X(I),Y(I),U(I),V(I),I=161,180) /
     +12.0,  2.0,  0.24021,  0.55561, 12.0,  3.0, -0.09670,  0.63739,
     +12.0,  4.0, -0.34554,  0.60263, 12.0,  5.0, -0.47542,  0.50935,
     +12.0,  6.0, -0.51254,  0.39613, 12.0,  7.0, -0.49613,  0.28110,
     +12.0,  8.0, -0.4580,  0.17092,  12.0,  9.0, -0.41757,  0.06614,
     +13.0,  1.0,  0.26610,  0.65350, 13.0,  2.0,  0.10556,  0.79609,
     +13.0,  3.0, -0.09516,  0.82051, 13.0,  4.0, -0.25777,  0.74779,
     +13.0,  5.0, -0.35014,  0.62051, 13.0,  6.0, -0.37938,  0.47491,
     +13.0,  7.0, -0.36839,  0.33184, 13.0,  8.0, -0.33924,  0.19928,
     +13.0,  9.0, -0.30639,  0.07708, 14.0,  1.0,  0.15525,  0.89493,
     +14.0,  2.0,  0.08346,  0.91506, 14.0,  3.0, -0.03162,  0.86285/
      DATA (X(I),Y(I),U(I),V(I),I=181,200) /
     +14.0,  4.0, -0.13502,  0.75407, 14.0,  5.0, -0.20156,  0.61316,
     +14.0,  6.0, -0.22928,  0.46401, 14.0,  7.0, -0.22861,  0.32176,
     +14.0,  8.0, -0.21234,  0.19220, 14.0,  9.0, -0.18973,  0.07447,
     +15.0,  1.0,  0.08927,  0.59845, 15.0,  2.0,  0.09178,  0.6640,
     +15.0,  3.0,  0.04096,  0.65234, 15.0,  4.0, -0.02027,  0.58279,
     +15.0,  5.0, -0.06847,  0.48077, 15.0,  6.0, -0.09616,  0.36732,
     +15.0,  7.0, -0.10497,  0.25618, 15.0,  8.0, -0.10038,  0.15345,
     +15.0,  9.0, -0.08746,  0.05972, 16.0,  1.0, -0.03855,  0.15811,
     +16.0,  2.0,  0.02590,  0.26747, 16.0,  3.0,  0.04735,  0.32219,
     +16.0,  4.0,  0.03514,  0.32091, 16.0,  5.0,  0.01236,  0.28216/
      DATA (X(I),Y(I),U(I),V(I),I=201,220) /
     +16.0,  6.0, -0.00739,  0.22395, 16.0,  7.0, -0.01859,  0.15962,
     +16.0,  8.0, -0.02038,  0.09659, 16.0,  9.0, -0.01411,  0.03786,
     +17.0,  1.0, -0.12034, -0.0090,  17.0,  2.0, -0.04278,  0.03011,
     +17.0,  3.0,  0.01331,  0.07006, 17.0,  4.0,  0.0370,   0.09351,
     +17.0,  5.0,  0.03877,  0.09632, 17.0,  6.0,  0.03182,  0.08358,
     +17.0,  7.0,  0.02463,  0.06237, 17.0,  8.0,  0.02182,  0.03837,
     +17.0,  9.0,  0.02474,  0.01506, 18.0,  1.0, -0.10499, -0.03625,
     +18.0,  2.0, -0.05596, -0.06505, 18.0,  3.0, -0.00893, -0.06464,
     +18.0,  4.0,  0.02074, -0.05027, 18.0,  5.0,  0.03273, -0.03436,
     +18.0,  6.0,  0.03427, -0.02185, 18.0,  7.0,  0.03204, -0.01379/
      DATA (X(I),Y(I),U(I),V(I),I=221,231) /
     +18.0,  8.0,  0.03056, -0.00830, 18.0,  9.0,  0.03227, -0.00335,
     +19.0,  1.0, -0.04691, -0.04893, 19.0,  2.0, -0.02908, -0.10203,
     +19.0,  3.0, -0.00856, -0.12466, 19.0,  4.0,  0.00645, -0.12222,
     +19.0,  5.0,  0.01415, -0.10523, 19.0,  6.0,  0.01646, -0.08263,
     +19.0,  7.0,  0.01635, -0.05973, 19.0,  8.0,  0.01610, -0.03757,
     +19.0,  9.0,  0.01725, -0.01552/
C
C     ******************************************************************
C
      DO 100 I=1,NMAX
        XX(I) = X(I)
        YY(I) = Y(I)
        UU(I) = U(I)
        VV(I) = V(I)
  100 CONTINUE
      RETURN
      END
STOP_CAT
echo "  Generating =====> [ ./viewpoint_setbs.dat ]"
cat <<"STOP_CAT"> ././viewpoint_setbs.uuu
begin 660 ./viewpoint_setbs.dat
M("`@("`@("`@("`@("`@("`@("`R("`M+C$V,#`P,#!%*S`S("`@+C0U,#`P
M,#!%*S`R("`@+CDY.3DY.3!%*S`T("`M+C$V,#`P,#!%*S`S("`@+C0U,#`P
M,#!%*S`R("`@+CDY.3DY.3!%*S`T"B`@("`@("`@("`@("`@("`@("`@,B`@
M+2XQ,S`P,#`P12LP,R`@("XT-3`P,#`P12LP,B`@("XY.3DY.3DP12LP-"`@
M+2XQ,S`P,#`P12LP,R`@("XT-3`P,#`P12LP,B`@("XY.3DY.3DP12LP-`H@
M("`@("`@("`@("`@("`@("`@(#(@("TN,3`P,#`P,$4K,#,@("`N-#4P,#`P
M,$4K,#(@("`N.3DY.3DY,$4K,#0@("TN,3`P,#`P,$4K,#,@("`N-#4P,#`P
M,$4K,#(@("`N.3DY.3DY,$4K,#0*("`@("`@("`@("`@("`@("`@("`R("`M
M+C8P,#`P,#!%*S`R("`@+C0U,#`P,#!%*S`R("`@+CDY.3DY.3!%*S`T("`M
M+C8P,#`P,#!%*S`R("`@+C0U,#`P,#!%*S`R("`@+CDY.3DY.3!%*S`T"B`@
M("`@("`@("`@("`@("`@("`@,B`@+2XS,#`P,#`P12LP,B`@("XT-3`P,#`P
M12LP,B`@("XY.3DY.3DP12LP-"`@+2XS,#`P,#`P12LP,B`@("XT-3`P,#`P
M12LP,B`@("XY.3DY.3DP12LP-`H@("`@("`@("`@("`@("`@("`@(#(@("`N
M,#`P,#`P,$4K,#`@("`N-#4P,#`P,$4K,#(@("`N.3DY.3DY,$4K,#0@("`N
J,#`P,#`P,$4K,#`@("`N-#4P,#`P,$4K,#(@("`N.3DY.3DY,$4K,#0*
`
end
STOP_CAT
echo "  Generating =====> [ ./viewpoint_setbu.dat ]"
cat <<"STOP_CAT"> ././viewpoint_setbu.uuu
begin 660 ./viewpoint_setbu.dat
M("`@("`@("`@("`@("`@("`@("`Q("`M+C,S,S`P,#!%*S`Q("`M+C,S,S`P
M,#!%*S`Q("`M+C,S,S`P,#!%*S`Q("`M+C,S,S`P,#!%*S`Q("`M+C,S,S`P
M,#!%*S`Q("`M+C,S,S`P,#!%*S`Q"B`@("`@("`@("`@("`@("`@("`@,2`@
M+2XS,S,P,#`P12LP,2`@+2XS,S,P,#`P12LP,2`@("XY.3DP,#`P12LP,2`@
M+2XS,S,P,#`P12LP,2`@+2XS,S,P,#`P12LP,2`@("XY.3DP,#`P12LP,0H@
M("`@("`@("`@("`@("`@("`@(#$@("TN,S,S,#`P,$4K,#$@("`N.3DY,#`P
M,$4K,#$@("TN,S,S,#`P,$4K,#$@("TN,S,S,#`P,$4K,#$@("`N.3DY,#`P
M,$4K,#$@("TN,S,S,#`P,$4K,#$*("`@("`@("`@("`@("`@("`@("`Q("`M
M+C,S,S`P,#!%*S`Q("`@+CDY.3`P,#!%*S`Q("`@+CDY.3`P,#!%*S`Q("`M
M+C,S,S`P,#!%*S`Q("`@+CDY.3`P,#!%*S`Q("`@+CDY.3`P,#!%*S`Q"B`@
M("`@("`@("`@("`@("`@("`@,2`@("XY.3DP,#`P12LP,2`@+2XS,S,P,#`P
M12LP,2`@+2XS,S,P,#`P12LP,2`@("XY.3DP,#`P12LP,2`@+2XS,S,P,#`P
M12LP,2`@+2XS,S,P,#`P12LP,0H@("`@("`@("`@("`@("`@("`@(#$@("`N
M.3DY,#`P,$4K,#$@("TN,S,S,#`P,$4K,#$@("`N.3DY,#`P,$4K,#$@("`N
M.3DY,#`P,$4K,#$@("TN,S,S,#`P,$4K,#$@("`N.3DY,#`P,$4K,#$*("`@
M("`@("`@("`@("`@("`@("`Q("`@+CDY.3`P,#!%*S`Q("`@+CDY.3`P,#!%
M*S`Q("`M+C,S,S`P,#!%*S`Q("`@+CDY.3`P,#!%*S`Q("`@+CDY.3`P,#!%
M*S`Q("`M+C,S,S`P,#!%*S`Q"B`@("`@("`@("`@("`@("`@("`@,2`@("XY
M.3DP,#`P12LP,2`@("XY.3DP,#`P12LP,2`@("XY.3DP,#`P12LP,2`@("XY
I.3DP,#`P12LP,2`@("XY.3DP,#`P12LP,2`@("XY.3DP,#`P12LP,0H@
`
end
STOP_CAT
echo "  Generating =====> [ ./viewpoint_setwc.dat ]"
cat <<"STOP_CAT"> ././viewpoint_setwc.uuu
begin 660 ./viewpoint_setwc.dat
M("`@("`@("`@("`@("`@("`@("`S("`M+C,S,S`P,#!%*S`Q("`M+C,S,S`P
M,#!%*S`Q("`M+C,S,S`P,#!%*S`Q("`M+C,S,S`P,#!%*S`Q("`M+C,S,S`P
M,#!%*S`Q("`M+C,S,S`P,#!%*S`Q"B`@("`@("`@("`@("`@("`@("`@,R`@
M+2XS,S,P,#`P12LP,2`@+2XS,S,P,#`P12LP,2`@("XY.3DP,#`P12LP,2`@
M+2XS,S,P,#`P12LP,2`@+2XS,S,P,#`P12LP,2`@("XY.3DP,#`P12LP,0H@
M("`@("`@("`@("`@("`@("`@(#,@("TN,S,S,#`P,$4K,#$@("`N.3DY,#`P
M,$4K,#$@("TN,S,S,#`P,$4K,#$@("TN,S,S,#`P,$4K,#$@("`N.3DY,#`P
M,$4K,#$@("TN,S,S,#`P,$4K,#$*("`@("`@("`@("`@("`@("`@("`S("`M
M+C,S,S`P,#!%*S`Q("`@+CDY.3`P,#!%*S`Q("`@+CDY.3`P,#!%*S`Q("`M
M+C,S,S`P,#!%*S`Q("`@+CDY.3`P,#!%*S`Q("`@+CDY.3`P,#!%*S`Q"B`@
M("`@("`@("`@("`@("`@("`@,R`@("XY.3DP,#`P12LP,2`@+2XS,S,P,#`P
M12LP,2`@+2XS,S,P,#`P12LP,2`@("XY.3DP,#`P12LP,2`@+2XS,S,P,#`P
M12LP,2`@+2XS,S,P,#`P12LP,0H@("`@("`@("`@("`@("`@("`@(#,@("`N
M.3DY,#`P,$4K,#$@("TN,S,S,#`P,$4K,#$@("`N.3DY,#`P,$4K,#$@("`N
M.3DY,#`P,$4K,#$@("TN,S,S,#`P,$4K,#$@("`N.3DY,#`P,$4K,#$*("`@
M("`@("`@("`@("`@("`@("`S("`@+CDY.3`P,#!%*S`Q("`@+CDY.3`P,#!%
M*S`Q("`M+C,S,S`P,#!%*S`Q("`@+CDY.3`P,#!%*S`Q("`@+CDY.3`P,#!%
M*S`Q("`M+C,S,S`P,#!%*S`Q"B`@("`@("`@("`@("`@("`@("`@,R`@("XY
M.3DP,#`P12LP,2`@("XY.3DP,#`P12LP,2`@("XY.3DP,#`P12LP,2`@("XY
I.3DP,#`P12LP,2`@("XY.3DP,#`P12LP,2`@("XY.3DP,#`P12LP,0H@
`
end
STOP_CAT
echo "  Generating =====> [ ./viewpt1.f ]"
cat <<"STOP_CAT"> ././viewpt1.f
C     PROGRAM VIEWPT1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program VIEWPT_SETBS
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       VIEWPT object access program
      EXTERNAL VIEWPT_SETBS
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT3D_DEFINE, WORKBOX_DEFINE
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3, AXISLBL_DEFZ3
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV105 =  6)
      PARAMETER (NVV106 =  1)
      PARAMETER (NVV107 =  1)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'VIEWPT.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101
C
C                       Real variables and arrays
      REAL    TMP102, TMP103, TMP104, ANXYPL, TMP105, ANVERT, TMP106
     *      , RAD, TMP107
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV105(NVV105)
      REAL    VV106(NVV106)
      REAL    VV107(NVV107)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV105 /-160., -130., -100., -60., -30., 0.0/
C
      DATA VV106 /45.0/
C
      DATA VV107 /9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'viewpoint_setbs.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              VIEWPT Object Demo Program #1'/
     * ' This program tests the VIEWPT object access program'/
     * ' VIEWPT_SETBS.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test VIEWPT_SETBS object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV105 = 1,NVV105
        ANXYPL = VV105(IVV105)
C
      DO 588 IVV106 = 1,NVV106
        ANVERT = VV106(IVV106)
C
      DO 587 IVV107 = 1,NVV107
        RAD = VV107(IVV107)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.25)
      CALL WORKBOX_DEFINE (1., 1., 1.)
      CALL AXISLBL_DEFX3 ('X Axis$',100)
      CALL AXISLBL_DEFY3 ('Y Axis$',100)
      CALL AXISLBL_DEFZ3 ('Z Axis$',100)
C
C                       Set 3D viewpoint in workbox spherical
C                       coordinates
      CALL VIEWPT_SETBS (ANXYPL,ANVERT,RAD)
C
      CALL PLOT3D_DEFINE (0.0, 0., 1.0, 0.0, 0., 1.0, 0.0, 0., 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106,TMP107
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZVWPT .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZVPXI ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZVPYI ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZVPZI ,TMP104 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZVWPT,ZZVPXI,ZZVPYI,ZZVPZI,ANXYPL,ANVERT,
     *       RAD
  502 FORMAT (I21,E15.7,E15.7,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              VIEWPT Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./viewpt2.f ]"
cat <<"STOP_CAT"> ././viewpt2.f
C     PROGRAM VIEWPT2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program VIEWPT_SETBU
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       VIEWPT object access program
      EXTERNAL VIEWPT_SETBU
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT3D_DEFINE, WORKBOX_DEFINE
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3, AXISLBL_DEFZ3
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV105 =  2)
      PARAMETER (NVV106 =  2)
      PARAMETER (NVV107 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'VIEWPT.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101
C
C                       Real variables and arrays
      REAL    TMP102, TMP103, TMP104, VX, TMP105, VY, TMP106, VZ, TMP107
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV105(NVV105)
      REAL    VV106(NVV106)
      REAL    VV107(NVV107)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV105 /-3.33, 9.99/
C
      DATA VV106 /-3.33, 9.99/
C
      DATA VV107 /-3.33, 9.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'viewpoint_setbu.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              VIEWPT Object Demo Program #2'/
     * ' This program tests the VIEWPT object access program'/
     * ' VIEWPT_SETBU.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test VIEWPT_SETBU object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV105 = 1,NVV105
        VX = VV105(IVV105)
C
      DO 588 IVV106 = 1,NVV106
        VY = VV106(IVV106)
C
      DO 587 IVV107 = 1,NVV107
        VZ = VV107(IVV107)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.25)
      CALL WORKBOX_DEFINE (1., 1., 1.)
      CALL AXISLBL_DEFX3 ('X Axis$',100)
      CALL AXISLBL_DEFY3 ('Y Axis$',100)
      CALL AXISLBL_DEFZ3 ('Z Axis$',100)
C
C                       Set 3D viewpoint in workbox Cartesian
C                       coordinates
      CALL VIEWPT_SETBU (VX,VY,VZ)
C
      CALL PLOT3D_DEFINE (0.0, 0., 1.0, 0.0, 0., 1.0, 0.0, 0., 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106,TMP107
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZVWPT .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZVPXI ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZVPYI ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZVPZI ,TMP104 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZVWPT,ZZVPXI,ZZVPYI,ZZVPZI,VX,VY,VZ
  502 FORMAT (I21,E15.7,E15.7,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              VIEWPT Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./viewpt3.f ]"
cat <<"STOP_CAT"> ././viewpt3.f
C     PROGRAM VIEWPT3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program VIEWPT_SETWC
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       VIEWPT object access program
      EXTERNAL VIEWPT_SETWC
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT3D_DEFINE, WORKBOX_DEFINE
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3, AXISLBL_DEFZ3
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV105 =  2)
      PARAMETER (NVV106 =  2)
      PARAMETER (NVV107 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'VIEWPT.INC'
C
C                       Integer variables and arrays
      INTEGER TMP101
C
C                       Real variables and arrays
      REAL    TMP102, TMP103, TMP104, VWX, TMP105, VWY, TMP106, VWZ
     *      , TMP107
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV105(NVV105)
      REAL    VV106(NVV106)
      REAL    VV107(NVV107)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV105 /-3.33, 9.99/
C
      DATA VV106 /-3.33, 9.99/
C
      DATA VV107 /-3.33, 9.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'viewpoint_setwc.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              VIEWPT Object Demo Program #3'/
     * ' This program tests the VIEWPT object access program'/
     * ' VIEWPT_SETWC.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test VIEWPT_SETWC object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV105 = 1,NVV105
        VWX = VV105(IVV105)
C
      DO 588 IVV106 = 1,NVV106
        VWY = VV106(IVV106)
C
      DO 587 IVV107 = 1,NVV107
        VWZ = VV107(IVV107)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.25)
      CALL WORKBOX_DEFINE (1., 1., 1.)
      CALL AXISLBL_DEFX3 ('X Axis$',100)
      CALL AXISLBL_DEFY3 ('Y Axis$',100)
      CALL AXISLBL_DEFZ3 ('Z Axis$',100)
C
C                       Set 3D viewpoint in world coordinates
      CALL VIEWPT_SETWC (VWX,VWY,VWZ)
C
      CALL PLOT3D_DEFINE (0.0, 0., 1.0, 0.0, 0., 1.0, 0.0, 0., 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106,TMP107
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (KZVWPT .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZVPXI ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZVPYI ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZVPZI ,TMP104 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) KZVWPT,ZZVPXI,ZZVPYI,ZZVPZI,VWX,VWY,VWZ
  502 FORMAT (I21,E15.7,E15.7,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              VIEWPT Demo Program #3 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./wcoord21.f ]"
cat <<"STOP_CAT"> ././wcoord21.f
C     PROGRAM WCOORD21
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program WCOORD2_CVXPU
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       WCOORD2 object access program
      EXTERNAL WCOORD2_CVXPU
      REAL     WCOORD2_CVXPU
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    XINCH, TMP101, XRETRN, TMP102
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-3333.33, 0.0, 9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'wcoord2_cvxpu.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              WCOORD2 Object Demo Program #1'/
     * ' This program tests the WCOORD2 object access program'/
     * ' WCOORD2_CVXPU.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test WCOORD2_CVXPU object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        XINCH = VV101(IVV101)
C
C                       Convert X length or distance from page units to
C                       world coordinates
      XRETRN = WCOORD2_CVXPU (XINCH)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XRETRN ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) XINCH,XRETRN
  502 FORMAT (E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  589 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              WCOORD2 Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./wcoord22.f ]"
cat <<"STOP_CAT"> ././wcoord22.f
C     PROGRAM WCOORD22
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program WCOORD2_CVYPU
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       WCOORD2 object access program
      EXTERNAL WCOORD2_CVYPU
      REAL     WCOORD2_CVYPU
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    YINCH, TMP101, XRETRN, TMP102
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-3333.33, 0.0, 9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'wcoord2_cvypu.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              WCOORD2 Object Demo Program #2'/
     * ' This program tests the WCOORD2 object access program'/
     * ' WCOORD2_CVYPU.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test WCOORD2_CVYPU object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        YINCH = VV101(IVV101)
C
C                       Convert Y length or distance from page units to
C                       world coordinates
      XRETRN = WCOORD2_CVYPU (YINCH)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XRETRN ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) YINCH,XRETRN
  502 FORMAT (E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  589 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              WCOORD2 Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./wcoord23.f ]"
cat <<"STOP_CAT"> ././wcoord23.f
C     PROGRAM WCOORD23
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program WCOORD2_2XPU
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       WCOORD2 object access program
      EXTERNAL WCOORD2_2XPU
      REAL     WCOORD2_2XPU
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
      PARAMETER (NVV102 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    XINCH, TMP101, YINCH, TMP102, XRETRN, TMP103
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-3333.33, 0.0, 9999.99/
C
      DATA VV102 /-3333.33, 0.0, 9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'wcoord2_2xpu.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              WCOORD2 Object Demo Program #3'/
     * ' This program tests the WCOORD2 object access program'/
     * ' WCOORD2_2XPU.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test WCOORD2_2XPU object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        XINCH = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        YINCH = VV102(IVV102)
C
C                       Convert X coordinate from page units to world
C                       coordinates
      XRETRN = WCOORD2_2XPU (XINCH,YINCH)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XRETRN ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) XINCH,YINCH,XRETRN
  502 FORMAT (E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  589 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              WCOORD2 Demo Program #3 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./wcoord24.f ]"
cat <<"STOP_CAT"> ././wcoord24.f
C     PROGRAM WCOORD24
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program WCOORD2_2YPU
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       WCOORD2 object access program
      EXTERNAL WCOORD2_2YPU
      REAL     WCOORD2_2YPU
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT2D_DEFINE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
      PARAMETER (NVV102 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    XINCH, TMP101, YINCH, TMP102, XRETRN, TMP103
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-3333.33, 0.0, 9999.99/
C
      DATA VV102 /-3333.33, 0.0, 9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'wcoord2_2ypu.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              WCOORD2 Object Demo Program #4'/
     * ' This program tests the WCOORD2 object access program'/
     * ' WCOORD2_2YPU.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL PLOT2D_DEFINE (0.0, 0.0, 1.0, 0.0, 0.0, 1.0)
C
C     ------------------------------------------------------------------
C
C                       Test WCOORD2_2YPU object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        XINCH = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        YINCH = VV102(IVV102)
C
C                       Convert Y coordinate from page units to world
C                       coordinates
      XRETRN = WCOORD2_2YPU (XINCH,YINCH)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XRETRN ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) XINCH,YINCH,XRETRN
  502 FORMAT (E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  589 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              WCOORD2 Demo Program #4 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./wcoord2_2xpu.dat ]"
cat <<"STOP_CAT"> ././wcoord2_2xpu.uuu
begin 660 ./wcoord2_2xpu.dat
M("`M+C,S,S,S,S!%*S`T("`M+C,S,S,S,S!%*S`T("`M+C(X-3$T,SA%*S`S
M"B`@+2XS,S,S,S,P12LP-"`@("XP,#`P,#`P12LP,"`@+2XR.#4Q-#,X12LP
M,PH@("TN,S,S,S,S,$4K,#0@("`N.3DY.3DY,$4K,#0@("TN,C@U,30S.$4K
M,#,*("`@+C`P,#`P,#!%*S`P("`M+C,S,S,S,S!%*S`T("`@+C`P,#`P,#!%
M*S`P"B`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P
M12LP,`H@("`N,#`P,#`P,$4K,#`@("`N.3DY.3DY,$4K,#0@("`N,#`P,#`P
M,$4K,#`*("`@+CDY.3DY.3!%*S`T("`M+C,S,S,S,S!%*S`T("`@+C@U-30S
M,3-%*S`S"B`@("XY.3DY.3DP12LP-"`@("XP,#`P,#`P12LP,"`@("XX-34T
M,S$S12LP,PH@("`N.3DY.3DY,$4K,#0@("`N.3DY.3DY,$4K,#0@("`N.#4U
)-#,Q,T4K,#,*
`
end
STOP_CAT
echo "  Generating =====> [ ./wcoord2_2ypu.dat ]"
cat <<"STOP_CAT"> ././wcoord2_2ypu.uuu
begin 660 ./wcoord2_2ypu.dat
M("`M+C,S,S,S,S!%*S`T("`M+C,S,S,S,S!%*S`T("`M+C,Y,3`V,3!%*S`S
M"B`@+2XS,S,S,S,P12LP-"`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P12LP
M,`H@("TN,S,S,S,S,$4K,#0@("`N.3DY.3DY,$4K,#0@("`N,3$W,S$X,T4K
M,#0*("`@+C`P,#`P,#!%*S`P("`M+C,S,S,S,S!%*S`T("`M+C,Y,3`V,3!%
M*S`S"B`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P
M12LP,`H@("`N,#`P,#`P,$4K,#`@("`N.3DY.3DY,$4K,#0@("`N,3$W,S$X
M,T4K,#0*("`@+CDY.3DY.3!%*S`T("`M+C,S,S,S,S!%*S`T("`M+C,Y,3`V
M,3!%*S`S"B`@("XY.3DY.3DP12LP-"`@("XP,#`P,#`P12LP,"`@("XP,#`P
M,#`P12LP,`H@("`N.3DY.3DY,$4K,#0@("`N.3DY.3DY,$4K,#0@("`N,3$W
),S$X,T4K,#0*
`
end
STOP_CAT
echo "  Generating =====> [ ./wcoord2_cvxpu.dat ]"
cat <<"STOP_CAT"> ././wcoord2_cvxpu.uuu
begin 660 ./wcoord2_cvxpu.dat
M("`M+C,S,S,S,S!%*S`T("`M+C(X-3$T,SA%*S`S"B`@("XP,#`P,#`P12LP
M,"`@("XP,#`P,#`P12LP,`H@("`N.3DY.3DY,$4K,#0@("`N.#4U-#,Q,T4K
#,#,*
`
end
STOP_CAT
echo "  Generating =====> [ ./wcoord2_cvypu.dat ]"
cat <<"STOP_CAT"> ././wcoord2_cvypu.uuu
begin 660 ./wcoord2_cvypu.dat
M("`M+C,S,S,S,S!%*S`T("`M+C,Y,3`V,3!%*S`S"B`@("XP,#`P,#`P12LP
M,"`@("XP,#`P,#`P12LP,`H@("`N.3DY.3DY,$4K,#0@("`N,3$W,S$X,T4K
#,#0*
`
end
STOP_CAT
echo "  Generating =====> [ ./workbox1.f ]"
cat <<"STOP_CAT"> ././workbox1.f
C     PROGRAM WORKBOX1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program WORKBOX_DEFINE
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       WORKBOX object access program
      EXTERNAL WORKBOX_DEFINE
C
C                       PLOT object access programs
      EXTERNAL PLOT_INIT
C
C                       Environment object access programs
      EXTERNAL DEVICE_PROMPT, DEVICE_RELEASE
      EXTERNAL PAGE_SIZE, PAGE_END, ORIGIN_SET
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
      EXTERNAL PLOT3D_DEFINE
      EXTERNAL AXISLBL_DEFX3, AXISLBL_DEFY3, AXISLBL_DEFZ3
      EXTERNAL TEXT2D_SETHT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV104 =  2)
      PARAMETER (NVV105 =  2)
      PARAMETER (NVV106 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'WORKBOX.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, TMP102, TMP103, XVOL, TMP104, YVOL, TMP105, ZVOL
     *      , TMP106
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV104(NVV104)
      REAL    VV105(NVV105)
      REAL    VV106(NVV106)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV104 /1.0, 10.0/
C
      DATA VV105 /1.0, 10.0/
C
      DATA VV106 /1.0, 10.0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PLOT_INIT (0)
C
C     ******************************************************************
C
C                       Check PRL version
C
C                       Get actual PRL version being used
      CALL PRL_LIBVER (VERAQ,VERRQ)
C
C     ******************************************************************
C
C                       Set machine-specific constants
C
      CALL TERM_SETSIO (LUNSI,LUNSO,LUNSE)
C
C                       Logical unit number (LUN) of standard in
      IN = TERM_GETIN ()
C                       LUN of standard out
      IOUT = TERM_GETOUT ()
C                       LUN of standard error
      IER = TERM_GETERR ()
C
C                       REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'workbox_define.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              WORKBOX Object Demo Program #1'/
     * ' This program tests the WORKBOX object access program'/
     * ' WORKBOX_DEFINE.'/
     * ' The input variables are varied through a wide range of valid'/
     * ' combinations.  The results for each combination are compared'/
     * ' to previously-computed results stored on file, and any '/
     * ' differences are displayed.  If no results file is found, the'/
     * ' computed results are saved in a file named'/
     * ' ',A/)
C
C                       Initialize program completion status
      IOK = 0
C
C     ******************************************************************
C
C                       Open test results file
C
C                       Open read-only
      IOPFLG = IPXCON ('O_RDONLY')
C
C                       Assume file exists and open read-only
      CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IRESLT)
C
C                       If file does not exist,
C                       create and open read/write
      IF (IRESLT .NE. 0) THEN
        IF (IRESLT .EQ. IPXCON('ENOENT')) THEN
C                       Open read-write
          IOPFLG = IPXCON ('O_RDWR')
C                       Allow file creation
     *            +IPXCON ('O_CREAT')
C                       Create file and open read/write
          CALL PXFOPN (FILNAM,0,IOPFLG,0,IFILE,IERROR)
C
C                       If error creating and opening file,
C                       print error message and exit
          IF (IERROR .NE. 0) THEN
            WRITE (IER,409) FILNAM
  409       FORMAT (' Error opening results file ',A)
            GOTO 900
          ENDIF
C                       Print message that file is being created
          WRITE (IOUT,411) FILNAM
  411     FORMAT (' Creating file ',A)
          IOK = 1
C
C                       If error opening existing file,
C                       print error message and exit
        ELSE
          WRITE (IER,409) FILNAM
          GOTO 900
        ENDIF
      ENDIF
C
C     ******************************************************************
C
C                       Set up proper environment for access program
C                       under test
C
C                       Select device and advance package to level 1
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE,YPAGE)
C
C     ------------------------------------------------------------------
C
C                       Test WORKBOX_DEFINE object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV104 = 1,NVV104
        XVOL = VV104(IVV104)
C
      DO 588 IVV105 = 1,NVV105
        YVOL = VV105(IVV105)
C
      DO 587 IVV106 = 1,NVV106
        ZVOL = VV106(IVV106)
C
      CALL PAGE_SIZE (XPAGE,YPAGE)
      CALL ORIGIN_SET (1.0,1.0)
      CALL SUBPLOT_DEFINE (XPAGE-2.0 ,YPAGE-2.0)
      CALL TEXT2D_SETHT (.25)
      CALL AXISLBL_DEFX3 ('X Axis$',100)
      CALL AXISLBL_DEFY3 ('Y Axis$',100)
      CALL AXISLBL_DEFZ3 ('Z Axis$',100)
      CALL VIEWPT_SETBS (-30., 45., 9999.)
C
C                       Define workbox size for 3D plot
      CALL WORKBOX_DEFINE (XVOL,YVOL,ZVOL)
C
      CALL PLOT3D_DEFINE (0.0, 0., 1.0, 0.0, 0., 1.0, 0.0, 0., 1.0)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104,TMP105,
     *       TMP106
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(ZZVOLX ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZVOLY ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(ZZVOLZ ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ZZVOLX,ZZVOLY,ZZVOLZ,XVOL,YVOL,ZVOL
  502 FORMAT (E15.7,E15.7,E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Finish subplot
      CALL SUBPLOT_END (0)
C                       End plotting on current page
      CALL PAGE_END (0)
C
C                       Repeat for next variable value
  587 CONTINUE
  588 CONTINUE
  589 CONTINUE
C
C                       Release device
      CALL DEVICE_RELEASE ()
C
C     ******************************************************************
C
C                       Print program status message
C
      IF (IOK .EQ. 0) THEN
        WRITE (IOUT,601)
  601   FORMAT (' Program results identical to file values')
      ENDIF
      GOTO 700
C
  610 WRITE (IER,611) FILNAM
  611 FORMAT (' Error reading file ',A)
      GOTO 700
C
  612 WRITE (IER,613) FILNAM
  613 FORMAT (' Error writing file ',A)
C
C     ******************************************************************
C
C                       Close test results file
C
C                       Close file
  700 CALL PXFCLS (IFILDS,IERROR)
C
C     ******************************************************************
C
C                       Print demo termination message
C
C                       Wait until user presses a key before exiting
      WRITE (IOUT,810)
  810 FORMAT (/
     * '              WORKBOX Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./workbox_define.dat ]"
cat <<"STOP_CAT"> ././workbox_define.uuu
begin 660 ./workbox_define.dat
M("`@+C$P,#`P,#!%*S`Q("`@+C$P,#`P,#!%*S`Q("`@+C$P,#`P,#!%*S`Q
M("`@+C$P,#`P,#!%*S`Q("`@+C$P,#`P,#!%*S`Q("`@+C$P,#`P,#!%*S`Q
M"B`@("XQ,#`P,#`P12LP,2`@("XQ,#`P,#`P12LP,2`@("XQ,#`P,#`P12LP
M,B`@("XQ,#`P,#`P12LP,2`@("XQ,#`P,#`P12LP,2`@("XQ,#`P,#`P12LP
M,@H@("`N,3`P,#`P,$4K,#$@("`N,3`P,#`P,$4K,#(@("`N,3`P,#`P,$4K
M,#$@("`N,3`P,#`P,$4K,#$@("`N,3`P,#`P,$4K,#(@("`N,3`P,#`P,$4K
M,#$*("`@+C$P,#`P,#!%*S`Q("`@+C$P,#`P,#!%*S`R("`@+C$P,#`P,#!%
M*S`R("`@+C$P,#`P,#!%*S`Q("`@+C$P,#`P,#!%*S`R("`@+C$P,#`P,#!%
M*S`R"B`@("XQ,#`P,#`P12LP,B`@("XQ,#`P,#`P12LP,2`@("XQ,#`P,#`P
M12LP,2`@("XQ,#`P,#`P12LP,B`@("XQ,#`P,#`P12LP,2`@("XQ,#`P,#`P
M12LP,0H@("`N,3`P,#`P,$4K,#(@("`N,3`P,#`P,$4K,#$@("`N,3`P,#`P
M,$4K,#(@("`N,3`P,#`P,$4K,#(@("`N,3`P,#`P,$4K,#$@("`N,3`P,#`P
M,$4K,#(*("`@+C$P,#`P,#!%*S`R("`@+C$P,#`P,#!%*S`R("`@+C$P,#`P
M,#!%*S`Q("`@+C$P,#`P,#!%*S`R("`@+C$P,#`P,#!%*S`R("`@+C$P,#`P
M,#!%*S`Q"B`@("XQ,#`P,#`P12LP,B`@("XQ,#`P,#`P12LP,B`@("XQ,#`P
M,#`P12LP,B`@("XQ,#`P,#`P12LP,B`@("XQ,#`P,#`P12LP,B`@("XQ,#`P
(,#`P12LP,@H@
`
end
STOP_CAT
echo "  <CR> to Continue"
read answer
cat <<STOP_CAT> ./compile
echo "
 
  Compiling and linking demo programs.
 "
echo "  Compiling ======> [ ./axislbl1.f ]"
$LINK ./axislbl1.f -o ./axislbl1.x $PLOT
chmod 0770 ./axislbl1.x
echo "  Compiling ======> [ ./axislbl2.f ]"
$LINK ./axislbl2.f -o ./axislbl2.x $PLOT
chmod 0770 ./axislbl2.x
echo "  Converting ======> [ ./axislbl_defx2.uuu ]"
uudecode ./axislbl_defx2.uuu
chmod 0660 ./axislbl_defx2.dat
echo "  Converting ======> [ ./axislbl_defx3.uuu ]"
uudecode ./axislbl_defx3.uuu
chmod 0660 ./axislbl_defx3.dat
echo "  Compiling ======> [ ./axisnum1.f ]"
$LINK ./axisnum1.f -o ./axisnum1.x $PLOT
chmod 0770 ./axisnum1.x
echo "  Compiling ======> [ ./axisnum2.f ]"
$LINK ./axisnum2.f -o ./axisnum2.x $PLOT
chmod 0770 ./axisnum2.x
echo "  Compiling ======> [ ./axisnum3.f ]"
$LINK ./axisnum3.f -o ./axisnum3.x $PLOT
chmod 0770 ./axisnum3.x
echo "  Compiling ======> [ ./axisnum4.f ]"
$LINK ./axisnum4.f -o ./axisnum4.x $PLOT
chmod 0770 ./axisnum4.x
echo "  Compiling ======> [ ./axisnum5.f ]"
$LINK ./axisnum5.f -o ./axisnum5.x $PLOT
chmod 0770 ./axisnum5.x
echo "  Converting ======> [ ./axisnum_expx.uuu ]"
uudecode ./axisnum_expx.uuu
chmod 0660 ./axisnum_expx.dat
echo "  Converting ======> [ ./axisnum_intall.uuu ]"
uudecode ./axisnum_intall.uuu
chmod 0660 ./axisnum_intall.dat
echo "  Converting ======> [ ./axisnum_intx.uuu ]"
uudecode ./axisnum_intx.uuu
chmod 0660 ./axisnum_intx.dat
echo "  Converting ======> [ ./axisnum_rotx.uuu ]"
uudecode ./axisnum_rotx.uuu
chmod 0660 ./axisnum_rotx.dat
echo "  Converting ======> [ ./axisnum_xoff.uuu ]"
uudecode ./axisnum_xoff.uuu
chmod 0660 ./axisnum_xoff.dat
echo "  Compiling ======> [ ./axisscale1.f ]"
$LINK ./axisscale1.f -o ./axisscale1.x $PLOT
chmod 0770 ./axisscale1.x
echo "  Compiling ======> [ ./axisscale2.f ]"
$LINK ./axisscale2.f -o ./axisscale2.x $PLOT
chmod 0770 ./axisscale2.x
echo "  Compiling ======> [ ./axisscale3.f ]"
$LINK ./axisscale3.f -o ./axisscale3.x $PLOT
chmod 0770 ./axisscale3.x
echo "  Compiling ======> [ ./axisscale4.f ]"
$LINK ./axisscale4.f -o ./axisscale4.x $PLOT
chmod 0770 ./axisscale4.x
echo "  Compiling ======> [ ./axisscale5.f ]"
$LINK ./axisscale5.f -o ./axisscale5.x $PLOT
chmod 0770 ./axisscale5.x
echo "  Converting ======> [ ./axisscale_algor.uuu ]"
uudecode ./axisscale_algor.uuu
chmod 0660 ./axisscale_algor.dat
echo "  Converting ======> [ ./axisscale_mauto.uuu ]"
uudecode ./axisscale_mauto.uuu
chmod 0660 ./axisscale_mauto.dat
echo "  Converting ======> [ ./axisscale_sauto.uuu ]"
uudecode ./axisscale_sauto.uuu
chmod 0660 ./axisscale_sauto.dat
echo "  Compiling ======> [ ./axistick1.f ]"
$LINK ./axistick1.f -o ./axistick1.x $PLOT
chmod 0770 ./axistick1.x
echo "  Compiling ======> [ ./axistick2.f ]"
$LINK ./axistick2.f -o ./axistick2.x $PLOT
chmod 0770 ./axistick2.x
echo "  Compiling ======> [ ./axistick3.f ]"
$LINK ./axistick3.f -o ./axistick3.x $PLOT
chmod 0770 ./axistick3.x
echo "  Compiling ======> [ ./axistick4.f ]"
$LINK ./axistick4.f -o ./axistick4.x $PLOT
chmod 0770 ./axistick4.x
echo "  Compiling ======> [ ./axistick5.f ]"
$LINK ./axistick5.f -o ./axistick5.x $PLOT
chmod 0770 ./axistick5.x
echo "  Compiling ======> [ ./axistick6.f ]"
$LINK ./axistick6.f -o ./axistick6.x $PLOT
chmod 0770 ./axistick6.x
echo "  Converting ======> [ ./axistick_loff.uuu ]"
uudecode ./axistick_loff.uuu
chmod 0660 ./axistick_loff.dat
echo "  Converting ======> [ ./axistick_revx.uuu ]"
uudecode ./axistick_revx.uuu
chmod 0660 ./axistick_revx.dat
echo "  Converting ======> [ ./axistick_setmax.uuu ]"
uudecode ./axistick_setmax.uuu
chmod 0660 ./axistick_setmax.dat
echo "  Converting ======> [ ./axistick_setx.uuu ]"
uudecode ./axistick_setx.uuu
chmod 0660 ./axistick_setx.dat
echo "  Converting ======> [ ./axistick_sety.uuu ]"
uudecode ./axistick_sety.uuu
chmod 0660 ./axistick_sety.dat
echo "  Converting ======> [ ./axistick_setz.uuu ]"
uudecode ./axistick_setz.uuu
chmod 0660 ./axistick_setz.dat
echo "  Compiling ======> [ ./barchart1.f ]"
$LINK ./barchart1.f -o ./barchart1.x $PLOT
chmod 0770 ./barchart1.x
echo "  Compiling ======> [ ./barchart2.f ]"
$LINK ./barchart2.f -o ./barchart2.x $PLOT
chmod 0770 ./barchart2.x
echo "  Compiling ======> [ ./barchart3.f ]"
$LINK ./barchart3.f -o ./barchart3.x $PLOT
chmod 0770 ./barchart3.x
echo "  Compiling ======> [ ./barchart4.f ]"
$LINK ./barchart4.f -o ./barchart4.x $PLOT
chmod 0770 ./barchart4.x
echo "  Compiling ======> [ ./barchart5.f ]"
$LINK ./barchart5.f -o ./barchart5.x $PLOT
chmod 0770 ./barchart5.x
echo "  Compiling ======> [ ./barchart6.f ]"
$LINK ./barchart6.f -o ./barchart6.x $PLOT
chmod 0770 ./barchart6.x
echo "  Converting ======> [ ./barchart_setgrp.uuu ]"
uudecode ./barchart_setgrp.uuu
chmod 0660 ./barchart_setgrp.dat
echo "  Compiling ======> [ ./curve2d1.f ]"
$LINK ./curve2d1.f -o ./curve2d1.x $PLOT
chmod 0770 ./curve2d1.x
echo "  Compiling ======> [ ./curve2d2.f ]"
$LINK ./curve2d2.f -o ./curve2d2.x $PLOT
chmod 0770 ./curve2d2.x
echo "  Compiling ======> [ ./curve2d3.f ]"
$LINK ./curve2d3.f -o ./curve2d3.x $PLOT
chmod 0770 ./curve2d3.x
echo "  Compiling ======> [ ./curve3d1.f ]"
$LINK ./curve3d1.f -o ./curve3d1.x $PLOT
chmod 0770 ./curve3d1.x
echo "  Compiling ======> [ ./device1.f ]"
$LINK ./device1.f -o ./device1.x $PLOT
chmod 0770 ./device1.x
echo "  Converting ======> [ ./device_select.uuu ]"
uudecode ./device_select.uuu
chmod 0660 ./device_select.dat
echo "  Compiling ======> [ ./fillarea1.f ]"
$LINK ./fillarea1.f -o ./fillarea1.x $PLOT
chmod 0770 ./fillarea1.x
echo "  Compiling ======> [ ./fillarea2.f ]"
$LINK ./fillarea2.f -o ./fillarea2.x $PLOT
chmod 0770 ./fillarea2.x
echo "  Compiling ======> [ ./fillarea3.f ]"
$LINK ./fillarea3.f -o ./fillarea3.x $PLOT
chmod 0770 ./fillarea3.x
echo "  Compiling ======> [ ./fillarea4.f ]"
$LINK ./fillarea4.f -o ./fillarea4.x $PLOT
chmod 0770 ./fillarea4.x
echo "  Converting ======> [ ./fillarea_2axis.uuu ]"
uudecode ./fillarea_2axis.uuu
chmod 0660 ./fillarea_2axis.dat
echo "  Converting ======> [ ./fillarea_2crv.uuu ]"
uudecode ./fillarea_2crv.uuu
chmod 0660 ./fillarea_2crv.dat
echo "  Converting ======> [ ./fillarea_polyg.uuu ]"
uudecode ./fillarea_polyg.uuu
chmod 0660 ./fillarea_polyg.dat
echo "  Compiling ======> [ ./grid1.f ]"
$LINK ./grid1.f -o ./grid1.x $PLOT
chmod 0770 ./grid1.x
echo "  Converting ======> [ ./grid_draw.uuu ]"
uudecode ./grid_draw.uuu
chmod 0660 ./grid_draw.dat
echo "  Compiling ======> [ ./int1.f ]"
$LINK ./int1.f -o ./int1.x $PLOT
chmod 0770 ./int1.x
echo "  Compiling ======> [ ./int2.f ]"
$LINK ./int2.f -o ./int2.x $PLOT
chmod 0770 ./int2.x
echo "  Converting ======> [ ./intnum_wdraw.uuu ]"
uudecode ./intnum_wdraw.uuu
chmod 0660 ./intnum_wdraw.dat
echo "  Converting ======> [ ./intnum_wdrawr.uuu ]"
uudecode ./intnum_wdrawr.uuu
chmod 0660 ./intnum_wdrawr.dat
echo "  Compiling ======> [ ./legend1.f ]"
$LINK ./legend1.f -o ./legend1.x $PLOT
chmod 0770 ./legend1.x
echo "  Compiling ======> [ ./legend2.f ]"
$LINK ./legend2.f -o ./legend2.x $PLOT
chmod 0770 ./legend2.x
echo "  Compiling ======> [ ./legend3.f ]"
$LINK ./legend3.f -o ./legend3.x $PLOT
chmod 0770 ./legend3.x
echo "  Compiling ======> [ ./legend4.f ]"
$LINK ./legend4.f -o ./legend4.x $PLOT
chmod 0770 ./legend4.x
echo "  Compiling ======> [ ./legend5.f ]"
$LINK ./legend5.f -o ./legend5.x $PLOT
chmod 0770 ./legend5.x
echo "  Compiling ======> [ ./locator1.f ]"
$LINK ./locator1.f -o ./locator1.x $PLOT
chmod 0770 ./locator1.x
echo "  Converting ======> [ ./locator_get.uuu ]"
uudecode ./locator_get.uuu
chmod 0660 ./locator_get.dat
echo "  Compiling ======> [ ./logpen21.f ]"
$LINK ./logpen21.f -o ./logpen21.x $PLOT
chmod 0770 ./logpen21.x
echo "  Converting ======> [ ./logpen2_getw2.uuu ]"
uudecode ./logpen2_getw2.uuu
chmod 0660 ./logpen2_getw2.dat
echo "  Compiling ======> [ ./origin1.f ]"
$LINK ./origin1.f -o ./origin1.x $PLOT
chmod 0770 ./origin1.x
echo "  Converting ======> [ ./origin_set.uuu ]"
uudecode ./origin_set.uuu
chmod 0660 ./origin_set.dat
echo "  Compiling ======> [ ./packary1.f ]"
$LINK ./packary1.f -o ./packary1.x $PLOT
chmod 0770 ./packary1.x
echo "  Compiling ======> [ ./packary2.f ]"
$LINK ./packary2.f -o ./packary2.x $PLOT
chmod 0770 ./packary2.x
echo "  Compiling ======> [ ./packary3.f ]"
$LINK ./packary3.f -o ./packary3.x $PLOT
chmod 0770 ./packary3.x
echo "  Compiling ======> [ ./packary4.f ]"
$LINK ./packary4.f -o ./packary4.x $PLOT
chmod 0770 ./packary4.x
echo "  Compiling ======> [ ./packary5.f ]"
$LINK ./packary5.f -o ./packary5.x $PLOT
chmod 0770 ./packary5.x
echo "  Converting ======> [ ./packary_draw.uuu ]"
uudecode ./packary_draw.uuu
chmod 0660 ./packary_draw.dat
echo "  Converting ======> [ ./packary_getmax.uuu ]"
uudecode ./packary_getmax.uuu
chmod 0660 ./packary_getmax.dat
echo "  Converting ======> [ ./packary_setent.uuu ]"
uudecode ./packary_setent.uuu
chmod 0660 ./packary_setent.dat
echo "  Compiling ======> [ ./page1.f ]"
$LINK ./page1.f -o ./page1.x $PLOT
chmod 0770 ./page1.x
echo "  Compiling ======> [ ./page2.f ]"
$LINK ./page2.f -o ./page2.x $PLOT
chmod 0770 ./page2.x
echo "  Compiling ======> [ ./page3.f ]"
$LINK ./page3.f -o ./page3.x $PLOT
chmod 0770 ./page3.x
echo "  Compiling ======> [ ./page4.f ]"
$LINK ./page4.f -o ./page4.x $PLOT
chmod 0770 ./page4.x
echo "  Converting ======> [ ./page_cvxwc.uuu ]"
uudecode ./page_cvxwc.uuu
chmod 0660 ./page_cvxwc.dat
echo "  Converting ======> [ ./page_cvywc.uuu ]"
uudecode ./page_cvywc.uuu
chmod 0660 ./page_cvywc.dat
echo "  Converting ======> [ ./page_size.uuu ]"
uudecode ./page_size.uuu
chmod 0660 ./page_size.dat
echo "  Compiling ======> [ ./piechart1.f ]"
$LINK ./piechart1.f -o ./piechart1.x $PLOT
chmod 0770 ./piechart1.x
echo "  Compiling ======> [ ./piechart2.f ]"
$LINK ./piechart2.f -o ./piechart2.x $PLOT
chmod 0770 ./piechart2.x
echo "  Compiling ======> [ ./piechart3.f ]"
$LINK ./piechart3.f -o ./piechart3.x $PLOT
chmod 0770 ./piechart3.x
echo "  Compiling ======> [ ./piechart4.f ]"
$LINK ./piechart4.f -o ./piechart4.x $PLOT
chmod 0770 ./piechart4.x
echo "  Compiling ======> [ ./piechart5.f ]"
$LINK ./piechart5.f -o ./piechart5.x $PLOT
chmod 0770 ./piechart5.x
echo "  Compiling ======> [ ./piechart6.f ]"
$LINK ./piechart6.f -o ./piechart6.x $PLOT
chmod 0770 ./piechart6.x
echo "  Compiling ======> [ ./plot1.f ]"
$LINK ./plot1.f -o ./plot1.x $PLOT
chmod 0770 ./plot1.x
echo "  Compiling ======> [ ./plot2d1.f ]"
$LINK ./plot2d1.f -o ./plot2d1.x $PLOT
chmod 0770 ./plot2d1.x
echo "  Compiling ======> [ ./plot2d2.f ]"
$LINK ./plot2d2.f -o ./plot2d2.x $PLOT
chmod 0770 ./plot2d2.x
echo "  Converting ======> [ ./plot2d_def2x.uuu ]"
uudecode ./plot2d_def2x.uuu
chmod 0660 ./plot2d_def2x.dat
echo "  Converting ======> [ ./plot2d_define.uuu ]"
uudecode ./plot2d_define.uuu
chmod 0660 ./plot2d_define.dat
echo "  Compiling ======> [ ./plot3d1.f ]"
$LINK ./plot3d1.f -o ./plot3d1.x $PLOT
chmod 0770 ./plot3d1.x
echo "  Compiling ======> [ ./plot3d2.f ]"
$LINK ./plot3d2.f -o ./plot3d2.x $PLOT
chmod 0770 ./plot3d2.x
echo "  Compiling ======> [ ./plotlog1.f ]"
$LINK ./plotlog1.f -o ./plotlog1.x $PLOT
chmod 0770 ./plotlog1.x
echo "  Compiling ======> [ ./plotlog2.f ]"
$LINK ./plotlog2.f -o ./plotlog2.x $PLOT
chmod 0770 ./plotlog2.x
echo "  Compiling ======> [ ./plotlog3.f ]"
$LINK ./plotlog3.f -o ./plotlog3.x $PLOT
chmod 0770 ./plotlog3.x
echo "  Compiling ======> [ ./plotlog4.f ]"
$LINK ./plotlog4.f -o ./plotlog4.x $PLOT
chmod 0770 ./plotlog4.x
echo "  Compiling ======> [ ./plotlog5.f ]"
$LINK ./plotlog5.f -o ./plotlog5.x $PLOT
chmod 0770 ./plotlog5.x
echo "  Compiling ======> [ ./plotlog6.f ]"
$LINK ./plotlog6.f -o ./plotlog6.x $PLOT
chmod 0770 ./plotlog6.x
echo "  Compiling ======> [ ./plotlog7.f ]"
$LINK ./plotlog7.f -o ./plotlog7.x $PLOT
chmod 0770 ./plotlog7.x
echo "  Converting ======> [ ./plotlog_autolm.uuu ]"
uudecode ./plotlog_autolm.uuu
chmod 0660 ./plotlog_autolm.dat
echo "  Converting ======> [ ./plotlog_def2x.uuu ]"
uudecode ./plotlog_def2x.uuu
chmod 0660 ./plotlog_def2x.dat
echo "  Converting ======> [ ./plotlog_def2y.uuu ]"
uudecode ./plotlog_def2y.uuu
chmod 0660 ./plotlog_def2y.dat
echo "  Converting ======> [ ./plotlog_defsx.uuu ]"
uudecode ./plotlog_defsx.uuu
chmod 0660 ./plotlog_defsx.dat
echo "  Converting ======> [ ./plotlog_defsy.uuu ]"
uudecode ./plotlog_defsy.uuu
chmod 0660 ./plotlog_defsy.dat
echo "  Compiling ======> [ ./plotpolr1.f ]"
$LINK ./plotpolr1.f -o ./plotpolr1.x $PLOT
chmod 0770 ./plotpolr1.x
echo "  Compiling ======> [ ./plotpolr2.f ]"
$LINK ./plotpolr2.f -o ./plotpolr2.x $PLOT
chmod 0770 ./plotpolr2.x
echo "  Compiling ======> [ ./plotpolr3.f ]"
$LINK ./plotpolr3.f -o ./plotpolr3.x $PLOT
chmod 0770 ./plotpolr3.x
echo "  Converting ======> [ ./plotpolr_define.uuu ]"
uudecode ./plotpolr_define.uuu
chmod 0660 ./plotpolr_define.dat
echo "  Converting ======> [ ./plotpolr_setrof.uuu ]"
uudecode ./plotpolr_setrof.uuu
chmod 0660 ./plotpolr_setrof.dat
echo "  Compiling ======> [ ./plotspher1.f ]"
$LINK ./plotspher1.f -o ./plotspher1.x $PLOT
chmod 0770 ./plotspher1.x
echo "  Compiling ======> [ ./prl1.f ]"
$LINK ./prl1.f -o ./prl1.x $PLOT
chmod 0770 ./prl1.x
echo "  Compiling ======> [ ./process1.f ]"
$LINK ./process1.f -o ./process1.x $PLOT
chmod 0770 ./process1.x
echo "  Compiling ======> [ ./real1.f ]"
$LINK ./real1.f -o ./real1.x $PLOT
chmod 0770 ./real1.x
echo "  Compiling ======> [ ./real2.f ]"
$LINK ./real2.f -o ./real2.x $PLOT
chmod 0770 ./real2.x
echo "  Converting ======> [ ./realnum_wdraw.uuu ]"
uudecode ./realnum_wdraw.uuu
chmod 0660 ./realnum_wdraw.dat
echo "  Converting ======> [ ./realnum_wdrawr.uuu ]"
uudecode ./realnum_wdrawr.uuu
chmod 0660 ./realnum_wdrawr.dat
echo "  Compiling ======> [ ./subplot1.f ]"
$LINK ./subplot1.f -o ./subplot1.x $PLOT
chmod 0770 ./subplot1.x
echo "  Converting ======> [ ./subplot_define.uuu ]"
uudecode ./subplot_define.uuu
chmod 0660 ./subplot_define.dat
echo "  Compiling ======> [ ./text2d1.f ]"
$LINK ./text2d1.f -o ./text2d1.x $PLOT
chmod 0770 ./text2d1.x
echo "  Compiling ======> [ ./text2d2.f ]"
$LINK ./text2d2.f -o ./text2d2.x $PLOT
chmod 0770 ./text2d2.x
echo "  Converting ======> [ ./text2d_wdraw.uuu ]"
uudecode ./text2d_wdraw.uuu
chmod 0660 ./text2d_wdraw.dat
echo "  Converting ======> [ ./text2d_wdrawr.uuu ]"
uudecode ./text2d_wdrawr.uuu
chmod 0660 ./text2d_wdrawr.dat
echo "  Compiling ======> [ ./vec21.f ]"
$LINK ./vec21.f -o ./vec21.x $PLOT
chmod 0770 ./vec21.x
echo "  Compiling ======> [ ./vec22.f ]"
$LINK ./vec22.f -o ./vec22.x $PLOT
chmod 0770 ./vec22.x
echo "  Compiling ======> [ ./vec23.f ]"
$LINK ./vec23.f -o ./vec23.x $PLOT
chmod 0770 ./vec23.x
echo "  Compiling ======> [ ./vec24.f ]"
$LINK ./vec24.f -o ./vec24.x $PLOT
chmod 0770 ./vec24.x
echo "  Converting ======> [ ./vec2_pdraw.uuu ]"
uudecode ./vec2_pdraw.uuu
chmod 0660 ./vec2_pdraw.dat
echo "  Converting ======> [ ./vec2_pdrawr.uuu ]"
uudecode ./vec2_pdrawr.uuu
chmod 0660 ./vec2_pdrawr.dat
echo "  Converting ======> [ ./vec2_wdrawr.uuu ]"
uudecode ./vec2_wdrawr.uuu
chmod 0660 ./vec2_wdrawr.dat
echo "  Compiling ======> [ ./vec31.f ]"
$LINK ./vec31.f -o ./vec31.x $PLOT
chmod 0770 ./vec31.x
echo "  Converting ======> [ ./viewpoint_setbs.uuu ]"
uudecode ./viewpoint_setbs.uuu
chmod 0660 ./viewpoint_setbs.dat
echo "  Converting ======> [ ./viewpoint_setbu.uuu ]"
uudecode ./viewpoint_setbu.uuu
chmod 0660 ./viewpoint_setbu.dat
echo "  Converting ======> [ ./viewpoint_setwc.uuu ]"
uudecode ./viewpoint_setwc.uuu
chmod 0660 ./viewpoint_setwc.dat
echo "  Compiling ======> [ ./viewpt1.f ]"
$LINK ./viewpt1.f -o ./viewpt1.x $PLOT
chmod 0770 ./viewpt1.x
echo "  Compiling ======> [ ./viewpt2.f ]"
$LINK ./viewpt2.f -o ./viewpt2.x $PLOT
chmod 0770 ./viewpt2.x
echo "  Compiling ======> [ ./viewpt3.f ]"
$LINK ./viewpt3.f -o ./viewpt3.x $PLOT
chmod 0770 ./viewpt3.x
echo "  Compiling ======> [ ./wcoord21.f ]"
$LINK ./wcoord21.f -o ./wcoord21.x $PLOT
chmod 0770 ./wcoord21.x
echo "  Compiling ======> [ ./wcoord22.f ]"
$LINK ./wcoord22.f -o ./wcoord22.x $PLOT
chmod 0770 ./wcoord22.x
echo "  Compiling ======> [ ./wcoord23.f ]"
$LINK ./wcoord23.f -o ./wcoord23.x $PLOT
chmod 0770 ./wcoord23.x
echo "  Compiling ======> [ ./wcoord24.f ]"
$LINK ./wcoord24.f -o ./wcoord24.x $PLOT
chmod 0770 ./wcoord24.x
echo "  Converting ======> [ ./wcoord2_2xpu.uuu ]"
uudecode ./wcoord2_2xpu.uuu
chmod 0660 ./wcoord2_2xpu.dat
echo "  Converting ======> [ ./wcoord2_2ypu.uuu ]"
uudecode ./wcoord2_2ypu.uuu
chmod 0660 ./wcoord2_2ypu.dat
echo "  Converting ======> [ ./wcoord2_cvxpu.uuu ]"
uudecode ./wcoord2_cvxpu.uuu
chmod 0660 ./wcoord2_cvxpu.dat
echo "  Converting ======> [ ./wcoord2_cvypu.uuu ]"
uudecode ./wcoord2_cvypu.uuu
chmod 0660 ./wcoord2_cvypu.dat
echo "  Compiling ======> [ ./workbox1.f ]"
$LINK ./workbox1.f -o ./workbox1.x $PLOT
chmod 0770 ./workbox1.x
echo "  Converting ======> [ ./workbox_define.uuu ]"
uudecode ./workbox_define.uuu
chmod 0660 ./workbox_define.dat
echo "
 
  All demo programs have been compiled.
 "
Proceed="No"
while [ "\$Proceed" = "No" ]
do
echo "
 
  Delete demo program source?
  ( Y or N )
 "
read answer
if [ "\$answer" = "y" ]; then
  Proceed="Yes"
  echo "
  All demo programs are being deleted"
  rm ./*.f
  rm ./*.uuu 2>/dev/null
  rm ./*.INC 2>/dev/null
else
  if [ "\$answer" = "Y" ]; then
    Proceed="Yes"
    echo "
  All demo programs are being deleted"
    rm ./*.f
    rm ./*.uuu 2>/dev/null
    rm ./*.INC 2>/dev/null
  fi
fi
if [ "\$answer" = "n" ]; then
  Proceed="Yes"
else
  if [ "\$answer" = "N" ]; then
    Proceed="Yes"
  fi
fi
echo "  <CR> to Continue"
read answer
done
STOP_CAT
chmod 770 ./compile
cat <<"STOP_CAT"> ./run_demo
(tput) 1>/dev/null 2>&1
if [ $? = 1 ]; then
  CLEAR="clear"; export CLEAR
else
  CLEAR="tput clear"; export CLEAR
fi
$CLEAR
echo "
                    Object Access
            Programmer's Reusable Library
                        PLOT
 

 
  PRL-PLOT demonstration programs. These programs
  test and demonstrate the capabilities of the
  PRL-PLOT library.
 
  <CR> to Continue"
read answer
while [ 1 -eq 1 ]; do
$CLEAR
echo "
 Select Demo Program
 ===================
   1 ./_plot.tk             2 ./axislbl1             3 ./axislbl2               
   4 ./axisnum1             5 ./axisnum2             6 ./axisnum3               
   7 ./axisnum4             8 ./axisnum5             9 ./axisscale1             
  10 ./axisscale2          11 ./axisscale3          12 ./axisscale4             
  13 ./axisscale5          14 ./axistick1           15 ./axistick2              
  16 ./axistick3           17 ./axistick4           18 ./axistick5              
  19 ./axistick6           20 ./barchart1           21 ./barchart2              
  22 ./barchart3           23 ./barchart4           24 ./barchart5              
  25 ./barchart6           26 ./curve2d1            27 ./curve2d2               
  28 ./curve2d3            29 ./curve3d1            30 ./device1                
  31 ./fillarea1           32 ./fillarea2           33 ./fillarea3              
  34 ./fillarea4           35 ./grid1               36 ./int1                   
  37 ./int2                38 ./legend1             39 ./legend2                
  40 ./legend3             41 ./legend4             42 ./legend5                
  43 ./locator1            44 ./logpen21            45 ./origin1                
  46 ./packary1            47 ./packary2            48 ./packary3               
  49 ./packary4            50 ./packary5            51 ./page1                  
  52 ./page2               53 ./page3               54 ./page4                  
  55 ./piechart1           56 ./piechart2           57 ./piechart3              
  58 ./piechart4           59 ./piechart5           60 ./piechart6              
  61 ./plot1               62 ./plot2d1             63 ./plot2d2                
  64 ./plot3d1             65 ./plot3d2             66 ./plotlog1               
  67 ./plotlog2            68 ./plotlog3            69 ./plotlog4               
  70 ./plotlog5            71 ./plotlog6            72 ./plotlog7               
  73 ./plotpolr1           74 ./plotpolr2           75 ./plotpolr3              
  76 ./plotspher1          77 ./prl1                78 ./process1               
  79 ./real1               80 ./real2               81 ./subplot1               
  82 ./text2d1             83 ./text2d2             84 ./vec21                  
  85 ./vec22               86 ./vec23               87 ./vec24                  
  88 ./vec31               89 ./viewpt1             90 ./viewpt2                
  91 ./viewpt3             92 ./wcoord21            93 ./wcoord22               
  94 ./wcoord23            95 ./wcoord24            96 ./workbox1               
 
   x. Exit, delete demo executables
   s. Exit, save demo executables"
read answer
$CLEAR
case "$answer" in
  "x") rm ./*.o ./*.x ./*.tk ./*.dat ./*.inp 2>/dev/null; break;;
  "s") rm ./*.o 2>/dev/null; break;;
  1) wish -f ./_plot.tk;;
  2) ./axislbl1.x;;
  3) ./axislbl2.x;;
  4) ./axisnum1.x;;
  5) ./axisnum2.x;;
  6) ./axisnum3.x;;
  7) ./axisnum4.x;;
  8) ./axisnum5.x;;
  9) ./axisscale1.x;;
 10) ./axisscale2.x;;
 11) ./axisscale3.x;;
 12) ./axisscale4.x;;
 13) ./axisscale5.x;;
 14) ./axistick1.x;;
 15) ./axistick2.x;;
 16) ./axistick3.x;;
 17) ./axistick4.x;;
 18) ./axistick5.x;;
 19) ./axistick6.x;;
 20) ./barchart1.x;;
 21) ./barchart2.x;;
 22) ./barchart3.x;;
 23) ./barchart4.x;;
 24) ./barchart5.x;;
 25) ./barchart6.x;;
 26) ./curve2d1.x;;
 27) ./curve2d2.x;;
 28) ./curve2d3.x;;
 29) ./curve3d1.x;;
 30) ./device1.x;;
 31) ./fillarea1.x;;
 32) ./fillarea2.x;;
 33) ./fillarea3.x;;
 34) ./fillarea4.x;;
 35) ./grid1.x;;
 36) ./int1.x;;
 37) ./int2.x;;
 38) ./legend1.x;;
 39) ./legend2.x;;
 40) ./legend3.x;;
 41) ./legend4.x;;
 42) ./legend5.x;;
 43) ./locator1.x;;
 44) ./logpen21.x;;
 45) ./origin1.x;;
 46) ./packary1.x;;
 47) ./packary2.x;;
 48) ./packary3.x;;
 49) ./packary4.x;;
 50) ./packary5.x;;
 51) ./page1.x;;
 52) ./page2.x;;
 53) ./page3.x;;
 54) ./page4.x;;
 55) ./piechart1.x;;
 56) ./piechart2.x;;
 57) ./piechart3.x;;
 58) ./piechart4.x;;
 59) ./piechart5.x;;
 60) ./piechart6.x;;
 61) ./plot1.x;;
 62) ./plot2d1.x;;
 63) ./plot2d2.x;;
 64) ./plot3d1.x;;
 65) ./plot3d2.x;;
 66) ./plotlog1.x;;
 67) ./plotlog2.x;;
 68) ./plotlog3.x;;
 69) ./plotlog4.x;;
 70) ./plotlog5.x;;
 71) ./plotlog6.x;;
 72) ./plotlog7.x;;
 73) ./plotpolr1.x;;
 74) ./plotpolr2.x;;
 75) ./plotpolr3.x;;
 76) ./plotspher1.x;;
 77) ./prl1.x;;
 78) ./process1.x;;
 79) ./real1.x;;
 80) ./real2.x;;
 81) ./subplot1.x;;
 82) ./text2d1.x;;
 83) ./text2d2.x;;
 84) ./vec21.x;;
 85) ./vec22.x;;
 86) ./vec23.x;;
 87) ./vec24.x;;
 88) ./vec31.x;;
 89) ./viewpt1.x;;
 90) ./viewpt2.x;;
 91) ./viewpt3.x;;
 92) ./wcoord21.x;;
 93) ./wcoord22.x;;
 94) ./wcoord23.x;;
 95) ./wcoord24.x;;
 96) ./workbox1.x;;
  *) echo "Invalid Choice
 
  <CR> to Continue"
read answer;;
esac
done
$CLEAR
echo "
                    Object Access
            Programmer's Reusable Library
                        PLOT
 

 
       For more information contact:
 
         Object Access
         2023 Leisure Lane
         League City, TX  77573
 
         e-mail:   oa@iah.com
         homepage: http://www.iah.com/oa
         phone:    713-332-7281, 713-554-7617
 
 "
STOP_CAT
chmod 770 ./run_demo
if [ "$SYSID" = "" ]; then
$CLEAR
echo "
                    Object Access
            Programmer's Reusable Library
                        PLOT
 

  If you had selected a supported system, the demos
  would be installed automatically now.  Since you
  did not, you must perform the following procedures
  to complete the demo installation:
 
  1. Compile the demo programs using the FORTRAN command
     for your system, or by executing the 'compile' 
     script by typing its name.
 
  2. Execute the demo programs by typing 'run_demo'
 
  "
else
$CLEAR
echo "
                    Object Access
            Programmer's Reusable Library
                        PLOT
 

  All files required to run the demo programs are
  prepared.  If you wish to continue, press ENTER.
  To stop and continue manually, type any character
  and press ENTER.
 
  <CR> to Continue"
read answer
$CLEAR
if [ "$answer" = "" ]; then
  ./compile
  rm ./compile
  ./run_demo
else
$CLEAR
echo "
                    Object Access
            Programmer's Reusable Library
                        PLOT
 

  If you had elected to proceed, the demos
  would be installed automatically now.  Since you
  did not, you must perform the following procedures
  to complete the demo installation:
 
  1. Compile the demo programs using the FORTRAN command
     for your system, or by executing the 'compile' 
     script by typing its name.
 
  2. Execute the demo programs by typing 'run_demo'
 
  "
fi
fi
