
                  E X A M P L E     R U N S

Example 1 (unicos)
 Starting with unprocessed data from the inner region codes, the following
 job calculates eigen-phases and integrated cross-sections for a single
 geometry and overall symmetry

cat > outer.f << EOF
      PROGRAM VRMAT
C
      COMMON/HEAP/IX
      POINTER (IX,BIGVEC(1))
C
C---- The program will need 4 scratch files (LUCHAN,LURMT,LUKMT and LUTMT)
      DATA NBUF/4/,IFAIL/0/
C
C---- Set up big vector using all available memory
      CALL GETCOR(NBUF,IX,ISTART,MCOR)
C
C---- Pre-process inner region data
      CALL INTERF(BIGVEC(ISTART),MCOR,IFAIL)
      IF(IFAIL.NE.0) STOP
C
C---- Calculate K-matrices
      CALL RSOLVE(BIGVEC(ISTART),MCOR,IFAIL)
      IF(IFAIL.NE.0) STOP
C
C---- Calculate eigen-phases
      CALL EIGENP(BIGVEC(ISTART),MCOR,IFAIL)
C
C---- Calculate T-matrices
      CALL TMATRX(BIGVEC(ISTART),MCOR,IFAIL)
      IF(IFAIL.NE.0) STOP
C
C---- Calculate integrated cross-sections
      CALL IXSECS(BIGVEC(ISTART),MCOR,IFAIL)
C
      STOP
      END
EOF
cat > outer.data << EOF
 &INTFIN
  NAME=' HF PI STATIC EXCHANGE + POLARIZATION',
  NELT=10,
  MGVN=1,STOT= 2,GUTOT=0,
  RMATR=10.0,  ISMAX= 2,  
  R= 1.7238, NTSET=0,
  IMCSF=1,1,
 &END
 &RSLVIN
  NAME=' HF PI SEP',
  MGVN=1,STOT=2,GUTOT=0,
  R=1.7328,
  ISMAX=2,
  NESCAT=150,EINC=0.025,0.025,IEUNIT=2,
 &END
 &BPROP IGAIL=1,RAF=80.1, &END
 &PHASIN NAME=' HF PI SEP',&END
 &TMATIN NAME=' HF PI SEP',&END
 &XSECIN NAME=' HF PI SEP',&END
EOF



Example 2:
Vibrational excitation cross-sections are to be calculated using the adiabatic
nuclei approximation.  The inner region data has already been processed by 
INTERF. Channel and R-matrix data will be needed for each geometry.  In this 
case they are saved as sets 1,2,3,... on two files, unit 10 for channels and
unit 21 for R-matrix data.

(The comments should be removed from the data before and actual run)

      PROGRAM VRMAT
C
      COMMON/HEAP/IX
      POINTER (IX,BIGVEC(1))
C
      DATA NBUF/4/,IFAIL/0/
C
C---- Set up big vector using all available memory
      CALL GETCOR(NBUF,IX,ISTART,MCOR)
C
C---- Loop over geometries to get fixed nuclei K-matrices
C
      DO 1 I=1,7
 1    CALL RSOLVE(BIGVEC(ISTART),MCOR,IFAIL)
C
C---- Calculate T-matrices
      CALl TMATRX(BIGVEC(ISTART),MCOR,IFAIL)
C
C---- Calculate integrated cross-sections
      CALL IXSECS(BIGVEC(ISTART),MCOR,IFAIL)
C
      STOP
      END
EOF
 &RSLVIN
  NAME=' HF PI SEP',
  MGVN=1,STOT=2,GUTOT=0,  ! Overall symmetry doublet-pi
  R=1.3,                  ! Internuclear separation
  NCHSET=1,NRMSET=1,      ! First sets on both channel and R-matrix files
  NKSET=1,                ! Write K-matrices to first set on K-matrix file
  ISMAX=2,                ! Use up to quadrupole in asymptotic potential
  NESCAT=150,  IEUNIT=2,  ! 150 energy points, units are eV
  EINC=0.025,0.025,       ! Starting value and increment in eV
 &END
 &BPROP RAF=60.1, IGAIL=1,! Propagate R-matrices to 60.1 au then use Gailitis
 &END
 &RSLVIN                  ! as above but with the following changes
  R=1.5,                  ! the next geometry
  NCHSET=2, NRMSET=2,     ! the input data is on set 2 on both files
  NKSET=0,                ! add K-matrices to end of existing file
 &END
 &BPROP  RAF=60.1, IGAIL=1! These must always be reset
 &END
 &RSLVIN                  ! This is exactly as above but for geometry 3
  R=1.7328, NCHSET=3, NRMSET=3,NKSET=0, ICFORM='F',IRFORM='F'
 &END
 &BPROP  &END
 &RSLVIN
  R=1.9, NCHSET=4, NRMSET=4,NKSET=0, 
 &END
 &BPROP  RAF=60.1, IGAIL=1,
 &END
 &RSLVIN
  R=2.1, NCHSET=5, NRMSET=5,NKSET=0, 
 &END
 &BPROP  RAF=60.1, IGAIL=1,
 &END
 &RSLVIN
  R=2.3, NCHSET=6,NRMSET=6,NKSET=0, 
 &END
 &BPROP  RAF=60.1, IGAIL=1,
 &END
 &RSLVIN
  R=2.5, NCHSET=7, NRMSET=7,NKSET=0,
 &END
 &BPROP  RAF=60.1, IGAIL=1,
 &END
 &TMATIN NAME=' HF PI SEP',
  NAVGE=1,NVTARG=6,              ! adiabatic average for 6 vibrational levels
  NGEOM=7,R=1.3,1.5,1.7328,1.9,2.1,2.3,2.5,   ! 7 geometries
  NREQ=3,NCHSET=3,               ! equilibrium geometry is no.3 
 &END
 &VIBIN E0=-100.07136,DE=0.2387,RE=1.696,BETA=1.260,  ! Morse functions
 &END
 &XSECIN NAME=' HF PI SEP',
 LUCHAN=28,   ! vibrational channel data is on unit 28 (scratch file)
 IEUNIT=2,    ! output energies in eV
 IXSN=2,      ! output cross-sections in angstroms**2
 &END
EOF

Example 3:
 Calculates eigenphases and cross-sections for vibrational excitation
 using a non-adiabatic approximation.  The channel and R-matrix data has been
 saved as formatted data, which will allow tranfer between machines.
 Vibrationally resolved channel data and T-matrices are produced by VIBRMT
 and are passed to the other modules.

      program VRMAT
c
      COMMON/HEAP/IX
      POINTER (IX,BIGVEC(1))
C
      DATA NBUF/4/,IFAIL/0/
C
C---- Set up big vector using all available memory
      CALL GETCOR(NBUF,IX,ISTART,MCOR)
C
      CALL VIBRMT(BIGVEC(bigvec(istart),MCOR,IFAIL)
C
      call RSOLVE(BIGVEC(bigvec(istart),mcor,IFAIL)
c
      call TMATRX(BIGVEC(bigvec(istart),mcor,IFAIL)
c
      call EIGENP(BIGVEC(bigvec(istart),mcor,IFAIL)
C
      CALL IXSECS(BIGVEC(bigvec(istart),MCOR,IFAIL)
c
      stop
      end
EOF
 &VRMTIN
  NAME=' HF PI SEP',
  MGVN=1,STOT=2,GUTOT=0,
  NGEOM=7,R=1.3,1.5,1.7328,1.9,2.1,2.3,2.5,
  ICFORM='F',IRFORM='F'
  ISMAX=2,NPOLE=3,NRQUAD=201,NVTARG=6,
 &END
 &VIBIN E0=-100.07136,DE=0.2387,RE=1.696,BETA=1.260, &END
 &RSLVIN
  NAME=' HF PI SEP',
  MGVN=1,STOT=2,GUTOT=0,
  NGEOM=7,R=1.3,1.5,1.7328,1.9,2.1,2.3,2.5,
  ICFORM='F',IRFORM='F'
  ISMAX=2,NPOLE=3,NRQUAD=201,NVTARG=6,
  NESCAT=150,EINC=0.025,0.025,IEUNIT=2,
 &END
 &VIBIN E0=-100.07136,DE=0.2387,RE=1.696,BETA=1.260, &END
 &BPROP RAF=80.1, IGAIL=1, &END
 &TMATIN NAME=' HF PI SEP',LUCHAN=28,
 &END
 &PHASIN NAME=' HF PI SEP',LUCHAN=28,IEUNIT=2,
 &END
 &XSECIN NAME=' HF PI SEP',LUCHAN=28,IEUNIT=2,IXSN=2,
 &END
EOF

Example 4:
 Calculates bound state energies and wavefunctions.
 Target property data is fetched from the front end machine.  
 The JCL is UNICOS as implemented at RAL.

# user=xyz pw=abc123
# QSUB-A pqrst
# QSUB-r temp3
# QSUB-eo
# QSUB-lT 500
# QSUB-lm 1000Kw
# QSUB
set +x
cd $TMPDIR
mkdir SEB$$
cd SEB$$
cat > outer.f <<EOF
      PROGRAM RMAT
      COMMON/HEAP/IX
      POINTER (IX,BIGVEC(1))
C
      DATA NBUF/8/,IFAIL/0/
C
C---- Set up big vector using all available memory
      CALL GETCOR(NBUF,IX,ISTART,NCOR)
C
C---- CALL INTERFACE ROUTINES
      CALL INTERF(BIGVEC(ISTART),NCOR,IFAIL)
C
      CALL BOUND(BIGVEC(ISTART),NCOR,IFAIL)
      STOP
      END
EOF
cat > outer.data << EOF
 &INTFIN
  NAME=' CH+ 3 STATE 2 SIGMA POLARIZATION',
  NELT=6,MGVN=1,STOT=2, GUTOT=0,
  NTARG=3,  
  RMATR=10.,
  NASET=1,
  NTSET=1,
  NCISET=2, NOCSF=201,
  IMCSF=1,1, 0,0, 3,0, 2,0,
  ISMAX= 2,
  R=2.137,
 &END
 &BOUNDIN
  NAME=' CH+ ',
  GUTOT=0,MGVN=0,STOT=2,
  NGEOM=1,R=2.137,
  ISMAX=2,
  NBOUND=5,
 &END
 &BPROP
  RAF=60.,
 &END
EOF
set -x
cft77 -es -dp outer.f
cat outer.l
segldr -l nag,/atlas/rmat/outer.test.a  outer.o
cp /atlas/seb/cos/chp/buttle fort.23 || exit
cp /atlas/seb/cos/chp/amps fort.22 || exit
cp /atlas/seb/cos/chp/ci fort.25 || exit
fetch fort.24  -m VH -t'fn=chp,ft=prop,tid=seb,pw=secret'
a.out < outer.data
