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

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

       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 =====> [ ./DBL.INC ]"
cat <<"STOP_CAT"> ././DBL.INC
C     ------------------Start DBL.INC Include File---------------------
C
C                       DBL Object Hidden Information
C
      DOUBLE PRECISION   DTOL, D1001, DIGNUM, DPI
C
      COMMON /DBL/  DTOL, D1001, DIGNUM, DPI
C
C     PRIVATE CONSTANTS
C       None
C
C     PRIVATE VARIABLES
C       DTOL   = double precision subtraction tolerance
C       D1001  = machine double precision multiplier
C       DIGNUM = large double precision number
C       DPI    = double precision value of pi
C
C     ------------------End DBL.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./REAL.INC ]"
cat <<"STOP_CAT"> ././REAL.INC
C     ------------------Start REAL.INC Include File---------------------
C
C                       REAL Object Hidden Information
C
      REAL      TOL, P1001, BIGNUM, PI
C
      COMMON /REAL/  TOL, P1001, BIGNUM, PI
C
C     PRIVATE CONSTANTS
C       None
C
C     PRIVATE VARIABLES
C       TOL    = floating point subtraction tolerance
C       P1001  = machine single precision multiplier
C       BIGNUM = large floating point number
C       PI     = single precision value of pi
C
C     ------------------End REAL.INC Include File---------------------
STOP_CAT
echo "  Generating =====> [ ./_progrlang.tk ]"
cat <<"STOP_CAT"> ././_progrlang.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-PROGRLANG library
#
#     NOTES:
#
#     ******************************************************************
#
#                       Define window title
#
set auto_path "$tk_library/demos $auto_path"
wm title . "PRL-PROGRLANG 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 700 -borderwidth 1 -text \
"This window demonstrates the Programmer's Reuseable Library \
PRL-PROGRLANG, 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-PROGRLANG.
 
To exit, select the \"Quit\" option in the Demo menu.
 
----------------------------------------------------
 
Copyright (C) 1995 Object Access, Inc.
 
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 ."
#
#     ******************************************************************
#
#                       "CHAR" menu
#
menubutton .menu.char -text "CHAR  " -menu .menu.char.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.char.m
#
#                       "char1" button
.menu.char.m add command -label "char1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e char1.x }
#
#                       "char2" button
.menu.char.m add command -label "char2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e char2.x }
#
#                       "char3" button
.menu.char.m add command -label "char3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e char3.x }
#
#                       "char4" button
.menu.char.m add command -label "char4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e char4.x }
#
#                       "char5" button
.menu.char.m add command -label "char5" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e char5.x }
#
#                       "char6" button
.menu.char.m add command -label "char6" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e char6.x }
#
#                       "char7" button
.menu.char.m add command -label "char7" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e char7.x }
#
#                       "char8" button
.menu.char.m add command -label "char8" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e char8.x }
#
#                       "char9" button
.menu.char.m add command -label "char9" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e char9.x }
#
#                       "char10" button
.menu.char.m add command -label "char10" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e char10.x }
#
#                       "char11" button
.menu.char.m add command -label "char11" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e char11.x }
#
#     ******************************************************************
#
#                       "CHARARY" menu
#
menubutton .menu.charary -text "CHARARY  " -menu .menu.charary.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.charary.m
#
#                       "charary1" button
.menu.charary.m add command -label "charary1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e charary1.x }
#
#                       "charary2" button
.menu.charary.m add command -label "charary2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e charary2.x }
#
#     ******************************************************************
#
#                       "CMPLX" menu
#
menubutton .menu.cmplx -text "CMPLX  " -menu .menu.cmplx.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.cmplx.m
#
#                       "cmplx1" button
.menu.cmplx.m add command -label "cmplx1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e cmplx1.x }
#
#                       "cmplx2" button
.menu.cmplx.m add command -label "cmplx2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e cmplx2.x }
#
#                       "cmplx3" button
.menu.cmplx.m add command -label "cmplx3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e cmplx3.x }
#
#     ******************************************************************
#
#                       "DBL" menu
#
menubutton .menu.dbl -text "DBL  " -menu .menu.dbl.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.dbl.m
#
#                       "dbl1" button
.menu.dbl.m add command -label "dbl1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e dbl1.x }
#
#                       "dbl2" button
.menu.dbl.m add command -label "dbl2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e dbl2.x }
#
#                       "dbl3" button
.menu.dbl.m add command -label "dbl3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e dbl3.x }
#
#                       "dbl4" button
.menu.dbl.m add command -label "dbl4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e dbl4.x }
#
#                       "dbl5" button
.menu.dbl.m add command -label "dbl5" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e dbl5.x }
#
#                       "dbl6" button
.menu.dbl.m add command -label "dbl6" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e dbl6.x }
#
#                       "dbl7" button
.menu.dbl.m add command -label "dbl7" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e dbl7.x }
#
#                       "dbl8" button
.menu.dbl.m add command -label "dbl8" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e dbl8.x }
#
#                       "dbl9" button
.menu.dbl.m add command -label "dbl9" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e dbl9.x }
#
#     ******************************************************************
#
#                       "HOLL" menu
#
menubutton .menu.holl -text "HOLL  " -menu .menu.holl.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.holl.m
#
#                       "holl1" button
.menu.holl.m add command -label "holl1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e holl1.x }
#
#                       "holl2" button
.menu.holl.m add command -label "holl2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e holl2.x }
#
#                       "holl3" button
.menu.holl.m add command -label "holl3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e holl3.x }
#
#                       "holl4" button
.menu.holl.m add command -label "holl4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e holl4.x }
#
#                       "holl5" button
.menu.holl.m add command -label "holl5" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e holl5.x }
#
#                       "holl6" button
.menu.holl.m add command -label "holl6" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e holl6.x }
#
#                       "holl7" button
.menu.holl.m add command -label "holl7" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e holl7.x }
#
#                       "holl8" button
.menu.holl.m add command -label "holl8" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e holl8.x }
#
#                       "holl9" button
.menu.holl.m add command -label "holl9" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e holl9.x }
#
#                       "holl10" button
.menu.holl.m add command -label "holl10" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e holl10.x }
#
#                       "holl11" button
.menu.holl.m add command -label "holl11" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e holl11.x }
#
#                       "holl12" button
.menu.holl.m add command -label "holl12" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e holl12.x }
#
#     ******************************************************************
#
#                       "INT" menu
#
menubutton .menu.int -text "INT  " -menu .menu.int.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.int.m
#
#                       "int1" button
.menu.int.m add command -label "int1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e int1.x }
#
#                       "int2" button
.menu.int.m add command -label "int2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e int2.x }
#
#                       "int3" button
.menu.int.m add command -label "int3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e int3.x }
#
#                       "int4" button
.menu.int.m add command -label "int4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e int4.x }
#
#                       "int5" button
.menu.int.m add command -label "int5" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e int5.x }
#
#                       "int6" button
.menu.int.m add command -label "int6" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e int6.x }
#
#     ******************************************************************
#
#                       "INTARY" menu
#
menubutton .menu.intary -text "INTARY  " -menu .menu.intary.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.intary.m
#
#                       "intary1" button
.menu.intary.m add command -label "intary1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e intary1.x }
#
#     ******************************************************************
#
#                       "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 }
#
#     ******************************************************************
#
#                       "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 }
#
#     ******************************************************************
#
#                       "PROGRLANG" menu
#
menubutton .menu.progrlang -text "PROGRLANG  " -menu .menu.progrlang.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.progrlang.m
#
#                       "progrlang1" button
.menu.progrlang.m add command -label "progrlang1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e progrlang1.x }
#
#     ******************************************************************
#
#                       "REAL" menu
#
menubutton .menu.real -text "REAL  " -menu .menu.real.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.real.m
#
#                       "real1" button
.menu.real.m add command -label "real1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e real1.x }
#
#                       "real2" button
.menu.real.m add command -label "real2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e real2.x }
#
#                       "real3" button
.menu.real.m add command -label "real3" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e real3.x }
#
#                       "real4" button
.menu.real.m add command -label "real4" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e real4.x }
#
#                       "real5" button
.menu.real.m add command -label "real5" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e real5.x }
#
#                       "real6" button
.menu.real.m add command -label "real6" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e real6.x }
#
#                       "real7" button
.menu.real.m add command -label "real7" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e real7.x }
#
#                       "real8" button
.menu.real.m add command -label "real8" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e real8.x }
#
#                       "real9" button
.menu.real.m add command -label "real9" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e real9.x }
#
#                       "real10" button
.menu.real.m add command -label "real10" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e real10.x }
#
#                       "real11" button
.menu.real.m add command -label "real11" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e real11.x }
#
#     ******************************************************************
#
#                       "REALARY" menu
#
menubutton .menu.realary -text "REALARY  " -menu .menu.realary.m
#
#     ------------------------------------------------------------------
#
                        menu .menu.realary.m
#
#                       "realary1" button
.menu.realary.m add command -label "realary1" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e realary1.x }
#
#                       "realary2" button
.menu.realary.m add command -label "realary2" -command { \
exec xterm -rw -cr black -ms black -fg black -bg CadetBlue1 \
-sb -e realary2.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
#
#                       "CHAR" button
.menu.more.defs add command -label "CHAR" -command \
{ mkDialog .modal {-text \
{The CHAR menu invokes demonstrations of the PRL-PROGRLANG \
CHAR object subprograms.  The CHAR object is \
a string of any characters capable of representation in the processor. \
} -aspect 450 -justify left} {OK {}}
}
#                       "CHARARY" button
.menu.more.defs add command -label "CHARARY" -command \
{ mkDialog .modal {-text \
{The CHARARY menu invokes demonstrations of the PRL-PROGRLANG \
CHARARY object subprograms.  The CHARARY object is \
a non-empty sequence of CHAR objects. \
} -aspect 450 -justify left} {OK {}}
}
#                       "CMPLX" button
.menu.more.defs add command -label "CMPLX" -command \
{ mkDialog .modal {-text \
{The CMPLX menu invokes demonstrations of the PRL-PROGRLANG \
CMPLX object subprograms.  The CMPLX object is \
a processor approximation to the value of a complex number. \
} -aspect 450 -justify left} {OK {}}
}
#                       "DBL" button
.menu.more.defs add command -label "DBL" -command \
{ mkDialog .modal {-text \
{The DBL menu invokes demonstrations of the PRL-PROGRLANG \
DBL object subprograms.  The DBL object is \
a processor approximation of a real number with more precision than a REAL. \
} -aspect 450 -justify left} {OK {}}
}
#                       "HOLL" button
.menu.more.defs add command -label "HOLL" -command \
{ mkDialog .modal {-text \
{The HOLL menu invokes demonstrations of the PRL-PROGRLANG \
HOLL object subprograms.  The HOLL (Hollerith) object is \
a string of any characters capable of representation in the processor. \
} -aspect 450 -justify left} {OK {}}
}
#                       "INT" button
.menu.more.defs add command -label "INT" -command \
{ mkDialog .modal {-text \
{The INT menu invokes demonstrations of the PRL-PROGRLANG \
INT object subprograms.  The INT object is \
an exact representation of an integral integer value. \
} -aspect 450 -justify left} {OK {}}
}
#                       "INTARY" button
.menu.more.defs add command -label "INTARY" -command \
{ mkDialog .modal {-text \
{The INTARY menu invokes demonstrations of the PRL-PROGRLANG \
INTARY object subprograms.  The INTARY object is \
a non-empty sequence of INT objects. \
} -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-PROGRLANG \
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-PROGRLANG \
PROCESS object subprograms.  The PROCESS object is \
a single thread of control that executes within an address space. \
} -aspect 450 -justify left} {OK {}}
}
#                       "PROGRLANG" button
.menu.more.defs add command -label "PROGRLANG" -command \
{ mkDialog .modal {-text \
{The PROGRLANG menu invokes demonstrations of the PRL-PROGRLANG \
PROGRLANG object subprograms.  The PROGRLANG object is \
the parent object of all PRL-PROGRLANG library objects. \
} -aspect 450 -justify left} {OK {}}
}
#                       "REAL" button
.menu.more.defs add command -label "REAL" -command \
{ mkDialog .modal {-text \
{The REAL menu invokes demonstrations of the PRL-PROGRLANG \
REAL object subprograms.  The REAL object is \
a processor approximation to the value of a real number. \
} -aspect 450 -justify left} {OK {}}
}
#                       "REALARY" button
.menu.more.defs add command -label "REALARY" -command \
{ mkDialog .modal {-text \
{The REALARY menu invokes demonstrations of the PRL-PROGRLANG \
REALARY object subprograms.  The REALARY object is \
a non-empty sequence of REAL objects. \
} -aspect 450 -justify left} {OK {}}
}
#     ******************************************************************
#
#                       Pack menus
#
pack .menu.demo \
     .menu.char \
     .menu.charary \
     .menu.cmplx \
     .menu.dbl \
     .menu.holl \
     .menu.int \
     .menu.intary \
     .menu.prl \
     .menu.process \
     .menu.progrlang \
     .menu.real \
     .menu.realary \
     .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.char \
           .menu.charary \
           .menu.cmplx \
           .menu.dbl \
           .menu.holl \
           .menu.int \
           .menu.intary \
           .menu.prl \
           .menu.process \
           .menu.progrlang \
           .menu.real \
           .menu.realary \
           .menu.more
#
#     ******************************************************************
#
#                       Position a dialog box on the screen
#
proc dpos w {
    wm geometry $w +300+300
}
#
STOP_CAT
echo "  Generating =====> [ ./char1.f ]"
cat <<"STOP_CAT"> ././char1.f
C     PROGRAM CHAR1
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 CHAR_CVINT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CHAR object access program
      EXTERNAL CHAR_CVINT
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  3)
      PARAMETER (NVV103 =  5)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IVAL, TMP102, NCHAR, TMP103
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER STR1*6, TMP101*6
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV102(NVV102)
      INTEGER VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /-32768, 0, 32767/
C
      DATA VV103 /1, 99, -9, 0, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'char_cvint.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CHAR Object Demo Program #1'/
     * ' This program tests the CHAR object access program'/
     * ' CHAR_CVINT.'/
     * ' 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-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 CHAR_CVINT object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        IVAL = VV102(IVV102)
C
      DO 588 IVV103 = 1,NVV103
        NCHAR = VV103(IVV103)
C
C                       Convert an INT object to a CHAR object in base
C                       10 notation
      CALL CHAR_CVINT (STR1,IVAL,NCHAR)
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 (STR1 .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) STR1,IVAL,NCHAR
  502 FORMAT (A,I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              CHAR 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 =====> [ ./char10.f ]"
cat <<"STOP_CAT"> ././char10.f
C     PROGRAM CHAR10
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 CHAR_SCANBT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CHAR object access program
      EXTERNAL CHAR_SCANBT
      INTEGER  CHAR_SCANBT
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  4)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER XRETRN, TMP102
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER STR*3, TMP101*3
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*3 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'!  ', '  ~', '   ','???'/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'char_scanbt.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CHAR Object Demo Program #10'/
     * ' This program tests the CHAR object access program'/
     * ' CHAR_SCANBT.'/
     * ' 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-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 CHAR_SCANBT object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        STR = VV101(IVV101)
C
C                       Find location of rightmost blank in a CHAR
C                       object
      XRETRN = CHAR_SCANBT (STR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (XRETRN .NE. 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) STR,XRETRN
  502 FORMAT (A,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              CHAR Demo Program #10 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 =====> [ ./char11.f ]"
cat <<"STOP_CAT"> ././char11.f
C     PROGRAM CHAR11
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 CHAR_UPPER
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CHAR object access program
      EXTERNAL CHAR_UPPER
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  4)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER STR*1, TMP101*1
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*1 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'!', '~', 'z', 'Z'/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'char_upper.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CHAR Object Demo Program #11'/
     * ' This program tests the CHAR object access program'/
     * ' CHAR_UPPER.'/
     * ' 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-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 CHAR_UPPER object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        STR = VV101(IVV101)
C
C                       Change the case of a CHAR object to upper
      CALL CHAR_UPPER (STR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (STR .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) STR
  502 FORMAT (A)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              CHAR Demo Program #11 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 =====> [ ./char2.f ]"
cat <<"STOP_CAT"> ././char2.f
C     PROGRAM CHAR2
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 CHAR_CVINT8
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CHAR object access program
      EXTERNAL CHAR_CVINT8
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IVAL, TMP101
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER OSTRNG*11, TMP102*11
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 /-32768, 0, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'char_cvint8.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CHAR Object Demo Program #2'/
     * ' This program tests the CHAR object access program'/
     * ' CHAR_CVINT8.'/
     * ' 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-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 CHAR_CVINT8 object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        IVAL = VV101(IVV101)
C
C                       Convert an INT object to a CHAR object in base 8
C                       notation
      CALL CHAR_CVINT8 (IVAL,OSTRNG)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (OSTRNG .NE. 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) IVAL,OSTRNG
  502 FORMAT (I21,A)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              CHAR 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 =====> [ ./char3.f ]"
cat <<"STOP_CAT"> ././char3.f
C     PROGRAM CHAR3
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 CHAR_CVREAL
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CHAR object access program
      EXTERNAL CHAR_CVREAL
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
      PARAMETER (NVV102 =  8)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IPLACE, TMP102
C
C                       Real variables and arrays
      REAL    RNUM, TMP101
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER CNUM*80, TMP103*80, LPOWER*4, TMP104*4
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-3333.33, 0.0, 9999.99/
C
      DATA VV102 /-40, -1, 0, 100, 101, 140, -32768, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'char_cvreal.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CHAR Object Demo Program #3'/
     * ' This program tests the CHAR object access program'/
     * ' CHAR_CVREAL.'/
     * ' 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-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 CHAR_CVREAL object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        RNUM = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        IPLACE = VV102(IVV102)
C
C                       Convert a REAL object to a CHAR object
      CALL CHAR_CVREAL (RNUM,IPLACE,CNUM,LPOWER)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (CNUM .NE. TMP103 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (LPOWER .NE. TMP104 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) RNUM,IPLACE,CNUM,LPOWER
  502 FORMAT (E15.7,I21,A,A)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              CHAR 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 =====> [ ./char4.f ]"
cat <<"STOP_CAT"> ././char4.f
C     PROGRAM CHAR4
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 CHAR_INDEXBL
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CHAR object access program
      EXTERNAL CHAR_INDEXBL
      INTEGER  CHAR_INDEXBL
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER XRETRN, TMP102
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER STR*1, TMP101*1
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*1 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'!', '~', ' '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'char_indexbl.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CHAR Object Demo Program #4'/
     * ' This program tests the CHAR object access program'/
     * ' CHAR_INDEXBL.'/
     * ' 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-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 CHAR_INDEXBL object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        STR = VV101(IVV101)
C
C                       Find location of leftmost non-blank in a CHAR
C                       object
      XRETRN = CHAR_INDEXBL (STR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (XRETRN .NE. 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) STR,XRETRN
  502 FORMAT (A,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              CHAR 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 =====> [ ./char5.f ]"
cat <<"STOP_CAT"> ././char5.f
C     PROGRAM CHAR5
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 CHAR_LENBT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CHAR object access program
      EXTERNAL CHAR_LENBT
      INTEGER  CHAR_LENBT
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER XRETRN, TMP102
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER STR*1, TMP101*1
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*1 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'!', '~', ' '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'char_lenbt.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CHAR Object Demo Program #5'/
     * ' This program tests the CHAR object access program'/
     * ' CHAR_LENBT.'/
     * ' 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-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 CHAR_LENBT object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        STR = VV101(IVV101)
C
C                       Get the length of a CHAR object excluding
C                       trailing blanks
      XRETRN = CHAR_LENBT (STR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (XRETRN .NE. 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) STR,XRETRN
  502 FORMAT (A,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              CHAR Demo Program #5 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./char6.f ]"
cat <<"STOP_CAT"> ././char6.f
C     PROGRAM CHAR6
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 CHAR_LOWER
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CHAR object access program
      EXTERNAL CHAR_LOWER
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  4)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER STR*1, TMP101*1
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*1 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'!', '~', 'Z', 'z'/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'char_lower.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CHAR Object Demo Program #6'/
     * ' This program tests the CHAR object access program'/
     * ' CHAR_LOWER.'/
     * ' 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-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 CHAR_LOWER object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        STR = VV101(IVV101)
C
C                       Change the case of a CHAR object to lower
      CALL CHAR_LOWER (STR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (STR .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) STR
  502 FORMAT (A)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              CHAR Demo Program #6 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./char7.f ]"
cat <<"STOP_CAT"> ././char7.f
C     PROGRAM CHAR7
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 CHAR_REMBE
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CHAR object access program
      EXTERNAL CHAR_REMBE
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  4)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER STR*3, TMP101*3
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*3 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /' ! ', '~  ', '  &', '   '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'char_rembe.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CHAR Object Demo Program #7'/
     * ' This program tests the CHAR object access program'/
     * ' CHAR_REMBE.'/
     * ' 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-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 CHAR_REMBE object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        STR = VV101(IVV101)
C
C                       Strip extraneous blanks from a CHAR object
      CALL CHAR_REMBE (STR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (STR .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) STR
  502 FORMAT (A)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              CHAR Demo Program #7 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 =====> [ ./char8.f ]"
cat <<"STOP_CAT"> ././char8.f
C     PROGRAM CHAR8
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 CHAR_REMBL
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CHAR object access program
      EXTERNAL CHAR_REMBL
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  4)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER STR*3, TMP101*3
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*3 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'!  ', '  ~', ' & ', '   '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'char_rembl.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CHAR Object Demo Program #8'/
     * ' This program tests the CHAR object access program'/
     * ' CHAR_REMBL.'/
     * ' 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-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 CHAR_REMBL object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        STR = VV101(IVV101)
C
C                       Strip leading blanks from a CHAR object
      CALL CHAR_REMBL (STR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (STR .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) STR
  502 FORMAT (A)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              CHAR Demo Program #8 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 =====> [ ./char9.f ]"
cat <<"STOP_CAT"> ././char9.f
C     PROGRAM CHAR9
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 CHAR_REMBT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CHAR object access program
      EXTERNAL CHAR_REMBT
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  4)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER STR*3, TMP101*3
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*3 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'  !', '~  ', ' & ', '   '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'char_rembt.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CHAR Object Demo Program #9'/
     * ' This program tests the CHAR object access program'/
     * ' CHAR_REMBT.'/
     * ' 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-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 CHAR_REMBT object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        STR = VV101(IVV101)
C
C                       Strip trailing blanks from a CHAR object
      CALL CHAR_REMBT (STR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (STR .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) STR
  502 FORMAT (A)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              CHAR Demo Program #9 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 =====> [ ./char_cvint.dat ]"
cat <<"STOP_CAT"> ././char_cvint.uuu
begin 660 ./char_cvint.dat
M*B`@("`@("`@("`@("`@("`@("`@+3,R-S8X("`@("`@("`@("`@("`@("`@
M("`Q"BTS,C<V."`@("`@("`@("`@("`@("TS,C<V."`@("`@("`@("`@("`@
M("`@("`Y.0H@("`@("`@("`@("`@("`@("`@("`M,S(W-C@@("`@("`@("`@
M("`@("`@("`@+3D*("`@("`@("`@("`@("`@("`@("`@+3,R-S8X("`@("`@
M("`@("`@("`@("`@("`P"B`@("`@("`@("`@("`@("`@("`@("TS,C<V."`@
M("`@("`@("`@("`@("`S,C<V-PHP("`@("`@("`@("`@("`@("`@("`@("`@
M(#`@("`@("`@("`@("`@("`@("`@(#$*,```````("`@("`@("`@("`@("`@
M("`@("`P("`@("`@("`@("`@("`@("`@(#DY"B`@("`@("`@("`@("`@("`@
M("`@("`@("`@,"`@("`@("`@("`@("`@("`@("`M.0H@("`@("`@("`@("`@
M("`@("`@("`@("`@(#`@("`@("`@("`@("`@("`@("`@(#`*("`@("`@("`@
M("`@("`@("`@("`@("`@("`P("`@("`@("`@("`@("`@(#,R-S8W"BH@("`@
M("`@("`@("`@("`@("`@("`S,C<V-R`@("`@("`@("`@("`@("`@("`@,0HS
M,C<V-P`@("`@("`@("`@("`@("`@,S(W-C<@("`@("`@("`@("`@("`@("`@
M.3D*("`@("`@("`@("`@("`@("`@("`@(#,R-S8W("`@("`@("`@("`@("`@
M("`@("TY"B`@("`@("`@("`@("`@("`@("`@("`S,C<V-R`@("`@("`@("`@
M("`@("`@("`@,`H@("`@("`@("`@("`@("`@("`@("`@,S(W-C<@("`@("`@
/("`@("`@("`@,S(W-C<*
`
end
STOP_CAT
echo "  Generating =====> [ ./char_cvint8.dat ]"
cat <<"STOP_CAT"> ././char_cvint8.uuu
begin 660 ./char_cvint8.dat
M("`@("`@("`@("`@("`@+3,R-S8X,S<W-S<W,#`P,#`*("`@("`@("`@("`@
M("`@("`@("`P,#`P,#`P,#`P,#`*("`@("`@("`@("`@("`@(#,R-S8W,#`P
),#`P-S<W-S<*
`
end
STOP_CAT
echo "  Generating =====> [ ./char_indexbl.dat ]"
cat <<"STOP_CAT"> ././char_indexbl.uuu
begin 660 ./char_indexbl.dat
M(2`@("`@("`@("`@("`@("`@("`@,0I^("`@("`@("`@("`@("`@("`@("`Q
8"B`@("`@("`@("`@("`@("`@("`@(#`*
`
end
STOP_CAT
echo "  Generating =====> [ ./char_lenbt.dat ]"
cat <<"STOP_CAT"> ././char_lenbt.uuu
begin 660 ./char_lenbt.dat
M(2`@("`@("`@("`@("`@("`@("`@,0I^("`@("`@("`@("`@("`@("`@("`Q
8"B`@("`@("`@("`@("`@("`@("`@(#`*
`
end
STOP_CAT
echo "  Generating =====> [ ./char_lower.dat ]"
cat <<"STOP_CAT"> ././char_lower.uuu
begin 660 ./char_lower.dat
((0I^"GH*>@H(
`
end
STOP_CAT
echo "  Generating =====> [ ./char_rembe.dat ]"
cat <<"STOP_CAT"> ././char_rembe.uuu
begin 660 ./char_rembe.dat
0("$@"GX@(`H@)@`*("`@"@@`
`
end
STOP_CAT
echo "  Generating =====> [ ./char_rembl.dat ]"
cat <<"STOP_CAT"> ././char_rembl.uuu
begin 660 ./char_rembl.dat
0(2`@"GX```HF`"`*("`@"@@`
`
end
STOP_CAT
echo "  Generating =====> [ ./char_rembt.dat ]"
cat <<"STOP_CAT"> ././char_rembt.uuu
begin 660 ./char_rembt.dat
0("`A"GX```H@)@`*````"@@`
`
end
STOP_CAT
echo "  Generating =====> [ ./char_scanbt.dat ]"
cat <<"STOP_CAT"> ././char_scanbt.uuu
begin 660 ./char_scanbt.dat
M(2`@("`@("`@("`@("`@("`@("`@("`S"B`@?B`@("`@("`@("`@("`@("`@
M("`@,@H@("`@("`@("`@("`@("`@("`@("`@(#,*/S\_("`@("`@("`@("`@
*("`@("`@("`P"B`@
`
end
STOP_CAT
echo "  Generating =====> [ ./char_upper.dat ]"
cat <<"STOP_CAT"> ././char_upper.uuu
begin 660 ./char_upper.dat
((0I^"EH*6@H(
`
end
STOP_CAT
echo "  Generating =====> [ ./charary1.f ]"
cat <<"STOP_CAT"> ././charary1.f
C     PROGRAM CHARARY1
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 CHARARY_LENG
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
      INTRINSIC CHAR
C
C                       CHARARY object access program
      EXTERNAL CHARARY_LENG
      INTEGER  CHARARY_LENG
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 = 3)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 2)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER XRETRN, TMP102
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER CHRARY(MX101)*1, TMP101(MX101)*1, NULL*1
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*2 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'! ', '~ ' ,'  '/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'charary_leng.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CHARARY Object Demo Program #1'/
     * ' This program tests the CHARARY object access program'/
     * ' CHARARY_LENG.'/
     * ' 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-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 CHARARY_LENG object access program
C
      NULL = CHAR (0)
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        CHRARY(1) = VV101(IVV101)
        CHRARY(2) = NULL
C
C                       Get the length of a CHARARY object
      XRETRN = CHARARY_LENG (CHRARY)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (XRETRN .NE. 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) CHRARY,XRETRN
  502 FORMAT (2A1,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              CHARARY 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 =====> [ ./charary2.f ]"
cat <<"STOP_CAT"> ././charary2.f
C     PROGRAM CHARARY2
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 CHARARY_CVINT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CHARARY object access program
      EXTERNAL CHARARY_CVINT
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
C
C                       Argument maximum array sizes
      PARAMETER (MX102 = 14)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IVAL, TMP101
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER CHRARY(MX102)*1, TMP102(MX102)*1
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 0, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'charary_cvint.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CHARARY Object Demo Program #2'/
     * ' This program tests the CHARARY object access program'/
     * ' CHARARY_CVINT.'/
     * ' 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-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 CHARARY_CVINT object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        IVAL = VV101(IVV101)
C
C                       Convert an INT object to a CHARARY object
      CALL CHARARY_CVINT (IVAL,CHRARY)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (CHRARY(1)  .NE. TMP102(1) .OR.
     *      CHRARY(14) .NE. TMP102(14) ) 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) IVAL,CHRARY
  502 FORMAT (I21,14A1)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              CHARARY 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 =====> [ ./charary_cvint.dat ]"
cat <<"STOP_CAT"> ././charary_cvint.uuu
begin 660 ./charary_cvint.dat
M("`@("`@("`@("`@("`@+3,R-S8X+3,R-S8X`"`@("`@("`*("`@("`@("`@
M("`@("`@("`@("`P,``@("`@("`@("`@("`*("`@("`@("`@("`@("`@(#,R
2-S8W,S(W-C<`("`@("`@("`*
`
end
STOP_CAT
echo "  Generating =====> [ ./charary_leng.dat ]"
cat <<"STOP_CAT"> ././charary_leng.uuu
begin 660 ./charary_leng.dat
M(0`@("`@("`@("`@("`@("`@("`@(#$*?@`@("`@("`@("`@("`@("`@("`@
;(#$*(``@("`@("`@("`@("`@("`@("`@(#$*
`
end
STOP_CAT
echo "  Generating =====> [ ./cmplx1.f ]"
cat <<"STOP_CAT"> ././cmplx1.f
C     PROGRAM CMPLX1
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 CMPLX_DIF0
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CMPLX object access program
      EXTERNAL CMPLX_DIF0
      COMPLEX  CMPLX_DIF0
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
      COMPLEX C1, TMP101, C2, TMP102, XRETRN, TMP103
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
      COMPLEX VV101(NVV101)
      COMPLEX VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /(-33.,-33.), (999.,999.)/
C
      DATA VV102 /(-33.,-33.), (999.,999.)/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'cmplx_dif0.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CMPLX Object Demo Program #1'/
     * ' This program tests the CMPLX object access program'/
     * ' CMPLX_DIF0.'/
     * ' 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-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 CMPLX_DIF0 object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        C1 = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        C2 = VV102(IVV102)
C
C                       Subtract two CMPLX objects using tolerance
C                       checking
      XRETRN = CMPLX_DIF0 (C1,C2)
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. CMPLX_IDIF0(XRETRN ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) C1,C2,XRETRN
  502 FORMAT (2E15.7,2E15.7,2E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              CMPLX 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 =====> [ ./cmplx2.f ]"
cat <<"STOP_CAT"> ././cmplx2.f
C     PROGRAM CMPLX2
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 CMPLX_IDIF0
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
      COMPLEX C1, TMP101, C2, TMP102
C
C                       Logical variables and arrays
      LOGICAL XRETRN, TMP103
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
      COMPLEX VV101(NVV101)
      COMPLEX VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /(-33.,-33.), (999.,999.)/
C
      DATA VV102 /(-33.,-33.), (999.,999.)/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'cmplx_idif0.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CMPLX Object Demo Program #2'/
     * ' This program tests the CMPLX object access program'/
     * ' CMPLX_IDIF0.'/
     * ' 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-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 CMPLX_IDIF0 object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        C1 = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        C2 = VV102(IVV102)
C
C                       Return .TRUE. if CMPLX difference is less than
C                       or equal to a tolerance
      XRETRN = CMPLX_IDIF0 (C1,C2)
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 (XRETRN .NEQV. 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) C1,C2,XRETRN
  502 FORMAT (2E15.7,2E15.7,L7)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              CMPLX 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 =====> [ ./cmplx3.f ]"
cat <<"STOP_CAT"> ././cmplx3.f
C     PROGRAM CMPLX3
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 CMPLX_XCHG
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       CMPLX object access program
      EXTERNAL CMPLX_XCHG
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV103 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
      COMPLEX CSWAP1, TMP101, CSWAP2, TMP103
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
      COMPLEX VV101(NVV101)
      COMPLEX VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /(-33.,-33.), (999.,999.)/
C
      DATA VV103 /(-33.,-33.), (999.,999.)/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'cmplx_xchg.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              CMPLX Object Demo Program #3'/
     * ' This program tests the CMPLX object access program'/
     * ' CMPLX_XCHG.'/
     * ' 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-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 CMPLX_XCHG object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        CSWAP1 = VV101(IVV101)
C
      DO 588 IVV103 = 1,NVV103
        CSWAP2 = VV103(IVV103)
C
C                       Swap two CMPLX objects
      CALL CMPLX_XCHG (CSWAP1,CSWAP2)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP103
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. CMPLX_IDIF0(CSWAP1 ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. CMPLX_IDIF0(CSWAP2 ,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) CSWAP1,CSWAP2
  502 FORMAT (2E15.7,2E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              CMPLX 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 =====> [ ./cmplx_dif0.dat ]"
cat <<"STOP_CAT"> ././cmplx_dif0.uuu
begin 660 ./cmplx_dif0.dat
M("`M+C,S,#`P,#!%*S`R("`M+C,S,#`P,#!%*S`R("`M+C,S,#`P,#!%*S`R
M("`M+C,S,#`P,#!%*S`R("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P
M"B`@+2XS,S`P,#`P12LP,B`@+2XS,S`P,#`P12LP,B`@("XY.3DP,#`P12LP
M,R`@("XY.3DP,#`P12LP,R`@+2XQ,#,R,#`P12LP-"`@+2XQ,#,R,#`P12LP
M-`H@("`N.3DY,#`P,$4K,#,@("`N.3DY,#`P,$4K,#,@("TN,S,P,#`P,$4K
M,#(@("TN,S,P,#`P,$4K,#(@("`N,3`S,C`P,$4K,#0@("`N,3`S,C`P,$4K
M,#0*("`@+CDY.3`P,#!%*S`S("`@+CDY.3`P,#!%*S`S("`@+CDY.3`P,#!%
M*S`S("`@+CDY.3`P,#!%*S`S("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%
$*S`P"B`@
`
end
STOP_CAT
echo "  Generating =====> [ ./cmplx_idif0.dat ]"
cat <<"STOP_CAT"> ././cmplx_idif0.uuu
begin 660 ./cmplx_idif0.dat
M("`M+C,S,#`P,#!%*S`R("`M+C,S,#`P,#!%*S`R("`M+C,S,#`P,#!%*S`R
M("`M+C,S,#`P,#!%*S`R("`@("`@5`H@("TN,S,P,#`P,$4K,#(@("TN,S,P
M,#`P,$4K,#(@("`N.3DY,#`P,$4K,#,@("`N.3DY,#`P,$4K,#,@("`@("!&
M"B`@("XY.3DP,#`P12LP,R`@("XY.3DP,#`P12LP,R`@+2XS,S`P,#`P12LP
M,B`@+2XS,S`P,#`P12LP,B`@("`@($8*("`@+CDY.3`P,#!%*S`S("`@+CDY
M.3`P,#!%*S`S("`@+CDY.3`P,#!%*S`S("`@+CDY.3`P,#!%*S`S("`@("`@
"5`HP
`
end
STOP_CAT
echo "  Generating =====> [ ./cmplx_xchg.dat ]"
cat <<"STOP_CAT"> ././cmplx_xchg.uuu
begin 660 ./cmplx_xchg.dat
M("`M+C,S,#`P,#!%*S`R("`M+C,S,#`P,#!%*S`R("`M+C,S,#`P,#!%*S`R
M("`M+C,S,#`P,#!%*S`R"B`@("XY.3DP,#`P12LP,R`@("XY.3DP,#`P12LP
M,R`@+2XS,S`P,#`P12LP,B`@+2XS,S`P,#`P12LP,@H@("TN,S,P,#`P,$4K
M,#(@("TN,S,P,#`P,$4K,#(@("`N.3DY,#`P,$4K,#,@("`N.3DY,#`P,$4K
M,#,*("`@+CDY.3`P,#!%*S`S("`@+CDY.3`P,#!%*S`S("`M+C,S,#`P,#!%
3*S`R("`M+C,S,#`P,#!%*S`R"B`@
`
end
STOP_CAT
echo "  Generating =====> [ ./dbl1.f ]"
cat <<"STOP_CAT"> ././dbl1.f
C     PROGRAM DBL1
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 DBL_DIF0
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       DBL object access program
      EXTERNAL DBL_DIF0
      DOUBLE PRECISION DBL_DIF0
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
      PARAMETER (NVV103 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'DBL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
      DOUBLE PRECISION TMP101, D1, TMP102, D2, TMP103, XRETRN, TMP104
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
      DOUBLE PRECISION VV101(NVV101)
      DOUBLE PRECISION VV102(NVV102)
      DOUBLE PRECISION VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /0.0D0, 0.1D0/
C
      DATA VV102 /-3333.33D0, 9999.99D0/
C
      DATA VV103 /-3333.33D0, 9999.99D0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'dbl_dif0.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              DBL Object Demo Program #1'/
     * ' This program tests the DBL object access program'/
     * ' DBL_DIF0.'/
     * ' 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-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 DBL_DIF0 object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        DTOL = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        D1 = VV102(IVV102)
C
      DO 587 IVV103 = 1,NVV103
        D2 = VV103(IVV103)
C
C                       Subtract two DBL objects using tolerance
C                       checking
      XRETRN = DBL_DIF0 (D1,D2)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. DBL_IDIF0(XRETRN ,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) DTOL,D1,D2,XRETRN
  502 FORMAT (D15.7,D15.7,D15.7,D15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  587 CONTINUE
  588 CONTINUE
  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 (/
     * '              DBL 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 =====> [ ./dbl2.f ]"
cat <<"STOP_CAT"> ././dbl2.f
C     PROGRAM DBL2
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 DBL_GETBIG
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       DBL object access program
      EXTERNAL DBL_GETBIG
      DOUBLE PRECISION DBL_GETBIG
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'DBL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
      DOUBLE PRECISION TMP101, XRETRN, TMP102
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
      DOUBLE PRECISION VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /1.0D15, 9999.99D0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'dbl_getbig.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              DBL Object Demo Program #2'/
     * ' This program tests the DBL object access program'/
     * ' DBL_GETBIG.'/
     * ' 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-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 DBL_GETBIG object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        DIGNUM = VV101(IVV101)
C
C                       Store large value in a DBL object
      XRETRN = DBL_GETBIG ()
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. DBL_IDIF0(XRETRN ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) DIGNUM,XRETRN
  502 FORMAT (D15.7,D15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              DBL 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 =====> [ ./dbl3.f ]"
cat <<"STOP_CAT"> ././dbl3.f
C     PROGRAM DBL3
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 DBL_GETMPM
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       DBL object access program
      EXTERNAL DBL_GETMPM
      DOUBLE PRECISION DBL_GETMPM
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'DBL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
      DOUBLE PRECISION TMP101, XRETRN, TMP102
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
      DOUBLE PRECISION VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /1.0D0, 1.1D0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'dbl_getmpm.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              DBL Object Demo Program #3'/
     * ' This program tests the DBL object access program'/
     * ' DBL_GETMPM.'/
     * ' 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-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 DBL_GETMPM object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        D1001 = VV101(IVV101)
C
C                       Get value of DBL machine precision multiplier
      XRETRN = DBL_GETMPM ()
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. DBL_IDIF0(XRETRN ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) D1001,XRETRN
  502 FORMAT (D15.7,D15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              DBL 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 =====> [ ./dbl4.f ]"
cat <<"STOP_CAT"> ././dbl4.f
C     PROGRAM DBL4
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 DBL_GETPI
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       DBL object access program
      EXTERNAL DBL_GETPI
      DOUBLE PRECISION DBL_GETPI
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  1)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'DBL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
      DOUBLE PRECISION TMP101, XRETRN, TMP102
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
      DOUBLE PRECISION VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /3.141592D0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'dbl_getpi.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              DBL Object Demo Program #4'/
     * ' This program tests the DBL object access program'/
     * ' DBL_GETPI.'/
     * ' 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-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 DBL_GETPI object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        DPI = VV101(IVV101)
C
C                       Store value of pi in a DBL objec
      XRETRN = DBL_GETPI ()
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. DBL_IDIF0(XRETRN ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) DPI,XRETRN
  502 FORMAT (D15.7,D15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              DBL 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 =====> [ ./dbl5.f ]"
cat <<"STOP_CAT"> ././dbl5.f
C     PROGRAM DBL5
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 DBL_GETTOL
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       DBL object access program
      EXTERNAL DBL_GETTOL
      DOUBLE PRECISION DBL_GETTOL
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'DBL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
      DOUBLE PRECISION TMP101, XRETRN, TMP102
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
      DOUBLE PRECISION VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /0.0D0, 0.1D0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'dbl_gettol.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              DBL Object Demo Program #5'/
     * ' This program tests the DBL object access program'/
     * ' DBL_GETTOL.'/
     * ' 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-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 DBL_GETTOL object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        DTOL = VV101(IVV101)
C
C                       Get DBL subtraction tolerance
      XRETRN = DBL_GETTOL ()
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. DBL_IDIF0(XRETRN ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) DTOL,XRETRN
  502 FORMAT (D15.7,D15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              DBL Demo Program #5 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./dbl6.f ]"
cat <<"STOP_CAT"> ././dbl6.f
C     PROGRAM DBL6
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 DBL_IDIF0
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
      PARAMETER (NVV103 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'DBL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
      DOUBLE PRECISION TMP101, D1, TMP102, D2, TMP103
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
      LOGICAL XRETRN, TMP104
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
      DOUBLE PRECISION VV101(NVV101)
      DOUBLE PRECISION VV102(NVV102)
      DOUBLE PRECISION VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /0.0D0, 0.1D0/
C
      DATA VV102 /-3333.33D0, 9999.99D0/
C
      DATA VV103 /-3333.33D0, 9999.99D0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'dbl_idif0.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              DBL Object Demo Program #6'/
     * ' This program tests the DBL object access program'/
     * ' DBL_IDIF0.'/
     * ' 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-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 DBL_IDIF0 object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        DTOL = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        D1 = VV102(IVV102)
C
      DO 587 IVV103 = 1,NVV103
        D2 = VV103(IVV103)
C
C                       Return .TRUE. if DBL difference is less than or
C                       equal to a tolerance
      XRETRN = DBL_IDIF0 (D1,D2)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (XRETRN .NEQV. 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) DTOL,D1,D2,XRETRN
  502 FORMAT (D15.7,D15.7,D15.7,L7)
  503 CONTINUE
C
C                       Repeat for next variable value
  587 CONTINUE
  588 CONTINUE
  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 (/
     * '              DBL Demo Program #6 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./dbl7.f ]"
cat <<"STOP_CAT"> ././dbl7.f
C     PROGRAM DBL7
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 DBL_SETMPM
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       DBL object access program
      EXTERNAL DBL_SETMPM
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'DBL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
      DOUBLE PRECISION TMP101, DMPM, TMP102
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
      DOUBLE PRECISION VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /-3333.33D0, 9999.99D0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'dbl_setmpm.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              DBL Object Demo Program #7'/
     * ' This program tests the DBL object access program'/
     * ' DBL_SETMPM.'/
     * ' 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-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 DBL_SETMPM object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        DMPM = VV102(IVV102)
C
C                       Set DBL machine precision multiplier
      CALL DBL_SETMPM (DMPM)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. DBL_IDIF0(D1001 ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) D1001,DMPM
  502 FORMAT (D15.7,D15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              DBL Demo Program #7 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 =====> [ ./dbl8.f ]"
cat <<"STOP_CAT"> ././dbl8.f
C     PROGRAM DBL8
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 DBL_SETTOL
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, 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 DTOLL
      PARAMETER (DTOLL=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'DBL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
      DOUBLE PRECISION TMP101, DTOLER, TMP102, DSAV
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
      DOUBLE PRECISION VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /-3333.33D0, 9999.99D0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 (DTOLL)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'dbl_settol.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              DBL Object Demo Program #8'/
     * ' This program tests the DBL object access program'/
     * ' DBL_SETTOL.'/
     * ' 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-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 DBL_SETTOL object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        DTOLER = VV102(IVV102)
C
C                       Set DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Reset good subtraction tolerance
        DSAV = DTOL
        CALL DBL_SETTOL (DTOLL)
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. DBL_IDIF0(DSAV ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) DTOL,DTOLER
  502 FORMAT (D15.7,D15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              DBL Demo Program #8 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 =====> [ ./dbl9.f ]"
cat <<"STOP_CAT"> ././dbl9.f
C     PROGRAM DBL9
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 DBL_XCHG
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       DBL object access program
      EXTERNAL DBL_XCHG
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV103 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
      DOUBLE PRECISION DSWAP1, TMP101, DSWAP2, TMP103
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
      DOUBLE PRECISION VV101(NVV101)
      DOUBLE PRECISION VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-3333.33D0, 9999.99D0/
C
      DATA VV103 /-3333.33D0, 9999.99D0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'dbl_xchg.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              DBL Object Demo Program #9'/
     * ' This program tests the DBL object access program'/
     * ' DBL_XCHG.'/
     * ' 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-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 DBL_XCHG object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        DSWAP1 = VV101(IVV101)
C
      DO 588 IVV103 = 1,NVV103
        DSWAP2 = VV103(IVV103)
C
C                       Swap two DBL objects
      CALL DBL_XCHG (DSWAP1,DSWAP2)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP103
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. DBL_IDIF0(DSWAP1 ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. DBL_IDIF0(DSWAP2 ,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) DSWAP1,DSWAP2
  502 FORMAT (D15.7,D15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              DBL Demo Program #9 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 =====> [ ./dbl_dif0.dat ]"
cat <<"STOP_CAT"> ././dbl_dif0.uuu
begin 660 ./dbl_dif0.dat
M("`@+C`P,#`P,#!%*S`P("`M+C,S,S,S,S!%*S`T("`M+C,S,S,S,S!%*S`T
M("`@+C`P,#`P,#!%*S`P"B`@("XP,#`P,#`P12LP,"`@+2XS,S,S,S,P12LP
M-"`@("XY.3DY.3DP12LP-"`@+2XQ,S,S,S,R12LP-0H@("`N,#`P,#`P,$4K
M,#`@("`N.3DY.3DY,$4K,#0@("TN,S,S,S,S,$4K,#0@("`N,3,S,S,S,D4K
M,#4*("`@+C`P,#`P,#!%*S`P("`@+CDY.3DY.3!%*S`T("`@+CDY.3DY.3!%
M*S`T("`@+C`P,#`P,#!%*S`P"B`@("XQ,#`P,#`P12LP,"`@+2XS,S,S,S,P
M12LP-"`@+2XS,S,S,S,P12LP-"`@("XP,#`P,#`P12LP,`H@("`N,3`P,#`P
M,$4K,#`@("TN,S,S,S,S,$4K,#0@("`N.3DY.3DY,$4K,#0@("TN,3,S,S,S
M,D4K,#4*("`@+C$P,#`P,#!%*S`P("`@+CDY.3DY.3!%*S`T("`M+C,S,S,S
M,S!%*S`T("`@+C$S,S,S,S)%*S`U"B`@("XQ,#`P,#`P12LP,"`@("XY.3DY
F.3DP12LP-"`@("XY.3DY.3DP12LP-"`@("XP,#`P,#`P12LP,`H@
`
end
STOP_CAT
echo "  Generating =====> [ ./dbl_getbig.dat ]"
cat <<"STOP_CAT"> ././dbl_getbig.uuu
begin 660 ./dbl_getbig.dat
M("`@+C$P,#`P,#!%*S$V("`@+C$P,#`P,#!%*S$V"B`@("XY.3DY.3DP12LP
1-"`@("XY.3DY.3DP12LP-`H@
`
end
STOP_CAT
echo "  Generating =====> [ ./dbl_getmpm.dat ]"
cat <<"STOP_CAT"> ././dbl_getmpm.uuu
begin 660 ./dbl_getmpm.dat
M("`@+C$P,#`P,#!%*S`Q("`@+C$P,#`P,#!%*S`Q"B`@("XQ,3`P,#`P12LP
1,2`@("XQ,3`P,#`P12LP,0H@
`
end
STOP_CAT
echo "  Generating =====> [ ./dbl_getpi.dat ]"
cat <<"STOP_CAT"> ././dbl_getpi.uuu
begin 660 ./dbl_getpi.dat
?("`@+C,Q-#$U.3)%*S`Q("`@+C,Q-#$U.3)%*S`Q"F`\
`
end
STOP_CAT
echo "  Generating =====> [ ./dbl_gettol.dat ]"
cat <<"STOP_CAT"> ././dbl_gettol.uuu
begin 660 ./dbl_gettol.dat
M("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P"B`@("XQ,#`P,#`P12LP
1,"`@("XQ,#`P,#`P12LP,`H@
`
end
STOP_CAT
echo "  Generating =====> [ ./dbl_idif0.dat ]"
cat <<"STOP_CAT"> ././dbl_idif0.uuu
begin 660 ./dbl_idif0.dat
M("`@+C`P,#`P,#!%*S`P("`M+C,S,S,S,S!%*S`T("`M+C,S,S,S,S!%*S`T
M("`@("`@5`H@("`N,#`P,#`P,$4K,#`@("TN,S,S,S,S,$4K,#0@("`N.3DY
M.3DY,$4K,#0@("`@("!&"B`@("XP,#`P,#`P12LP,"`@("XY.3DY.3DP12LP
M-"`@+2XS,S,S,S,P12LP-"`@("`@($8*("`@+C`P,#`P,#!%*S`P("`@+CDY
M.3DY.3!%*S`T("`@+CDY.3DY.3!%*S`T("`@("`@5`H@("`N,3`P,#`P,$4K
M,#`@("TN,S,S,S,S,$4K,#0@("TN,S,S,S,S,$4K,#0@("`@("!4"B`@("XQ
M,#`P,#`P12LP,"`@+2XS,S,S,S,P12LP-"`@("XY.3DY.3DP12LP-"`@("`@
M($8*("`@+C$P,#`P,#!%*S`P("`@+CDY.3DY.3!%*S`T("`M+C,S,S,S,S!%
M*S`T("`@("`@1@H@("`N,3`P,#`P,$4K,#`@("`N.3DY.3DY,$4K,#0@("`N
3.3DY.3DY,$4K,#0@("`@("!4"C`P
`
end
STOP_CAT
echo "  Generating =====> [ ./dbl_setmpm.dat ]"
cat <<"STOP_CAT"> ././dbl_setmpm.uuu
begin 660 ./dbl_setmpm.dat
M("`M+C,S,S,S,S!%*S`T("`M+C,S,S,S,S!%*S`T"B`@("XY.3DY.3DP12LP
1-"`@("XY.3DY.3DP12LP-`HM
`
end
STOP_CAT
echo "  Generating =====> [ ./dbl_settol.dat ]"
cat <<"STOP_CAT"> ././dbl_settol.uuu
begin 660 ./dbl_settol.dat
M("`M+C,S,S,S,S!%*S`T("`M+C,S,S,S,S!%*S`T"B`@("XY.3DY.3DP12LP
1-"`@("XY.3DY.3DP12LP-`HM
`
end
STOP_CAT
echo "  Generating =====> [ ./dbl_xchg.dat ]"
cat <<"STOP_CAT"> ././dbl_xchg.uuu
begin 660 ./dbl_xchg.dat
M("`M+C,S,S,S,S!%*S`T("`M+C,S,S,S,S!%*S`T"B`@("XY.3DY.3DP12LP
M-"`@+2XS,S,S,S,P12LP-`H@("TN,S,S,S,S,$4K,#0@("`N.3DY.3DY,$4K
B,#0*("`@+CDY.3DY.3!%*S`T("`M+C,S,S,S,S!%*S`T"B`N
`
end
STOP_CAT
echo "  Generating =====> [ ./holl1.f ]"
cat <<"STOP_CAT"> ././holl1.f
C     PROGRAM HOLL1
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 HOLL_GETBYT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       HOLL object access program
      EXTERNAL HOLL_GETBYT
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  4)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 1)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IHOLLR(MX101), TMP101(MX101), NPOS, TMP102, IEXTRC, TMP103
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 32767/
C
      DATA VV102 /-4, 0, 1, 4/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'holl_getbyt.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              HOLL Object Demo Program #1'/
     * ' This program tests the HOLL object access program'/
     * ' HOLL_GETBYT.'/
     * ' 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-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 HOLL_GETBYT object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        IHOLLR(1) = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        NPOS = VV102(IVV102)
C
C                       Extract a byte from a HOLL object
      CALL HOLL_GETBYT (IHOLLR,NPOS,IEXTRC)
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 (IEXTRC .NE. TMP103 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) IHOLLR,NPOS,IEXTRC
  502 FORMAT (I21,I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              HOLL 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 =====> [ ./holl10.f ]"
cat <<"STOP_CAT"> ././holl10.f
C     PROGRAM HOLL10
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 HOLL_COPY
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       HOLL object access program
      EXTERNAL HOLL_COPY
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 1)
      PARAMETER (MX102 = 1)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER INHOLL(MX101), TMP101(MX101), IUHOLL(MX102), TMP102(MX102)
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'holl_copy.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              HOLL Object Demo Program #10'/
     * ' This program tests the HOLL object access program'/
     * ' HOLL_COPY.'/
     * ' 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-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 HOLL_COPY object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        INHOLL(1) = VV101(IVV101)
C
C                       Copy one HOLL object to another
      CALL HOLL_COPY (INHOLL,IUHOLL)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (IUHOLL(1) .NE. TMP102(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) INHOLL,IUHOLL
  502 FORMAT (I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              HOLL Demo Program #10 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 =====> [ ./holl11.f ]"
cat <<"STOP_CAT"> ././holl11.f
C     PROGRAM HOLL11
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 HOLL_REMBL
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       HOLL object access program
      EXTERNAL HOLL_REMBL
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 1)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IHOLLR(MX101), TMP101(MX101)
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'holl_rembl.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              HOLL Object Demo Program #11'/
     * ' This program tests the HOLL object access program'/
     * ' HOLL_REMBL.'/
     * ' 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-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 HOLL_REMBL object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        IHOLLR(1) = VV101(IVV101)
C
C                       Strip leading blanks from a HOLL object
      CALL HOLL_REMBL (IHOLLR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (IHOLLR(1) .NE. TMP101(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) IHOLLR
  502 FORMAT (I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              HOLL Demo Program #11 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 =====> [ ./holl12.f ]"
cat <<"STOP_CAT"> ././holl12.f
C     PROGRAM HOLL12
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 HOLL_REMBT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       HOLL object access program
      EXTERNAL HOLL_REMBT
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 1)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IHOLLR(MX101), TMP101(MX101)
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'holl_rembt.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              HOLL Object Demo Program #12'/
     * ' This program tests the HOLL object access program'/
     * ' HOLL_REMBT.'/
     * ' 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-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 HOLL_REMBT object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        IHOLLR(1) = VV101(IVV101)
C
C                       Strip trailing blanks from a HOLL object
      CALL HOLL_REMBT (IHOLLR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (IHOLLR(1) .NE. TMP101(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) IHOLLR
  502 FORMAT (I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              HOLL Demo Program #12 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 =====> [ ./holl2.f ]"
cat <<"STOP_CAT"> ././holl2.f
C     PROGRAM HOLL2
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 HOLL_LENG
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       HOLL object access program
      EXTERNAL HOLL_LENG
      INTEGER  HOLL_LENG
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 1)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IHOLLR(MX101), TMP101(MX101), XRETRN, TMP102
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'holl_leng.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              HOLL Object Demo Program #2'/
     * ' This program tests the HOLL object access program'/
     * ' HOLL_LENG.'/
     * ' 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-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 HOLL_LENG object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        IHOLLR(1) = VV101(IVV101)
C
C                       Find the length of a HOLL object
      XRETRN = HOLL_LENG (IHOLLR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (XRETRN .NE. 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) IHOLLR,XRETRN
  502 FORMAT (I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              HOLL 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 =====> [ ./holl3.f ]"
cat <<"STOP_CAT"> ././holl3.f
C     PROGRAM HOLL3
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 HOLL_CVCHAR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       HOLL object access program
      EXTERNAL HOLL_CVCHAR
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  2)
      PARAMETER (NVV103 =  5)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 1)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IHOLLR(MX101), TMP101(MX101), NWORD, TMP103
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER CHRSRC*1, TMP102*1
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*1 VV102(NVV102)
      INTEGER VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /'!', '~'/
C
      DATA VV103 /1, 3, -32768, 0, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'holl_cvchar.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              HOLL Object Demo Program #3'/
     * ' This program tests the HOLL object access program'/
     * ' HOLL_CVCHAR.'/
     * ' 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-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 HOLL_CVCHAR object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        CHRSRC = VV102(IVV102)
C
      DO 588 IVV103 = 1,NVV103
        NWORD = VV103(IVV103)
C
C                       Convert a CHAR object to a HOLL object
      CALL HOLL_CVCHAR (IHOLLR,CHRSRC,NWORD)
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 (IHOLLR(1) .NE. TMP101(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) IHOLLR,CHRSRC,NWORD
  502 FORMAT (I21,A,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              HOLL 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 =====> [ ./holl4.f ]"
cat <<"STOP_CAT"> ././holl4.f
C     PROGRAM HOLL4
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 HOLL_2CHAR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       HOLL object access program
      EXTERNAL HOLL_2CHAR
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, 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 (NVV103 =  4)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 1)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IHOLLR(MX101), TMP101(MX101), NWORD, TMP103
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER CHRDST*1, TMP102*1
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
      INTEGER VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 0, 32767/
C
      DATA VV103 /1, 32767, 0, -32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'holl_2char.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              HOLL Object Demo Program #4'/
     * ' This program tests the HOLL object access program'/
     * ' HOLL_2CHAR.'/
     * ' 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-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 HOLL_2CHAR object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        IHOLLR(1) = VV101(IVV101)
C
      DO 588 IVV103 = 1,NVV103
        NWORD = VV103(IVV103)
C
C                       Convert a HOLL object to a CHAR object
      CALL HOLL_2CHAR (IHOLLR,CHRDST,NWORD)
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 (CHRDST .NE. 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) IHOLLR,CHRDST,NWORD
  502 FORMAT (I21,A,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              HOLL 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 =====> [ ./holl5.f ]"
cat <<"STOP_CAT"> ././holl5.f
C     PROGRAM HOLL5
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 HOLL_SETBYT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       HOLL object access program
      EXTERNAL HOLL_SETBYT
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV103 =  4)
      PARAMETER (NVV104 =  2)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 1)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IHOLLR(MX101), TMP101(MX101), NPOS, TMP103, INSERT, TMP104
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
      INTEGER VV103(NVV103)
      INTEGER VV104(NVV104)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 32767/
C
      DATA VV103 /1, 4, -4, 0/
C
      DATA VV104 /0, 255/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'holl_setbyt.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              HOLL Object Demo Program #5'/
     * ' This program tests the HOLL object access program'/
     * ' HOLL_SETBYT.'/
     * ' 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-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 HOLL_SETBYT object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        IHOLLR(1) = VV101(IVV101)
C
      DO 588 IVV103 = 1,NVV103
        NPOS = VV103(IVV103)
C
      DO 587 IVV104 = 1,NVV104
        INSERT = VV104(IVV104)
C
C                       Insert a byte into a HOLL object
      CALL HOLL_SETBYT (IHOLLR,NPOS,INSERT)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP103,TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (IHOLLR(1) .NE. TMP101(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) IHOLLR,NPOS,INSERT
  502 FORMAT (I21,I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  587 CONTINUE
  588 CONTINUE
  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 (/
     * '              HOLL Demo Program #5 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./holl6.f ]"
cat <<"STOP_CAT"> ././holl6.f
C     PROGRAM HOLL6
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 HOLL_BYTE
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       HOLL object access program
      EXTERNAL HOLL_BYTE
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
      PARAMETER (NVV104 =  2)
      PARAMETER (NVV105 =  2)
C
C                       Argument maximum array sizes
      PARAMETER (MX102 = 1)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IHOLLR(MX102), TMP102(MX102), NPOS, TMP104, IEXIN, TMP105
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER OPTION*1, TMP101*1
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*1 VV101(NVV101)
      INTEGER VV102(NVV102)
      INTEGER VV104(NVV104)
      INTEGER VV105(NVV105)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'X','I'/
C
      DATA VV102 /-32768, 32767/
C
      DATA VV104 /1, 4/
C
      DATA VV105 /0, 255/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'holl_byte.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              HOLL Object Demo Program #6'/
     * ' This program tests the HOLL object access program'/
     * ' HOLL_BYTE.'/
     * ' 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-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 HOLL_BYTE object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        OPTION = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        IHOLLR(1) = VV102(IVV102)
C
      DO 587 IVV104 = 1,NVV104
        NPOS = VV104(IVV104)
C
      DO 586 IVV105 = 1,NVV105
        IEXIN = VV105(IVV105)
C
C                       Extract an byte from, or insert an byte to, a
C                       HOLL object
      CALL HOLL_BYTE (OPTION,IHOLLR,NPOS,IEXIN)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP104,TMP105
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (IHOLLR(1) .NE. TMP102(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (IEXIN .NE. TMP105 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) OPTION,IHOLLR,NPOS,IEXIN
  502 FORMAT (A,I21,I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  586 CONTINUE
  587 CONTINUE
  588 CONTINUE
  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 (/
     * '              HOLL Demo Program #6 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./holl7.f ]"
cat <<"STOP_CAT"> ././holl7.f
C     PROGRAM HOLL7
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 HOLL_CVCHARY
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       HOLL object access program
      EXTERNAL HOLL_CVCHARY
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 1)
      PARAMETER (MX102 = 1)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IHOLLR(MX102), TMP102(MX102)
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER CHRARY(MX101)*1, TMP101(MX101)*1
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*1 VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'!', '~'/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'holl_cvchary.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              HOLL Object Demo Program #7'/
     * ' This program tests the HOLL object access program'/
     * ' HOLL_CVCHARY.'/
     * ' 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-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 HOLL_CVCHARY object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        CHRARY(1) = VV101(IVV101)
C
C                       Convert a CHARARY object to a HOLL object
      CALL HOLL_CVCHARY (CHRARY,IHOLLR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (IHOLLR(1) .NE. TMP102(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) CHRARY,IHOLLR
  502 FORMAT (A,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              HOLL Demo Program #7 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 =====> [ ./holl8.f ]"
cat <<"STOP_CAT"> ././holl8.f
C     PROGRAM HOLL8
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 HOLL_2CHARY
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       HOLL object access program
      EXTERNAL HOLL_2CHARY
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 1)
      PARAMETER (MX102 = 1)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IHOLLR(MX101), TMP101(MX101)
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER CHRARY(MX102)*1, TMP102(MX102)*1
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'holl_2chary.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              HOLL Object Demo Program #8'/
     * ' This program tests the HOLL object access program'/
     * ' HOLL_2CHARY.'/
     * ' 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-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 HOLL_2CHARY object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        IHOLLR(1) = VV101(IVV101)
C
C                       Convert a HOLL object to a CHARARY object
      CALL HOLL_2CHARY (IHOLLR,CHRARY)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (CHRARY(1) .NE. TMP102(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) IHOLLR,CHRARY
  502 FORMAT (I21,A)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              HOLL Demo Program #8 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 =====> [ ./holl9.f ]"
cat <<"STOP_CAT"> ././holl9.f
C     PROGRAM HOLL9
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 HOLL_CVREAL
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       HOLL object access program
      EXTERNAL HOLL_CVREAL
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
      PARAMETER (NVV102 =  4)
C
C                       Argument maximum array sizes
      PARAMETER (MX102 = 1)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IOHOLL(MX102), TMP102(MX102)
C
C                       Real variables and arrays
      REAL    RVAL, TMP101
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-3333.33, 0.0, 9999.99/
C
      DATA VV102 /0, 32767, -32768, -1/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'holl_cvreal.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              HOLL Object Demo Program #9'/
     * ' This program tests the HOLL object access program'/
     * ' HOLL_CVREAL.'/
     * ' 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-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 HOLL_CVREAL object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        RVAL = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        IOHOLL(1) = VV102(IVV102)
C
C                       Convert a REAL object to a HOLL object
      CALL HOLL_CVREAL (RVAL,IOHOLL)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (IOHOLL(1) .NE. TMP102(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) RVAL,IOHOLL
  502 FORMAT (E15.7,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              HOLL Demo Program #9 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 =====> [ ./int1.f ]"
cat <<"STOP_CAT"> ././int1.f
C     PROGRAM INT1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program (INT_)IAND
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER ITEM, TMP101, JTEM, TMP102, XRETRN, TMP103
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 32767/
C
      DATA VV102 /-32768, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'int_iand.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              INT Object Demo Program #1'/
     * ' This program tests the INT object access program'/
     * ' IAND.'/
     * ' 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-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 IAND object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        ITEM = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        JTEM = VV102(IVV102)
C
C                       Logical 'and' of two INT objects
      XRETRN = IAND (ITEM,JTEM)
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 (XRETRN .NE. TMP103 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ITEM,JTEM,XRETRN
  502 FORMAT (I21,I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              INT Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./int2.f ]"
cat <<"STOP_CAT"> ././int2.f
C     PROGRAM INT2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program (INT_)IEOR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER ITEM, TMP101, JTEM, TMP102, XRETRN, TMP103
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 32767/
C
      DATA VV102 /-32768, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'int_ieor.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              INT Object Demo Program #2'/
     * ' This program tests the INT object access program'/
     * ' IEOR.'/
     * ' 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-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 IEOR object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        ITEM = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        JTEM = VV102(IVV102)
C
C                       Logical 'exclusive or' of two INT objects
      XRETRN = IEOR (ITEM,JTEM)
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 (XRETRN .NE. TMP103 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ITEM,JTEM,XRETRN
  502 FORMAT (I21,I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              INT Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./int3.f ]"
cat <<"STOP_CAT"> ././int3.f
C     PROGRAM INT3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program INT_CVSTRING
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       INT object access program
      EXTERNAL INT_CVSTRING
      INTEGER  INT_CVSTRING
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  4)
      PARAMETER (NVV102 =  5)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER NSEQ, TMP102, ISTAT, TMP103, XRETRN, TMP104
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER CVALS*3, TMP101*3
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*3 VV101(NVV101)
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'1,2', '123', '12,', ',12'/
C
      DATA VV102 /1, 2, 0, 32767, -32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'int_cvstring.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              INT Object Demo Program #3'/
     * ' This program tests the INT object access program'/
     * ' INT_CVSTRING.'/
     * ' 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-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 INT_CVSTRING object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        CVALS = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        NSEQ = VV102(IVV102)
C
C                       Convert a character string to an INT object
      XRETRN = INT_CVSTRING (CVALS,NSEQ,ISTAT)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (ISTAT .NE. TMP103 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (XRETRN .NE. TMP104 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) CVALS,NSEQ,ISTAT,XRETRN
  502 FORMAT (A,I21,I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              INT 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 =====> [ ./int4.f ]"
cat <<"STOP_CAT"> ././int4.f
C     PROGRAM INT4
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program (INT_)IOR
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER ITEM, TMP101, JTEM, TMP102, XRETRN, TMP103
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 32767/
C
      DATA VV102 /-32768, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'int_ior.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              INT Object Demo Program #4'/
     * ' This program tests the INT object access program'/
     * ' IOR.'/
     * ' 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-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 IOR object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        ITEM = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        JTEM = VV102(IVV102)
C
C                       Logical 'or' of two INT objects
      XRETRN = IOR (ITEM,JTEM)
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 (XRETRN .NE. TMP103 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ITEM,JTEM,XRETRN
  502 FORMAT (I21,I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              INT 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 =====> [ ./int5.f ]"
cat <<"STOP_CAT"> ././int5.f
C     PROGRAM INT5
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program (INT_)ISHFT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  5)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER IVALS, TMP101, NBITS, TMP102, XRETRN, TMP103
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 32767/
C
      DATA VV102 /1, 32766, -32768, -1, 0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'int_ishft.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              INT Object Demo Program #5'/
     * ' This program tests the INT object access program'/
     * ' ISHFT.'/
     * ' 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-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 ISHFT object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        IVALS = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        NBITS = VV102(IVV102)
C
C                       Logical shift an INT object
      XRETRN = ISHFT (IVALS,NBITS)
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 (XRETRN .NE. TMP103 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) IVALS,NBITS,XRETRN
  502 FORMAT (I21,I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              INT Demo Program #5 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./int6.f ]"
cat <<"STOP_CAT"> ././int6.f
C     PROGRAM INT6
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program INT_XCHG
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       INT object access program
      EXTERNAL INT_XCHG
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV103 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER ISWAP1, TMP101, ISWAP2, TMP103
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
      INTEGER VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 32767/
C
      DATA VV103 /-32768, 32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'int_xchg.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              INT Object Demo Program #6'/
     * ' This program tests the INT object access program'/
     * ' INT_XCHG.'/
     * ' 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-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 INT_XCHG object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        ISWAP1 = VV101(IVV101)
C
      DO 588 IVV103 = 1,NVV103
        ISWAP2 = VV103(IVV103)
C
C                       Swap two INT objects
      CALL INT_XCHG (ISWAP1,ISWAP2)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP103
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (ISWAP1 .NE. TMP101 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (ISWAP2 .NE. TMP103 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ISWAP1,ISWAP2
  502 FORMAT (I21,I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              INT Demo Program #6 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./int_cvstring.dat ]"
cat <<"STOP_CAT"> ././int_cvstring.uuu
begin 660 ./int_cvstring.dat
M,2PR("`@("`@("`@("`@("`@("`@("`Q("`@("`@("`@("`@("`@("`@("`P
M("`@("`@("`@("`@("`@("`@("`Q"C$L,B`@("`@("`@("`@("`@("`@("`@
M,B`@("`@("`@("`@("`@("`@("`@,"`@("`@("`@("`@("`@("`@("`@,@HQ
M+#(@("`@("`@("`@("`@("`@("`@(#`@("`@("`@("`@("`@("`@("`@+3$@
M("`@("`@("`@("`@("`@("`@(#`*,2PR("`@("`@("`@("`@("`@(#,R-S8W
M("`@("`@("`@("`@("`@("`@("TQ("`@("`@("`@("`@("`@("`@("`P"C$L
M,B`@("`@("`@("`@("`@("TS,C<V-R`@("`@("`@("`@("`@("`@("`M,2`@
M("`@("`@("`@("`@("`@("`@,`HQ,C,@("`@("`@("`@("`@("`@("`@(#$@
M("`@("`@("`@("`@("`@("`@(#`@("`@("`@("`@("`@("`@("`Q,C,*,3(S
M("`@("`@("`@("`@("`@("`@("`R("`@("`@("`@("`@("`@("`@("`P("`@
M("`@("`@("`@("`@("`@("`P"C$R,R`@("`@("`@("`@("`@("`@("`@,"`@
M("`@("`@("`@("`@("`@("`M,2`@("`@("`@("`@("`@("`@("`@,`HQ,C,@
M("`@("`@("`@("`@("`@,S(W-C<@("`@("`@("`@("`@("`@("`@+3$@("`@
M("`@("`@("`@("`@("`@(#`*,3(S("`@("`@("`@("`@("`@+3,R-S8W("`@
M("`@("`@("`@("`@("`@("TQ("`@("`@("`@("`@("`@("`@("`P"C$R+"`@
M("`@("`@("`@("`@("`@("`@,2`@("`@("`@("`@("`@("`@("`@,"`@("`@
M("`@("`@("`@("`@("`Q,@HQ,BP@("`@("`@("`@("`@("`@("`@(#(@("`@
M("`@("`@("`@("`@("`@(#`@("`@("`@("`@("`@("`@("`@(#`*,3(L("`@
M("`@("`@("`@("`@("`@("`P("`@("`@("`@("`@("`@("`@("TQ("`@("`@
M("`@("`@("`@("`@("`P"C$R+"`@("`@("`@("`@("`@("`S,C<V-R`@("`@
M("`@("`@("`@("`@("`M,2`@("`@("`@("`@("`@("`@("`@,`HQ,BP@("`@
M("`@("`@("`@("`M,S(W-C<@("`@("`@("`@("`@("`@("`@+3$@("`@("`@
M("`@("`@("`@("`@(#`*+#$R("`@("`@("`@("`@("`@("`@("`Q("`@("`@
M("`@("`@("`@("`@("`P("`@("`@("`@("`@("`@("`@("`P"BPQ,B`@("`@
M("`@("`@("`@("`@("`@,B`@("`@("`@("`@("`@("`@("`@,"`@("`@("`@
M("`@("`@("`@("`Q,@HL,3(@("`@("`@("`@("`@("`@("`@(#`@("`@("`@
M("`@("`@("`@("`@+3$@("`@("`@("`@("`@("`@("`@(#`*+#$R("`@("`@
M("`@("`@("`@(#,R-S8W("`@("`@("`@("`@("`@("`@("TQ("`@("`@("`@
M("`@("`@("`@("`P"BPQ,B`@("`@("`@("`@("`@("TS,C<V-R`@("`@("`@
C("`@("`@("`@("`M,2`@("`@("`@("`@("`@("`@("`@,`HV
`
end
STOP_CAT
echo "  Generating =====> [ ./int_iand.dat ]"
cat <<"STOP_CAT"> ././int_iand.uuu
begin 660 ./int_iand.dat
M("`@("`@("`@("`@("`@+3,R-S8X("`@("`@("`@("`@("`@+3,R-S8X("`@
M("`@("`@("`@("`@+3,R-S8X"B`@("`@("`@("`@("`@("TS,C<V."`@("`@
M("`@("`@("`@("`S,C<V-R`@("`@("`@("`@("`@("`@("`@,`H@("`@("`@
M("`@("`@("`@,S(W-C<@("`@("`@("`@("`@("`M,S(W-C@@("`@("`@("`@
M("`@("`@("`@(#`*("`@("`@("`@("`@("`@(#,R-S8W("`@("`@("`@("`@
?("`@(#,R-S8W("`@("`@("`@("`@("`@(#,R-S8W"C8W
`
end
STOP_CAT
echo "  Generating =====> [ ./int_ieor.dat ]"
cat <<"STOP_CAT"> ././int_ieor.uuu
begin 660 ./int_ieor.dat
M("`@("`@("`@("`@("`@+3,R-S8X("`@("`@("`@("`@("`@+3,R-S8X("`@
M("`@("`@("`@("`@("`@("`P"B`@("`@("`@("`@("`@("TS,C<V."`@("`@
M("`@("`@("`@("`S,C<V-R`@("`@("`@("`@("`@("`@("`M,0H@("`@("`@
M("`@("`@("`@,S(W-C<@("`@("`@("`@("`@("`M,S(W-C@@("`@("`@("`@
M("`@("`@("`@+3$*("`@("`@("`@("`@("`@(#,R-S8W("`@("`@("`@("`@
?("`@(#,R-S8W("`@("`@("`@("`@("`@("`@("`P"C8W
`
end
STOP_CAT
echo "  Generating =====> [ ./int_ior.dat ]"
cat <<"STOP_CAT"> ././int_ior.uuu
begin 660 ./int_ior.dat
M("`@("`@("`@("`@("`@+3,R-S8X("`@("`@("`@("`@("`@+3,R-S8X("`@
M("`@("`@("`@("`@+3,R-S8X"B`@("`@("`@("`@("`@("TS,C<V."`@("`@
M("`@("`@("`@("`S,C<V-R`@("`@("`@("`@("`@("`@("`M,0H@("`@("`@
M("`@("`@("`@,S(W-C<@("`@("`@("`@("`@("`M,S(W-C@@("`@("`@("`@
M("`@("`@("`@+3$*("`@("`@("`@("`@("`@(#,R-S8W("`@("`@("`@("`@
?("`@(#,R-S8W("`@("`@("`@("`@("`@(#,R-S8W"C8W
`
end
STOP_CAT
echo "  Generating =====> [ ./int_xchg.dat ]"
cat <<"STOP_CAT"> ././int_xchg.uuu
begin 660 ./int_xchg.dat
M("`@("`@("`@("`@("`@+3,R-S8X("`@("`@("`@("`@("`@+3,R-S8X"B`@
M("`@("`@("`@("`@("`S,C<V-R`@("`@("`@("`@("`@("TS,C<V.`H@("`@
M("`@("`@("`@("`M,S(W-C@@("`@("`@("`@("`@("`@,S(W-C<*("`@("`@
E("`@("`@("`@(#,R-S8W("`@("`@("`@("`@("`@+3,R-S8X"C<*
`
end
STOP_CAT
echo "  Generating =====> [ ./intary1.f ]"
cat <<"STOP_CAT"> ././intary1.f
C     PROGRAM INTARY1
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 INTARY_QSORT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       INTARY object access program
      EXTERNAL INTARY_QSORT
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV103 =  4)
      PARAMETER (NVV104 =  2)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 2)
      PARAMETER (MX104 = 2)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER INTARY(MX101), TMP101(MX101), LENIRY, TMP103, IPTR(MX104)
     *      , TMP104(MX104)
C
C                       Real variables and arrays
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      INTEGER VV101(NVV101)
      INTEGER VV103(NVV103)
      INTEGER VV104(NVV104)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-32768, 32767/
C
      DATA VV103 /1, 2, -32767, 0/
C
      DATA VV104 /1, 2/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'intary_qsort.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              INTARY Object Demo Program #1'/
     * ' This program tests the INTARY object access program'/
     * ' INTARY_QSORT.'/
     * ' 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-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 INTARY_QSORT object access program
C
C                       Loop for each input variable of access program
      DO 588 IVV103 = 1,NVV103
        LENIRY = VV103(IVV103)
C
      DO 589 IVV101 = 1,NVV101
        INTARY(1) = VV101(IVV101)
        INTARY(2) = 0
C
        IPTR(1) = VV104(1)
        IPTR(2) = VV104(2)
C
C                       Sort an INTARY object in ascending order
      CALL INTARY_QSORT (INTARY,LENIRY,IPTR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP103,TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (INTARY(1) .NE. TMP101(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (IPTR(1) .NE. TMP104(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) INTARY,LENIRY,IPTR
  502 FORMAT (2I21,I21,2I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  589 CONTINUE
  588 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 (/
     * '              INTARY 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 =====> [ ./intary_qsort.dat ]"
cat <<"STOP_CAT"> ././intary_qsort.uuu
begin 660 ./intary_qsort.dat
M("`@("`@("`@("`@("`@+3,R-S8X("`@("`@("`@("`@("`@("`@("`P("`@
M("`@("`@("`@("`@("`@("`Q("`@("`@("`@("`@("`@("`@("`Q("`@("`@
M("`@("`@("`@("`@("`R"B`@("`@("`@("`@("`@("`S,C<V-R`@("`@("`@
M("`@("`@("`@("`@,"`@("`@("`@("`@("`@("`@("`@,2`@("`@("`@("`@
M("`@("`@("`@,2`@("`@("`@("`@("`@("`@("`@,@H@("`@("`@("`@("`@
M("`M,S(W-C@@("`@("`@("`@("`@("`@("`@(#`@("`@("`@("`@("`@("`@
M("`@(#(@("`@("`@("`@("`@("`@("`@(#$@("`@("`@("`@("`@("`@("`@
M(#(*("`@("`@("`@("`@("`@("`@("`P("`@("`@("`@("`@("`@(#,R-S8W
M("`@("`@("`@("`@("`@("`@("`R("`@("`@("`@("`@("`@("`@("`R("`@
M("`@("`@("`@("`@("`@("`Q"B`@("`@("`@("`@("`@("TS,C<V."`@("`@
M("`@("`@("`@("`@("`@,"`@("`@("`@("`@("`@("TS,C<V-R`@("`@("`@
M("`@("`@("`@("`@,2`@("`@("`@("`@("`@("`@("`@,@H@("`@("`@("`@
M("`@("`@,S(W-C<@("`@("`@("`@("`@("`@("`@(#`@("`@("`@("`@("`@
M("`M,S(W-C<@("`@("`@("`@("`@("`@("`@(#$@("`@("`@("`@("`@("`@
M("`@(#(*("`@("`@("`@("`@("`@+3,R-S8X("`@("`@("`@("`@("`@("`@
M("`P("`@("`@("`@("`@("`@("`@("`P("`@("`@("`@("`@("`@("`@("`Q
M("`@("`@("`@("`@("`@("`@("`R"B`@("`@("`@("`@("`@("`S,C<V-R`@
M("`@("`@("`@("`@("`@("`@,"`@("`@("`@("`@("`@("`@("`@,"`@("`@
F("`@("`@("`@("`@("`@,2`@("`@("`@("`@("`@("`@("`@,@H@
`
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 =====> [ ./progrlang1.f ]"
cat <<"STOP_CAT"> ././progrlang1.f
C     PROGRAM PROGRLANG1
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 PROGRLANG_INIT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_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 PROGRLANG_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-PROGRLANG "PROGRLANG1" Object Demo Program'//
     * ' PROGRLANG_INIT must be used to initialize the PRL-PROGRLANG',
     * ' library'/
     * ' prior to invoking any other PRL-PROGRLANG subprograms. ',
     * ' Failure'/
     * ' to initialize the library will cause erroneous program'/
     * ' operation.'/
     * ' '/
     * ' PROGRLANG_INIT was called before printing this message'/)
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 PROGRLANG1 Execution Completed'/
     * '                         Press <CR> to exit demo')
      READ (*,811) STRING
  811 FORMAT (A)
C                       Exit demo
      CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./real1.f ]"
cat <<"STOP_CAT"> ././real1.f
C     PROGRAM REAL1
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program REAL_ARCANG
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       REAL object access program
      EXTERNAL REAL_ARCANG
      REAL     REAL_ARCANG
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  3)
      PARAMETER (NVV102 =  3)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    CSIN, TMP101, CCOS, TMP102, XRETRN, TMP103
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-1.0, 0.0, 1.0/
C
      DATA VV102 /-1.0, 0.0, 1.0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'real_arcang.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REAL Object Demo Program #1'/
     * ' This program tests the REAL object access program'/
     * ' REAL_ARCANG.'/
     * ' 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-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 REAL_ARCANG object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        CSIN = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        CCOS = VV102(IVV102)
C
C                       Convert a sin and cosine to an angle from -180
C                       to +180 degrees
      XRETRN = REAL_ARCANG (CSIN,CCOS)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XRETRN ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) CSIN,CCOS,XRETRN
  502 FORMAT (E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              REAL Demo Program #1 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./real10.f ]"
cat <<"STOP_CAT"> ././real10.f
C     PROGRAM REAL10
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program REAL_SETTOL
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, 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 (TOLST=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'REAL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, TOLER, TMP102
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /0.0D0, 0.1D0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 (TOLST)
C
C                       DBL subtraction tolerance
      CALL DBL_SETTOL (DTOLER)
C
C     ******************************************************************
C
C                       Print introduction message
C
C                       Set file pathname
      FILNAM = 'real_settol.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REAL Object Demo Program #10'/
     * ' This program tests the REAL object access program'/
     * ' REAL_SETTOL.'/
     * ' 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-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 REAL_SETTOL object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        TOLER = VV102(IVV102)
C
C                       Set REAL subtraction tolerance
      CALL REAL_SETTOL (TOLER)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(TOL ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) TOL,TOLER
  502 FORMAT (E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              REAL Demo Program #10 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 =====> [ ./real11.f ]"
cat <<"STOP_CAT"> ././real11.f
C     PROGRAM REAL11
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program REAL_XCHG
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       REAL object access program
      EXTERNAL REAL_XCHG
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV103 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    RSWAP1, TMP101, RSWAP2, TMP103
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-3333.33, 9999.99/
C
      DATA VV103 /-3333.33, 9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'real_xchg.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REAL Object Demo Program #11'/
     * ' This program tests the REAL object access program'/
     * ' REAL_XCHG.'/
     * ' 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-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 REAL_XCHG object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        RSWAP1 = VV101(IVV101)
C
      DO 588 IVV103 = 1,NVV103
        RSWAP2 = VV103(IVV103)
C
C                       Swap two REAL objects
      CALL REAL_XCHG (RSWAP1,RSWAP2)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP103
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(RSWAP1 ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(RSWAP2 ,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) RSWAP1,RSWAP2
  502 FORMAT (E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              REAL Demo Program #11 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./real2.f ]"
cat <<"STOP_CAT"> ././real2.f
C     PROGRAM REAL2
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program REAL_DIF0
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       REAL object access program
      EXTERNAL REAL_DIF0
      REAL     REAL_DIF0
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
      PARAMETER (NVV103 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'REAL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, S1, TMP102, S2, TMP103, XRETRN, TMP104
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV102(NVV102)
      REAL    VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /0.0, 0.1/
C
      DATA VV102 /-3333.33, 9999.99/
C
      DATA VV103 /-3333.33, 9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'real_dif0.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REAL Object Demo Program #2'/
     * ' This program tests the REAL object access program'/
     * ' REAL_DIF0.'/
     * ' 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-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 REAL_DIF0 object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        TOL = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        S1 = VV102(IVV102)
C
      DO 587 IVV103 = 1,NVV103
        S2 = VV103(IVV103)
C
C                       Subtract two REAL objects using tolerance
C                       checking
      XRETRN = REAL_DIF0 (S1,S2)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XRETRN ,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) TOL,S1,S2,XRETRN
  502 FORMAT (E15.7,E15.7,E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  587 CONTINUE
  588 CONTINUE
  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 (/
     * '              REAL Demo Program #2 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./real3.f ]"
cat <<"STOP_CAT"> ././real3.f
C     PROGRAM REAL3
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program REAL_GETBIG
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       REAL object access program
      EXTERNAL REAL_GETBIG
      REAL     REAL_GETBIG
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'REAL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, XRETRN, TMP102
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /1.0E15, 9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'real_getbig.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REAL Object Demo Program #3'/
     * ' This program tests the REAL object access program'/
     * ' REAL_GETBIG.'/
     * ' 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-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 REAL_GETBIG object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        BIGNUM = VV101(IVV101)
C
C                       Store large value in a REAL object
      XRETRN = REAL_GETBIG ()
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XRETRN ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) BIGNUM,XRETRN
  502 FORMAT (E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              REAL 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 =====> [ ./real4.f ]"
cat <<"STOP_CAT"> ././real4.f
C     PROGRAM REAL4
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program REAL_GETMPM
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       REAL object access program
      EXTERNAL REAL_GETMPM
      REAL     REAL_GETMPM
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'REAL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, XRETRN, TMP102
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /1.0, 1.1/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'real_getmpm.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REAL Object Demo Program #4'/
     * ' This program tests the REAL object access program'/
     * ' REAL_GETMPM.'/
     * ' 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-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 REAL_GETMPM object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        P1001 = VV101(IVV101)
C
C                       Get value of REAL machine precision multiplier
      XRETRN = REAL_GETMPM ()
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XRETRN ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) P1001,XRETRN
  502 FORMAT (E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              REAL 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 =====> [ ./real5.f ]"
cat <<"STOP_CAT"> ././real5.f
C     PROGRAM REAL5
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program REAL_GETPI
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       REAL object access program
      EXTERNAL REAL_GETPI
      REAL     REAL_GETPI
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  1)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'REAL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, XRETRN, TMP102
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /3.141592/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'real_getpi.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REAL Object Demo Program #5'/
     * ' This program tests the REAL object access program'/
     * ' REAL_GETPI.'/
     * ' 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-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 REAL_GETPI object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        PI = VV101(IVV101)
C
C                       Store value of pi in a REAL object
      XRETRN = REAL_GETPI ()
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XRETRN ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) PI,XRETRN
  502 FORMAT (E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              REAL Demo Program #5 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./real6.f ]"
cat <<"STOP_CAT"> ././real6.f
C     PROGRAM REAL6
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program REAL_GETTOL
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       REAL object access program
      EXTERNAL REAL_GETTOL
      REAL     REAL_GETTOL
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'REAL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, XRETRN, TMP102
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /0.0, 0.1/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'real_gettol.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REAL Object Demo Program #6'/
     * ' This program tests the REAL object access program'/
     * ' REAL_GETTOL.'/
     * ' 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-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 REAL_GETTOL object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        TOL = VV101(IVV101)
C
C                       Get value of REAL subtraction tolerance
      XRETRN = REAL_GETTOL ()
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(XRETRN ,TMP102 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) TOL,XRETRN
  502 FORMAT (E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              REAL Demo Program #6 Execution Completed'/
     * '                      Press <CR> to exit demo')
      READ (IN,811) PAUS
  811 FORMAT (A)
C
C     ******************************************************************
C
C                       Terminate program execution
C
  900 CALL PROCESS_EXIT
      END
STOP_CAT
echo "  Generating =====> [ ./real7.f ]"
cat <<"STOP_CAT"> ././real7.f
C     PROGRAM REAL7
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program REAL_IDIF0
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  2)
      PARAMETER (NVV103 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'REAL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, S1, TMP102, S2, TMP103
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
      LOGICAL XRETRN, TMP104
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      REAL    VV102(NVV102)
      REAL    VV103(NVV103)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /0.0, 0.1/
C
      DATA VV102 /-3333.33, 9999.99/
C
      DATA VV103 /-3333.33, 9999.99/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'real_idif0.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REAL Object Demo Program #7'/
     * ' This program tests the REAL object access program'/
     * ' REAL_IDIF0.'/
     * ' 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-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 REAL_IDIF0 object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        TOL = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        S1 = VV102(IVV102)
C
      DO 587 IVV103 = 1,NVV103
        S2 = VV103(IVV103)
C
C                       Return .TRUE. if REAL difference is less than or
C                       equal to a tolerance
      XRETRN = REAL_IDIF0 (S1,S2)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (XRETRN .NEQV. 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) TOL,S1,S2,XRETRN
  502 FORMAT (E15.7,E15.7,E15.7,L7)
  503 CONTINUE
C
C                       Repeat for next variable value
  587 CONTINUE
  588 CONTINUE
  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 (/
     * '              REAL Demo Program #7 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 =====> [ ./real8.f ]"
cat <<"STOP_CAT"> ././real8.f
C     PROGRAM REAL8
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program REAL_CVSTRING
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       REAL object access program
      EXTERNAL REAL_CVSTRING
      REAL     REAL_CVSTRING
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  4)
      PARAMETER (NVV102 =  5)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER NSEQ, TMP102, ISTAT, TMP103
C
C                       Real variables and arrays
      REAL    XRETRN, TMP104
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
      CHARACTER CVALS*5, TMP101*5
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      CHARACTER*5 VV101(NVV101)
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /'1.,2.', '123.0', '12.0,', ',12. '/
C
      DATA VV102 /1, 2, 0, 32767, -32767/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'real_cvstring.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REAL Object Demo Program #8'/
     * ' This program tests the REAL object access program'/
     * ' REAL_CVSTRING.'/
     * ' 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-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 REAL_CVSTRING object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        CVALS = VV101(IVV101)
C
      DO 588 IVV102 = 1,NVV102
        NSEQ = VV102(IVV102)
C
C                       Convert a character string to a REAL object
      XRETRN = REAL_CVSTRING (CVALS,NSEQ,ISTAT)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (ISTAT .NE. TMP103 ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(XRETRN ,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) CVALS,NSEQ,ISTAT,XRETRN
  502 FORMAT (A,I21,I21,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              REAL Demo Program #8 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 =====> [ ./real9.f ]"
cat <<"STOP_CAT"> ././real9.f
C     PROGRAM REAL9
C
C       Programmer's Reusable Library, Version 0.7      (TM)
C
C            Copyright (C) 1995 Object Access (SM)
C
C     Permission is granted to any individual or institution
C     to use, copy, modify, and distribute this single program
C     unit, provided that this complete copyright and
C     permission notice is maintained, intact, in all copies.
C
C     Object Access Incorporated provides this software
C     "as is" without express or implied warranty.
C
C     PURPOSE: Demonstrate and test access program REAL_SETMPM
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       REAL object access program
      EXTERNAL REAL_SETMPM
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV102 =  2)
C
C                       Argument maximum array sizes
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Private variables and arrays
      INCLUDE 'REAL.INC'
C
C                       Integer variables and arrays
C
C                       Real variables and arrays
      REAL    TMP101, PMPM, TMP102
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV102 /1.0D0, 1.1D0/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'real_setmpm.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REAL Object Demo Program #9'/
     * ' This program tests the REAL object access program'/
     * ' REAL_SETMPM.'/
     * ' 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-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 REAL_SETMPM object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV102 = 1,NVV102
        PMPM = VV102(IVV102)
C
C                       Set REAL machine precision multiplier
      CALL REAL_SETMPM (PMPM)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(P1001 ,TMP101 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) P1001,PMPM
  502 FORMAT (E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  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 (/
     * '              REAL Demo Program #9 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 =====> [ ./real_arcang.dat ]"
cat <<"STOP_CAT"> ././real_arcang.uuu
begin 660 ./real_arcang.dat
M("`M+C$P,#`P,#!%*S`Q("`M+C$P,#`P,#!%*S`Q("`M+C$X,#`P,#%%*S`S
M"B`@+2XQ,#`P,#`P12LP,2`@("XP,#`P,#`P12LP,"`@+2XY,#`P,#`W12LP
M,@H@("TN,3`P,#`P,$4K,#$@("`N,3`P,#`P,$4K,#$@("TN.3`P,#`P-T4K
M,#(*("`@+C`P,#`P,#!%*S`P("`M+C$P,#`P,#!%*S`Q("`@+C$X,#`P,#%%
M*S`S"B`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P12LP,"`@("XP,#`P,#`P
M12LP,`H@("`N,#`P,#`P,$4K,#`@("`N,3`P,#`P,$4K,#$@("`N,#`P,#`P
M,$4K,#`*("`@+C$P,#`P,#!%*S`Q("`M+C$P,#`P,#!%*S`Q("`@+C$X,#`P
M,#%%*S`S"B`@("XQ,#`P,#`P12LP,2`@("XP,#`P,#`P12LP,"`@("XY,#`P
M,#`W12LP,@H@("`N,3`P,#`P,$4K,#$@("`N,3`P,#`P,$4K,#$@("`N.3`P
),#`P-T4K,#(*
`
end
STOP_CAT
echo "  Generating =====> [ ./real_cvstring.dat ]"
cat <<"STOP_CAT"> ././real_cvstring.uuu
begin 660 ./real_cvstring.dat
M,2XL,BX@("`@("`@("`@("`@("`@("`@(#$@("`@("`@("`@("`@("`@("`@
M(#`@("`N,3`P,#`P,$4K,#$*,2XL,BX@("`@("`@("`@("`@("`@("`@(#(@
M("`@("`@("`@("`@("`@("`@(#`@("`N,C`P,#`P,$4K,#$*,2XL,BX@("`@
M("`@("`@("`@("`@("`@(#`@("`@("`@("`@("`@("`@("`@+3$@("`N,#`P
M,#`P,$4K,#`*,2XL,BX@("`@("`@("`@("`@("`@,S(W-C<@("`@("`@("`@
M("`@("`@("`@+3$@("`N,#`P,#`P,$4K,#`*,2XL,BX@("`@("`@("`@("`@
M("`M,S(W-C<@("`@("`@("`@("`@("`@("`@+3$@("`N,#`P,#`P,$4K,#`*
M,3(S+C`@("`@("`@("`@("`@("`@("`@(#$@("`@("`@("`@("`@("`@("`@
M(#`@("`N,3(S,#`P,$4K,#,*,3(S+C`@("`@("`@("`@("`@("`@("`@(#(@
M("`@("`@("`@("`@("`@("`@(#`@("`N,#`P,#`P,$4K,#`*,3(S+C`@("`@
M("`@("`@("`@("`@("`@(#`@("`@("`@("`@("`@("`@("`@+3$@("`N,#`P
M,#`P,$4K,#`*,3(S+C`@("`@("`@("`@("`@("`@,S(W-C<@("`@("`@("`@
M("`@("`@("`@+3$@("`N,#`P,#`P,$4K,#`*,3(S+C`@("`@("`@("`@("`@
M("`M,S(W-C<@("`@("`@("`@("`@("`@("`@+3$@("`N,#`P,#`P,$4K,#`*
M,3(N,"P@("`@("`@("`@("`@("`@("`@(#$@("`@("`@("`@("`@("`@("`@
M(#`@("`N,3(P,#`P,$4K,#(*,3(N,"P@("`@("`@("`@("`@("`@("`@(#(@
M("`@("`@("`@("`@("`@("`@(#`@("`N,#`P,#`P,$4K,#`*,3(N,"P@("`@
M("`@("`@("`@("`@("`@(#`@("`@("`@("`@("`@("`@("`@+3$@("`N,#`P
M,#`P,$4K,#`*,3(N,"P@("`@("`@("`@("`@("`@,S(W-C<@("`@("`@("`@
M("`@("`@("`@+3$@("`N,#`P,#`P,$4K,#`*,3(N,"P@("`@("`@("`@("`@
M("`M,S(W-C<@("`@("`@("`@("`@("`@("`@+3$@("`N,#`P,#`P,$4K,#`*
M+#$R+B`@("`@("`@("`@("`@("`@("`@(#$@("`@("`@("`@("`@("`@("`@
M(#`@("`N,#`P,#`P,$4K,#`*+#$R+B`@("`@("`@("`@("`@("`@("`@(#(@
M("`@("`@("`@("`@("`@("`@(#`@("`N,3(P,#`P,$4K,#(*+#$R+B`@("`@
M("`@("`@("`@("`@("`@(#`@("`@("`@("`@("`@("`@("`@+3$@("`N,#`P
M,#`P,$4K,#`*+#$R+B`@("`@("`@("`@("`@("`@,S(W-C<@("`@("`@("`@
M("`@("`@("`@+3$@("`N,#`P,#`P,$4K,#`*+#$R+B`@("`@("`@("`@("`@
M("`M,S(W-C<@("`@("`@("`@("`@("`@("`@+3$@("`N,#`P,#`P,$4K,#`*
`
end
STOP_CAT
echo "  Generating =====> [ ./real_dif0.dat ]"
cat <<"STOP_CAT"> ././real_dif0.uuu
begin 660 ./real_dif0.dat
M("`P+C`P,#`P,#!%*S`P("TP+C,S,S,S,S!%*S`T("TP+C,S,S,S,S!%*S`T
M("`P+C`P,#`P,#!%*S`P"B`@,"XP,#`P,#`P12LP,"`M,"XS,S,S,S,P12LP
M-"`@,"XY.3DY.3DP12LP-"`M,"XQ,S,S,S,R12LP-0H@(#`N,#`P,#`P,$4K
M,#`@(#`N.3DY.3DY,$4K,#0@+3`N,S,S,S,S,$4K,#0@(#`N,3,S,S,S,D4K
M,#4*("`P+C`P,#`P,#!%*S`P("`P+CDY.3DY.3!%*S`T("`P+CDY.3DY.3!%
M*S`T("`P+C`P,#`P,#!%*S`P"B`@,"XQ,#`P,#`P12LP,"`M,"XS,S,S,S,P
M12LP-"`M,"XS,S,S,S,P12LP-"`@,"XP,#`P,#`P12LP,`H@(#`N,3`P,#`P
M,$4K,#`@+3`N,S,S,S,S,$4K,#0@(#`N.3DY.3DY,$4K,#0@+3`N,3,S,S,S
M,D4K,#4*("`P+C$P,#`P,#!%*S`P("`P+CDY.3DY.3!%*S`T("TP+C,S,S,S
M,S!%*S`T("`P+C$S,S,S,S)%*S`U"B`@,"XQ,#`P,#`P12LP,"`@,"XY.3DY
F.3DP12LP-"`@,"XY.3DY.3DP12LP-"`@,"XP,#`P,#`P12LP,`H@
`
end
STOP_CAT
echo "  Generating =====> [ ./real_getbig.dat ]"
cat <<"STOP_CAT"> ././real_getbig.uuu
begin 660 ./real_getbig.dat
M("`@+C$P,#`P,#!%*S$V("`@+C$P,#`P,#!%*S$V"B`@("XY.3DY.3DP12LP
1-"`@("XY.3DY.3DP12LP-`H@
`
end
STOP_CAT
echo "  Generating =====> [ ./real_getmpm.dat ]"
cat <<"STOP_CAT"> ././real_getmpm.uuu
begin 660 ./real_getmpm.dat
M("`@+C$P,#`P,#!%*S`Q("`@+C$P,#`P,#!%*S`Q"B`@("XQ,3`P,#`P12LP
1,2`@("XQ,3`P,#`P12LP,0H@
`
end
STOP_CAT
echo "  Generating =====> [ ./real_getpi.dat ]"
cat <<"STOP_CAT"> ././real_getpi.uuu
begin 660 ./real_getpi.dat
?("`@+C,Q-#$U.3)%*S`Q("`@+C,Q-#$U.3)%*S`Q"F`\
`
end
STOP_CAT
echo "  Generating =====> [ ./real_gettol.dat ]"
cat <<"STOP_CAT"> ././real_gettol.uuu
begin 660 ./real_gettol.dat
M("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P"B`@("XQ,#`P,#`P12LP
1,"`@("XQ,#`P,#`P12LP,`H@
`
end
STOP_CAT
echo "  Generating =====> [ ./real_idif0.dat ]"
cat <<"STOP_CAT"> ././real_idif0.uuu
begin 660 ./real_idif0.dat
M("`@+C`P,#`P,#!%*S`P("`M+C,S,S,S,S!%*S`T("`M+C,S,S,S,S!%*S`T
M("`@("`@5`H@("`N,#`P,#`P,$4K,#`@("TN,S,S,S,S,$4K,#0@("`N.3DY
M.3DY,$4K,#0@("`@("!&"B`@("XP,#`P,#`P12LP,"`@("XY.3DY.3DP12LP
M-"`@+2XS,S,S,S,P12LP-"`@("`@($8*("`@+C`P,#`P,#!%*S`P("`@+CDY
M.3DY.3!%*S`T("`@+CDY.3DY.3!%*S`T("`@("`@5`H@("`N,3`P,#`P,$4K
M,#`@("TN,S,S,S,S,$4K,#0@("TN,S,S,S,S,$4K,#0@("`@("!4"B`@("XQ
M,#`P,#`P12LP,"`@+2XS,S,S,S,P12LP-"`@("XY.3DY.3DP12LP-"`@("`@
M($8*("`@+C$P,#`P,#!%*S`P("`@+CDY.3DY.3!%*S`T("`M+C,S,S,S,S!%
M*S`T("`@("`@1@H@("`N,3`P,#`P,$4K,#`@("`N.3DY.3DY,$4K,#0@("`N
3.3DY.3DY,$4K,#0@("`@("!4"C`P
`
end
STOP_CAT
echo "  Generating =====> [ ./real_setmpm.dat ]"
cat <<"STOP_CAT"> ././real_setmpm.uuu
begin 660 ./real_setmpm.dat
M("`@+C$P,#`P,#!%*S`Q("`@+C$P,#`P,#!%*S`Q"B`@("XQ,3`P,#`P12LP
1,2`@("XQ,3`P,#`P12LP,0H@
`
end
STOP_CAT
echo "  Generating =====> [ ./real_settol.dat ]"
cat <<"STOP_CAT"> ././real_settol.uuu
begin 660 ./real_settol.dat
M("`@+C`P,#`P,#!%*S`P("`@+C`P,#`P,#!%*S`P"B`@("XQ,#`P,#`P12LP
1,"`@("XQ,#`P,#`P12LP,`H@
`
end
STOP_CAT
echo "  Generating =====> [ ./real_xchg.dat ]"
cat <<"STOP_CAT"> ././real_xchg.uuu
begin 660 ./real_xchg.dat
M("`M+C,S,S,S,S!%*S`T("`M+C,S,S,S,S!%*S`T"B`@("XY.3DY.3DP12LP
M-"`@+2XS,S,S,S,P12LP-`H@("TN,S,S,S,S,$4K,#0@("`N.3DY.3DY,$4K
B,#0*("`@+CDY.3DY.3!%*S`T("`M+C,S,S,S,S!%*S`T"B`N
`
end
STOP_CAT
echo "  Generating =====> [ ./realary1.f ]"
cat <<"STOP_CAT"> ././realary1.f
C     PROGRAM REALARY1
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 REALARY_MINMAX
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       REALARY object access program
      EXTERNAL REALARY_MINMAX
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV102 =  4)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 2)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER LENRRY, TMP102
C
C                       Real variables and arrays
      REAL    ARRAY(MX101), TMP101(MX101), BMIN, TMP103, BMAX, TMP104
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      INTEGER VV102(NVV102)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-3333.33, 9999.99/
C
      DATA VV102 /1, 2, 0, -2/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'realary_minmax.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REALARY Object Demo Program #1'/
     * ' This program tests the REALARY object access program'/
     * ' REALARY_MINMAX.'/
     * ' 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-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 REALARY_MINMAX object access program
C
C                       Loop for each input variable of access program
      DO 589 IVV101 = 1,NVV101
        ARRAY(1) = VV101(IVV101)
        ARRAY(2) = 0.0
C
      DO 588 IVV102 = 1,NVV102
        LENRRY = VV102(IVV102)
C
C                       Find the minimum and maximum values in a REALARY
C                       object
      CALL REALARY_MINMAX (ARRAY,LENRRY,BMIN,BMAX)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP102,TMP103,TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(BMIN ,TMP103 )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (.NOT. REAL_IDIF0(BMAX ,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) ARRAY,LENRRY,BMIN,BMAX
  502 FORMAT (2E15.7,I21,E15.7,E15.7)
  503 CONTINUE
C
C                       Repeat for next variable value
  588 CONTINUE
  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 (/
     * '              REALARY 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 =====> [ ./realary2.f ]"
cat <<"STOP_CAT"> ././realary2.f
C     PROGRAM REALARY2
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 REALARY_QSORT
C
C     LOCAL VARIABLES:
C
C
C     NOTES:  None
C
C     ******************************************************************
C
C                       External subprogram declarations
C
C     INTRINSIC
C
C                       REALARY object access program
      EXTERNAL REALARY_QSORT
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT, PRL_LIBVER
C
C                       REAL object access programs
      EXTERNAL REAL_IDIF0, REAL_SETTOL
      LOGICAL  REAL_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_IDIF0, DBL_SETTOL
      LOGICAL  DBL_IDIF0
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_IDIF0
      LOGICAL  CMPLX_IDIF0
C
C                       TERM object access programs
      EXTERNAL TERM_GETIN, TERM_GETOUT, TERM_GETERR, TERM_SETSIO
      INTEGER  TERM_GETIN, TERM_GETOUT, TERM_GETERR
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       FILE object access programs
      EXTERNAL PXFCLS, PXFOPN
C
C                       PCONS object access programs
      EXTERNAL IPXCON
      INTEGER  IPXCON
C
C     ------------------------------------------------------------------
C
C                       Test program parameter values
C
C                       Standard input logical unit for the system
      PARAMETER (LUNSI=5)
C                       Standard output logical unit for the system
      PARAMETER (LUNSO=6)
C                       Standard error logical unit for the system
      PARAMETER (LUNSE=6)
C
C                       REAL subtraction tolerance
      PARAMETER (TOLER=0.00001)
C                       DBL subtraction tolerance
      DOUBLE PRECISION DTOLER
      PARAMETER (DTOLER=1.0D-13)
C
C                       Number of input variable test values
      PARAMETER (NVV101 =  2)
      PARAMETER (NVV103 =  4)
      PARAMETER (NVV104 =  2)
C
C                       Argument maximum array sizes
      PARAMETER (MX101 = 2)
      PARAMETER (MX104 = 2)
C
C     ------------------------------------------------------------------
C
C                       Access program variables
C
C                       Integer variables and arrays
      INTEGER LENRRY, TMP103, IPTR(MX104), TMP104(MX104)
C
C                       Real variables and arrays
      REAL    ARRAY(MX101), TMP101(MX101)
C
C                       Double precision variables and arrays
C
C                       Complex variables and arrays
C
C                       Logical variables and arrays
C
C                       Character variables and arrays
C
C     ------------------------------------------------------------------
C
C                       Test program variables
C
      CHARACTER*1 PAUS
C                       Program logical unit numbers
      INTEGER     IN, IOUT, IER, IFILE, IO
C
C                       Name of results file for the access program
      CHARACTER*(40) FILNAM
C
C                       Library version numbers (actual & required)
      CHARACTER*8  VERAQ,VERRQ
C
C                       Input variable test value arrays
      REAL    VV101(NVV101)
      INTEGER VV103(NVV103)
      INTEGER VV104(NVV104)
C
C                       Program required PRL version
      DATA VERRQ /'0.7     '/
C
C                       Input variable test values
      DATA VV101 /-3333.33, 9999.99/
C
      DATA VV103 /1, 2, 0, -32768/
C
      DATA VV104 /1, 2/
C
C     ******************************************************************
C
C                       Initialize library
C
      CALL PROGRLANG_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 = 'realary_qsort.dat'
C
      WRITE (IOUT,301) FILNAM
  301 FORMAT (
     * '              REALARY Object Demo Program #2'/
     * ' This program tests the REALARY object access program'/
     * ' REALARY_QSORT.'/
     * ' 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-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 REALARY_QSORT object access program
C
C                       Loop for each input variable of access program
      DO 588 IVV103 = 1,NVV103
        LENRRY = VV103(IVV103)
C
      DO 589 IVV101 = 1,NVV101
        ARRAY(1) = VV101(IVV101)
        ARRAY(2) = 0.0
C
        IPTR(1) = VV104(1)
        IPTR(2) = VV104(2)
C
C                       Sort a REALARY object in ascending order
      CALL REALARY_QSORT (ARRAY,LENRRY,IPTR)
C
C                       Read input and output variable values from file
      IF (IRESLT .EQ. 0) THEN
        READ (IFILE,502,ERR=610) TMP101,TMP103,TMP104
C
C                       Compare output with previously-computed values
C                       and write to error device if they do not match
        IF (.NOT. REAL_IDIF0(ARRAY(1) ,TMP101(1) )) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ELSE IF (IPTR(1) .NE. TMP104(1) ) THEN
          IO = IER
          IOK = 1
          GOTO 501
        ENDIF
C                       Test combination matches previous results
        GOTO 503
C
C                       Write input and output variable values to file
      ELSE
        IO = IFILE
        GOTO 501
      ENDIF
C                       Write input and output variable values
C                       to file or error device
  501 CONTINUE
      WRITE (IO,502,ERR=612) ARRAY,LENRRY,IPTR
  502 FORMAT (2E15.7,I21,2I21)
  503 CONTINUE
C
C                       Repeat for next variable value
  589 CONTINUE
  588 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 (/
     * '              REALARY 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 =====> [ ./realary_minmax.dat ]"
cat <<"STOP_CAT"> ././realary_minmax.uuu
begin 660 ./realary_minmax.dat
M("`M+C,S,S,S,S!%*S`T("`@+C`P,#`P,#!%*S`P("`@("`@("`@("`@("`@
M("`@("`Q("`M+C,S,S,S,S!%*S`T("`M+C,S,S,S,S!%*S`T"B`@+2XS,S,S
M,S,P12LP-"`@("XP,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@("`@,B`@
M+2XS,S,S,S,P12LP-"`@("XP,#`P,#`P12LP,`H@("TN,S,S,S,S,$4K,#0@
M("`N,#`P,#`P,$4K,#`@("`@("`@("`@("`@("`@("`@(#`@("TN,S,S,S,S
M,$4K,#0@("TN,S,S,S,S,$4K,#0*("`M+C,S,S,S,S!%*S`T("`@+C`P,#`P
M,#!%*S`P("`@("`@("`@("`@("`@("`@("TR("`M+C,S,S,S,S!%*S`T("`M
M+C,S,S,S,S!%*S`T"B`@("XY.3DY.3DP12LP-"`@("XP,#`P,#`P12LP,"`@
M("`@("`@("`@("`@("`@("`@,2`@("XY.3DY.3DP12LP-"`@("XY.3DY.3DP
M12LP-`H@("`N.3DY.3DY,$4K,#0@("`N,#`P,#`P,$4K,#`@("`@("`@("`@
M("`@("`@("`@(#(@("`N,#`P,#`P,$4K,#`@("`N.3DY.3DY,$4K,#0*("`@
M+CDY.3DY.3!%*S`T("`@+C`P,#`P,#!%*S`P("`@("`@("`@("`@("`@("`@
M("`P("`@+CDY.3DY.3!%*S`T("`@+CDY.3DY.3!%*S`T"B`@("XY.3DY.3DP
M12LP-"`@("XP,#`P,#`P12LP,"`@("`@("`@("`@("`@("`@("`M,B`@("XY
:.3DY.3DP12LP-"`@("XY.3DY.3DP12LP-`H@
`
end
STOP_CAT
echo "  Generating =====> [ ./realary_qsort.dat ]"
cat <<"STOP_CAT"> ././realary_qsort.uuu
begin 660 ./realary_qsort.dat
M("`M+C,S,S,S,S!%*S`T("`@+C`P,#`P,#!%*S`P("`@("`@("`@("`@("`@
M("`@("`Q("`@("`@("`@("`@("`@("`@("`Q("`@("`@("`@("`@("`@("`@
M("`R"B`@("XY.3DY.3DP12LP-"`@("XP,#`P,#`P12LP,"`@("`@("`@("`@
M("`@("`@("`@,2`@("`@("`@("`@("`@("`@("`@,2`@("`@("`@("`@("`@
M("`@("`@,@H@("TN,S,S,S,S,$4K,#0@("`N,#`P,#`P,$4K,#`@("`@("`@
M("`@("`@("`@("`@(#(@("`@("`@("`@("`@("`@("`@(#$@("`@("`@("`@
M("`@("`@("`@(#(*("`@+C`P,#`P,#!%*S`P("`@+CDY.3DY.3!%*S`T("`@
M("`@("`@("`@("`@("`@("`R("`@("`@("`@("`@("`@("`@("`R("`@("`@
M("`@("`@("`@("`@("`Q"B`@+2XS,S,S,S,P12LP-"`@("XP,#`P,#`P12LP
M,"`@("`@("`@("`@("`@("`@("`@,"`@("`@("`@("`@("`@("`@("`@,2`@
M("`@("`@("`@("`@("`@("`@,@H@("`N.3DY.3DY,$4K,#0@("`N,#`P,#`P
M,$4K,#`@("`@("`@("`@("`@("`@("`@(#`@("`@("`@("`@("`@("`@("`@
M(#$@("`@("`@("`@("`@("`@("`@(#(*("`M+C,S,S,S,S!%*S`T("`@+C`P
M,#`P,#!%*S`P("`@("`@("`@("`@("`@+3,R-S8X("`@("`@("`@("`@("`@
M("`@("`Q("`@("`@("`@("`@("`@("`@("`R"B`@("XY.3DY.3DP12LP-"`@
M("XP,#`P,#`P12LP,"`@("`@("`@("`@("`@("TS,C<V."`@("`@("`@("`@
@("`@("`@("`@,2`@("`@("`@("`@("`@("`@("`@,@HV
`
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-PROGRLANG 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-PROGRLANG 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  5 must be performed last.  Other steps may be mixed
C          as necessary.
C
C     ******************************************************************
C
C     INTRINSIC
C
C                       CHAR object access programs
      EXTERNAL CHAR_CVINT, CHAR_CVINT8, CHAR_CVREAL, CHAR_INDEXBL
     *        , CHAR_LENBT, CHAR_LOWER, CHAR_REMBE, CHAR_REMBL
     *        , CHAR_REMBT, CHAR_SCANBT, CHAR_UPPER
      INTEGER CHAR_INDEXBL, CHAR_LENBT, CHAR_SCANBT
C
C                       CHARARY object access programs
      EXTERNAL CHARARY_LENG, CHARARY_CVINT
      INTEGER CHARARY_LENG
C
C                       CMPLX object access programs
      EXTERNAL CMPLX_DIF0, CMPLX_IDIF0, CMPLX_XCHG
      COMPLEX CMPLX_DIF0
      LOGICAL CMPLX_IDIF0
C
C                       DBL object access programs
      EXTERNAL DBL_DIF0, DBL_GETBIG, DBL_GETMPM, DBL_GETPI, DBL_GETTOL
     *        , DBL_IDIF0, DBL_SETMPM, DBL_SETTOL, DBL_XCHG
      DOUBLE PRECISION DBL_DIF0, DBL_GETBIG, DBL_GETMPM, DBL_GETPI
     *        , DBL_GETTOL
      LOGICAL DBL_IDIF0
C
C                       HOLL object access programs
      EXTERNAL HOLL_GETBYT, HOLL_LENG, HOLL_CVCHAR
     *        , HOLL_2CHAR, HOLL_SETBYT, HOLL_BYTE
     *        , HOLL_CVCHARY, HOLL_2CHARY, HOLL_CVREAL
     *        , HOLL_COPY, HOLL_REMBL, HOLL_REMBT
      INTEGER HOLL_LENG
C
C                       INT object access programs
      EXTERNAL INT_CVSTRING, INT_XCHG
      INTEGER  INT_CVSTRING
C
C                       INTARY object access programs
      EXTERNAL INTARY_QSORT
C
C                       PRL object access programs
      EXTERNAL PRL_LIBVER
C
C                       PROCESS object access programs
      EXTERNAL PROCESS_EXIT
C
C                       PROGRLANG object access programs
      EXTERNAL PROGRLANG_INIT
C
C                       REAL object access programs
      EXTERNAL REAL_ARCANG, REAL_DIF0, REAL_GETBIG, REAL_GETMPM
     *        , REAL_GETPI, REAL_GETTOL, REAL_IDIF0, REAL_CVSTRING
     *        , REAL_SETMPM, REAL_SETTOL, REAL_XCHG
      REAL REAL_ARCANG, REAL_DIF0, REAL_GETBIG, REAL_GETMPM, REAL_GETPI
     *        , REAL_GETTOL, REAL_CVSTRING
      LOGICAL REAL_IDIF0
C
C                       REALARY object access programs
      EXTERNAL REALARY_MINMAX, REALARY_QSORT
C
C     ------------------------------------------------------------------
C
C                       Maximum array sizes
      PARAMETER (MX101 = 1)
      PARAMETER (MX102 = 1)
      PARAMETER (MX103 = 1)
      PARAMETER (MX104 = 1)
      PARAMETER (MX105 = 1)
C
C                       Integer variables and arrays
      INTEGER NCHAR, NWORD, NPOS, LENIRY, LENRRY, ISCOPE, IVAL, IPLACE
     *        , IHOLLR, IEXTRC, INSERT, IEXIN, IOHOLL(MX101)
     *        , INHOLL(MX102), IUHOLL(MX103), INTARY, IPTR(MX104), ITEM
     *        , JTEM, NSEQ, ISTAT, IVALS, NBITS, ISWAP1, ISWAP2
      INTEGER IRETRN
C
C                       Real variables and arrays
      REAL RNUM, ARRAY, BMIN, BMAX, CSIN, CCOS, S1, S2, PMPM, TOLER
     *        , RSWAP1, RSWAP2, RVAL
      REAL RRETRN
C
C                       Double precision variables and arrays
      DOUBLE PRECISION D1, D2, DMPM, DTOLER, DSWAP1, DSWAP2
      DOUBLE PRECISION DRETRN
C
C                       Complex variables and arrays
      COMPLEX C1, C2, CSWAP1, CSWAP2
      COMPLEX XRETRN
C
C                       Logical variables and arrays
      LOGICAL LRETRN
C
C                       Character variables and arrays
      CHARACTER VERAQ*8, VERRQ*8, STR1*1, OSTRNG*11, CNUM*80, LPOWER*4
     *        , STR*1, CHRARY(MX105)*1, CHRSRC*1, CHRDST*1, OPTION*1
     *        , CVALS*132
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 PROGRLANG_INIT object access program
C
C                       Initialize the PRL-PROGRLANG library
C     ISCOPE =
      CALL PROGRLANG_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  - Set subtraction tolerances and machine
C                       precision multipliers as necessary
C
C     ------------------------------------------------------------------
C
C                       Use REAL_SETTOL object access program
C
C                       Set REAL subtraction tolerance
C     TOLER =
      CALL REAL_SETTOL (TOLER)
C
C     ------------------------------------------------------------------
C
C                       Use REAL_SETMPM object access program
C
C                       Set REAL machine precision multiplier
C     PMPM =
      CALL REAL_SETMPM (PMPM)
C
C     ------------------------------------------------------------------
C
C                       Use DBL_SETTOL object access program
C
C                       Set DBL subtraction tolerance
C     DTOLER =
      CALL DBL_SETTOL (DTOLER)
C
C     ------------------------------------------------------------------
C
C                       Use DBL_SETMPM object access program
C
C                       Set DBL machine precision multiplier
C     DMPM =
      CALL DBL_SETMPM (DMPM)
C
C     ******************************************************************
C
C                       STEP 4  - Use FORTRAN primitive data type
C                       objects as needed
C
C     ------------------------------------------------------------------
C
C                       Use CHAR object access programs
C
C                       Convert an INT object to a CHAR object in base
C                       10 notation
C     IVAL =
C     NCHAR =
      CALL CHAR_CVINT (STR1,IVAL,NCHAR)
C
C                       Convert an INT object to a CHAR object in base 8
C                       notation
C     IVAL =
      CALL CHAR_CVINT8 (IVAL,OSTRNG)
C
C                       Convert a REAL object to a CHAR object
C     RNUM =
C     IPLACE =
      CALL CHAR_CVREAL (RNUM,IPLACE,CNUM,LPOWER)
C
C                       Find location of leftmost non-blank in a CHAR
C                       object
C     STR =
      IRETRN = CHAR_INDEXBL (STR)
C
C                       Get the length of a CHAR object excluding
C                       trailing blanks
C     STR =
      IRETRN = CHAR_LENBT (STR)
C
C                       Change the case of a CHAR object to lower
C     STR =
      CALL CHAR_LOWER (STR)
C
C                       Strip extraneous blanks from a CHAR object
C     STR =
      CALL CHAR_REMBE (STR)
C
C                       Strip leading blanks from a CHAR object
C     STR =
      CALL CHAR_REMBL (STR)
C
C                       Strip trailing blanks from a CHAR object
C     STR =
      CALL CHAR_REMBT (STR)
C
C                       Find location of rightmost blank in a CHAR
C                       object
C     STR =
      IRETRN = CHAR_SCANBT (STR)
C
C                       Change the case of a CHAR object to upper
C     STR =
      CALL CHAR_UPPER (STR)
C
C     ------------------------------------------------------------------
C
C                       Use CHARARY object access programs
C
C                       Get the length of a CHARARY object
C     CHRARY(1) =
      IRETRN = CHARARY_LENG (CHRARY)
C
C                       Convert an INT object to a CHARARY object
C     IVAL =
      CALL CHARARY_CVINT (IVAL,CHRARY)
C
C     ------------------------------------------------------------------
C
C                       Use CMPLX object access programs
C
C                       Subtract two CMPLX objects using tolerance
C                       checking
C     C1 =
C     C2 =
      XRETRN = CMPLX_DIF0 (C1,C2)
C
C                       Return .TRUE. if CMPLX difference is less than
C                       or equal to a tolerance
C     C1 =
C     C2 =
      LRETRN = CMPLX_IDIF0 (C1,C2)
C
C                       Swap two CMPLX objects
C     CSWAP1 =
C     CSWAP2 =
      CALL CMPLX_XCHG (CSWAP1,CSWAP2)
C
C     ------------------------------------------------------------------
C
C                       Use DBL object access programs
C
C                       Subtract two DBL objects using tolerance
C                       checking
C     D1 =
C     D2 =
      DRETRN = DBL_DIF0 (D1,D2)
C
C                       Store large value in a DBL object
      DRETRN = DBL_GETBIG ()
C
C                       Get value of DBL machine precision multiplier
      DRETRN = DBL_GETMPM ()
C
C                       Store value of pi in a DBL objec
      DRETRN = DBL_GETPI ()
C
C                       Get DBL subtraction tolerance
      DRETRN = DBL_GETTOL ()
C
C                       Return .TRUE. if DBL difference is less than or
C                       equal to a tolerance
C     D1 =
C     D2 =
      LRETRN = DBL_IDIF0 (D1,D2)
C
C                       Set DBL machine precision multiplier
C     DMPM =
      CALL DBL_SETMPM (DMPM)
C
C                       Set DBL subtraction tolerance
C     DTOLER =
      CALL DBL_SETTOL (DTOLER)
C
C                       Swap two DBL objects
C     DSWAP1 =
C     DSWAP2 =
      CALL DBL_XCHG (DSWAP1,DSWAP2)
C
C     ------------------------------------------------------------------
C
C                       Use HOLL object access programs
C
C                       Extract a byte from a HOLL object
C     IHOLLR =
C     NPOS =
      CALL HOLL_GETBYT (IHOLLR,NPOS,IEXTRC)
C
C                       Find the length of a HOLL object
C     IHOLLR =
      IRETRN = HOLL_LENG (IHOLLR)
C
C                       Convert a CHAR object to a HOLL object
C     CHRSRC =
C     NWORD =
      CALL HOLL_CVCHAR (IHOLLR,CHRSRC,NWORD)
C
C                       Convert a HOLL object to a CHAR object
C     IHOLLR =
C     NWORD =
      CALL HOLL_2CHAR (IHOLLR,CHRDST,NWORD)
C
C                       Insert a byte into a HOLL object
C     IHOLLR =
C     NPOS =
C     INSERT =
      CALL HOLL_SETBYT (IHOLLR,NPOS,INSERT)
C
C                       Extract an byte from, or insert an byte to, a
C                       HOLL object
C     OPTION =
C     IHOLLR =
C     NPOS =
C     IEXIN =
      CALL HOLL_BYTE (OPTION,IHOLLR,NPOS,IEXIN)
C
C                       Convert a CHARARY object to a HOLL object
C     CHRARY(1) =
      CALL HOLL_CVCHARY (CHRARY,IHOLLR)
C
C                       Convert a HOLL object to a CHARARY object
C     IHOLLR =
      CALL HOLL_2CHARY (IHOLLR,CHRARY)
C
C                       Convert a REAL object to a HOLL object
C     RVAL =
C     IOHOLL(1) =
      CALL HOLL_CVREAL (RVAL,IOHOLL)
C
C                       Copy one HOLL object to another
C     INHOLL(1) =
      CALL HOLL_COPY (INHOLL,IUHOLL)
C
C                       Strip leading blanks from a HOLL object
C     IHOLLR =
      CALL HOLL_REMBL (IHOLLR)
C
C                       Strip trailing blanks from a HOLL object
C     IHOLLR =
      CALL HOLL_REMBT (IHOLLR)
C
C     ------------------------------------------------------------------
C
C                       Use INT object access programs
C
C                       Logical 'and' of two INT objects
C     ITEM =
C     JTEM =
      IRETRN = IAND (ITEM,JTEM)
C
C                       Logical 'exclusive or' of two INT objects
C     ITEM =
C     JTEM =
      IRETRN = IEOR (ITEM,JTEM)
C
C                       Convert a character string to an INT object
C     CVALS =
C     NSEQ =
      IRETRN = INT_CVSTRING (CVALS,NSEQ,ISTAT)
C                       Check return status
      IF (ISTAT .NE. 0) THEN
C                       Check if illegal character found in string
        IF     (ISTAT .EQ. -1) THEN
          CONTINUE
C                       Check if 'Q' found in string
        ELSEIF (ISTAT .EQ. -2) THEN
          CONTINUE
C                       Check if 'P' found in string
        ELSEIF (ISTAT .EQ. -3) THEN
          CONTINUE
C                       Check if 'X' found in string
        ELSEIF (ISTAT .EQ. -4) THEN
          CONTINUE
C                       Check for unspecified error
        ELSE
          CONTINUE
        ENDIF
      ENDIF
C
C                       Logical 'or' of two INT objects
C     ITEM =
C     JTEM =
      IRETRN = IOR (ITEM,JTEM)
C
C                       Logical shift an INT object
C     IVALS =
C     NBITS =
      IRETRN = ISHFT (IVALS,NBITS)
C
C                       Swap two INT objects
C     ISWAP1 =
C     ISWAP2 =
      CALL INT_XCHG (ISWAP1,ISWAP2)
C
C     ------------------------------------------------------------------
C
C                       Use INTARY object access programs
C
C                       Sort an INTARY object in ascending order
C     INTARY =
C     LENIRY =
C     IPTR(1) =
      CALL INTARY_QSORT (INTARY,LENIRY,IPTR)
C
C     ------------------------------------------------------------------
C
C                       Use REAL object access programs
C
C                       Convert a sin and cosine to an angle from -180
C                       to +180 degrees
C     CSIN =
C     CCOS =
      RRETRN = REAL_ARCANG (CSIN,CCOS)
C
C                       Subtract two REAL objects using tolerance
C                       checking
C     S1 =
C     S2 =
      RRETRN = REAL_DIF0 (S1,S2)
C
C                       Store large value in a REAL object
      RRETRN = REAL_GETBIG ()
C
C                       Get value of REAL machine precision multiplier
      RRETRN = REAL_GETMPM ()
C
C                       Store value of pi in a REAL object
      RRETRN = REAL_GETPI ()
C
C                       Get value of REAL subtraction tolerance
      RRETRN = REAL_GETTOL ()
C
C                       Return .TRUE. if REAL difference is less than or
C                       equal to a tolerance
C     S1 =
C     S2 =
      LRETRN = REAL_IDIF0 (S1,S2)
C
C                       Convert a character string to a REAL object
C     CVALS =
C     NSEQ =
      RRETRN = REAL_CVSTRING (CVALS,NSEQ,ISTAT)
C                       Check return status
      IF (ISTAT .NE. 0) THEN
C                       Check if illegal character found in string
        IF     (ISTAT .EQ. -1) THEN
          CONTINUE
C                       Check if 'Q' found in string
        ELSEIF (ISTAT .EQ. -2) THEN
          CONTINUE
C                       Check if 'P' found in string
        ELSEIF (ISTAT .EQ. -3) THEN
          CONTINUE
C                       Check if 'X' found in string
        ELSEIF (ISTAT .EQ. -4) THEN
          CONTINUE
C                       Check for unspecified error
        ELSE
          CONTINUE
        ENDIF
      ENDIF
C
C                       Set REAL machine precision multiplier
C     PMPM =
      CALL REAL_SETMPM (PMPM)
C
C                       Set REAL subtraction tolerance
C     TOLER =
      CALL REAL_SETTOL (TOLER)
C
C                       Swap two REAL objects
C     RSWAP1 =
C     RSWAP2 =
      CALL REAL_XCHG (RSWAP1,RSWAP2)
C
C     ------------------------------------------------------------------
C
C                       Use REALARY object access programs
C
C                       Find the minimum and maximum values in a REALARY
C                       object
C     ARRAY =
C     LENRRY =
      CALL REALARY_MINMAX (ARRAY,LENRRY,BMIN,BMAX)
C
C                       Sort a REALARY object in ascending order
C     ARRAY =
C     LENRRY =
C     IPTR(1) =
      CALL REALARY_QSORT (ARRAY,LENRRY,IPTR)
C
C     ******************************************************************
C
C                       STEP 5  - Terminate program execution using
C                       PRL-POSIX
C
C     ------------------------------------------------------------------
C
C                       Use PROCESS_EXIT object access program
C
C                       Silently terminate program execution
      CALL PROCESS_EXIT ()
      END
STOP_CAT
echo "  <CR> to Continue"
read answer
cat <<STOP_CAT> ./compile
echo "
 
  Compiling and linking demo programs.
 "
echo "  Compiling ======> [ ./char1.f ]"
$LINK ./char1.f -o ./char1.x $PROGRLANG
chmod 0770 ./char1.x
echo "  Compiling ======> [ ./char10.f ]"
$LINK ./char10.f -o ./char10.x $PROGRLANG
chmod 0770 ./char10.x
echo "  Compiling ======> [ ./char11.f ]"
$LINK ./char11.f -o ./char11.x $PROGRLANG
chmod 0770 ./char11.x
echo "  Compiling ======> [ ./char2.f ]"
$LINK ./char2.f -o ./char2.x $PROGRLANG
chmod 0770 ./char2.x
echo "  Compiling ======> [ ./char3.f ]"
$LINK ./char3.f -o ./char3.x $PROGRLANG
chmod 0770 ./char3.x
echo "  Compiling ======> [ ./char4.f ]"
$LINK ./char4.f -o ./char4.x $PROGRLANG
chmod 0770 ./char4.x
echo "  Compiling ======> [ ./char5.f ]"
$LINK ./char5.f -o ./char5.x $PROGRLANG
chmod 0770 ./char5.x
echo "  Compiling ======> [ ./char6.f ]"
$LINK ./char6.f -o ./char6.x $PROGRLANG
chmod 0770 ./char6.x
echo "  Compiling ======> [ ./char7.f ]"
$LINK ./char7.f -o ./char7.x $PROGRLANG
chmod 0770 ./char7.x
echo "  Compiling ======> [ ./char8.f ]"
$LINK ./char8.f -o ./char8.x $PROGRLANG
chmod 0770 ./char8.x
echo "  Compiling ======> [ ./char9.f ]"
$LINK ./char9.f -o ./char9.x $PROGRLANG
chmod 0770 ./char9.x
echo "  Converting ======> [ ./char_cvint.uuu ]"
uudecode ./char_cvint.uuu
chmod 0660 ./char_cvint.dat
echo "  Converting ======> [ ./char_cvint8.uuu ]"
uudecode ./char_cvint8.uuu
chmod 0660 ./char_cvint8.dat
echo "  Converting ======> [ ./char_indexbl.uuu ]"
uudecode ./char_indexbl.uuu
chmod 0660 ./char_indexbl.dat
echo "  Converting ======> [ ./char_lenbt.uuu ]"
uudecode ./char_lenbt.uuu
chmod 0660 ./char_lenbt.dat
echo "  Converting ======> [ ./char_lower.uuu ]"
uudecode ./char_lower.uuu
chmod 0660 ./char_lower.dat
echo "  Converting ======> [ ./char_rembe.uuu ]"
uudecode ./char_rembe.uuu
chmod 0660 ./char_rembe.dat
echo "  Converting ======> [ ./char_rembl.uuu ]"
uudecode ./char_rembl.uuu
chmod 0660 ./char_rembl.dat
echo "  Converting ======> [ ./char_rembt.uuu ]"
uudecode ./char_rembt.uuu
chmod 0660 ./char_rembt.dat
echo "  Converting ======> [ ./char_scanbt.uuu ]"
uudecode ./char_scanbt.uuu
chmod 0660 ./char_scanbt.dat
echo "  Converting ======> [ ./char_upper.uuu ]"
uudecode ./char_upper.uuu
chmod 0660 ./char_upper.dat
echo "  Compiling ======> [ ./charary1.f ]"
$LINK ./charary1.f -o ./charary1.x $PROGRLANG
chmod 0770 ./charary1.x
echo "  Compiling ======> [ ./charary2.f ]"
$LINK ./charary2.f -o ./charary2.x $PROGRLANG
chmod 0770 ./charary2.x
echo "  Converting ======> [ ./charary_cvint.uuu ]"
uudecode ./charary_cvint.uuu
chmod 0660 ./charary_cvint.dat
echo "  Converting ======> [ ./charary_leng.uuu ]"
uudecode ./charary_leng.uuu
chmod 0660 ./charary_leng.dat
echo "  Compiling ======> [ ./cmplx1.f ]"
$LINK ./cmplx1.f -o ./cmplx1.x $PROGRLANG
chmod 0770 ./cmplx1.x
echo "  Compiling ======> [ ./cmplx2.f ]"
$LINK ./cmplx2.f -o ./cmplx2.x $PROGRLANG
chmod 0770 ./cmplx2.x
echo "  Compiling ======> [ ./cmplx3.f ]"
$LINK ./cmplx3.f -o ./cmplx3.x $PROGRLANG
chmod 0770 ./cmplx3.x
echo "  Converting ======> [ ./cmplx_dif0.uuu ]"
uudecode ./cmplx_dif0.uuu
chmod 0660 ./cmplx_dif0.dat
echo "  Converting ======> [ ./cmplx_idif0.uuu ]"
uudecode ./cmplx_idif0.uuu
chmod 0660 ./cmplx_idif0.dat
echo "  Converting ======> [ ./cmplx_xchg.uuu ]"
uudecode ./cmplx_xchg.uuu
chmod 0660 ./cmplx_xchg.dat
echo "  Compiling ======> [ ./dbl1.f ]"
$LINK ./dbl1.f -o ./dbl1.x $PROGRLANG
chmod 0770 ./dbl1.x
echo "  Compiling ======> [ ./dbl2.f ]"
$LINK ./dbl2.f -o ./dbl2.x $PROGRLANG
chmod 0770 ./dbl2.x
echo "  Compiling ======> [ ./dbl3.f ]"
$LINK ./dbl3.f -o ./dbl3.x $PROGRLANG
chmod 0770 ./dbl3.x
echo "  Compiling ======> [ ./dbl4.f ]"
$LINK ./dbl4.f -o ./dbl4.x $PROGRLANG
chmod 0770 ./dbl4.x
echo "  Compiling ======> [ ./dbl5.f ]"
$LINK ./dbl5.f -o ./dbl5.x $PROGRLANG
chmod 0770 ./dbl5.x
echo "  Compiling ======> [ ./dbl6.f ]"
$LINK ./dbl6.f -o ./dbl6.x $PROGRLANG
chmod 0770 ./dbl6.x
echo "  Compiling ======> [ ./dbl7.f ]"
$LINK ./dbl7.f -o ./dbl7.x $PROGRLANG
chmod 0770 ./dbl7.x
echo "  Compiling ======> [ ./dbl8.f ]"
$LINK ./dbl8.f -o ./dbl8.x $PROGRLANG
chmod 0770 ./dbl8.x
echo "  Compiling ======> [ ./dbl9.f ]"
$LINK ./dbl9.f -o ./dbl9.x $PROGRLANG
chmod 0770 ./dbl9.x
echo "  Converting ======> [ ./dbl_dif0.uuu ]"
uudecode ./dbl_dif0.uuu
chmod 0660 ./dbl_dif0.dat
echo "  Converting ======> [ ./dbl_getbig.uuu ]"
uudecode ./dbl_getbig.uuu
chmod 0660 ./dbl_getbig.dat
echo "  Converting ======> [ ./dbl_getmpm.uuu ]"
uudecode ./dbl_getmpm.uuu
chmod 0660 ./dbl_getmpm.dat
echo "  Converting ======> [ ./dbl_getpi.uuu ]"
uudecode ./dbl_getpi.uuu
chmod 0660 ./dbl_getpi.dat
echo "  Converting ======> [ ./dbl_gettol.uuu ]"
uudecode ./dbl_gettol.uuu
chmod 0660 ./dbl_gettol.dat
echo "  Converting ======> [ ./dbl_idif0.uuu ]"
uudecode ./dbl_idif0.uuu
chmod 0660 ./dbl_idif0.dat
echo "  Converting ======> [ ./dbl_setmpm.uuu ]"
uudecode ./dbl_setmpm.uuu
chmod 0660 ./dbl_setmpm.dat
echo "  Converting ======> [ ./dbl_settol.uuu ]"
uudecode ./dbl_settol.uuu
chmod 0660 ./dbl_settol.dat
echo "  Converting ======> [ ./dbl_xchg.uuu ]"
uudecode ./dbl_xchg.uuu
chmod 0660 ./dbl_xchg.dat
echo "  Compiling ======> [ ./holl1.f ]"
$LINK ./holl1.f -o ./holl1.x $PROGRLANG
chmod 0770 ./holl1.x
echo "  Compiling ======> [ ./holl10.f ]"
$LINK ./holl10.f -o ./holl10.x $PROGRLANG
chmod 0770 ./holl10.x
echo "  Compiling ======> [ ./holl11.f ]"
$LINK ./holl11.f -o ./holl11.x $PROGRLANG
chmod 0770 ./holl11.x
echo "  Compiling ======> [ ./holl12.f ]"
$LINK ./holl12.f -o ./holl12.x $PROGRLANG
chmod 0770 ./holl12.x
echo "  Compiling ======> [ ./holl2.f ]"
$LINK ./holl2.f -o ./holl2.x $PROGRLANG
chmod 0770 ./holl2.x
echo "  Compiling ======> [ ./holl3.f ]"
$LINK ./holl3.f -o ./holl3.x $PROGRLANG
chmod 0770 ./holl3.x
echo "  Compiling ======> [ ./holl4.f ]"
$LINK ./holl4.f -o ./holl4.x $PROGRLANG
chmod 0770 ./holl4.x
echo "  Compiling ======> [ ./holl5.f ]"
$LINK ./holl5.f -o ./holl5.x $PROGRLANG
chmod 0770 ./holl5.x
echo "  Compiling ======> [ ./holl6.f ]"
$LINK ./holl6.f -o ./holl6.x $PROGRLANG
chmod 0770 ./holl6.x
echo "  Compiling ======> [ ./holl7.f ]"
$LINK ./holl7.f -o ./holl7.x $PROGRLANG
chmod 0770 ./holl7.x
echo "  Compiling ======> [ ./holl8.f ]"
$LINK ./holl8.f -o ./holl8.x $PROGRLANG
chmod 0770 ./holl8.x
echo "  Compiling ======> [ ./holl9.f ]"
$LINK ./holl9.f -o ./holl9.x $PROGRLANG
chmod 0770 ./holl9.x
echo "  Compiling ======> [ ./int1.f ]"
$LINK ./int1.f -o ./int1.x $PROGRLANG
chmod 0770 ./int1.x
echo "  Compiling ======> [ ./int2.f ]"
$LINK ./int2.f -o ./int2.x $PROGRLANG
chmod 0770 ./int2.x
echo "  Compiling ======> [ ./int3.f ]"
$LINK ./int3.f -o ./int3.x $PROGRLANG
chmod 0770 ./int3.x
echo "  Compiling ======> [ ./int4.f ]"
$LINK ./int4.f -o ./int4.x $PROGRLANG
chmod 0770 ./int4.x
echo "  Compiling ======> [ ./int5.f ]"
$LINK ./int5.f -o ./int5.x $PROGRLANG
chmod 0770 ./int5.x
echo "  Compiling ======> [ ./int6.f ]"
$LINK ./int6.f -o ./int6.x $PROGRLANG
chmod 0770 ./int6.x
echo "  Converting ======> [ ./int_cvstring.uuu ]"
uudecode ./int_cvstring.uuu
chmod 0660 ./int_cvstring.dat
echo "  Converting ======> [ ./int_iand.uuu ]"
uudecode ./int_iand.uuu
chmod 0660 ./int_iand.dat
echo "  Converting ======> [ ./int_ieor.uuu ]"
uudecode ./int_ieor.uuu
chmod 0660 ./int_ieor.dat
echo "  Converting ======> [ ./int_ior.uuu ]"
uudecode ./int_ior.uuu
chmod 0660 ./int_ior.dat
echo "  Converting ======> [ ./int_xchg.uuu ]"
uudecode ./int_xchg.uuu
chmod 0660 ./int_xchg.dat
echo "  Compiling ======> [ ./intary1.f ]"
$LINK ./intary1.f -o ./intary1.x $PROGRLANG
chmod 0770 ./intary1.x
echo "  Converting ======> [ ./intary_qsort.uuu ]"
uudecode ./intary_qsort.uuu
chmod 0660 ./intary_qsort.dat
echo "  Compiling ======> [ ./prl1.f ]"
$LINK ./prl1.f -o ./prl1.x $PROGRLANG
chmod 0770 ./prl1.x
echo "  Compiling ======> [ ./process1.f ]"
$LINK ./process1.f -o ./process1.x $PROGRLANG
chmod 0770 ./process1.x
echo "  Compiling ======> [ ./progrlang1.f ]"
$LINK ./progrlang1.f -o ./progrlang1.x $PROGRLANG
chmod 0770 ./progrlang1.x
echo "  Compiling ======> [ ./real1.f ]"
$LINK ./real1.f -o ./real1.x $PROGRLANG
chmod 0770 ./real1.x
echo "  Compiling ======> [ ./real10.f ]"
$LINK ./real10.f -o ./real10.x $PROGRLANG
chmod 0770 ./real10.x
echo "  Compiling ======> [ ./real11.f ]"
$LINK ./real11.f -o ./real11.x $PROGRLANG
chmod 0770 ./real11.x
echo "  Compiling ======> [ ./real2.f ]"
$LINK ./real2.f -o ./real2.x $PROGRLANG
chmod 0770 ./real2.x
echo "  Compiling ======> [ ./real3.f ]"
$LINK ./real3.f -o ./real3.x $PROGRLANG
chmod 0770 ./real3.x
echo "  Compiling ======> [ ./real4.f ]"
$LINK ./real4.f -o ./real4.x $PROGRLANG
chmod 0770 ./real4.x
echo "  Compiling ======> [ ./real5.f ]"
$LINK ./real5.f -o ./real5.x $PROGRLANG
chmod 0770 ./real5.x
echo "  Compiling ======> [ ./real6.f ]"
$LINK ./real6.f -o ./real6.x $PROGRLANG
chmod 0770 ./real6.x
echo "  Compiling ======> [ ./real7.f ]"
$LINK ./real7.f -o ./real7.x $PROGRLANG
chmod 0770 ./real7.x
echo "  Compiling ======> [ ./real8.f ]"
$LINK ./real8.f -o ./real8.x $PROGRLANG
chmod 0770 ./real8.x
echo "  Compiling ======> [ ./real9.f ]"
$LINK ./real9.f -o ./real9.x $PROGRLANG
chmod 0770 ./real9.x
echo "  Converting ======> [ ./real_arcang.uuu ]"
uudecode ./real_arcang.uuu
chmod 0660 ./real_arcang.dat
echo "  Converting ======> [ ./real_cvstring.uuu ]"
uudecode ./real_cvstring.uuu
chmod 0660 ./real_cvstring.dat
echo "  Converting ======> [ ./real_dif0.uuu ]"
uudecode ./real_dif0.uuu
chmod 0660 ./real_dif0.dat
echo "  Converting ======> [ ./real_getbig.uuu ]"
uudecode ./real_getbig.uuu
chmod 0660 ./real_getbig.dat
echo "  Converting ======> [ ./real_getmpm.uuu ]"
uudecode ./real_getmpm.uuu
chmod 0660 ./real_getmpm.dat
echo "  Converting ======> [ ./real_getpi.uuu ]"
uudecode ./real_getpi.uuu
chmod 0660 ./real_getpi.dat
echo "  Converting ======> [ ./real_gettol.uuu ]"
uudecode ./real_gettol.uuu
chmod 0660 ./real_gettol.dat
echo "  Converting ======> [ ./real_idif0.uuu ]"
uudecode ./real_idif0.uuu
chmod 0660 ./real_idif0.dat
echo "  Converting ======> [ ./real_setmpm.uuu ]"
uudecode ./real_setmpm.uuu
chmod 0660 ./real_setmpm.dat
echo "  Converting ======> [ ./real_settol.uuu ]"
uudecode ./real_settol.uuu
chmod 0660 ./real_settol.dat
echo "  Converting ======> [ ./real_xchg.uuu ]"
uudecode ./real_xchg.uuu
chmod 0660 ./real_xchg.dat
echo "  Compiling ======> [ ./realary1.f ]"
$LINK ./realary1.f -o ./realary1.x $PROGRLANG
chmod 0770 ./realary1.x
echo "  Compiling ======> [ ./realary2.f ]"
$LINK ./realary2.f -o ./realary2.x $PROGRLANG
chmod 0770 ./realary2.x
echo "  Converting ======> [ ./realary_minmax.uuu ]"
uudecode ./realary_minmax.uuu
chmod 0660 ./realary_minmax.dat
echo "  Converting ======> [ ./realary_qsort.uuu ]"
uudecode ./realary_qsort.uuu
chmod 0660 ./realary_qsort.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
                        PROGRLANG
 

 
  PRL-PROGRLANG demonstration programs. These programs
  test and demonstrate the capabilities of the
  PRL-PROGRLANG library.
 
  <CR> to Continue"
read answer
while [ 1 -eq 1 ]; do
$CLEAR
echo "
 Select Demo Program
 ===================
   1 ./_progrlang.tk  2 ./char1          3 ./char10         4 ./char11          
   5 ./char2          6 ./char3          7 ./char4          8 ./char5           
   9 ./char6         10 ./char7         11 ./char8         12 ./char9           
  13 ./charary1      14 ./charary2      15 ./cmplx1        16 ./cmplx2          
  17 ./cmplx3        18 ./dbl1          19 ./dbl2          20 ./dbl3            
  21 ./dbl4          22 ./dbl5          23 ./dbl6          24 ./dbl7            
  25 ./dbl8          26 ./dbl9          27 ./holl1         28 ./holl10          
  29 ./holl11        30 ./holl12        31 ./holl2         32 ./holl3           
  33 ./holl4         34 ./holl5         35 ./holl6         36 ./holl7           
  37 ./holl8         38 ./holl9         39 ./int1          40 ./int2            
  41 ./int3          42 ./int4          43 ./int5          44 ./int6            
  45 ./intary1       46 ./prl1          47 ./process1      48 ./progrlang1      
  49 ./real1         50 ./real10        51 ./real11        52 ./real2           
  53 ./real3         54 ./real4         55 ./real5         56 ./real6           
  57 ./real7         58 ./real8         59 ./real9         60 ./realary1        
  61 ./realary2                                                                 
 
   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 ./_progrlang.tk;;
  2) ./char1.x;;
  3) ./char10.x;;
  4) ./char11.x;;
  5) ./char2.x;;
  6) ./char3.x;;
  7) ./char4.x;;
  8) ./char5.x;;
  9) ./char6.x;;
 10) ./char7.x;;
 11) ./char8.x;;
 12) ./char9.x;;
 13) ./charary1.x;;
 14) ./charary2.x;;
 15) ./cmplx1.x;;
 16) ./cmplx2.x;;
 17) ./cmplx3.x;;
 18) ./dbl1.x;;
 19) ./dbl2.x;;
 20) ./dbl3.x;;
 21) ./dbl4.x;;
 22) ./dbl5.x;;
 23) ./dbl6.x;;
 24) ./dbl7.x;;
 25) ./dbl8.x;;
 26) ./dbl9.x;;
 27) ./holl1.x;;
 28) ./holl10.x;;
 29) ./holl11.x;;
 30) ./holl12.x;;
 31) ./holl2.x;;
 32) ./holl3.x;;
 33) ./holl4.x;;
 34) ./holl5.x;;
 35) ./holl6.x;;
 36) ./holl7.x;;
 37) ./holl8.x;;
 38) ./holl9.x;;
 39) ./int1.x;;
 40) ./int2.x;;
 41) ./int3.x;;
 42) ./int4.x;;
 43) ./int5.x;;
 44) ./int6.x;;
 45) ./intary1.x;;
 46) ./prl1.x;;
 47) ./process1.x;;
 48) ./progrlang1.x;;
 49) ./real1.x;;
 50) ./real10.x;;
 51) ./real11.x;;
 52) ./real2.x;;
 53) ./real3.x;;
 54) ./real4.x;;
 55) ./real5.x;;
 56) ./real6.x;;
 57) ./real7.x;;
 58) ./real8.x;;
 59) ./real9.x;;
 60) ./realary1.x;;
 61) ./realary2.x;;
  *) echo "Invalid Choice
 
  <CR> to Continue"
read answer;;
esac
done
$CLEAR
echo "
                    Object Access
            Programmer's Reusable Library
                        PROGRLANG
 

 
       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
                        PROGRLANG
 

  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
                        PROGRLANG
 

  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
                        PROGRLANG
 

  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
