(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
                        SURFACE
 

  Demo Program Build and Run Procedure
  ====================================
 
  This Procedure will compile and run the library
  demonstration programs.  The library object archive
  file 'libsurface.a' must be created, and the
  library environment variable SURFACE 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
                        SURFACE
 

       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 =====> [ ./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 =====> [ ./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 =====> [ ./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 =====> [ ./_surface.tk ]"
cat <<"STOP_CAT"> ././_surface.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-SURFACE library
#
#     NOTES:
#
#     ******************************************************************
#
#                       Define window title
#
set auto_path "$tk_library/demos $auto_path"
wm title . "PRL-SURFACE 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 600 -borderwidth 1 -text \
"This window demonstrates the Programmer's Reuseable Library \
PRL-SURFACE, 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-SURFACE.
 
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 }
#
#     ******************************************************************
#
#                       "SURFACE" menu
#
menubutton .menu.surface -text "SURFACE  " -menu .menu.surface.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.surface.m
#
#                       "surface1" button
.menu.surface.m add command -label "surface1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e surface1.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 }
#
#     ******************************************************************
#
#                       "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 }
#
#     ******************************************************************
#
#                       "PLOT2D" menu
#
.menu.setup.m add cascade -label "PLOT2D" -menu .menu.setup.plot2d
#
#     ------------------------------------------------------------------
#
                        menu .menu.setup.plot2d
#
#                       "plot2d1" button
.menu.setup.plot2d add command -label "plot2d1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plot2d1.x }
#
#     ******************************************************************
#
#                       "PLOT3D" menu
#
.menu.setup.m add cascade -label "PLOT3D" -menu .menu.setup.plot3d
#
#     ------------------------------------------------------------------
#
                        menu .menu.setup.plot3d
#
#                       "plot3d1" button
.menu.setup.plot3d add command -label "plot3d1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e plot3d1.x }
#
#     ******************************************************************
#
#                       "WORKBOX" menu
#
.menu.setup.m add cascade -label "WORKBOX" -menu .menu.setup.workbox
#
#     ------------------------------------------------------------------
#
                        menu .menu.setup.workbox
#
#                       "workbox1" button
.menu.setup.workbox add command -label "workbox1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e workbox1.x }
#
#     ******************************************************************
#
#                       "CONTR2D" menu
#
menubutton .menu.contr2d -text "CONTR2D  " -menu .menu.contr2d.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.contr2d.m
#
#                       "contr2d1" button
.menu.contr2d.m add command -label "contr2d1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e contr2d1.x }
#
#                       "contr2d2" button
.menu.contr2d.m add command -label "contr2d2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e contr2d2.x }
#
#                       "contr2d3" button
.menu.contr2d.m add command -label "contr2d3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e contr2d3.x }
#
#                       "contr2d4" button
.menu.contr2d.m add command -label "contr2d4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e contr2d4.x }
#
#     ******************************************************************
#
#                       "CONTR3D" menu
#
menubutton .menu.contr3d -text "CONTR3D  " -menu .menu.contr3d.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.contr3d.m
#
#                       "contr3d1" button
.menu.contr3d.m add command -label "contr3d1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e contr3d1.x }
#
#                       "contr3d2" button
.menu.contr3d.m add command -label "contr3d2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e contr3d2.x }
#
#                       "contr3d3" button
.menu.contr3d.m add command -label "contr3d3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e contr3d3.x }
#
#                       "contr3d4" button
.menu.contr3d.m add command -label "contr3d4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e contr3d4.x }
#
#     ******************************************************************
#
#                       "SURF3D" menu
#
menubutton .menu.surf3d -text "SURF3D  " -menu .menu.surf3d.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.surf3d.m
#
#                       "surf3d1" button
.menu.surf3d.m add command -label "surf3d1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e surf3d1.x }
#
#                       "surf3d2" button
.menu.surf3d.m add command -label "surf3d2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e surf3d2.x }
#
#                       "surf3d3" button
.menu.surf3d.m add command -label "surf3d3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e surf3d3.x }
#
#                       "surf3d4" button
.menu.surf3d.m add command -label "surf3d4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e surf3d4.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
#
#                       "CONTR2D" button
.menu.more.defs add command -label "CONTR2D" -command \
{ mkDialog .modal {-text \
{The CONTR2D menu invokes demonstrations of the PRL-SURFACE \
CONTR2D object subprograms.  The CONTR2D object is \
an interpolation locus of a 3D surface at constant height drawn in 2D. \
} -aspect 450 -justify left} {OK {}}
}
#                       "CONTR3D" button
.menu.more.defs add command -label "CONTR3D" -command \
{ mkDialog .modal {-text \
{The CONTR3D menu invokes demonstrations of the PRL-SURFACE \
CONTR3D object subprograms.  The CONTR3D object is \
an interpolation locus of a 3D surface at constant height drawn in 3D. \
} -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-SURFACE \
DEVICE object subprograms.  The DEVICE object is \
the parent object for all other PRL-DEVICE objects. \
} -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-SURFACE \
ORIGIN object subprograms.  The ORIGIN object is \
the lower left-hand corner of a subplot. \
} -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-SURFACE \
PAGE object subprograms.  The PAGE object is \
a drawing surface of fixed size. \
} -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-SURFACE \
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-SURFACE \
PLOT3D object subprograms.  The PLOT3D object is \
a plot referenced to 3D axes scaled for linear 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-SURFACE \
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-SURFACE \
PROCESS object subprograms.  The PROCESS object is \
a single thread of control that executes within an address space. \
} -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-SURFACE \
SUBPLOT object subprograms.  The SUBPLOT object is \
a collection of graphical objects associated with a given reference system. \
} -aspect 450 -justify left} {OK {}}
}
#                       "SURF3D" button
.menu.more.defs add command -label "SURF3D" -command \
{ mkDialog .modal {-text \
{The SURF3D menu invokes demonstrations of the PRL-SURFACE \
SURF3D object subprograms.  The SURF3D object is \
a collection of 3D points forming a rectangular grid in the X and Y dimensions.
} -aspect 450 -justify left} {OK {}}
}
#                       "SURFACE" button
.menu.more.defs add command -label "SURFACE" -command \
{ mkDialog .modal {-text \
{The SURFACE menu invokes demonstrations of the PRL-SURFACE \
SURFACE object subprograms.  The SURFACE object is \
the parent object for all other PRL-SURFACE objects. \
} -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-SURFACE \
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.surface \
     .menu.setup \
     .menu.contr2d \
     .menu.contr3d \
     .menu.surf3d \
     .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.surface \
           .menu.setup \
           .menu.contr2d \
           .menu.contr3d \
           .menu.surf3d \
           .menu.process \
           .menu.more
#
#     ******************************************************************
#
#                       Position a dialog box on the screen
#
proc dpos w {
    wm geometry $w +300+300
}
#
STOP_CAT
echo "  Generating =====> [ ./contr2d1.f ]"
cat <<"STOP_CAT"> ././contr2d1.f
C     PROGRAM CONTR2D1
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 CONTR2D_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      REAL ZMAT(31,31)
      REAL CL(20)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
      DATA NX /31/
      DATA NY /31/
      DATA XMIN,XMAX,YMIN,YMAX /-10.0,10.0,-10.0,10.0/
C
C     ******************************************************************
C
C                       INITIALIZE LIBRARIES
C
C                       Initialize the surface package
      CALL SURFACE_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 SURFACE DATA FROM WHICH CONTOURS
C                       WILL BE INTERPOLATED AND PLOTTED
C
C     ------------------------------------------------------------------
C
C                       GENERATE X,Y, AND Z DATA
C
C                       Compute interval between X grid lines
      DX = (XMAX-XMIN)/(NX-1)
C                       Compute interval between Y grid lines
      DY = (YMAX-YMIN)/(NY-1)
C                       Initialize min and max Z coordinates
      ZMIN = 1E30
      ZMAX = -1E30
C                       Loop for each X grid line
      DO 65 I=1,NX
C                       Compute coordinate of X grid line
        X = XMIN + (I-1)*DX
C                       Loop for each Y grid line
        DO 60 J=1,NY
C                       Compute coordinate of Y grid line
          Y = YMIN + (J-1)*DY
C                       Compute Z coordinate at intersection of
C                       X and Y grid lines
          ZMAT(I,J) = FXY(X,Y,0.0,0.0,15.0,10.0) +
     1                0.90*FXY(X,Y,-5.0,-2.5,10.0,20.0) +
     2                0.75*FXY(X,Y,7.0,3.0,20.0,20.0) +
     3                0.85*FXY(X,Y,2.0,-4.0,15.0,15.0) +
     4                0.85*FXY(X,Y,-2.5,6.5,25.0,35.0)
C                       Update min and max Z coordinates
          ZMIN = AMIN1 (ZMIN,ZMAT(I,J))
          ZMAX = AMAX1 (ZMAX,ZMAT(I,J))
C                       Repeat for next Y grid line
   60   CONTINUE
C                       Repeat for next X grid line
   65 CONTINUE
C
C     ------------------------------------------------------------------
C
C                       COMPUTE AND STORE Z COORDINATES OF CONTOURS
C
C                       Store number of contour levels
      NL = 5
C                       Compute Z interval between contour levels
      D = (ZMAX-ZMIN)/(NL-1)
C                       Compute and store Z coordinate of each
C                       contour level
      DO 10 I=1,NL
        CL(I) = ZMIN + (I-1)*D
   10 CONTINUE
C
C     ******************************************************************
C
C                       INITIALIZE 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.20*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 ('CONTR2D1 Demo: 2D Color Contour Plot$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw title centered below subplot area
      YY = -0.17*YPG
      CALL TEXT2D_PDRAW
     *     ('CONTR2D1 Demo: 2D Color Contour Plot$',100,XX,YY)
C
C     ------------------------------------------------------------------
C
C                       DEFINE PLOT HEADING
C
C                       Set color to green
      CALL COLOR_SETNAM ('GREEN')
C                       Enable character area fill
      CALL FONT_SETPAT (0.0,1,YPAGE/750.,1)
C                       Draw heading over plot
      CALL HEADING_DRAW ('Topo-like Function$',100,1.2,1)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.9)
C                       Set current color to green
      CALL COLOR_SETNAM ('GREE')
C                       Define X axis label
      CALL AXISLBL_DEFX2 ('X-AXIS$',100)
C                       Define Y axis label
      CALL AXISLBL_DEFY2 ('Y-AXIS$',100)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Define 2D coordinate system
      CALL PLOT2D_DEFINE (XMIN,5.0,XMAX,YMIN,5.0,YMAX)
C
C                       DRAW COLOR CONTOUR
C
C                       Set default text height
      CALL GRAPHICS_RESET ('TEXT2D_SETHT')
C                       Specify color contour plot
      CALL CONTR2D_SHADEON (0)
C                       Enable hardware shading
      CALL DEVICE_FILLON
C                       Specify location of contour legend box
      CALL CONTR2D_LEGLOC (XPG*0.05,YPG*0.05)
C
C                       Draw color contour plot
      CALL CONTR2D_DRAW (ZMAT,31,31,XMIN,XMAX,YMIN,YMAX,NL,CL)
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
      FUNCTION FXY (X,Y,XC,YC,XS,YS)
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: GET Z VALUES FROM X,Y DATA MATRIX
C
C     ARGUMENT LIST INPUT:
C
C     ARGUMENT LIST OUTPUT:
C
C     GLOBAL INPUT:
C
C     GLOBAL OUTPUT:
C
C     EXCEPTIONS:
C
C     LOCAL VARIABLES:
C
C     NOTES:  None
C
C     ******************************************************************
C
      INTRINSIC COS, EXP
C
C     ******************************************************************
C
      R = (X-XC)**2/XS + (Y-YC)**2/YS
      FXY = COS(R)*EXP(-R)
C
      RETURN
      END
STOP_CAT
echo "  Generating =====> [ ./contr2d2.f ]"
cat <<"STOP_CAT"> ././contr2d2.f
C     PROGRAM CONTR2D2
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 CONTR2D_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      REAL ZMAT(31,31)
      REAL CL(20)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
      DATA NX /31/
      DATA NY /31/
      DATA XMIN,XMAX,YMIN,YMAX /0.1,0.5,0.1,0.5/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the surface package
      CALL SURFACE_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 SURFACE DATA FROM WHICH CONTOURS
C                       WILL BE INTERPOLATED AND PLOTTED
C
C     ------------------------------------------------------------------
C
C                       GENERATE X,Y, AND Z DATA
C
C                       Compute interval between X grid lines
      DX = (XMAX-XMIN)/(NX-1)
C                       Compute interval between Y grid lines
      DY = (YMAX-YMIN)/(NY-1)
C                       Initialize min and max Z coordinates
      ZMIN = 1E30
      ZMAX = -1E30
C                       Loop for each X grid line
      DO 65 I=1,NX
C                       Compute coordinate of X grid line
        X = XMIN + (I-1)*DX
C                       Loop for each Y grid line
        DO 60 J=1,NY
C                       Compute coordinate of Y grid line
          Y = YMIN + (J-1)*DY
C                       Compute Z coordinate at intersection of
C                       X and Y grid lines
          ZMAT(I,J) = FXY(X,Y)
C                       Update min and max Z coordinates
          ZMIN = AMIN1(ZMIN,ZMAT(I,J))
          ZMAX = AMAX1(ZMAX,ZMAT(I,J))
C                       Repeat for next Y grid line
   60   CONTINUE
C                       Repeat for next X grid line
   65 CONTINUE
C
C
C     ------------------------------------------------------------------
C
C                       COMPUTE AND STORE Z COORDINATES OF CONTOURS
C
C                       Store number of contour levels
      NL = 5
C                       Compute Z interval between contour levels
      D = (ZMAX - ZMIN)/(NL -1)
C                       Compute and store Z coordinate of each
C                       contour level
      DO 10 I=1,NL
        CL(I) = ZMIN + (I-1)*D
   10 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.20*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 ('CONTR2D2 Demo: 2D Color Contour Plot$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw title centered below subplot area
      YY = -0.17*YPG
      CALL TEXT2D_PDRAW
     *     ('CONTR2D2 Demo: 2D Color Contour Plot$',100,XX,YY)
C
C                       DEFINE PLOT HEADING
C
C                       Set color to green
      CALL COLOR_SETNAM ('GREEN')
C                       Enable character area fill
      CALL FONT_SETPAT (0.0,1,YPAGE/750.,1)
C                       Draw heading over plot
      CALL HEADING_DRAW ('Singularity Function$',100,1.2,1)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set default character height
      CALL GRAPHICS_RESET ('TEXT2D_SETHT')
C                       Set current color to green
      CALL COLOR_SETNAM ('GREE')
C                       Define X axis label
      CALL AXISLBL_DEFX2 ('X-AXIS$',100)
C                       Define Y axis label
      CALL AXISLBL_DEFY2 ('Y-AXIS$',100)
C
C     ******************************************************************
C
C                       DRAW COLOR CONTOUR
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Define 2D coordinate system
      CALL PLOT2D_DEFINE (XMIN,0.1,XMAX,YMIN,0.1,YMAX)
C
C                       Specify color contour plot
      CALL CONTR2D_SHADEON (0)
C                       Enable hardware shading
      CALL DEVICE_FILLON
C                       Specify location of contour legend box
      CALL CONTR2D_LEGLOC (XPG*0.65,0.0)
C
C                       Draw color contour plot
      CALL CONTR2D_DRAW (ZMAT,31,31,XMIN,XMAX,YMIN,YMAX,NL,CL)
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
      FUNCTION FXY (X,Y)
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: GET Z VALUES FROM X,Y DATA MATRIX
C
C     ARGUMENT LIST INPUT:
C
C     ARGUMENT LIST OUTPUT:
C
C     GLOBAL INPUT:
C
C     GLOBAL OUTPUT:
C
C     EXCEPTIONS:
C
C     LOCAL VARIABLES:
C
C     NOTES:  None
C
C     ******************************************************************
C
      INTRINSIC SIN
C
C     ******************************************************************
C
      R = 1.0/(X**2 + Y**2)
      FXY = R*SIN(R)
C
      RETURN
      END
STOP_CAT
echo "  Generating =====> [ ./contr2d3.f ]"
cat <<"STOP_CAT"> ././contr2d3.f
C     PROGRAM CONTR2D3
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 CONTR2D_LABON
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       Array for storing Z coordinates of surface
      REAL ZMAT(31,31)
C                       Array for storing Z coordinates of
C                       contour levels
      REAL CL(20)
C                       Number of X grid lines for plotting contours
      DATA NX /31/
C                       Number of Y grid lines for plotting contours
      DATA NY /31/
C                       Min and max X and Y coordinates of surface
      DATA XMIN,XMAX,YMIN,YMAX /-10.0,10.0,-10.0,10.0/
C
C     ******************************************************************
C
C                       INITIALIZE LIBRARIES
C
C                       Initialize the surface package
      CALL SURFACE_INIT (0)
C
C     ******************************************************************
C
C                       COMPUTE SURFACE DATA FROM WHICH CONTOURS
C                       WILL BE INTERPOLATED AND PLOTTED
C
C     ------------------------------------------------------------------
C
C                       COMPUTE AND STORE Z COORDINATES OF SURFACE
C
C                       Compute interval between X grid lines
      DX = (XMAX-XMIN)/(NX-1)
C                       Compute interval between Y grid lines
      DY = (YMAX-YMIN)/(NY-1)
C                       Initialize min and max Z coordinates
      ZMIN = 1E30
      ZMAX = -1E30
C                       Loop for each X grid line
      DO 65 I=1,NX
C                       Compute coordinate of X grid line
      X = XMIN + (I-1)*DX
C                       Loop for each Y grid line
        DO 60 J=1,NY
C                       Compute coordinate of Y grid line
          Y = YMIN + (J-1)*DY
C                       Compute Z coordinate at intersection of
C                       X and Y grid lines
          ZMAT(I,J) = FXYZ (X,Y,0.0 ,0.0 ,15.0,10.0) +
     1            0.9*FXYZ (X,Y,-5.0,-2.5,10.0,20.0) +
     2           0.75*FXYZ (X,Y,7.0 ,3.0 ,20.0,20.0) +
     3           0.85*FXYZ (X,Y,2.0 ,-4.0,15.0,15.0) +
     4           0.85*FXYZ (X,Y,-2.5,6.5 ,25.0,35.0)
C                       Update min and max Z coordinates
          ZMIN = AMIN1 (ZMIN,ZMAT(I,J))
          ZMAX = AMAX1 (ZMAX,ZMAT(I,J))
C                       Repeat for next Y grid line
   60   CONTINUE
C                       Repeat for next X grid line
   65 CONTINUE
C
C     ------------------------------------------------------------------
C
C                       COMPUTE AND STORE Z COORDINATES OF CONTOURS
C
C                       Store number of contour levels
      NL = 5
C                       Compute Z interval between contour levels
      D = (ZMAX - ZMIN)/(NL -1)
C                       Compute and store Z coordinate of each
C                       contour level
      DO 10 I = 1,NL
        CL(I) = ZMIN + (I-1)*D
  10  CONTINUE
C
C     ******************************************************************
C
C                       INITIALIZE 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 - 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                       Set text style to 'cartog'
      CALL FONT_CARTOG
C                       Determine length of text string in inches
      XX = TEXT2D_GETLEN ('CONTR2D3 Demo: Line Contour Plot$',100)
C                       Compute X coordinate in inches to center
C                       plot title
      XX = 0.50*(XPG-XX)
C                       Draw plot title under subplot area
      CALL TEXT2D_PDRAW
     *     ('CONTR2D3 Demo: Line Contour Plot$',100,XX,-0.17*YPG)
C
C     ------------------------------------------------------------------
C
C                       DRAW PLOT HEADING
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Define fill pattern and activate area fill
C                       for shaded characters
      CALL FONT_SETPAT (0.0,1,0.05,1)
C                       Draw plot heading over subplot area
      CALL HEADING_DRAW ('Topo-like Function$',100,1.2,1)
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Define X axis label
      CALL AXISLBL_DEFX2 ('X-Axis$',100)
C                       Define Y axis label
      CALL AXISLBL_DEFY2 ('Y-Axis$',100)
C                       Allow up to 10 tick marks on axes
      CALL AXISTICK_SETMAX (10)
C
C     ******************************************************************
C
C                       DRAW THE PLOT AXES
C
C                       Set current drawing color to foreground
      CALL COLOR_SETNAM ('FORE')
C                       Reset text height to default (.14 inches)
      CALL GRAPHICS_RESET ('TEXT2D_SETHT')
C                       Draw frame around subplot area
      CALL FRAME_DRAW
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
C     ******************************************************************
C
C                       DRAW THE PLOT CURVES
C
C                       Label contour lines at 6th line segment and
C                       also draw line legend box
      CALL CONTR2D_LABON (-6)
C                       Set current drawing color to 'cyan'
      CALL COLOR_SETNAM ('CYAN')
C                       Interpolate and draw contour lines for the
C                       surface defined by the Z coordinates in ZMAT
      CALL CONTR2D_DRAW (ZMAT,31,31,XMIN,XMAX,YMIN,YMAX,NL,CL)
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
      FUNCTION FXYZ (X,Y,XC,YC,XS,YS)
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: COMPUTE Z SURFACE VALUES FROM X,Y DATA
C
C     ARGUMENT LIST INPUT:
C
C     ARGUMENT LIST OUTPUT:
C
C     GLOBAL INPUT:
C
C     GLOBAL OUTPUT:
C
C     EXCEPTIONS:
C
C     LOCAL VARIABLES:
C
C     NOTES:  None
C
C     ******************************************************************
C
      INTRINSIC COS, EXP
C
C     ******************************************************************
C
      R = (X-XC)**2/XS + (Y-YC)**2/YS
      FXYZ = COS(R)*EXP(-R)
C
      RETURN
      END
STOP_CAT
echo "  Generating =====> [ ./contr2d4.f ]"
cat <<"STOP_CAT"> ././contr2d4.f
C     PROGRAM CONTR2D4
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 CONTR2D_LEGLOC and
C              CONTR2D_SHADEON
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      REAL ZMAT(31,31)
      REAL CL(20)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
      DATA NX /31/
      DATA NY /31/
      DATA XMIN,XMAX,YMIN,YMAX /0.1,0.5,0.1,0.5/
C
C     ******************************************************************
C
C                       INITIALZE LIBRARIES
C
C                       Initialize the surface package
      CALL SURFACE_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 SURFACE DATA FROM WHICH CONTOURS
C                       WILL BE INTERPOLATED AND PLOTTED
C
C     ------------------------------------------------------------------
C
C                       GENERATE X,Y, AND Z DATA
C
C                       Compute interval between X grid lines
      DX = (XMAX-XMIN)/(NX-1)
C                       Compute interval between Y grid lines
      DY = (YMAX-YMIN)/(NY-1)
C                       Initialize min and max Z coordinates
      ZMIN = 1E30
      ZMAX = -1E30
C                       Loop for each X grid line
      DO 65 I=1,NX
C                       Compute coordinate of X grid line
        X = XMIN + (I-1)*DX
C                       Loop for each Y grid line
        DO 60 J=1,NY
C                       Compute coordinate of Y grid line
          Y = YMIN + (J-1)*DY
C                       Compute Z coordinate at intersection of
C                       X and Y grid lines
          ZMAT(I,J) = FXY(X,Y)
C                       Update min and max Z coordinates
          ZMIN = AMIN1(ZMIN,ZMAT(I,J))
          ZMAX = AMAX1(ZMAX,ZMAT(I,J))
C                       Repeat for next Y grid line
   60   CONTINUE
C                       Repeat for next X grid line
   65 CONTINUE
C
C
C     ------------------------------------------------------------------
C
C                       COMPUTE AND STORE Z COORDINATES OF CONTOURS
C
C                       Store number of contour levels
      NL = 5
C                       Compute Z interval between contour levels
      D = (ZMAX - ZMIN)/(NL -1)
C                       Compute and store Z coordinate of each
C                       contour level
      DO 10 I=1,NL
        CL(I) = ZMIN + (I-1)*D
   10 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 100 ILEG=1,2
      IF (ILEG .EQ. 1) THEN
        XLEG = 0.0
      ELSE
        XLEG = XPG*0.5
      ENDIF
C
      DO 101 JLEG=1,2
      IF (JLEG .EQ. 1) THEN
        YLEG = 0.0
      ELSE
        YLEG = YPG*0.75
      ENDIF
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.20*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 ('CONTR2D4 Demo: Contour Plot Legend$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw title centered below subplot area
      YY = -0.17*YPG
      CALL TEXT2D_PDRAW
     *     ('CONTR2D4 Demo: Contour Plot Legend$',100,XX,YY)
C
C                       DEFINE PLOT HEADING
C
C                       Set color to green
      CALL COLOR_SETNAM ('GREEN')
C                       Enable character area fill
      CALL FONT_SETPAT (0.0,1,YPAGE/750.,1)
C                       Draw heading over plot
      CALL HEADING_DRAW ('Singularity Function$',100,1.2,1)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set default character height
      CALL GRAPHICS_RESET ('TEXT2D_SETHT')
C                       Set current color to green
      CALL COLOR_SETNAM ('GREE')
C                       Define X axis label
      CALL AXISLBL_DEFX2 ('X-AXIS$',100)
C                       Define Y axis label
      CALL AXISLBL_DEFY2 ('Y-AXIS$',100)
C
C     ******************************************************************
C
C                       DRAW COLOR CONTOUR
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Define 2D coordinate system
      CALL PLOT2D_DEFINE (XMIN,0.1,XMAX,YMIN,0.1,YMAX)
C
C                       Specify color contour plot
      IF (JLEG .EQ. 1) THEN
        CALL CONTR2D_SHADEON (0)
      ENDIF
C                       Enable hardware shading
      CALL DEVICE_FILLON
C                       Specify location of contour legend box
      CALL CONTR2D_LEGLOC (XLEG,YLEG)
C
C                       Draw color contour plot
      CALL CONTR2D_DRAW (ZMAT,31,31,XMIN,XMAX,YMIN,YMAX,NL,CL)
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
  101 CONTINUE
  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
      FUNCTION FXY (X,Y)
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: GET Z VALUES FROM X,Y DATA MATRIX
C
C     ARGUMENT LIST INPUT:
C
C     ARGUMENT LIST OUTPUT:
C
C     GLOBAL INPUT:
C
C     GLOBAL OUTPUT:
C
C     EXCEPTIONS:
C
C     LOCAL VARIABLES:
C
C     NOTES:  None
C
C     ******************************************************************
C
      INTRINSIC SIN
C
C     ******************************************************************
C
      R = 1.0/(X**2 + Y**2)
      FXY = R*SIN(R)
C
      RETURN
      END
STOP_CAT
echo "  Generating =====> [ ./contr3d1.f ]"
cat <<"STOP_CAT"> ././contr3d1.f
C     PROGRAM CONTR3D1
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 CONTR3D_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:
C       The surface contour is generated from the function
C         ZMAT(i,j) = F(Xi,Yj)
C       where
C         Xi = XMIN + (i-1)*(XMAX-XMIN)/(NX-1)
C         Yj = YMIN + (j-1)*(YMAX-YMIN)/(NY-1)
C         XMIN, YMIN  minimum values of X, Y
C         XMAX, YMAX  maximum values of X, Y
C         NX          number of x values in the ZMAT array
C         NY          number of y values in the ZMAT array
C
C     ******************************************************************
C
C                       Array for storing Z coordinates of
C                       contour levels
      DIMENSION CL(10)
C                       Array for storing Z coordinates of surface
      REAL ZMAT(31,31)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Number of X grid lines for plotting contours
      DATA NX /31/
C                       Number of Y grid lines for plotting contours
      DATA NY /31/
C                       Min and max X and Y coordinates of surface
      DATA XMIN,XMAX,YMIN,YMAX /0.0,1.0,0.0,1.0/
C
C     ******************************************************************
C
C                       INITIALIZE LIBRARIES
C
C                       Initialize the surface package
      CALL SURFACE_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 SURFACE DATA FROM WHICH CONTOURS
C                       WILL BE INTERPOLATED AND PLOTTED
C
C     ------------------------------------------------------------------
C
C                       COMPUTE AND STORE Z COORDINATES OF SURFACE
C
C                       Compute interval between X grid lines
      DX = (XMAX-XMIN)/(NX-1)
C                       Compute interval between Y grid lines
      DY = (YMAX-YMIN)/(NY-1)
C                       Initialize min and max Z coordinates
      ZMIN = 1.0E30
      ZMAX = -1.0E30
C                       Loop for each X grid line
      DO 65 I=1,NX
C                       Compute coordinate of X grid line
      X = XMIN + (I-1)*DX
C                       Loop for each Y grid line
        DO 60 J=1,NY
C                       Compute coordinate of Y grid line
          Y = YMIN + (J-1)*DY
C                       Compute Z coordinate at intersection of
C                       X and Y grid lines
          ZMAT(I,J) = FXY(X,Y)
C                       Update min and max Z coordinates
          ZMIN=AMIN1(ZMIN,ZMAT(I,J))
          ZMAX=AMAX1(ZMAX,ZMAT(I,J))
C                       Repeat for next Y grid line
   60   CONTINUE
C                       Repeat for next X grid line
   65 CONTINUE
C
C     ------------------------------------------------------------------
C
C                       COMPUTE AND STORE Z COORDINATES OF CONTOURS
C
C                       Store number of contour levels
      NL = 6
C                       Compute Z interval between contour levels
      D = (ZMAX - ZMIN)/(NL -1)
C                       Compute and store Z coordinate of each
C                       contour level
      DO 10 I = 1,NL
         CL(I) = ZMIN + (I-1)*D
   10 CONTINUE
C
C     ******************************************************************
C
C                       INITIALIZE 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 - 2.0*YRL
C
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 ('CONTR3D1 Demo: 3D Color Contour Plot$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw title centered below subplot area
      YY = -0.15*YPG
      CALL TEXT2D_PDRAW
     *     ('CONTR3D1 Demo: 3D Color Contour Plot$',100,XX,YY)
C
C     ------------------------------------------------------------------
C
C                       DRAW PLOT HEADING
C
C                       Set current drawing color to 'green'
      CALL COLOR_SETNAM ('GREEN')
C                       Draw heading over plot
      CALL HEADING_DRAW ('Humped Surface Function$',100,1.5,1)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE*0.50)
C                       Define X axis label
      CALL AXISLBL_DEFX3 ('X',1)
C                       Define Y axis label
      CALL AXISLBL_DEFY3 ('Y',1)
C                       Define Z axis label
      CALL AXISLBL_DEFZ3 ('Z',1)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Set current drawing color to 'foreground'
      CALL COLOR_SETNAM ('FOREGROUND')
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Define workbox dimensions for 3D coord system
      CALL WORKBOX_DEFINE (10.0,10.0,10.0)
C                       Set viewpoint to 45 degree angle of
C                       elevation and rotation, and effectively
C                       infinite distance
      CALL VIEWPT_SETBS (45.0,45.0,9999.0)
C                       Define 3D coordinate system with
C                       X = 0.0 to 1.0 and Y = 0.0 to 1.0,
C                       Z = ZMIN to ZMAX, and draw axes, axes labels
      CALL PLOT3D_DEFINE (0.0,0.5,1.0, 0.0,0.5,1.0, ZMIN,0.0,ZMAX)
C
C                       Locate coutour plot legend box
C                       -2.2 inches in X from physical origin
      CALL CONTR2D_LEGLOC (-XPG*0.35,0.0)
C                       Label contour lines at 2nd line segment and
C                       also draw line legend box
      CALL CONTR2D_LABON (-2)
C                       Interpolate and draw 3D contour lines for the
C                       surface defined by the Z coordinates in ZMAT
      CALL CONTR3D_DRAW (ZMAT,NX,NY,XMIN,XMAX,YMIN,YMAX,NL,CL)
C
C                       Draw surface defined by points in matrix ZMAT
      CALL SURF3D_DRAW (ZMAT,1,NX,1,NY,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
      FUNCTION FXY (X,Y)
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: COMPUTE Z SURFACE VALUES FROM X,Y DATA
C
C     ARGUMENT LIST INPUT:
C
C     ARGUMENT LIST OUTPUT:
C
C     GLOBAL INPUT:
C
C     GLOBAL OUTPUT:
C
C     EXCEPTIONS:
C
C     LOCAL VARIABLES:
C
C     NOTES:  None
C
C     ******************************************************************
C
      FXY = (1.0 - X/2.0)**6*(1.0-Y/2.0)**6+1000.0*(1.0-X)**3*X**3*
     1      (1.0-Y)**3*Y**3+Y**6*(1.0-X/2.0)**6+X**6*(1.0-Y/2.0)**6
C
      RETURN
      END
STOP_CAT
echo "  Generating =====> [ ./contr3d2.f ]"
cat <<"STOP_CAT"> ././contr3d2.f
C     PROGRAM CONTR3D2
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 CONTR3D_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:
C       The surface is generated from the function
C         ZMAT(i,j) = F(Xi,Yj)
C           where
C         Xi = XMIN + (i-1)*(XMAX-XMIN)/(NX-1)
C         Yj = YMIN + (j-1)*(YMAX-YMIN)/(NY-1)
C         XMIN, YMIN = minimum values of X, Y
C         XMAX, YMAX = maximum values of X, Y
C         NX         = number of x values in the ZMAT array
C         NY         = number of y values in the ZMAT array
C
C     ******************************************************************
C
      DIMENSION CL(10)
C
      REAL ZMAT(31,31)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
      DATA NX /31/
      DATA NY /31/
      DATA XMIN,XMAX,YMIN,YMAX /-10.0,10.0,-10.0,10.0/
C
C     ******************************************************************
C
C                       INITIALIZE LIBRARIES
C
C                       Initialize the surface package
      CALL SURFACE_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 SURFACE DATA FROM WHICH CONTOURS
C                       WILL BE INTERPOLATED AND PLOTTED
C
C     ------------------------------------------------------------------
C
C                       GENERATE X,Y, AND Z DATA
C
C                       Compute interval between X grid lines
      DX = (XMAX-XMIN)/(NX-1)
C                       Compute interval between Y grid lines
      DY = (YMAX-YMIN)/(NY-1)
C                       Initialize min and max Z coordinates
      ZMIN = 1E30
      ZMAX = -1E30
C                       Loop for each X grid line
      DO 65 I=1,NX
C                       Compute coordinate of X grid line
        X = XMIN + (I-1)*DX
C                       Loop for each Y grid line
        DO 60 J=1,NY
C                       Compute coordinate of Y grid line
          Y = YMIN + (J-1)*DY
C                       Compute Z coordinate at intersection of
C                       X and Y grid lines
          ZMAT(I,J) = FXY (X,Y,0.0,0.0,15.0,10.0) +
     1                0.90*FXY(X,Y,-5.0,-2.5,10.0,20.0) +
     2                0.75*FXY(X,Y,7.0,3.0,20.0,20.0) +
     3                0.85*FXY(X,Y,2.0,-4.0,15.0,15.0) +
     4                0.85*FXY(X,Y,-2.5,6.5,25.0,35.0)
C                       Update min and max Z coordinates
          ZMIN=AMIN1 (ZMIN,ZMAT(I,J))
          ZMAX=AMAX1 (ZMAX,ZMAT(I,J))
C                       Repeat for next Y grid line
   60   CONTINUE
C                       Repeat for next X grid line
   65 CONTINUE
C
C     ------------------------------------------------------------------
C
C                       COMPUTE AND STORE Z COORDINATES OF CONTOURS
C
C                       Store number of contour levels
C
      NL = 6
C                       Compute Z interval between contour levels
      D = (ZMAX - ZMIN)/(NL -1)
C                       Compute and store Z coordinate of each
C                       contour level
      DO 10 I = 1,NL
        CL(I) = ZMIN + (I-1)*D
   10 CONTINUE
C
C     ******************************************************************
C
C                       INITIALIZE 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.20*XPAGE
      YRL = 0.07*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 3.25*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 ('CONTR3D2 Demo: 3D Color Contour Plot$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw title centered below subplot area
      YY = -0.05*YPG
      CALL TEXT2D_PDRAW
     *     ('CONTR3D2 Demo: 3D Color Contour Plot$',100,XX,YY)
C
C     ------------------------------------------------------------------
C
C                       DEFINE PLOT HEADING
C
C                       Set current color to green
      CALL COLOR_SETNAM ('GREEN')
C                       Draw heading over plot in green
      CALL HEADING_DRAW ('Topo-like Function$',100,1.2,3)
      CALL HEADING_DRAW ('with$',100,0.9,3)
      CALL HEADING_DRAW ('Hidden Surface Removal$',100,1.2,3)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set default character height
      CALL GRAPHICS_RESET ('TEXT2D_SETHT')
C                       Define X axis label
      CALL AXISLBL_DEFX3 ('X',1)
C                       Define Y axis label
      CALL AXISLBL_DEFY3 ('Y',1)
C                       Define Z axis label
      CALL AXISLBL_DEFZ3 ('Z',1)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Define 3-D coord system workbox volume
      CALL WORKBOX_DEFINE (12.0,12.0,10.0)
C                       Define 3-D viewpoint
      CALL VIEWPT_SETBS (45.0,45.0,9999.0)
C                       Set current color to white
      CALL COLOR_SETNAM ('FOREGROUND')
C                       Define 3-D coordinate system
      CALL PLOT3D_DEFINE
     *     (-10.0,5.0,10.0, -10.0,5.0,10.0, ZMIN*.3,0.0,ZMAX*.3)
C
C                       DRAW 3-D COLOR CONTOUR
C
C                       Enable hardware shading
      CALL DEVICE_FILLON
C                       Specify color contour plot
      CALL CONTR2D_SHADEON (0)
C                       Draw color contour plot
      CALL CONTR3D_DRAW (ZMAT,NX,NY,XMIN,XMAX,YMIN,YMAX,NL,CL)
C
C                       DRAW 3-D SURFACE
C
C                       Set current color to black
      CALL COLOR_SETNAM ('BLAC')
C                       Draw 3-D surface mesh with hidden line removal
      CALL SURF3D_DRAW (ZMAT,1,NX,1,NY,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
      FUNCTION FXY (X,Y,XC,YC,XS,YS)
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: GET Z VALUES FROM X,Y DATA MATRIX
C
C     ARGUMENT LIST INPUT:
C
C     ARGUMENT LIST OUTPUT:
C
C     GLOBAL INPUT:
C
C     GLOBAL OUTPUT:
C
C     EXCEPTIONS:
C
C     LOCAL VARIABLES:
C
C     NOTES:  None
C
C     ******************************************************************
C
      INTRINSIC COS, EXP
C
C     ******************************************************************
C
      R = (X-XC)**2/XS + (Y-YC)**2/YS
      FXY = COS(R)*EXP(-R)
C
      RETURN
      END
STOP_CAT
echo "  Generating =====> [ ./contr3d3.f ]"
cat <<"STOP_CAT"> ././contr3d3.f
C     PROGRAM CONTR3D3
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 CONTR3D_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:
C       The surface is generated from the function
C         ZMAT(i,j) = F(Xi,Yj)
C           where
C         Xi = XMIN + (i-1)*(XMAX-XMIN)/(NX-1)
C         Yj = YMIN + (j-1)*(YMAX-YMIN)/(NY-1)
C         XMIN, YMIN = minimum values of X, Y
C         XMAX, YMAX = maximum values of X, Y
C         NX         = number of x values in the ZMAT array
C         NY         = number of y values in the ZMAT array
C
C     ******************************************************************
C
      DIMENSION CL(10)
C
      REAL ZMAT(31,31)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
      DATA NX /31/
      DATA NY /31/
      DATA XMIN,XMAX,YMIN,YMAX /0.1,0.5,0.1,0.5/
C
C     ******************************************************************
C
C                       INITIALIZE LIBRARIES
C
C                       Initialize the surface package
      CALL SURFACE_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 SURFACE DATA FROM WHICH CONTOURS
C                       WILL BE INTERPOLATED AND PLOTTED
C
C     ------------------------------------------------------------------
C
C                       GENERATE X,Y, AND Z DATA
C
C                       Compute interval between X grid lines
      DX = (XMAX-XMIN)/(NX-1)
C                       Compute interval between Y grid lines
      DY = (YMAX-YMIN)/(NY-1)
C                       Initialize min and max Z coordinates
      ZMIN = 1E30
      ZMAX = -1E30
C                       Loop for each X grid line
      DO 65 I=1,NX
C                       Compute coordinate of X grid line
        X = XMIN + (I-1)*DX
C                       Loop for each Y grid line
        DO 60 J=1,NY
C                       Compute coordinate of Y grid line
          Y = YMIN + (J-1)*DY
C                       Compute Z coordinate at intersection of
C                       X and Y grid lines
          ZMAT(I,J) = FXY (X,Y)
C                       Update min and max Z coordinates
          ZMIN = AMIN1 (ZMIN,ZMAT(I,J))
          ZMAX = AMAX1 (ZMAX,ZMAT(I,J))
C                       Repeat for next Y grid line
   60   CONTINUE
C                       Repeat for next X grid line
   65 CONTINUE
C
C     ------------------------------------------------------------------
C
C                       COMPUTE AND STORE Z COORDINATES OF CONTOURS
C
C                       Store number of contour levels
      NL = 5
C                       Compute Z interval between contour levels
      D = (ZMAX-ZMIN)/(NL-1)
C                       Compute and store Z coordinate of each
C                       contour level
      DO 10 I=1,NL
        CL(I) = ZMIN + (I-1)*D
  10  CONTINUE
C
C     ******************************************************************
C
C                       INITIALIZE 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.20*XPAGE
      YRL = 0.07*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 3.35*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                       DEFINE PLOT HEADING AND LABELS
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 ('CONTR3D3 Demo: 3D Color Contour Plot$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw title centered below subplot area
      YY = -0.07*YPG
      CALL TEXT2D_PDRAW
     *     ('CONTR3D3 Demo: 3D Color Contour Plot$',100,XX,YY)
C
C     ------------------------------------------------------------------
C
C                       DEFINE PLOT HEADING
C
C                       Set current color to green
      CALL COLOR_SETNAM ('GREEN')
C                       Draw heading over plot in green
      CALL HEADING_DRAW ('Singularity Function$',100,1.2,3)
      CALL HEADING_DRAW ('with$',100,0.8,3)
      CALL HEADING_DRAW ('Hidden Surface Removal$',100,1.2,3)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set default character height
      CALL GRAPHICS_RESET ('TEXT2D_SETHT')
C                       Define X axis label
      CALL AXISLBL_DEFX3 ('X',1)
C                       Define Y axis label
      CALL AXISLBL_DEFY3 ('Y',1)
C                       Define Z axis label
      CALL AXISLBL_DEFZ3 ('Z',1)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
      CALL COLOR_SETNAM ('BLUE')
C                       Define 3-D coord system workbox volume
      CALL WORKBOX_DEFINE (10.0,10.0,10.0)
C                       Define 3-D viewpoint
      CALL VIEWPT_SETBS (45.0,45.0,9999.0)
C                       Set current color to white
      CALL COLOR_SETNAM ('FOREGROUND')
C                       Define 3-D coordinate system
      CALL PLOT3D_DEFINE (XMIN,0.0,XMAX, YMIN,0.0,YMAX, ZMIN,0.0,ZMAX)
C
C                       DRAW 3-D COLOR CONTOUR
C
C                       Enable hardware shading
      CALL DEVICE_FILLON
C                       Specify color contour plot
      CALL CONTR2D_SHADEON (0)
C                       Draw color contour plot
      CALL CONTR3D_DRAW (ZMAT,NX,NY,XMIN,XMAX,YMIN,YMAX,NL,CL)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
C                       End subplot
      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
      FUNCTION FXY (X,Y)
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: GET Z VALUES FROM X,Y DATA MATRIX
C
C     ARGUMENT LIST INPUT:
C
C     ARGUMENT LIST OUTPUT:
C
C     GLOBAL INPUT:
C
C     GLOBAL OUTPUT:
C
C     EXCEPTIONS:
C
C     LOCAL VARIABLES:
C
C     NOTES:  None
C
C     ******************************************************************
C
      INTRINSIC SIN
C
C     ******************************************************************
C
      R = 1.0/(X**2 + Y**2)
      FXY = R*SIN (R)
C
      RETURN
      END
STOP_CAT
echo "  Generating =====> [ ./contr3d4.f ]"
cat <<"STOP_CAT"> ././contr3d4.f
C     PROGRAM CONTR3D4
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 CONTR3D_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:
C       The surface is generated from the function
C         ZMAT(i,j) = F(Xi,Yj)
C           where
C         Xi = XMIN + (i-1)*(XMAX-XMIN)/(NX-1)
C         Yj = YMIN + (j-1)*(YMAX-YMIN)/(NY-1)
C         XMIN, YMIN = minimum values of X, Y
C         XMAX, YMAX = maximum values of X, Y
C         NX         = number of x values in the ZMAT array
C         NY         = number of y values in the ZMAT array
C
C     ******************************************************************
C
      DIMENSION CL(10)
      REAL ZMAT(31,31)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
      DATA NX /31/
      DATA NY /31/
      DATA XMIN,XMAX,YMIN,YMAX /0.0,1.0,0.0,1.0/
C
C     ******************************************************************
C
C                       INITIALIZE LIBRARIES
C
C                       Initialize the surface package
      CALL SURFACE_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 SURFACE DATA FROM WHICH CONTOURS
C                       WILL BE INTERPOLATED AND PLOTTED
C
C     ------------------------------------------------------------------
C
C                       GENERATE X,Y, AND Z DATA
C
C                       Compute interval between X grid lines
      DX = (XMAX-XMIN)/(NX-1)
C                       Compute interval between Y grid lines
      DY = (YMAX-YMIN)/(NY-1)
C                       Initialize min and max Z coordinates
      ZMIN = 1E30
      ZMAX = -1E30
C                       Loop for each X grid line
      DO 65 I=1,NX
C                       Compute coordinate of X grid line
        X = XMIN + (I-1)*DX
C                       Loop for each Y grid line
        DO 60 J=1,NY
C                       Compute coordinate of Y grid line
          Y = YMIN + (J-1)*DY
C                       Compute Z coordinate at intersection of
C                       X and Y grid lines
          ZMAT(I,J) = FXY (X,Y)
C                       Update min and max Z coordinates
          ZMIN=AMIN1(ZMIN,ZMAT(I,J))
          ZMAX=AMAX1(ZMAX,ZMAT(I,J))
C                       Repeat for next Y grid line
   60   CONTINUE
C                       Repeat for next X grid line
   65 CONTINUE
C
C     ------------------------------------------------------------------
C
C                       COMPUTE AND STORE Z COORDINATES OF CONTOURS
C
C                       Store number of contour levels
      NL = 6
C                       Compute Z interval between contour levels
      D = (ZMAX - ZMIN)/(NL -1)
C                       Compute and store Z coordinate of each
C                       contour level
      DO 10 I=1,NL
        CL(I) = ZMIN + (I-1)*D
  10  CONTINUE
C
C     ******************************************************************
C
C                       INITIALIZE 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.20*XPAGE
      YRL = 0.07*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 3.25*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                       DEFINE PLOT HEADING AND LABELS
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 ('CONTR3D4 Demo: 3D Color Contour Plot$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw title centered below subplot area
      YY = -0.07*YPG
      CALL TEXT2D_PDRAW
     *     ('CONTR3D4 Demo: 3D Color Contour Plot$',100,XX,YY)
C
C     ------------------------------------------------------------------
C
C                       DEFINE PLOT HEADING
C
C                       Set current color to green
      CALL COLOR_SETNAM ('GREEN')
C                       Draw heading over plot in green
      CALL HEADING_DRAW ('Humped Concave Surface Function$',100,1.2,3)
      CALL HEADING_DRAW ('with$',100,0.9,3)
      CALL HEADING_DRAW ('Hidden Surface Removal$',100,1.2,3)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set default character height
      CALL GRAPHICS_RESET ('TEXT2D_SETHT')
C                       Define X axis label
      CALL AXISLBL_DEFX3 ('X',1)
C                       Define Y axis label
      CALL AXISLBL_DEFY3 ('Y',1)
C                       Define Z axis label
      CALL AXISLBL_DEFZ3 ('Z',1)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Define 3-D coord system workbox volume
      CALL WORKBOX_DEFINE (10.0,10.0,10.0)
C                       Define 3-D viewpoint
      CALL VIEWPT_SETBS (45.0,45.0,9999.0)
C                       Set current color to white
      CALL COLOR_SETNAM ('FOREGROUND')
C                       Define 3-D coordinate system
      CALL PLOT3D_DEFINE (0.0, 0.5, 1.0, 0.0, 0.5, 1.0, ZMIN, 0.0, ZMAX)
C
C                        DRAW 3-D COLOR CONTOUR
C
C                        Specify location of contour legand box
      CALL CONTR2D_LEGLOC (-XPG*0.25,0.0)
C                       Enable hardware shading
      CALL DEVICE_FILLON
C                       Specify color contour plot
      CALL CONTR2D_SHADEON (0)
C                       Draw color contour plot
      CALL CONTR3D_DRAW (ZMAT,NX,NY,XMIN,XMAX,YMIN,YMAX,NL,CL)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
C                       End subplot
      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
      FUNCTION FXY (X,Y)
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: GET Z VALUES FROM X,Y DATA MATRIX
C
C     ARGUMENT LIST INPUT:
C
C     ARGUMENT LIST OUTPUT:
C
C     GLOBAL INPUT:
C
C     GLOBAL OUTPUT:
C
C     EXCEPTIONS:
C
C     LOCAL VARIABLES:
C
C     NOTES:  None
C
C     ******************************************************************
C
      FXY = (1.0 - X/2.0)**6*(1.0-Y/2.0)**6+1000.0*(1.0-X)**3*X**3*
     1      (1.0-Y)**3*Y**3+Y**6*(1.0-X/2.0)**6+X**6*(1.0-Y/2.0)**6
C
      RETURN
      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 =====> [ ./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 =====> [ ./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_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 =====> [ ./page2.f ]"
cat <<"STOP_CAT"> ././page2.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_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 =====> [ ./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 =====> [ ./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 =====> [ ./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 =====> [ ./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-SURFACE 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-SURFACE 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                       CONTR2D object access programs
      EXTERNAL CONTR2D_CLRCUST, CONTR2D_DRAW, CONTR2D_LABON
     *        , CONTR2D_LCUSTON, CONTR2D_LEGLOC, CONTR2D_LINCUST
     *        , CONTR2D_SHADEON
C
C                       CONTR3D object access programs
      EXTERNAL CONTR3D_DRAW
C
C                       DEVICE object access programs
      EXTERNAL DEVICE_END, DEVICE_SELECT
C
C                       ORIGIN object access programs
      EXTERNAL ORIGIN_SET
C
C                       PAGE object access programs
      EXTERNAL PAGE_END, PAGE_SIZE
C
C                       PLOT2D object access programs
      EXTERNAL PLOT2D_DEFINE
C
C                       PLOT3D object access programs
      EXTERNAL PLOT3D_DEFINE
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       SUBPLOT object access programs
      EXTERNAL SUBPLOT_DEFINE, SUBPLOT_END
C
C                       SURF3D object access programs
      EXTERNAL SURF3D_BLDMESH, SURF3D_DRAW, SURF3D_HIDOFF, SURF3D_POLYG
     *        , SURF3D_SETBND, SURF3D_SETMESH
C
C                       SURFACE object access programs
      EXTERNAL SURFACE_INIT
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)
C
C                       Integer variables and arrays
      INTEGER ICOLR, NX, NY, NL, LPOS, ILNSTY, ICFLG, KTYPQ, ISPARE, NSP
     *        , IXPTS, IYPTS, NP, NC, IX, IY, ISCOPE
C
C                       Real variables and arrays
      REAL XVOL, YVOL, ZVOL, ZMAT(MX101,MX102), XMIN, XMAX, YMIN, YMAX
     *        , CL(MX103), XPOS, YPOS, XPAGE, YPAGE, XOABS, YOABS, PAGEX
     *        , PAGEY, XLOW, XSTEP, XHIGH, YLOW, YSTEP, YHIGH, ZLOW
     *        , ZSTEP, ZHIGH, AX, AY, X(MX104), Y(MX105), Z(MX106)
     *        , XP(MX107), YP(MX108), ZP(MX109), PXMIN, PXMAX, PYMIN
     *        , PYMAX, WEI
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 VERAQ*8, 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 SURFACE_INIT object access program
C
C                       Initialize the PRL-SURFACE library
C     ISCOPE =
      CALL SURFACE_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                       Library
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  - Use PRL-PLOT to set world coordinate
C                       reference system properties
C
C     ------------------------------------------------------------------
C
C                       Use WORKBOX_DEFINE object access program
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  - Use PRL-PLOT to define world coord.
C                       reference 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                       STEP 9  - Invoke SURFACE library objects as
C                       needed
C
C     ------------------------------------------------------------------
C
C                       Use CONTR2D object access programs
C
C                       Define custom color map for color-shaded contour
C                       plot
C     ICOLR =
      CALL CONTR2D_CLRCUST (ICOLR)
C
C                       Draw a 2D contour line plot or color-shaded
C                       contour plot
C     ZMAT(1,1) =
C     NX =
C     NY =
C     XMIN =
C     XMAX =
C     YMIN =
C     YMAX =
C     NL =
C     CL(1) =
      CALL CONTR2D_DRAW (ZMAT,NX,NY,XMIN,XMAX,YMIN,YMAX,NL,CL)
C
C                       Enable contour line labeling for line contour
C                       plot
C     LPOS =
      CALL CONTR2D_LABON (LPOS)
C
C                       Enable custom line styles for line contour plot
      CALL CONTR2D_LCUSTON ()
C
C                       Define location of contour plot legend block
C     XPOS =
C     YPOS =
      CALL CONTR2D_LEGLOC (XPOS,YPOS)
C
C                       Define custom line styles for line contour plot
C     ILNSTY =
      CALL CONTR2D_LINCUST (ILNSTY)
C
C                       Enable drawing of color-shaded 2D or 3D contour
C                       plot
C     ICFLG =
      CALL CONTR2D_SHADEON (ICFLG)
C
C     ------------------------------------------------------------------
C
C                       Use CONTR3D object access programs
C
C                       Draw a 3D contour line plot or color-shaded
C                       contour plot
C     ZMAT(1,1) =
C     NX =
C     NY =
C     XMIN =
C     XMAX =
C     YMIN =
C     YMAX =
C     NL =
C     CL(1) =
      CALL CONTR3D_DRAW (ZMAT,NX,NY,XMIN,XMAX,YMIN,YMAX,NL,CL)
C
C     ------------------------------------------------------------------
C
C                       Use SURF3D object access programs
C
C                       Construct a 3D surface mesh from scattered
C                       points
C     X(1) =
C     Y(1) =
C     Z(1) =
C     NSP =
C     NX =
C     NY =
      CALL SURF3D_BLDMESH (X,Y,Z,NSP,ZMAT,NX,NY)
C
C                       Draw a 3D surface
C     ZMAT(1,1) =
C     IXPTS =
C     NX =
C     IYPTS =
C     NY =
C     ISPARE =
      CALL SURF3D_DRAW (ZMAT,IXPTS,NX,IYPTS,NY,ISPARE)
C
C                       Suppress hidden line removal on 3D surface plot
      CALL SURF3D_HIDOFF ()
C
C                       Draw a 3D polygon
C     XP(1) =
C     YP(1) =
C     ZP(1) =
C     NP =
C     NC =
      CALL SURF3D_POLYG (XP,YP,ZP,NP,NC)
C
C                       Set the perimeter boundary limits of a 3D
C                       surface mesh
C     PXMIN =
C     PXMAX =
C     PYMIN =
C     PYMAX =
      CALL SURF3D_SETBND (PXMIN,PXMAX,PYMIN,PYMAX)
C
C                       Set 3D surface mesh construction parameters
C     IX =
C     IY =
C     WEI =
      CALL SURF3D_SETMESH (IX,IY,WEI)
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 =====> [ ./surf3d1.f ]"
cat <<"STOP_CAT"> ././surf3d1.f
C     PROGRAM SURF3D1
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 SURF3D_BLDMESH and
C              SURF3D_SETMESH
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      REAL X(1500), Y(1500), Z(1500)
      REAL ZMAT(31,31)
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                       INITIALIZE LIBRARIES
C
C                       Initialize the surface package
      CALL SURFACE_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                       INITIALIZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT(KTYPE,XPAGE_SIZE,YPAGE_SIZE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Loop for mesh construction parameter values
      DO 100 IMESH=2,6,2
C
C                       Define page size in inches
      CALL PAGE_SIZE(XPAGE_SIZE,YPAGE_SIZE)
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_SIZE
      YRL = 0.10*YPAGE_SIZE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE_SIZE - 2.0*XRL
      YPG = YPAGE_SIZE - 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 PLOT TITLE
C
C                       Define 2D coordinate system
      CALL PLOT2D_DEFINE(0.0,0.1,1.0,0.0,0.1,1.0)
C                       Set current color to green
      CALL COLOR_SETNAM('GREEN')
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE_SIZE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT(SIZE)
C
C
C                       Determine length of text string in inches
      XX=TEXT2D_GETLEN('3-D Surfaces Plot$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)/XPG
C                       Draw title centered below subplot area
      CALL TEXT2D_WDRAW('3-D Surfaces Plot$',100,XX,0.95)
C
C                       Set current color to red
      CALL COLOR_SETNAM('RED')
C                       Compute text height based on page height
      SIZE = 0.20*YPAGE_SIZE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT(SIZE)
C                       Determine length of text string in inches
      XX=TEXT2D_GETLEN('With$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)/XPG
C                       Draw title centered below subplot area
      CALL TEXT2D_WDRAW('With$',100,XX,0.90)
C
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE_SIZE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT(SIZE)
C                       Set current color to yellow
      CALL COLOR_SETNAM('YELLOW')
C                       Determine length of text string in inches
      XX=TEXT2D_GETLEN('Hidden Line Removal$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)/XPG
C                       Draw title centered below subplot area
      CALL TEXT2D_WDRAW('Hidden Line Removal$',100,XX,0.82)
C
C
C                       Set current color to white
      CALL COLOR_SETNAM ('FORE')
C                       Set text style to cartog
      CALL FONT_CARTOG
C                       Compute text height based on page height
      SIZE = 0.30*YPAGE_SIZE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT(SIZE)
C                       Determine length of text string in inches
      XX=TEXT2D_GETLEN('SURF3D1 Demo: 3D Surface Mesh$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)/XPG
C                       Draw title centered below subplot area
      CALL TEXT2D_WDRAW('SURF3D1 Demo: 3D Surface Mesh',100,XX,-0.10)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END(0)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Reset text height to default
      CALL GRAPHICS_RESET('TEXT2D_SETHT')
C                       Set current color to blue
      CALL COLOR_SETNAM('BLUE')
C                       Define subplot area
      YPG = 0.80*YPG
      CALL SUBPLOT_DEFINE(XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Define workbox dimensions for a 3-D
C                       coordinate system
      CALL WORKBOX_DEFINE(10.0,10.0,10.0)
C                       Set viewpoint at 45 degrees
C                       azmuth and elevation and infinite distance
      CALL VIEWPT_SETBS(45.0,45.0,9999.0)
C                       Set X axis label for 3D plot
      CALL AXISLBL_DEFX3('X',1)
C                       Set Y axis label for 3D plot
      CALL AXISLBL_DEFY3('Y',1)
C                       Set Z axis label for 3D plot
      CALL AXISLBL_DEFZ3('Z',1)
C                       Set drawing color to 'foreground" (white)
      CALL COLOR_SETNAM('FOREGROUND')
C                       Define 3D coordinate system
      CALL PLOT3D_DEFINE(-10.0,5.0,10.0,-10.0,5.0,10.0,-0.15,1.15,1.0)
C
C                       Open data file for read-only
      IOPFLG = IPXCON ('O_RDONLY')
      CALL PXFOPN ('surf3d1.inp',0,IOPFLG,0,IOFIL,IERROR)
C
C                       Read scattered surface points from file
      NC = 0
      NP = 0
   50 CONTINUE
      READ(IOFIL,*,END=99) NN
      DO 30 I=1,NN
        READ(IOFIL,*) ZX, ZY, ZZ
        NP = NP + 1
        X(NP) = ZX
        Y(NP) = ZY
        Z(NP) = ZZ
   30 CONTINUE
      GO TO 50
   99 NC = 1
C                         Close file
      CALL PXFCLS (IOFIL,IERROR)
C
C                         Set 3D surface mesh construction parameters
      IX = IMESH
      IY = IMESH
      WEI = FLOAT(IMESH)
      CALL SURF3D_SETMESH(IX,IY,WEI)
C
C                         Build a 3D surface mesh from scattered points
      CALL SURF3D_BLDMESH(X,Y,Z,NP,ZMAT,31,31)
C
C                         Draw 3D surface
      IXPTS = 1
      IYPTS = 1
      CALL SURF3D_DRAW(ZMAT,IXPTS,31,IYPTS,31,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 =====> [ ./surf3d1.inp ]"
cat <<"STOP_CAT"> ././surf3d1.inp
           5
  -10.00000      -10.00000      2.4790170E-03
  -9.333333      -10.00000     -2.3698660E-04
  -9.333333      -9.333333     -6.4952527E-03
  -10.00000      -9.333333      8.0751773E-04
  -10.00000      -10.00000      2.4790170E-03
           5
  -10.00000      -7.333333     -1.9822745E-02
  -9.333333      -7.333333     -4.2404320E-02
  -9.333333      -6.666667     -5.2630764E-02
  -10.00000      -6.666667     -2.9862678E-02
  -10.00000      -7.333333     -1.9822745E-02
           5
  -10.00000      -4.666667     -5.1562004E-02
  -9.333333      -4.666667     -5.3819045E-02
  -9.333333      -4.000000     -4.8245046E-02
  -10.00000      -4.000000     -5.4712303E-02
  -10.00000      -4.666667     -5.1562004E-02
           5
  -10.00000      -2.000000     -6.2834986E-02
  -9.333333      -2.000000     -5.2507982E-02
  -9.333333      -1.333333     -6.4969175E-02
  -10.00000      -1.333333     -6.7205898E-02
  -10.00000      -2.000000     -6.2834986E-02
           5
  -10.00000      0.6666670     -7.6975286E-02
  -9.333333      0.6666670     -0.1051266
  -9.333333       1.333334     -0.1080075
  -10.00000       1.333334     -7.5812958E-02
  -10.00000      0.6666670     -7.6975286E-02
           5
  -10.00000       3.333334     -6.1885241E-02
  -9.333333       3.333334     -7.6258153E-02
  -9.333333       4.000000     -6.1018042E-02
  -10.00000       4.000000     -5.7676416E-02
  -10.00000       3.333334     -6.1885241E-02
           5
  -10.00000       6.000000     -5.4428909E-02
  -9.333333       6.000000     -3.6513526E-02
  -9.333333       6.666668     -3.6496606E-02
  -10.00000       6.666668     -5.5275783E-02
  -10.00000       6.000000     -5.4428909E-02
           5
  -10.00000       8.666668     -5.7034932E-02
  -9.333333       8.666668     -4.8047062E-02
  -9.333333       9.333334     -5.2548561E-02
  -10.00000       9.333334     -5.6238636E-02
  -10.00000       8.666668     -5.7034932E-02
           5
  -9.333333      -8.666667     -1.6650813E-02
  -8.666667      -8.666667     -3.5003752E-02
  -8.666667      -8.000000     -4.9574893E-02
  -9.333333      -8.000000     -2.9453168E-02
  -9.333333      -8.666667     -1.6650813E-02
           5
  -9.333333      -6.000000     -5.8002338E-02
  -8.666667      -6.000000     -4.5972127E-02
  -8.666667      -5.333333     -2.4830854E-02
  -9.333333      -5.333333     -5.7973213E-02
  -9.333333      -6.000000     -5.8002338E-02
           5
  -9.333333      -3.333333     -4.4535201E-02
  -8.666667      -3.333333      4.0559698E-02
  -8.666667      -2.666667      4.3132473E-02
  -9.333333      -2.666667     -4.5497157E-02
  -9.333333      -3.333333     -4.4535201E-02
           5
  -9.333333     -0.6666660     -8.0377951E-02
  -8.666667     -0.6666660     -2.8712058E-02
  -8.666667      0.0000000E+00 -6.3785002E-02
  -9.333333      0.0000000E+00 -9.5026135E-02
  -9.333333     -0.6666660     -8.0377951E-02
           5
  -9.333333       2.000000     -0.1029559
  -8.666667       2.000000     -0.1100132
  -8.666667       2.666667     -9.6650019E-02
  -9.333333       2.666667     -9.1385379E-02
  -9.333333       2.000000     -0.1029559
           5
  -9.333333       4.666667     -4.8502445E-02
  -8.666667       4.666667     -2.0244770E-02
  -8.666667       5.333334     -1.2909245E-03
  -9.333333       5.333334     -4.0267445E-02
  -9.333333       4.666667     -4.8502445E-02
           5
  -9.333333       7.333334     -3.9104365E-02
  -8.666667       7.333334      7.2704395E-03
  -8.666667       8.000000     -1.7421156E-03
  -9.333333       8.000000     -4.3265566E-02
  -9.333333       7.333334     -3.9104365E-02
           5
  -8.666667      -10.00000     -7.5403713E-03
  -8.000000      -10.00000     -1.8677963E-02
  -8.000000      -9.333333     -3.5481464E-02
  -8.666667      -9.333333     -1.9685514E-02
  -8.666667      -10.00000     -7.5403713E-03
           5
  -8.666667      -7.333333     -5.8506038E-02
  -8.000000      -7.333333     -5.3131606E-02
  -8.000000      -6.666667     -2.8009746E-02
  -8.666667      -6.666667     -5.7794694E-02
  -8.666667      -7.333333     -5.8506038E-02
           5
  -8.666667      -4.666667      9.2751870E-04
  -8.000000      -4.666667      0.1251850
  -8.000000      -4.000000      0.1730592
  -8.666667      -4.000000      2.4883825E-02
  -8.666667      -4.666667      9.2751870E-04
           5
  -8.666667      -2.000000      3.0761534E-02
  -8.000000      -2.000000      0.1894217
  -8.000000      -1.333333      0.1479147
  -8.666667      -1.333333      5.1620565E-03
  -8.666667      -2.000000      3.0761534E-02
           5
  -8.666667      0.6666670     -9.2543758E-02
  -8.000000      0.6666670     -2.2971395E-02
  -8.000000       1.333334     -6.0666990E-02
  -8.666667       1.333334     -0.1089406
  -8.666667      0.6666670     -9.2543758E-02
           5
  -8.666667       3.333334     -7.3141716E-02
  -8.000000       3.333334     -4.0288903E-02
  -8.000000       4.000000     -2.8703026E-03
  -8.666667       4.000000     -4.5650963E-02
  -8.666667       3.333334     -7.3141716E-02
           5
  -8.666667       6.000000      9.2514353E-03
  -8.000000       6.000000      8.5197605E-02
  -8.000000       6.666668      9.1177449E-02
  -8.666667       6.666668      1.1591948E-02
  -8.666667       6.000000      9.2514353E-03
           5
  -8.666667       8.666668     -1.3567576E-02
  -8.000000       8.666668      5.0292414E-02
  -8.000000       9.333334      2.6396682E-02
  -8.666667       9.333334     -2.6485531E-02
  -8.666667       8.666668     -1.3567576E-02
           5
  -8.000000      -8.666667     -5.1556122E-02
  -7.333333      -8.666667     -5.9365854E-02
  -7.333333      -8.000000     -5.2417655E-02
  -8.000000      -8.000000     -5.9725385E-02
  -8.000000      -8.666667     -5.1556122E-02
           5
  -8.000000      -6.000000      1.4603104E-02
  -7.333333      -6.000000      0.1186253
  -7.333333      -5.333333      0.2095651
  -8.000000      -5.333333      6.8804361E-02
  -8.000000      -6.000000      1.4603104E-02
           5
  -8.000000      -3.333333      0.2029790
  -7.333333      -3.333333      0.4062701
  -7.333333      -2.666667      0.4125831
  -8.000000      -2.666667      0.2088998
  -8.000000      -3.333333      0.2029790
           5
  -8.000000     -0.6666660      9.1773309E-02
  -7.333333     -0.6666660      0.2548956
  -7.333333      0.0000000E+00  0.1718523
  -8.000000      0.0000000E+00  3.1116851E-02
  -8.000000     -0.6666660      9.1773309E-02
           5
  -8.000000       2.000000     -7.5771950E-02
  -7.333333       2.000000      9.8528340E-04
  -7.333333       2.666667     -2.0719692E-04
  -8.000000       2.666667     -6.7427941E-02
  -8.000000       2.000000     -7.5771950E-02
           5
  -8.000000       4.666667      3.5253379E-02
  -7.333333       4.666667      0.1187136
  -7.333333       5.333334      0.1606100
  -8.000000       5.333334      6.6161327E-02
  -8.000000       4.666667      3.5253379E-02
           5
  -8.000000       7.333334      8.5513383E-02
  -7.333333       7.333334      0.1917103
  -7.333333       8.000000      0.1715185
  -8.000000       8.000000      7.0907936E-02
  -8.000000       7.333334      8.5513383E-02
           5
  -7.333333      -10.00000     -3.0818453E-02
  -6.666667      -10.00000     -4.0764693E-02
  -6.666667      -9.333333     -5.6290559E-02
  -7.333333      -9.333333     -4.8832767E-02
  -7.333333      -10.00000     -3.0818453E-02
           5
  -7.333333      -7.333333     -2.0471634E-02
  -6.666667      -7.333333      3.0421244E-02
  -6.666667      -6.666667      0.1231163
  -7.333333      -6.666667      3.8259141E-02
  -7.333333      -7.333333     -2.0471634E-02
           5
  -7.333333      -4.666667      0.2967265
  -6.666667      -4.666667      0.4687363
  -6.666667      -4.000000      0.5495998
  -7.333333      -4.000000      0.3658917
  -7.333333      -4.666667      0.2967265
           5
  -7.333333      -2.000000      0.3853504
  -6.666667      -2.000000      0.5636424
  -6.666667      -1.333333      0.5018349
  -7.333333      -1.333333      0.3298585
  -7.333333      -2.000000      0.3853504
           5
  -7.333333      0.6666670      9.3776628E-02
  -6.666667      0.6666670      0.2307026
  -6.666667       1.333334      0.1530516
  -7.333333       1.333334      3.3551753E-02
  -7.333333      0.6666670      9.3776628E-02
           5
  -7.333333       3.333334      2.6167843E-02
  -6.666667       3.333334      0.1175839
  -6.666667       4.000000      0.1661738
  -7.333333       4.000000      7.0062377E-02
  -7.333333       3.333334      2.6167843E-02
           5
  -7.333333       6.000000      0.1881324
  -6.666667       6.000000      0.3097403
  -6.666667       6.666668      0.3235539
  -7.333333       6.666668      0.1982497
  -7.333333       6.000000      0.1881324
           5
  -7.333333       8.666668      0.1414551
  -6.666667       8.666668      0.2521722
  -6.666667       9.333334      0.2037576
  -7.333333       9.333334      0.1052288
  -7.333333       8.666668      0.1414551
           5
  -6.666667      -8.666667     -5.6569234E-02
  -6.000000      -8.666667     -4.7937885E-02
  -6.000000      -8.000000     -3.9640083E-03
  -6.666667      -8.000000     -2.9924402E-02
  -6.666667      -8.666667     -5.6569234E-02
           5
  -6.666667      -6.000000      0.2382663
  -6.000000      -6.000000      0.3361939
  -6.000000      -5.333333      0.4752067
  -6.666667      -5.333333      0.3596424
  -6.666667      -6.000000      0.2382663
           5
  -6.666667      -3.333333      0.5927242
  -6.000000      -3.333333      0.7142309
  -6.000000      -2.666667      0.7153608
  -6.666667      -2.666667      0.5961519
  -6.666667      -3.333333      0.5927242
           5
  -6.666667     -0.6666660      0.4187366
  -6.000000     -0.6666660      0.5535771
  -6.000000      0.0000000E+00  0.4616007
  -6.666667      0.0000000E+00  0.3241643
  -6.666667     -0.6666660      0.4187366
           5
  -6.666667       2.000000      0.1047679
  -6.000000       2.000000      0.2150600
  -6.000000       2.666667      0.1948851
  -6.666667       2.666667      9.3515299E-02
  -6.666667       2.000000      0.1047679
           5
  -6.666667       4.666667      0.2235963
  -6.000000       4.666667      0.3369909
  -6.000000       5.333334      0.3971272
  -6.666667       5.333334      0.2748857
  -6.666667       4.666667      0.2235963
           5
  -6.666667       7.333334      0.3163797
  -6.000000       7.333334      0.4469764
  -6.000000       8.000000      0.4176072
  -6.666667       8.000000      0.2911789
  -6.666667       7.333334      0.3163797
           5
  -6.000000      -10.00000     -4.6708565E-02
  -5.333333      -10.00000     -4.8785720E-02
  -5.333333      -9.333333     -5.7686824E-02
  -6.000000      -9.333333     -5.8105391E-02
  -6.000000      -10.00000     -4.6708565E-02
           5
  -6.000000      -7.333333      7.9268418E-02
  -5.333333      -7.333333      0.1040829
  -5.333333      -6.666667      0.2334564
  -6.000000      -6.666667      0.1973570
  -6.000000      -7.333333      7.9268418E-02
           5
  -6.000000      -4.666667      0.5931365
  -5.333333      -4.666667      0.6392876
  -5.333333      -4.000000      0.7145447
  -6.000000      -4.000000      0.6746222
  -6.000000      -4.666667      0.5931365
           5
  -6.000000      -2.000000      0.6851743
  -5.333333      -2.000000      0.7412865
  -5.333333      -1.333333      0.7077430
  -6.000000      -1.333333      0.6298348
  -6.000000      -2.000000      0.6851743
           5
  -6.000000      0.6666670      0.3637858
  -5.333333      0.6666670      0.4835460
  -5.333333       1.333334      0.3900235
  -6.000000       1.333334      0.2756955
  -6.000000      0.6666670      0.3637858
           5
  -6.000000       3.333334      0.2170394
  -5.333333       3.333334      0.3086807
  -5.333333       4.000000      0.3677893
  -6.000000       4.000000      0.2706809
  -6.000000       3.333334      0.2170394
           5
  -6.000000       6.000000      0.4382403
  -5.333333       6.000000      0.5610155
  -5.333333       6.666668      0.5797036
  -6.000000       6.666668      0.4548565
  -6.000000       6.000000      0.4382403
           5
  -6.000000       8.666668      0.3710444
  -5.333333       8.666668      0.4858312
  -5.333333       9.333334      0.4183086
  -6.000000       9.333334      0.3119199
  -6.000000       8.666668      0.3710444
           5
  -5.333333      -8.666667     -4.2162143E-02
  -4.666667      -8.666667     -4.6800636E-02
  -4.666667      -8.000000      1.4449712E-03
  -5.333333      -8.000000      1.0169717E-02
  -5.333333      -8.666667     -4.2162143E-02
           5
  -5.333333      -6.000000      0.3813334
  -4.666667      -6.000000      0.3597373
  -4.666667      -5.333333      0.4949121
  -5.333333      -5.333333      0.5240574
  -5.333333      -6.000000      0.3813334
           5
  -5.333333      -3.333333      0.7505327
  -4.666667      -3.333333      0.7083385
  -4.666667      -2.666667      0.7312062
  -5.333333      -2.666667      0.7564704
  -5.333333      -3.333333      0.7505327
           5
  -5.333333     -0.6666660      0.6533865
  -4.666667     -0.6666660      0.7257397
  -4.666667      0.0000000E+00  0.6727859
  -5.333333      0.0000000E+00  0.5766741
  -5.333333     -0.6666660      0.6533865
           5
  -5.333333       2.000000      0.3185598
  -4.666667       2.000000      0.4123645
  -4.666667       2.666667      0.3710089
  -5.333333       2.666667      0.2890117
  -5.333333       2.000000      0.3185598
           5
  -5.333333       4.666667      0.4441158
  -4.666667       4.666667      0.5337392
  -4.666667       5.333334      0.6137928
  -5.333333       5.333334      0.5138631
  -5.333333       4.666667      0.4441158
           5
  -5.333333       7.333334      0.5708683
  -4.666667       7.333334      0.6777121
  -4.666667       8.000000      0.6423016
  -5.333333       8.000000      0.5381550
  -5.333333       7.333334      0.5708683
           5
  -4.666667      -10.00000     -4.8388042E-02
  -4.000000      -10.00000     -4.7019664E-02
  -4.000000      -9.333333     -6.4356059E-02
  -4.666667      -9.333333     -5.9111666E-02
  -4.666667      -10.00000     -4.8388042E-02
           5
  -4.666667      -7.333333      9.1264695E-02
  -4.000000      -7.333333      4.2762581E-02
  -4.000000      -6.666667      0.1521711
  -4.666667      -6.666667      0.2167553
  -4.666667      -7.333333      9.1264695E-02
           5
  -4.666667      -4.666667      0.6006641
  -4.000000      -4.666667      0.4934825
  -4.000000      -4.000000      0.5594617
  -4.666667      -4.000000      0.6693044
  -4.666667      -4.666667      0.6006641
           5
  -4.666667      -2.000000      0.7453630
  -4.000000      -2.000000      0.7165583
  -4.000000      -1.333333      0.7604544
  -4.666667      -1.333333      0.7471059
  -4.666667      -2.000000      0.7453630
           5
  -4.666667      0.6666670      0.5903414
  -4.000000      0.6666670      0.6834915
  -4.000000       1.333334      0.5898468
  -4.666667       1.333334      0.4945802
  -4.666667      0.6666670      0.5903414
           5
  -4.666667       3.333334      0.3850189
  -4.000000       3.333334      0.4476383
  -4.000000       4.000000      0.5084205
  -4.666667       4.000000      0.4475919
  -4.666667       3.333334      0.3850189
           5
  -4.666667       6.000000      0.6673122
  -4.000000       6.000000      0.7497656
  -4.000000       6.666668      0.7718357
  -4.666667       6.666668      0.6877457
  -4.666667       6.000000      0.6673122
           5
  -4.666667       8.666668      0.5859493
  -4.000000       8.666668      0.6638814
  -4.000000       9.333334      0.5867947
  -4.666667       9.333334      0.5125446
  -4.666667       8.666668      0.5859493
           5
  -4.000000      -8.666667     -6.3572623E-02
  -3.333333      -8.666667     -8.6435072E-02
  -3.333333      -8.000000     -7.3430151E-02
  -4.000000      -8.000000     -3.0530864E-02
  -4.000000      -8.666667     -6.3572623E-02
           5
  -4.000000      -6.000000      0.2796152
  -3.333333      -6.000000      0.1710540
  -3.333333      -5.333333      0.2716866
  -4.000000      -5.333333      0.3996910
  -4.000000      -6.000000      0.2796152
           5
  -4.000000      -3.333333      0.6110891
  -3.333333      -3.333333      0.4911940
  -3.333333      -2.666667      0.5773993
  -4.000000      -2.666667      0.6627379
  -4.000000      -3.333333      0.6110891
           5
  -4.000000     -0.6666660      0.7762890
  -3.333333     -0.6666660      0.8053670
  -3.333333      0.0000000E+00  0.8064840
  -4.000000      0.0000000E+00  0.7507980
  -4.000000     -0.6666660      0.7762890
           5
  -4.000000       2.000000      0.4989389
  -3.333333       2.000000      0.5801805
  -3.333333       2.666667      0.5131350
  -4.000000       2.666667      0.4440497
  -4.000000       2.000000      0.4989389
           5
  -4.000000       4.666667      0.6009281
  -3.333333       4.666667      0.6454501
  -3.333333       5.333334      0.7395221
  -4.000000       5.333334      0.6900373
  -4.000000       4.666667      0.6009281
           5
  -4.000000       7.333334      0.7605122
  -3.333333       7.333334      0.8152321
  -3.333333       8.000000      0.7758874
  -4.000000       8.000000      0.7228817
  -4.000000       7.333334      0.7605122
           5
  -3.333333      -10.00000     -4.5554139E-02
  -2.666667      -10.00000     -4.4308148E-02
  -2.666667      -9.333333     -7.7751547E-02
  -3.333333      -9.333333     -7.1910091E-02
  -3.333333      -10.00000     -4.5554139E-02
           5
  -3.333333      -7.333333     -2.2205314E-02
  -2.666667      -7.333333     -7.3158011E-02
  -2.666667      -6.666667     -5.6568179E-03
  -3.333333      -6.666667      6.5096319E-02
  -3.333333      -7.333333     -2.2205314E-02
           5
  -3.333333      -4.666667      0.3528815
  -2.666667      -4.666667      0.2269097
  -2.666667      -4.000000      0.2965010
  -3.333333      -4.000000      0.4201810
  -3.333333      -4.666667      0.3528815
           5
  -3.333333      -2.000000      0.6725096
  -2.666667      -2.000000      0.6337789
  -2.666667      -1.333333      0.7455950
  -3.333333      -1.333333      0.7559977
  -3.333333      -2.000000      0.6725096
           5
  -3.333333      0.6666670      0.7581747
  -2.666667      0.6666670      0.8122469
  -2.666667       1.333334      0.7436011
  -3.333333       1.333334      0.6736673
  -3.333333      0.6666670      0.7581747
           5
  -3.333333       3.333334      0.5020143
  -2.666667       3.333334      0.5503945
  -2.666667       4.000000      0.5847093
  -3.333333       4.000000      0.5535152
  -3.333333       3.333334      0.5020143
           5
  -3.333333       6.000000      0.8040377
  -2.666667       6.000000      0.8271361
  -2.666667       6.666668      0.8521607
  -3.333333       6.666668      0.8276173
  -3.333333       6.000000      0.8040377
           5
  -3.333333       8.666668      0.7152629
  -2.666667       8.666668      0.7379701
  -2.666667       9.333334      0.6580996
  -3.333333       9.333334      0.6361541
  -3.333333       8.666668      0.7152629
           5
  -2.666667      -8.666667     -0.1040490
  -2.000000      -8.666667     -0.1059877
  -2.000000      -8.000000     -0.1106729
  -2.666667      -8.000000     -0.1065146
  -2.666667      -8.666667     -0.1040490
           5
  -2.666667      -6.000000      7.8752711E-02
  -2.000000      -6.000000      4.6257496E-02
  -2.000000      -5.333333      0.1085848
  -2.666667      -5.333333      0.1587302
  -2.666667      -6.000000      7.8752711E-02
           5
  -2.666667      -3.333333      0.3874243
  -2.000000      -3.333333      0.3402362
  -2.000000      -2.666667      0.4800085
  -2.666667      -2.666667      0.5052673
  -2.666667      -3.333333      0.3874243
           5
  -2.666667     -0.6666660      0.8179596
  -2.000000     -0.6666660      0.8319482
  -2.000000      0.0000000E+00  0.8644438
  -2.666667      0.0000000E+00  0.8401459
  -2.666667     -0.6666660      0.8179596
           5
  -2.666667       2.000000      0.6550490
  -2.000000       2.000000      0.7191037
  -2.000000       2.666667      0.6361049
  -2.666667       2.666667      0.5792544
  -2.666667       2.000000      0.6550490
           5
  -2.666667       4.666667      0.6673333
  -2.000000       4.666667      0.6633164
  -2.000000       5.333334      0.7493605
  -2.666667       5.333334      0.7602978
  -2.666667       4.666667      0.6673333
           5
  -2.666667       7.333334      0.8394859
  -2.000000       7.333334      0.8313043
  -2.000000       8.000000      0.7916828
  -2.666667       8.000000      0.7992827
  -2.666667       7.333334      0.8394859
           5
  -2.000000      -10.00000     -4.3635070E-02
  -1.333333      -10.00000     -4.4212922E-02
  -1.333333      -9.333333     -7.2520480E-02
  -2.000000      -9.333333     -7.8196533E-02
  -2.000000      -10.00000     -4.3635070E-02
           5
  -2.000000      -7.333333     -8.1733756E-02
  -1.333333      -7.333333     -3.6493346E-02
  -1.333333      -6.666667      2.9001672E-02
  -2.000000      -6.666667     -2.3260687E-02
  -2.000000      -7.333333     -8.1733756E-02
           5
  -2.000000      -4.666667      0.1642890
  -1.333333      -4.666667      0.1949384
  -1.333333      -4.000000      0.2639360
  -2.000000      -4.000000      0.2344771
  -2.000000      -4.666667      0.1642890
           5
  -2.000000      -2.000000      0.6278149
  -1.333333      -2.000000      0.6789268
  -1.333333      -1.333333      0.7982120
  -2.000000      -1.333333      0.7516745
  -2.000000      -2.000000      0.6278149
           5
  -2.000000      0.6666670      0.8521367
  -1.333333      0.6666670      0.8875095
  -1.333333       1.333334      0.8419765
  -2.000000       1.333334      0.7998176
  -2.000000      0.6666670      0.8521367
           5
  -2.000000       3.333334      0.5870163
  -1.333333       3.333334      0.5987680
  -1.333333       4.000000      0.5828418
  -2.000000       4.000000      0.5977128
  -2.000000       3.333334      0.5870163
           5
  -2.000000       6.000000      0.8160944
  -1.333333       6.000000      0.7685800
  -1.333333       6.666668      0.7976532
  -2.000000       6.666668      0.8428516
  -2.000000       6.000000      0.8160944
           5
  -2.000000       8.666668      0.7309134
  -1.333333       8.666668      0.6933490
  -1.333333       9.333334      0.6163238
  -2.000000       9.333334      0.6515682
  -2.000000       8.666668      0.7309134
           5
  -1.333333      -8.666667     -8.8969961E-02
 -0.6666660      -8.666667     -5.8523860E-02
 -0.6666660      -8.000000     -2.0602925E-02
  -1.333333      -8.000000     -7.8998469E-02
  -1.333333      -8.666667     -8.8969961E-02
           5
  -1.333333      -6.000000      9.5880449E-02
 -0.6666660      -6.000000      0.2158593
 -0.6666660      -5.333333      0.2692296
  -1.333333      -5.333333      0.1484285
  -1.333333      -6.000000      9.5880449E-02
           5
  -1.333333      -3.333333      0.3773412
 -0.6666660      -3.333333      0.4942641
 -0.6666660      -2.666667      0.6432663
  -1.333333      -2.666667      0.5270469
  -1.333333      -3.333333      0.3773412
           5
  -1.333333     -0.6666660      0.8698272
 -0.6666660     -0.6666660      0.9373547
 -0.6666660      0.0000000E+00  0.9433343
  -1.333333      0.0000000E+00  0.8972475
  -1.333333     -0.6666660      0.8698272
           5
  -1.333333       2.000000      0.7633845
 -0.6666660       2.000000      0.7747099
 -0.6666660       2.666667      0.6660336
  -1.333333       2.666667      0.6702497
  -1.333333       2.000000      0.7633845
           5
  -1.333333       4.666667      0.6275741
 -0.6666660       4.666667      0.5570043
 -0.6666660       7.333334      0.7120893
  -1.333333       7.333334      0.7889410
  -1.333333       6.666668      0.7976532
           5
  -1.333333       9.333334      0.6163238
 -0.6666660       9.333334      0.5531040
 -0.6666660       10.00000      0.4654360
  -1.333333       10.00000      0.5232383
  -1.333333       9.333334      0.6163238
           5
 -0.6666660      -8.000000     -2.0602925E-02
  0.0000000E+00  -8.000000      4.5407746E-02
  0.0000000E+00  -7.333333      0.1511330
 -0.6666660      -7.333333      5.0536599E-02
 -0.6666660      -8.000000     -2.0602925E-02
           5
 -0.6666660      -5.333333      0.2692296
  0.0000000E+00  -5.333333      0.4287394
  0.0000000E+00  -4.666667      0.4736589
 -0.6666660      -4.666667      0.3123740
 -0.6666660      -5.333333      0.2692296
           5
 -0.6666660      -2.666667      0.6432663
  0.0000000E+00  -2.666667      0.7879574
  0.0000000E+00  -2.000000      0.9152195
 -0.6666660      -2.000000      0.7868929
 -0.6666660      -2.666667      0.6432663
           5
 -0.6666660      0.0000000E+00  0.9433343
  0.0000000E+00  0.0000000E+00  0.9839402
  0.0000000E+00  0.6666670      0.9293389
 -0.6666660      0.6666670      0.9183500
 -0.6666660      0.0000000E+00  0.9433343
           5
 -0.6666660       2.666667      0.6660336
  0.0000000E+00   2.666667      0.6148303
  0.0000000E+00   3.333334      0.5032014
 -0.6666660       3.333334      0.5721208
 -0.6666660       2.666667      0.6660336
           5
 -0.6666660       5.333334      0.6224691
  0.0000000E+00   5.333334      0.5142118
  0.0000000E+00   6.000000      0.5737108
 -0.6666660       6.000000      0.6854777
 -0.6666660       5.333334      0.6224691
           5
 -0.6666660       8.000000      0.6792213
  0.0000000E+00   8.000000      0.5761945
  0.0000000E+00   8.666668      0.5288393
 -0.6666660       8.666668      0.6252699
 -0.6666660       8.000000      0.6792213
           5
  0.0000000E+00  -9.333333     -5.3610966E-02
  0.6666670      -9.333333     -4.6135455E-02
  0.6666670      -8.666667      2.8721406E-03
  0.0000000E+00  -8.666667     -2.4904557E-02
  0.0000000E+00  -9.333333     -5.3610966E-02
           5
  0.0000000E+00  -6.666667      0.2683386
  0.6666670      -6.666667      0.3814025
  0.6666670      -6.000000      0.4999226
  0.0000000E+00  -6.000000      0.3659846
  0.0000000E+00  -6.666667      0.2683386
           5
  0.0000000E+00  -4.000000      0.5387596
  0.6666670      -4.000000      0.6817094
  0.6666670      -3.333333      0.7786367
  0.0000000E+00  -3.333333      0.6482777
  0.0000000E+00  -4.000000      0.5387596
           5
  0.0000000E+00  -1.333333      0.9924312
  0.6666670      -1.333333       1.058501
  0.6666670     -0.6666660       1.046716
  0.0000000E+00 -0.6666660       1.010435
  0.0000000E+00  -1.333333      0.9924312
           5
  0.0000000E+00   1.333334      0.8496675
  0.6666670       1.333334      0.7919118
  0.6666670       2.000000      0.6628948
  0.0000000E+00   2.000000      0.7414308
  0.0000000E+00   1.333334      0.8496675
           5
  0.0000000E+00   4.000000      0.4459105
  0.6666670       4.000000      0.3411390
  0.6666670       4.666667      0.3458454
  0.0000000E+00   4.666667      0.4574509
  0.0000000E+00   4.000000      0.4459105
           5
  0.0000000E+00   6.666668      0.6056268
  0.6666670       6.666668      0.4748795
  0.6666670       7.333334      0.4732495
  0.0000000E+00   7.333334      0.6039910
  0.0000000E+00   6.666668      0.6056268
           5
  0.0000000E+00   9.333334      0.4645795
  0.6666670       9.333334      0.3565875
  0.6666670       10.00000      0.2909042
  0.0000000E+00   10.00000      0.3859964
  0.0000000E+00   9.333334      0.4645795
           5
  0.6666670      -8.000000      0.1007586
   1.333334      -8.000000      0.1349696
   1.333334      -7.333333      0.2900258
  0.6666670      -7.333333      0.2366661
  0.6666670      -8.000000      0.1007586
           5
  0.6666670      -5.333333      0.5747527
   1.333334      -5.333333      0.6714652
   1.333334      -4.666667      0.7186505
  0.6666670      -4.666667      0.6224153
  0.6666670      -5.333333      0.5747527
           5
  0.6666670      -2.666667      0.9008458
   1.333334      -2.666667      0.9364843
   1.333334      -2.000000       1.017116
  0.6666670      -2.000000       1.006738
  0.6666670      -2.666667      0.9008458
           5
  0.6666670      0.0000000E+00  0.9873053
   1.333334      0.0000000E+00  0.9311072
   1.333334      0.6666670      0.8209072
  0.6666670      0.6666670      0.8999352
  0.6666670      0.0000000E+00  0.9873053
           5
  0.6666670       2.666667      0.5234271
   1.333334       2.666667      0.4145249
   1.333334       3.333334      0.3014145
  0.6666670       3.333334      0.4042994
  0.6666670       2.666667      0.5234271
           5
  0.6666670       5.333334      0.3947032
   1.333334       5.333334      0.2851723
   1.333334       6.000000      0.3242884
  0.6666670       6.000000      0.4470988
  0.6666670       5.333334      0.3947032
           5
  0.6666670       8.000000      0.4496432
   1.333334       8.000000      0.3118963
   1.333334       8.666668      0.2798609
  0.6666670       8.666668      0.4101117
  0.6666670       8.000000      0.4496432
           5
   1.333334      -9.333333     -4.1655462E-02
   2.000000      -9.333333     -4.0667720E-02
   2.000000      -8.666667      2.4710190E-02
   1.333334      -8.666667      1.9945003E-02
   1.333334      -9.333333     -4.1655462E-02
           5
   1.333334      -6.666667      0.4532995
   2.000000      -6.666667      0.4773751
   2.000000      -6.000000      0.6193652
   1.333334      -6.000000      0.5873008
   1.333334      -6.666667      0.4532995
           5
   1.333334      -4.000000      0.7656578
   2.000000      -4.000000      0.7798828
   2.000000      -3.333333      0.8241991
   1.333334      -3.333333      0.8405524
   1.333334      -4.000000      0.7656578
           5
   1.333334      -1.333333       1.046355
   2.000000      -1.333333      0.9476742
   2.000000     -0.6666660      0.9041323
   1.333334     -0.6666660       1.013063
   1.333334      -1.333333       1.046355
           5
   1.333334       1.333334      0.6938428
   2.000000       1.333334      0.5741420
   2.000000       2.000000      0.4419946
   1.333334       2.000000      0.5543443
   1.333334       1.333334      0.6938428
           5
   1.333334       4.000000      0.2433232
   2.000000       4.000000      0.1789755
   2.000000       4.666667      0.1810504
   1.333334       4.666667      0.2460817
   1.333334       4.000000      0.2433232
           5
   1.333334       6.666668      0.3409769
   2.000000       6.666668      0.2225369
   2.000000       7.333334      0.2042093
   1.333334       7.333334      0.3340706
   1.333334       6.666668      0.3409769
           5
   1.333334       9.333334      0.2387253
   2.000000       9.333334      0.1235118
   2.000000       10.00000      9.0664409E-02
   1.333334       10.00000      0.1889026
   1.333334       9.333334      0.2387253
           5
   2.000000      -8.000000      0.1450179
   2.666667      -8.000000      0.1318924
   2.666667      -7.333333      0.2881165
   2.000000      -7.333333      0.3065154
   2.000000      -8.000000      0.1450179
           5
   2.000000      -5.333333      0.7084106
   2.666667      -5.333333      0.6901379
   2.666667      -4.666667      0.7272393
   2.000000      -4.666667      0.7512081
   2.000000      -5.333333      0.7084106
           5
   2.000000      -2.666667      0.8855928
   2.666667      -2.666667      0.7684410
   2.666667      -2.000000      0.7887656
   2.000000      -2.000000      0.9372264
   2.000000      -2.666667      0.8855928
           5
   2.000000      0.0000000E+00  0.8160464
   2.666667      0.0000000E+00  0.6626654
   2.666667      0.6666670      0.5645475
   2.000000      0.6666670      0.7015913
   2.000000      0.0000000E+00  0.8160464
           5
   2.000000       2.666667      0.3181049
   2.666667       2.666667      0.2601429
   2.666667       3.333334      0.1949182
   2.000000       3.333334      0.2241620
   2.000000       2.666667      0.3181049
           5
   2.000000       5.333334      0.2059952
   2.666667       5.333334      0.1709391
   2.666667       6.000000      0.1626344
   2.000000       6.000000      0.2244907
   2.000000       5.333334      0.2059952
           5
   2.000000       8.000000      0.1792700
   2.666667       8.000000      6.8512045E-02
   2.666667       8.666668      4.3396942E-02
   2.000000       8.666668      0.1525573
   2.000000       8.000000      0.1792700
           5
   2.666667      -9.333333     -4.3435909E-02
   3.333334      -9.333333     -4.9033944E-02
   3.333334      -8.666667     -2.5981717E-06
   2.666667      -8.666667      1.7339032E-02
   2.666667      -9.333333     -4.3435909E-02
           5
   2.666667      -6.666667      0.4564331
   3.333334      -6.666667      0.3960465
   3.333334      -6.000000      0.5336280
   2.666667      -6.000000      0.5995477
   2.666667      -6.666667      0.4564331
           5
   2.666667      -4.000000      0.7358834
   3.333334      -4.000000      0.6483495
   3.333334      -3.333333      0.6283112
   2.666667      -3.333333      0.7460610
   2.666667      -4.000000      0.7358834
           5
   2.666667      -1.333333      0.7836152
   3.333334      -1.333333      0.5889212
   3.333334     -0.6666660      0.5541652
   2.666667     -0.6666660      0.7401613
   2.666667      -1.333333      0.7836152
           5
   2.666667       1.333334      0.4581265
   3.333334       1.333334      0.3697788
   3.333334       2.000000      0.3068425
   2.666667       2.000000      0.3528016
   2.666667       1.333334      0.4581265
           5
   2.666667       4.000000      0.1659244
   3.333334       4.000000      0.2084788
   3.333334       4.666667      0.2012616
   2.666667       4.666667      0.1653111
   2.666667       4.000000      0.1659244
           5
   2.666667       6.666668      0.1360794
   3.333334       6.666668      9.1642030E-02
   3.333334       7.333334      3.6349773E-02
   2.666667       7.333334      0.1009303
   2.666667       6.666668      0.1360794
           5
   2.666667       9.333334      2.3981448E-02
   3.333334       9.333334     -4.9575415E-02
   3.333334       10.00000     -5.4519404E-02
   2.666667       10.00000      6.8340134E-03
   2.666667       9.333334      2.3981448E-02
           5
   3.333334      -8.000000      9.9208489E-02
   4.000000      -8.000000      5.4025069E-02
   4.000000      -7.333333      0.1696958
   3.333334      -7.333333      0.2397100
   3.333334      -8.000000      9.9208489E-02
           5
   3.333334      -5.333333      0.6231178
   4.000000      -5.333333      0.5132491
   4.000000      -4.666667      0.5433554
   3.333334      -4.666667      0.6559061
   3.333334      -5.333333      0.6231178
           5
   3.333334      -2.666667      0.6143198
   4.000000      -2.666667      0.4480826
   4.000000      -2.000000      0.4193678
   3.333334      -2.000000      0.6054989
   3.333334      -2.666667      0.6143198
           5
   3.333334      0.0000000E+00  0.5010646
   4.000000      0.0000000E+00  0.3628795
   4.000000      0.6666670      0.3441799
   3.333334      0.6666670      0.4368573
   3.333334      0.0000000E+00  0.5010646
           5
   3.333334       2.666667      0.2555150
   4.000000       2.666667      0.3058532
   4.000000       3.333334      0.3022348
   3.333334       3.333334      0.2227185
   3.333334       2.666667      0.2555150
           5
   3.333334       5.333334      0.1836468
   4.000000       5.333334      0.2371012
   4.000000       6.000000      0.1701573
   3.333334       6.000000      0.1455168
   3.333334       5.333334      0.1836468
           5
   3.333334       8.000000     -7.6858848E-03
   4.000000       8.000000     -4.4312406E-02
   4.000000       8.666668     -7.9243474E-02
   3.333334       8.666668     -3.5656925E-02
   3.333334       8.000000     -7.6858848E-03
           5
   4.000000      -9.333333     -5.4769628E-02
   4.666667      -9.333333     -5.7068534E-02
   4.666667      -8.666667     -4.2849272E-02
   4.000000      -8.666667     -2.2383358E-02
   4.000000      -9.333333     -5.4769628E-02
           5
   4.000000      -6.666667      0.3046705
   4.666667      -6.666667      0.1963945
   4.666667      -6.000000      0.2985868
   4.000000      -6.000000      0.4288880
   4.000000      -6.666667      0.3046705
           5
   4.000000      -4.000000      0.5269351
   4.666667      -4.000000      0.3807709
   4.666667      -3.333333      0.3360256
   4.000000      -3.333333      0.4874537
   4.000000      -4.000000      0.5269351
           5
   4.000000      -1.333333      0.3992322
   4.666667      -1.333333      0.2442627
   4.666667     -0.6666660      0.2521735
   4.000000     -0.6666660      0.3814653
   4.000000      -1.333333      0.3992322
           5
   4.000000       1.333334      0.3273321
   4.666667       1.333334      0.3390889
   4.666667       2.000000      0.3722446
   4.000000       2.000000      0.3140670
   4.000000       1.333334      0.3273321
           5
   4.000000       4.000000      0.2972761
   4.666667       4.000000      0.4125405
   4.666667       4.666667      0.3805865
   4.000000       4.666667      0.2791986
   4.000000       4.000000      0.2972761
           5
   4.000000       6.666668      9.0030067E-02
   4.666667       6.666668      0.1227736
   4.666667       7.333334      2.7933232E-02
   4.000000       7.333334      1.3988839E-02
   4.000000       6.666668      9.0030067E-02
           5
   4.000000       9.333334     -9.2439823E-02
   4.666667       9.333334     -0.1066178
   4.666667       10.00000     -0.1018577
   4.000000       10.00000     -9.0043440E-02
   4.000000       9.333334     -9.2439823E-02
           5
   4.666667      -8.000000      6.7610294E-03
   5.333334      -8.000000     -3.1365328E-02
   5.333334      -7.333333      1.9768167E-02
   4.666667      -7.333333      9.1120459E-02
   4.666667      -8.000000      6.7610294E-03
           5
   4.666667      -5.333333      0.3716057
   5.333334      -5.333333      0.2185417
   5.333334      -4.666667      0.2397225
   4.666667      -4.666667      0.3986287
   4.666667      -5.333333      0.3716057
           5
   4.666667      -2.666667      0.2883994
   5.333334      -2.666667      0.1498877
   5.333334      -2.000000      0.1310377
   4.666667      -2.000000      0.2556626
   4.666667      -2.666667      0.2883994
           5
   4.666667      0.0000000E+00  0.2741691
   5.333334      0.0000000E+00  0.2464501
   5.333334      0.6666670      0.3220659
   4.666667      0.6666670      0.3048288
   4.666667      0.0000000E+00  0.2741691
           5
   4.666667       2.666667      0.3997517
   5.333334       2.666667      0.5149183
   5.333334       3.333334      0.5386695
   4.666667       3.333334      0.4159243
   4.666667       2.666667      0.3997517
           5
   4.666667       5.333334      0.3160041
   5.333334       5.333334      0.4011914
   5.333334       6.000000      0.2928426
   4.666667       6.000000      0.2249063
   4.666667       5.333334      0.3160041
           5
   4.666667       8.000000     -4.5296784E-02
   5.333334       8.000000     -2.1909874E-02
   5.333334       8.666668     -7.7061363E-02
   4.666667       8.666668     -8.9952074E-02
   4.666667       8.000000     -4.5296784E-02
           5
   5.333334      -9.333333     -5.3283714E-02
   6.000000      -9.333333     -4.3175042E-02
   6.000000      -8.666667     -5.5067148E-02
   5.333334      -8.666667     -5.4871514E-02
   5.333334      -9.333333     -5.3283714E-02
           5
   5.333334      -6.666667      9.0500645E-02
   6.000000      -6.666667      6.4450307E-03
   6.000000      -6.000000      4.8205286E-02
   5.333334      -6.000000      0.1636558
   5.333334      -6.666667      9.0500645E-02
           5
   5.333334      -4.000000      0.2251276
   6.000000      -4.000000      8.1981294E-02
   6.000000      -3.333333      5.9575204E-02
   5.333334      -3.333333      0.1879075
   5.333334      -4.000000      0.2251276
           5
   5.333334      -1.333333      0.1419905
   6.000000      -1.333333      9.4061308E-02
   6.000000     -0.6666660      0.1703133
   5.333334     -0.6666660      0.1828708
   5.333334      -1.333333      0.1419905
           5
   5.333334       1.333334      0.3984964
   6.000000       1.333334      0.4832449
   6.000000       2.000000      0.5677109
   5.333334       2.000000      0.4656338
   5.333334       1.333334      0.3984964
           5
   5.333334       4.000000      0.5297464
   6.000000       4.000000      0.6262443
   6.000000       4.666667      0.5680034
   5.333334       4.666667      0.4834394
   5.333334       4.000000      0.5297464
           5
   5.333334       6.666668      0.1747450
   6.000000       6.666668      0.2283834
   6.000000       7.333334      0.1082428
   5.333334       7.333334      6.4882562E-02
   5.333334       6.666668      0.1747450
           5
   5.333334       9.333334     -9.9761754E-02
   6.000000       9.333334     -8.2287610E-02
   6.000000       10.00000     -8.2445592E-02
   5.333334       10.00000     -9.6497506E-02
   5.333334       9.333334     -9.9761754E-02
           5
   6.000000      -8.000000     -5.2261852E-02
   6.666668      -8.000000     -5.4066721E-02
   6.666668      -7.333333     -5.3368162E-02
   6.000000      -7.333333     -3.0611124E-02
   6.000000      -8.000000     -5.2261852E-02
           5
   6.000000      -5.333333      8.0556028E-02
   6.666668      -5.333333     -1.8858941E-02
   6.666668      -4.666667     -1.8373623E-02
   6.000000      -4.666667      9.2380412E-02
   6.000000      -5.333333      8.0556028E-02
           5
   6.000000      -2.666667      4.3419339E-02
   6.666668      -2.666667     -2.5501467E-02
   6.666668      -2.000000      1.2478603E-02
   6.000000      -2.000000      5.1527176E-02
   6.000000      -2.666667      4.3419339E-02
           5
   6.000000      0.0000000E+00  0.2704721
   6.666668      0.0000000E+00  0.3193397
   6.666668      0.6666670      0.4479344
   6.000000      0.6666670      0.3798639
   6.000000      0.0000000E+00  0.2704721
           5
   6.000000       2.666667      0.6237041
   6.666668       2.666667      0.7012395
   6.666668       3.333334      0.7139234
   6.000000       3.333334      0.6445867
   6.000000       2.666667      0.6237041
           5
   6.000000       5.333334      0.4744289
   6.666668       5.333334      0.5219031
   6.666668       6.000000      0.3998287
   6.000000       6.000000      0.3561261
   6.000000       5.333334      0.4744289
           5
   6.000000       8.000000      1.1024140E-02
   6.666668       8.000000      3.9618563E-02
   6.666668       8.666668     -3.0239789E-02
   6.000000       8.666668     -5.3191192E-02
   6.000000       8.000000      1.1024140E-02
           5
   6.666668      -9.333333     -2.9157743E-02
   7.333334      -9.333333     -1.5144442E-02
   7.333334      -8.666667     -2.8539823E-02
   6.666668      -8.666667     -4.4621162E-02
   6.666668      -9.333333     -2.9157743E-02
           5
   6.666668      -6.666667     -4.3146458E-02
   7.333334      -6.666667     -5.7357069E-02
   7.333334      -6.000000     -6.2111475E-02
   6.666668      -6.000000     -2.9003944E-02
   6.666668      -6.666667     -4.3146458E-02
           5
   6.666668      -4.000000     -2.6506102E-02
   7.333334      -4.000000     -8.7492034E-02
   7.333334      -3.333333     -8.4951259E-02
   6.666668      -3.333333     -3.3846900E-02
   6.666668      -4.000000     -2.6506102E-02
           5
   6.666668      -1.333333      8.6649619E-02
   7.333334      -1.333333      9.7572200E-02
   7.333334     -0.6666660      0.2223413
   6.666668     -0.6666660      0.1931815
   6.666668      -1.333333      8.6649619E-02
           5
   6.666668       1.333334      0.5622380
   7.333334       1.333334      0.6075750
   7.333334       2.000000      0.6887190
   6.666668       2.000000      0.6493555
   6.666668       1.333334      0.5622380
           5
   6.666668       4.000000      0.6864405
   7.333334       4.000000      0.7035182
   7.333334       4.666667      0.6348014
   6.666668       4.666667      0.6206402
   6.666668       4.000000      0.6864405
           5
   6.666668       6.666668      0.2680491
   7.333334       6.666668      0.2832492
   7.333334       7.333334      0.1580556
   6.666668       7.333334      0.1427442
   6.666668       6.666668      0.2680491
           5
   6.666668       9.333334     -6.3902475E-02
   7.333334       9.333334     -5.0933186E-02
   7.333334       10.00000     -5.5744041E-02
   6.666668       10.00000     -6.7301035E-02
   6.666668       9.333334     -6.3902475E-02
           5
   7.333334      -8.000000     -4.1582156E-02
   8.000000      -8.000000     -2.3515334E-02
   8.000000      -7.333333     -3.4721106E-02
   7.333334      -7.333333     -5.1329892E-02
   7.333334      -8.000000     -4.1582156E-02
           5
   7.333334      -5.333333     -6.8958856E-02
   8.000000      -5.333333     -7.5734630E-02
   8.000000      -4.666667     -9.2458487E-02
   7.333334      -4.666667     -7.8850187E-02
   7.333334      -5.333333     -6.8958856E-02
           5
   7.333334      -2.666667     -5.8618896E-02
   8.000000      -2.666667     -6.5131783E-02
   8.000000      -2.000000      3.0095428E-03
   7.333334      -2.000000      1.4600998E-03
   7.333334      -2.666667     -5.8618896E-02
           5
   7.333334      0.0000000E+00  0.3606913
   8.000000      0.0000000E+00  0.3704442
   8.000000      0.6666670      0.4989326
   7.333334      0.6666670      0.4945063
   7.333334      0.0000000E+00  0.3606913
           5
   7.333334       2.666667      0.7323149
   8.000000       2.666667      0.7133905
   8.000000       3.333334      0.7131470
   7.333334       3.333334      0.7369152
   7.333334       2.666667      0.7323149
           5
   7.333334       5.333334      0.5356467
   8.000000       5.333334      0.5133194
   8.000000       6.000000      0.3961289
   7.333334       6.000000      0.4143279
   7.333334       5.333334      0.5356467
           5
   7.333334       8.000000      5.4495744E-02
   8.000000       8.000000      5.2388195E-02
   8.000000       8.666668     -1.3632593E-02
   7.333334       8.666668     -1.6165491E-02
   7.333334       8.000000      5.4495744E-02
           5
   8.000000      -9.333333     -4.6024490E-03
   8.666668      -9.333333      1.0048829E-03
   8.666668      -8.666667     -2.4361794E-03
   8.000000      -8.666667     -1.3019172E-02
   8.000000      -9.333333     -4.6024490E-03
           5
   8.000000      -6.666667     -4.6422578E-02
   8.666668      -6.666667     -2.5663912E-02
   8.666668      -6.000000     -3.9382961E-02
   8.000000      -6.000000     -5.9775461E-02
   8.000000      -6.666667     -4.6422578E-02
           5
   8.000000      -4.000000     -0.1034636
   8.666668      -4.000000     -8.9947395E-02
   8.666668      -3.333333     -8.7627560E-02
   8.000000      -3.333333     -9.8155715E-02
   8.000000      -4.000000     -0.1034636
           5
   8.000000      -1.333333      0.1057163
   8.666668      -1.333333      9.8111860E-02
   8.666668     -0.6666660      0.2152541
   8.000000     -0.6666660      0.2334977
   8.000000      -1.333333      0.1057163
           5
   8.000000       1.333334      0.6042178
   8.666668       1.333334      0.5521658
   8.666668       2.000000      0.6175995
   8.000000       2.000000      0.6769997
   8.000000       1.333334      0.6042178
           5
   8.000000       4.000000      0.6777638
   8.666668       4.000000      0.6136317
   8.666668       4.666667      0.5486691
   8.000000       4.666667      0.6097334
   8.000000       4.000000      0.6777638
           5
   8.000000       6.666668      0.2700891
   8.666668       6.666668      0.2310140
   8.666668       7.333334      0.1224530
   8.000000       7.333334      0.1504516
   8.000000       6.666668      0.2700891
           5
   8.000000       9.333334     -4.5340389E-02
   8.666668       9.333334     -4.5446783E-02
   8.666668       10.00000     -4.5549445E-02
   8.000000       10.00000     -4.8975136E-02
   8.000000       9.333334     -4.5340389E-02
           5
   8.666668      -8.000000     -7.9991277E-03
   9.333334      -8.000000      8.6426217E-04
   9.333334      -7.333333     -2.0859218E-03
   8.666668      -7.333333     -1.5574729E-02
   8.666668      -8.000000     -7.9991277E-03
           5
   8.666668      -5.333333     -5.7105642E-02
   9.333334      -5.333333     -3.2507416E-02
   9.333334      -4.666667     -5.0660193E-02
   8.666668      -4.666667     -7.6272696E-02
   8.666668      -5.333333     -5.7105642E-02
           5
   8.666668      -2.666667     -5.8570020E-02
   9.333334      -2.666667     -5.0981980E-02
   9.333334      -2.000000     -3.6583112E-03
   8.666668      -2.000000      3.7257653E-03
   8.666668      -2.666667     -5.8570020E-02
           5
   8.666668      0.0000000E+00  0.3402367
   9.333334      0.0000000E+00  0.2763067
   9.333334      0.6666670      0.3777204
   8.666668      0.6666670      0.4569530
   8.666668      0.0000000E+00  0.3402367
           5
   8.666668       2.666667      0.6497080
   9.333334       2.666667      0.5509251
   9.333334       3.333334      0.5497066
   8.666668       3.333334      0.6480338
   8.666668       2.666667      0.6497080
           5
   8.666668       5.333334      0.4573780
   9.333334       5.333334      0.3744312
   9.333334       6.000000      0.2756451
   8.666668       6.000000      0.3475259
   8.666668       5.333334      0.4573780
           5
   8.666668       8.000000      3.5650745E-02
   9.333334       8.000000      1.0352937E-02
   9.333334       8.666668     -3.2314807E-02
   8.666668       8.666668     -2.0620821E-02
   8.666668       8.000000      3.5650745E-02
           5
   9.333334      -9.333333      2.4565330E-03
   10.00000      -9.333333      1.7301766E-03
   10.00000      -8.666667      2.6590771E-03
   9.333334      -8.666667      2.2089665E-03
   9.333334      -9.333333      2.4565330E-03
           5
   9.333334      -6.666667     -7.7208979E-03
   10.00000      -6.666667      1.9964445E-03
   10.00000      -6.000000     -3.4113028E-03
   9.333334      -6.000000     -1.7585175E-02
   9.333334      -6.666667     -7.7208979E-03
           5
   9.333334      -4.000000     -6.6158161E-02
   10.00000      -4.000000     -4.5382909E-02
   10.00000      -3.333333     -5.4542556E-02
   9.333334      -3.333333     -6.9608502E-02
   9.333334      -4.000000     -6.6158161E-02
           5
   9.333334      -1.333333      7.2381467E-02
   10.00000      -1.333333      3.4902073E-02
   10.00000     -0.6666660      0.1087025
   9.333334     -0.6666660      0.1698632
   9.333334      -1.333333      7.2381467E-02
           5
   9.333334       1.333334      0.4620838
   10.00000       1.333334      0.3493507
   10.00000       2.000000      0.4016047
   9.333334       2.000000      0.5212399
   9.333334       1.333334      0.4620838
           5
   9.333334       4.000000      0.5179991
   10.00000       4.000000      0.4003605
   10.00000       4.666667      0.3473892
   9.333334       4.666667      0.4579836
   9.333334       4.000000      0.5179991
           5
   9.333334       6.666668      0.1733907
   10.00000       6.666668      0.1075353
   10.00000       7.333334      3.5447691E-02
   9.333334       7.333334      8.1066094E-02
   9.333334       6.666668      0.1733907
           5
   9.333334       9.333334     -4.7694862E-02
   10.00000       9.333334     -4.8521340E-02
   10.00000       10.00000     -3.8970198E-02
   9.333334       10.00000     -4.2933173E-02
   9.333334       9.333334     -4.7694862E-02
STOP_CAT
echo "  Generating =====> [ ./surf3d2.f ]"
cat <<"STOP_CAT"> ././surf3d2.f
C     PROGRAM SURF3D2
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 SURF3D_DRAW
C
C     LOCAL VARIABLES:
C
C
C     NOTES:
C       The surface is gnerated using the function
C         ZMAT(i,j) = F(Xi,Yj),
C       where
C         Xi = XMIN + (i-1)*(XMAX-XMIN)/(NX-1)
C         Yj = YMIN + (j-1)*(YMAX-YMIN)/(NY-1)
C         XMIN, YMIN = minimum values of X, Y
C         XMAX, YMAX = maximum values of X, Y
C         NX         = number of x values in the ZMAT array
C         NY         = number of y values in the ZMAT array
C
C     ******************************************************************
C
C                       Array for storing points that define
C                       the surface to be plotted
      REAL ZMAT(31,31)
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       X dimension of array that defines surface
      DATA NX /31/
C                       Y dimension of array that defines surface
      DATA NY /31/
C                       Min and max world coordinates for surface
      DATA XMIN,XMAX,YMIN,YMAX /-10.0,10.0,-10.0,10.0/
C
C     ******************************************************************
C
C                       INITIALIZE LIBRARIES
C
C                       Initialize the surface package
      CALL SURFACE_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 AND STORE POINTS DEFINING THE
C                       SURFACE TO BE PLOTTED
C
C                       Compute X and Y distance between surface
C                       definition grid lines
      DX = (XMAX-XMIN)/(NX-1)
      DY = (YMAX-YMIN)/(NY-1)
C                       Initialize min and max Z coordinates
      ZMIN=1E30
      ZMAX=-1E30
C                       Loop for each X surface grid line
      DO 65 I=1,NX
C                       Store X coordinate of surface grid line
        X = XMIN + (I-1)*DX
C                       Loop for each Y surface grid line
        DO 60 J=1,NY
C                       Store Y coordinate of surface grid line
          Y = YMIN + (J-1)*DY
C                       Compute and store Z coordinate of surface
C                       at X-Y intersection point
          ZMAT(I,J) = FXYZ(X,Y, 0.0, 0.0,15.0,10.0) +
     1            0.9*FXYZ(X,Y,-5.0,-2.5,10.0,20.0) +
     2           0.75*FXYZ(X,Y, 7.0, 3.0,20.0,20.0) +
     3           0.85*FXYZ(X,Y, 2.0,-4.0,15.0,15.0) +
     4           0.85*FXYZ(X,Y,-2.5, 6.5,25.0,35.0)
C                       Store Z coordinate if it is the smallest yet
          ZMIN = AMIN1 (ZMIN,ZMAT(I,J))
C                       Store Z coordinate if it is the largest yet
          ZMAX = AMAX1 (ZMAX,ZMAT(I,J))
C                       Repeat for next Y surface grid line
   60   CONTINUE
C                       Repeat for next X surface grid line
   65 CONTINUE
C
C     ******************************************************************
C
C                       INITIALIZE 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.10*YPAGE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE - 2.0*XRL
      YPG = YPAGE - 3.25*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 ('SURF3D2 Demo: 3D Surface Plot$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)
C                       Draw title centered below subplot area
      YY = -0.07*YPG
      CALL TEXT2D_PDRAW ('SURF3D2 Demo: 3D Surface Plot$',100,XX,YY)
C
C     ------------------------------------------------------------------
C
C                       DEFINE PLOT HEADING
C
C                       Set current color to green
      CALL COLOR_SETNAM ('GREEN')
C                       Draw heading over plot in green
      CALL HEADING_DRAW ('Topo-like Function$',100,1.2,3)
      CALL HEADING_DRAW ('with$',100,0.9,3)
      CALL HEADING_DRAW ('Hidden Line Removal$',100,1.2,3)
C                       Set text style to cartog
      CALL FONT_CARTOG
C
C     ------------------------------------------------------------------
C
C                       DEFINE AXES LABELS
C
C                       Set X axis label for 3-D plot
      CALL AXISLBL_DEFX3 ('X',1)
C                       Set Y axis label for 3-D plot
      CALL AXISLBL_DEFY3 ('Y',1)
C                       Set Z axis label for 3-D plot
      CALL AXISLBL_DEFZ3 ('Z',1)
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 workbox dimensions for a 3-D
C                       coordinate system
      CALL WORKBOX_DEFINE (10.0,10.0,10.0)
C                       Set viewpoint at 45 degrees
C                       azmuth and elevation and infinite distance
      CALL VIEWPT_SETBS (45.0,45.0,9999.0)
C                       Define 3D coordinate system with
C                       X = -10.0 to 10.0 and Y = -10.0 to 10.0, and
C                       draw axes, axes labels
      CALL PLOT3D_DEFINE (-10.0,5.0,10.0, -10.0,5.0,10.0, -0.15,0.5,1.0)
C
C                       Suppress hidden line removal
C                       (disabled by comment)
C     CALL SURF3D_HIDOFF
C                       Define a surface plot grid line at every
C                       X matrix element
      IXPTS = 1
C                       Define a surface plot grid line at every
C                       Y matrix element
      IYPTS = 1
C                       Draw surface defined by points in matrix ZMAT
      CALL SURF3D_DRAW (ZMAT,IXPTS,31,IYPTS,31,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
      FUNCTION FXYZ (X,Y,XC,YC,XS,YS)
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: GET Z VALUES FROM X,Y DATA MATRIX
C
C     ARGUMENT LIST INPUT:
C
C     ARGUMENT LIST OUTPUT:
C
C     GLOBAL INPUT:
C
C     GLOBAL OUTPUT:
C
C     EXCEPTIONS:
C
C     LOCAL VARIABLES:
C
C     NOTES:  None
C
C     ******************************************************************
C
      INTRINSIC COS, EXP
C
C     ******************************************************************
C
      R = (X-XC)**2/XS + (Y-YC)**2/YS
      FXYZ = COS(R)*EXP(-R)
C
      RETURN
      END
STOP_CAT
echo "  Generating =====> [ ./surf3d3.f ]"
cat <<"STOP_CAT"> ././surf3d3.f
C     PROGRAM SURF3D3
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 SURF3D_POLYG and
C              SURF3D_HIDOFF
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
 
      REAL X (10), Y (10), Z (10)
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                       INITIALIZE LIBRARIES
C
C                       Initialize the surface package
      CALL SURFACE_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                       INITIALIZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT (KTYPE,XPAGE_SIZE,YPAGE_SIZE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
      DO 100 IHID=1,2
C
C                       Define page size in inches
      CALL PAGE_SIZE (XPAGE_SIZE,YPAGE_SIZE)
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_SIZE
      YRL = 0.10*YPAGE_SIZE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE_SIZE - 2.0*XRL
      YPG = YPAGE_SIZE - 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 PLOT TITLE
C
C                       Define 2D coordinate system
      CALL PLOT2D_DEFINE (0.0,0.1,1.0,0.0,0.1,1.0)
C                       Set current color to green
      CALL COLOR_SETNAM ('GREEN')
C                       Set font fill pattern
      CALL FONT_SETPAT (0.0,1,0.05,1)
C                       Enable hardware area fill
      CALL DEVICE_FILLON
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE_SIZE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C
C
C                       Determine length of text string in inches
      XX=TEXT2D_GETLEN ('3D Polygon Plot$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50* (XPG-XX)/XPG
C                       Draw title centered below subplot area
      CALL TEXT2D_WDRAW ('3D Polygon Plot$',100,XX,0.95)
C
C                       Set current color to red
      CALL COLOR_SETNAM ('RED')
C                       Compute text height based on page height
      SIZE = 0.20*YPAGE_SIZE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
      IF (IHID .EQ. 1) THEN
C                       Determine length of text string in inches
        XX=TEXT2D_GETLEN ('Without$',100)
C                       Compute X coordinate in inches to center string
        XX = 0.50* (XPG-XX)/XPG
C                       Draw title centered below subplot area
        CALL TEXT2D_WDRAW ('Without$',100,XX,0.90)
      ELSE
C                       Determine length of text string in inches
        XX=TEXT2D_GETLEN ('With$',100)
C                       Compute X coordinate in inches to center string
        XX = 0.50* (XPG-XX)/XPG
C                       Draw title centered below subplot area
        CALL TEXT2D_WDRAW ('With$',100,XX,0.90)
      ENDIF
C
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE_SIZE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Set current color to yellow
      CALL COLOR_SETNAM ('YELLOW')
C                       Determine length of text string in inches
      XX=TEXT2D_GETLEN ('Hidden Line Removal$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50* (XPG-XX)/XPG
C                       Draw title centered below subplot area
      CALL TEXT2D_WDRAW ('Hidden Line Removal$',100,XX,0.82)
C
C
C                       Set current color to white
      CALL COLOR_SETNAM ('FORE')
C                       Set text style to cartog
      CALL FONT_CARTOG
C                       Compute text height based on page height
      SIZE = 0.30*YPAGE_SIZE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT (SIZE)
C                       Determine length of text string in inches
      XX=TEXT2D_GETLEN ('SURF3D3 Demo: Hidden Line$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50* (XPG-XX)/XPG
C                       Draw title centered below subplot area
      CALL TEXT2D_WDRAW ('SURF3D3 Demo: Hidden Line$',100,XX,-0.10)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END (0)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Reset text height to default
      CALL GRAPHICS_RESET ('TEXT2D_SETHT')
C                       Set current color to blue
      CALL COLOR_SETNAM ('BLUE')
C                       Define subplot area
      YPG = 0.80*YPG
      CALL SUBPLOT_DEFINE (XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Define workbox dimensions for a 3D
C                       coordinate system
      CALL WORKBOX_DEFINE (10.0,10.0,10.0)
C                       Set viewpoint at 20 degrees
C                       azmuth and elevation and infinite distance
      CALL VIEWPT_SETBS (20.0,20.0,9999.0)
C                       Set X axis label for 3D plot
      CALL AXISLBL_DEFX3 ('X',1)
C                       Set Y axis label for 3D plot
      CALL AXISLBL_DEFY3 ('Y',1)
C                       Set Z axis label for 3D plot
      CALL AXISLBL_DEFZ3 ('Z',1)
C                       Set drawing color to 'foreground"  (white)
      CALL COLOR_SETNAM ('FOREGROUND')
C                       Define 3D coordinate system
      CALL PLOT3D_DEFINE (-10.0,5.0,10.0,-10.0,5.0,10.0,-10.0,5.0,10.0)
C
C                       Suppress hidden line removal
      IF (IHID .EQ. 1) THEN
        CALL SURF3D_HIDOFF ()
      ENDIF
C
C                       Open data file for read-only
      IOPFLG = IPXCON ('O_RDONLY')
      CALL PXFOPN ('surf3d3.inp',0,IOPFLG,0,IOFIL,IERROR)
C
C                       Read polygon from file
   50 CONTINUE
      CALL READAR (IOFIL,X,Y,Z,NP,NC,IFLAG)
C                       Draw a 3D polygon
      CALL SURF3D_POLYG (X,Y,Z,NP,NC)
C                       Check for more polygons
      IF (IFLAG .NE. 1) GO TO 50
C
C                         Close file
      CALL PXFCLS (IOFIL,IERROR)
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
      SUBROUTINE READAR (IOFIL,X,Y,Z,NTRP,NC,IFLAG)
      SAVE
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C                     All rights reserved.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE:  Read polygon point coordinates from data file
C
C     ARGUMENT LIST INPUT:
C
C     ARGUMENT LIST OUTPUT:
C
C     GLOBAL INPUT:
C
C     GLOBAL OUTPUT:
C
C     EXCEPTIONS:
C
C     LOCAL VARIABLES:
C
C     NOTES:  None
C
C     ******************************************************************
C
      DIMENSION X (1),Y (1),Z (1)
C
C     ******************************************************************
C
      IFLAG=0
      NX=1
   10 CONTINUE
      NZ=NX+1
      READ (IOFIL,1,END=2) (X(N),Y(N),Z(N),N=NX,NZ)
    1 FORMAT (6F12.7)
      CONTINUE
      NC=0
      DO 5 J=NX,NZ
      IF (X(J) .EQ. 9998.) GO TO 6
      IF (X(J) .EQ. 9999.) GO TO 7
      GO TO 5
    6 NC=1
    7 NTRP=J-1
      IFLAG=NC
      RETURN
    5 CONTINUE
      NX=NX+2
      GO TO 10
    2 IFLAG=2
C
C     ******************************************************************
C
      RETURN
      END
STOP_CAT
echo "  Generating =====> [ ./surf3d3.inp ]"
cat <<"STOP_CAT"> ././surf3d3.inp
  -5.0000000   0.0000000   3.0000000  -3.0000000   2.0000000   3.0000000
  -3.0000000   2.0000000  -3.0000000  -5.0000000   0.0000000  -3.0000000
  -5.0000000   0.0000000   3.00000009999.0000000
  -3.0000000   2.0000000  -3.0000000  -3.0000000   2.0000000   3.0000000
   3.0000000   2.0000000   3.0000000   3.0000000   2.0000000  -3.0000000
  -3.0000000   2.0000000  -3.00000009999.0000000
   3.0000000   2.0000000  -3.0000000   5.0000000   0.0000000  -3.0000000
   5.0000000   0.0000000   3.0000000   3.0000000   2.0000000   3.0000000
   3.0000000   2.0000000  -3.00000009999.0000000
   5.0000000   0.0000000  -3.0000000   5.0000000   0.0000000   3.0000000
   3.0000000  -2.0000000   3.0000000   3.0000000  -2.0000000  -3.0000000
   5.0000000   0.0000000  -3.00000009999.0000000
   3.0000000  -2.0000000   3.0000000   3.0000000  -2.0000000  -3.0000000
  -3.0000000  -2.0000000  -3.0000000  -3.0000000  -2.0000000   3.0000000
   3.0000000  -2.0000000   3.00000009999.0000000
  -5.0000000   0.0000000  -3.0000000  -5.0000000   0.0000000   3.0000000
  -3.0000000  -2.0000000   3.0000000  -3.0000000  -2.0000000  -3.0000000
  -5.0000000   0.0000000  -3.00000009999.0000000
  -5.0000000   0.0000000   3.0000000  -3.0000000   2.0000000   3.0000000
   3.0000000   2.0000000   3.0000000   5.0000000   0.0000000   3.0000000
   3.0000000  -2.0000000   3.0000000  -3.0000000  -2.0000000   3.0000000
  -5.0000000   0.0000000   3.00000009999.0000000
  -5.0000000   0.0000000  -3.0000000  -3.0000000   2.0000000  -3.0000000
   3.0000000   2.0000000  -3.0000000   5.0000000   0.0000000  -3.0000000
   3.0000000  -2.0000000  -3.0000000  -3.0000000  -2.0000000  -3.0000000
  -5.0000000   0.0000000  -3.00000009998.0000000
  -5.0000000   0.0000000   3.0000000  -3.0000000   2.0000000   3.0000000
  -3.0000000   2.0000000  -3.0000000  -5.0000000   0.0000000  -3.0000000
  -5.0000000   0.0000000   3.00000009999.0000000
  -3.0000000   2.0000000  -3.0000000  -3.0000000   2.0000000   3.0000000
   3.0000000   2.0000000   3.0000000   3.0000000   2.0000000  -3.0000000
  -3.0000000   2.0000000  -3.00000009999.0000000
   3.0000000   2.0000000  -3.0000000   5.0000000   0.0000000  -3.0000000
   5.0000000   0.0000000   3.0000000   3.0000000   2.0000000   3.0000000
   3.0000000   2.0000000  -3.00000009999.0000000
   5.0000000   0.0000000  -3.0000000   5.0000000   0.0000000   3.0000000
   3.0000000  -2.0000000   3.0000000   3.0000000  -2.0000000  -3.0000000
   5.0000000   0.0000000  -3.00000009999.0000000
   3.0000000  -2.0000000   3.0000000   3.0000000  -2.0000000  -3.0000000
  -3.0000000  -2.0000000  -3.0000000  -3.0000000  -2.0000000   3.0000000
   3.0000000  -2.0000000   3.00000009999.0000000
  -5.0000000   0.0000000  -3.0000000  -5.0000000   0.0000000   3.0000000
  -3.0000000  -2.0000000   3.0000000  -3.0000000  -2.0000000  -3.0000000
  -5.0000000   0.0000000  -3.00000009999.0000000
  -5.0000000   0.0000000   3.0000000  -3.0000000   2.0000000   3.0000000
   3.0000000   2.0000000   3.0000000   5.0000000   0.0000000   3.0000000
   3.0000000  -2.0000000   3.0000000  -3.0000000  -2.0000000   3.0000000
  -5.0000000   0.0000000   3.00000009999.0000000
  -5.0000000   0.0000000  -3.0000000  -3.0000000   2.0000000  -3.0000000
   3.0000000   2.0000000  -3.0000000   5.0000000   0.0000000  -3.0000000
   3.0000000  -2.0000000  -3.0000000  -3.0000000  -2.0000000  -3.0000000
  -5.0000000   0.0000000  -3.00000009998.0000000
STOP_CAT
echo "  Generating =====> [ ./surf3d4.f ]"
cat <<"STOP_CAT"> ././surf3d4.f
C     PROGRAM SURF3D4
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 SURF3D_SETBND
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
      REAL X(1500), Y(1500), Z(1500)
      REAL ZMAT(31,31)
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                       INITIALIZE LIBRARIES
C
C                       Initialize the surface package
      CALL SURFACE_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                       INITIALIZE OUTPUT DEVICE
C
C                       Allow user to choose a device interactively
      KTYPE = 0
      CALL DEVICE_PROMPT(KTYPE,XPAGE_SIZE,YPAGE_SIZE)
C
C     ******************************************************************
C
C                       DEFINE PAGE SIZE
C
C                       Loop for mesh construction parameter values
      DO 100 IBND=2,10,2
C
C                       Define page size in inches
      CALL PAGE_SIZE(XPAGE_SIZE,YPAGE_SIZE)
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_SIZE
      YRL = 0.10*YPAGE_SIZE
C                       Compute length of X and Y axis in inches
      XPG = XPAGE_SIZE - 2.0*XRL
      YPG = YPAGE_SIZE - 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 PLOT TITLE
C
C                       Define 2D coordinate system
      CALL PLOT2D_DEFINE(0.0,0.1,1.0,0.0,0.1,1.0)
C                       Set current color to green
      CALL COLOR_SETNAM('GREEN')
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE_SIZE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT(SIZE)
C
C
C                       Determine length of text string in inches
      XX=TEXT2D_GETLEN('3-D Surfaces Plot$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)/XPG
C                       Draw title centered below subplot area
      CALL TEXT2D_WDRAW('3-D Surfaces Plot$',100,XX,0.95)
C
C                       Set current color to red
      CALL COLOR_SETNAM('RED')
C                       Compute text height based on page height
      SIZE = 0.20*YPAGE_SIZE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT(SIZE)
C                       Determine length of text string in inches
      XX=TEXT2D_GETLEN('With$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)/XPG
C                       Draw title centered below subplot area
      CALL TEXT2D_WDRAW('With$',100,XX,0.90)
C
C
C                       Compute text height based on page height
      SIZE = 0.25*YPAGE_SIZE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT(SIZE)
C                       Set current color to yellow
      CALL COLOR_SETNAM('YELLOW')
C                       Determine length of text string in inches
      XX=TEXT2D_GETLEN('Hidden Line Removal$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)/XPG
C                       Draw title centered below subplot area
      CALL TEXT2D_WDRAW('Hidden Line Removal$',100,XX,0.82)
C
C
C                       Set current color to white
      CALL COLOR_SETNAM ('FORE')
C                       Set text style to cartog
      CALL FONT_CARTOG
C                       Compute text height based on page height
      SIZE = 0.30*YPAGE_SIZE/11.0
C                       Set current text height in inches
      CALL TEXT2D_SETHT(SIZE)
C                       Determine length of text string in inches
      XX=TEXT2D_GETLEN('SURF3D4 Demo: 3D Surface Bound$',100)
C                       Compute X coordinate in inches to center string
      XX = 0.50*(XPG-XX)/XPG
C                       Draw title centered below subplot area
      CALL TEXT2D_WDRAW('SURF3D4 Demo: 3D Surface Bound',100,XX,-0.10)
C
C     ******************************************************************
C
C                       END THE SUBPLOT
C
      CALL SUBPLOT_END(0)
C
C     ******************************************************************
C
C                       DEFINE SUBPLOT AREA
C
C                       Reset text height to default
      CALL GRAPHICS_RESET('TEXT2D_SETHT')
C                       Set current color to blue
      CALL COLOR_SETNAM('BLUE')
C                       Define subplot area
      YPG = 0.80*YPG
      CALL SUBPLOT_DEFINE(XPG,YPG)
C
C     ******************************************************************
C
C                       DRAW THE PLOT
C
C                       Draw frame around subplot area
      CALL FRAME_DRAW
C                       Define workbox dimensions for a 3-D
C                       coordinate system
      CALL WORKBOX_DEFINE(10.0,10.0,10.0)
C                       Set viewpoint at 45 degrees
C                       azmuth and elevation and infinite distance
      CALL VIEWPT_SETBS(45.0,45.0,9999.0)
C                       Set X axis label for 3D plot
      CALL AXISLBL_DEFX3('X',1)
C                       Set Y axis label for 3D plot
      CALL AXISLBL_DEFY3('Y',1)
C                       Set Z axis label for 3D plot
      CALL AXISLBL_DEFZ3('Z',1)
C                       Set drawing color to 'foreground" (white)
      CALL COLOR_SETNAM('FOREGROUND')
C                       Define 3D coordinate system
      CALL PLOT3D_DEFINE(-10.0,5.0,10.0,-10.0,5.0,10.0,-0.15,1.15,1.0)
C
C                       Open data file for read-only
      IOPFLG = IPXCON ('O_RDONLY')
      CALL PXFOPN ('surf3d1.inp',0,IOPFLG,0,IOFIL,IERROR)
C
C                       Read scattered surface points from file
      NC = 0
      NP = 0
   50 CONTINUE
      WEI = 6.0
      READ(IOFIL,*,END=99) NN
      DO 30 I=1,NN
        READ(IOFIL,*) ZX, ZY, ZZ
        NP = NP + 1
        X(NP) = ZX
        Y(NP) = ZY
        Z(NP) = ZZ
   30 CONTINUE
      GO TO 50
   99 NC = 1
C                         Close file
      CALL PXFCLS (IOFIL,IERROR)
C
C                         Set 3D surface mesh construction parameters
      IX = 6
      IY = 6
      WEI = 6.0
      CALL SURF3D_SETMESH(IX,IY,WEI)
C
C                       Set the perimeter boundary limits of a 3D
C                       surface mesh
      PXMIN = -FLOAT(IBND)
      PXMAX = FLOAT(IBND)
      PYMIN = -FLOAT(IBND)
      PYMAX = FLOAT(IBND)
      CALL SURF3D_SETBND (PXMIN,PXMAX,PYMIN,PYMAX)
C
C                         Build a 3D surface mesh from scattered points
      CALL SURF3D_BLDMESH(X,Y,Z,NP,ZMAT,31,31)
C
C                         Draw 3D surface
      IXPTS = 1
      IYPTS = 1
      CALL SURF3D_DRAW(ZMAT,IXPTS,31,IYPTS,31,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 =====> [ ./surface1.f ]"
cat <<"STOP_CAT"> ././surface1.f
C     PROGRAM SURFACE1
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 SURFACE_INIT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       SURFACE object access programs
      EXTERNAL SURFACE_INIT
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C     ------------------------------------------------------------------
C
      CHARACTER*80 STRING
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL SURFACE_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 (
     * '                   SURFACE Object Demo Program #1'//
     * ' SURFACE_INIT must be used to initialize the PRL-SURFACE'/
     * ' library prior to invoking any other PRL-SURFACE subprograms.'/
     * ' Failure to initialize the library will cause erroneous'/
     * ' program operation.'/
     * ' '/
     * ' SURFACE_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 (/
     * '              SURFACE 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 =====> [ ./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 ======> [ ./contr2d1.f ]"
$LINK ./contr2d1.f -o ./contr2d1.x $SURFACE
chmod 0770 ./contr2d1.x
echo "  Compiling ======> [ ./contr2d2.f ]"
$LINK ./contr2d2.f -o ./contr2d2.x $SURFACE
chmod 0770 ./contr2d2.x
echo "  Compiling ======> [ ./contr2d3.f ]"
$LINK ./contr2d3.f -o ./contr2d3.x $SURFACE
chmod 0770 ./contr2d3.x
echo "  Compiling ======> [ ./contr2d4.f ]"
$LINK ./contr2d4.f -o ./contr2d4.x $SURFACE
chmod 0770 ./contr2d4.x
echo "  Compiling ======> [ ./contr3d1.f ]"
$LINK ./contr3d1.f -o ./contr3d1.x $SURFACE
chmod 0770 ./contr3d1.x
echo "  Compiling ======> [ ./contr3d2.f ]"
$LINK ./contr3d2.f -o ./contr3d2.x $SURFACE
chmod 0770 ./contr3d2.x
echo "  Compiling ======> [ ./contr3d3.f ]"
$LINK ./contr3d3.f -o ./contr3d3.x $SURFACE
chmod 0770 ./contr3d3.x
echo "  Compiling ======> [ ./contr3d4.f ]"
$LINK ./contr3d4.f -o ./contr3d4.x $SURFACE
chmod 0770 ./contr3d4.x
echo "  Compiling ======> [ ./device1.f ]"
$LINK ./device1.f -o ./device1.x $SURFACE
chmod 0770 ./device1.x
echo "  Converting ======> [ ./device_select.uuu ]"
uudecode ./device_select.uuu
chmod 0660 ./device_select.dat
echo "  Compiling ======> [ ./origin1.f ]"
$LINK ./origin1.f -o ./origin1.x $SURFACE
chmod 0770 ./origin1.x
echo "  Converting ======> [ ./origin_set.uuu ]"
uudecode ./origin_set.uuu
chmod 0660 ./origin_set.dat
echo "  Compiling ======> [ ./page1.f ]"
$LINK ./page1.f -o ./page1.x $SURFACE
chmod 0770 ./page1.x
echo "  Compiling ======> [ ./page2.f ]"
$LINK ./page2.f -o ./page2.x $SURFACE
chmod 0770 ./page2.x
echo "  Converting ======> [ ./page_size.uuu ]"
uudecode ./page_size.uuu
chmod 0660 ./page_size.dat
echo "  Compiling ======> [ ./plot2d1.f ]"
$LINK ./plot2d1.f -o ./plot2d1.x $SURFACE
chmod 0770 ./plot2d1.x
echo "  Converting ======> [ ./plot2d_define.uuu ]"
uudecode ./plot2d_define.uuu
chmod 0660 ./plot2d_define.dat
echo "  Compiling ======> [ ./plot3d1.f ]"
$LINK ./plot3d1.f -o ./plot3d1.x $SURFACE
chmod 0770 ./plot3d1.x
echo "  Compiling ======> [ ./prl1.f ]"
$LINK ./prl1.f -o ./prl1.x $SURFACE
chmod 0770 ./prl1.x
echo "  Compiling ======> [ ./process1.f ]"
$LINK ./process1.f -o ./process1.x $SURFACE
chmod 0770 ./process1.x
echo "  Compiling ======> [ ./subplot1.f ]"
$LINK ./subplot1.f -o ./subplot1.x $SURFACE
chmod 0770 ./subplot1.x
echo "  Converting ======> [ ./subplot_define.uuu ]"
uudecode ./subplot_define.uuu
chmod 0660 ./subplot_define.dat
echo "  Compiling ======> [ ./surf3d1.f ]"
$LINK ./surf3d1.f -o ./surf3d1.x $SURFACE
chmod 0770 ./surf3d1.x
echo "  Compiling ======> [ ./surf3d2.f ]"
$LINK ./surf3d2.f -o ./surf3d2.x $SURFACE
chmod 0770 ./surf3d2.x
echo "  Compiling ======> [ ./surf3d3.f ]"
$LINK ./surf3d3.f -o ./surf3d3.x $SURFACE
chmod 0770 ./surf3d3.x
echo "  Compiling ======> [ ./surf3d4.f ]"
$LINK ./surf3d4.f -o ./surf3d4.x $SURFACE
chmod 0770 ./surf3d4.x
echo "  Compiling ======> [ ./surface1.f ]"
$LINK ./surface1.f -o ./surface1.x $SURFACE
chmod 0770 ./surface1.x
echo "  Compiling ======> [ ./workbox1.f ]"
$LINK ./workbox1.f -o ./workbox1.x $SURFACE
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
                        SURFACE
 

 
  PRL-SURFACE demonstration programs. These programs
  test and demonstrate the capabilities of the
  PRL-SURFACE library.
 
  <CR> to Continue"
read answer
while [ 1 -eq 1 ]; do
$CLEAR
echo "
 Select Demo Program
 ===================
   1 ./_surface.tk         2 ./contr2d1            3 ./contr2d2                 
   4 ./contr2d3            5 ./contr2d4            6 ./contr3d1                 
   7 ./contr3d2            8 ./contr3d3            9 ./contr3d4                 
  10 ./device1            11 ./origin1            12 ./page1                    
  13 ./page2              14 ./plot2d1            15 ./plot3d1                  
  16 ./prl1               17 ./process1           18 ./subplot1                 
  19 ./surf3d1            20 ./surf3d2            21 ./surf3d3                  
  22 ./surf3d4            23 ./surface1           24 ./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 ./_surface.tk;;
  2) ./contr2d1.x;;
  3) ./contr2d2.x;;
  4) ./contr2d3.x;;
  5) ./contr2d4.x;;
  6) ./contr3d1.x;;
  7) ./contr3d2.x;;
  8) ./contr3d3.x;;
  9) ./contr3d4.x;;
 10) ./device1.x;;
 11) ./origin1.x;;
 12) ./page1.x;;
 13) ./page2.x;;
 14) ./plot2d1.x;;
 15) ./plot3d1.x;;
 16) ./prl1.x;;
 17) ./process1.x;;
 18) ./subplot1.x;;
 19) ./surf3d1.x;;
 20) ./surf3d2.x;;
 21) ./surf3d3.x;;
 22) ./surf3d4.x;;
 23) ./surface1.x;;
 24) ./workbox1.x;;
  *) echo "Invalid Choice
 
  <CR> to Continue"
read answer;;
esac
done
$CLEAR
echo "
                    Object Access
            Programmer's Reusable Library
                        SURFACE
 

 
       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
                        SURFACE
 

  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
                        SURFACE
 

  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
                        SURFACE
 

  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
