SUBROUTINE XCH ( I, IOPT )

Argument Definitions (+ indicates altered content)
INTEGER            I,          IOPT
Description
  Copyright (C) 1978 Charlotte Froese Fisher 
  Copyright (C) 2012 Jacek Kobus 
 
The xch function computes a function x such that for 
   iopt = 1  x =sqrt(r)*true exchange function 
   iopt = 2  x = true exchange function/sqrt(r) 
   iopt = 3  x = r**3/2*(true exchange + off-diagonal terms)
Source file:xch.f
Intrinsic Functions Called
GENERIC*8          ABS
External Functions and Subroutines Called
REAL*8             BB,         HL,         QUADR,      RK
SUBROUTINE         DIFF,       YKF
Parameter Variables Used
INTEGER            MAXNO              (MAXNO = 29999)
INTEGER            MAXORB             (MAXORB = 20)
Local Variables (+ indicates altered content)
INTEGER           +I1,        +I2,        +II,        +III
INTEGER           +IJ1,       +IJ2,       +IJT,       +J
INTEGER           +JJ,        +K,         +LJ,        +M
INTEGER           +N1,        +N2
REAL*8            +C,         +CC
Referenced Common Block Variables (+ indicates altered content)
COEFF              REAL*8             B(MAXORB,MAXORB,5)
MCOMMBLOCK         INTEGER            L(MAXORB)
MCOMMBLOCK         REAL*8             P(MAXORB,MAXNO)
MCOMMBLOCK         REAL*8             R(MAXNO),  RR(MAXNO)
MCOMMBLOCK         REAL*8            +X(MAXNO),  YK(MAXNO)
PARAM              INTEGER            NO,        NWF
PARAM0             INTEGER            IONE,      IZERO
PARAM1             REAL*8             D0,        D2
REL                INTEGER            IREL
STATE              INTEGER           +I1R(300), +I2R(300)
STATE              INTEGER           +ILI(MAXORB)
STATE              INTEGER           +ILJ(MAXORB)
STATE              INTEGER           +ILO(MAXORB)
STATE              INTEGER            IO(300),   IQ(300)
STATE              INTEGER           +J1R(300), +J2R(300)
STATE              INTEGER           +JLO(MAXORB)
STATE              INTEGER            JO(300),   KR(300)
STATE              INTEGER            LQ(MAXORB)
STATE              INTEGER            NCLI(MAXORB)
STATE              INTEGER            NCLJ(MAXORB)
STATE              INTEGER            NCRI(300)
STATE              INTEGER            NCRJ(300)
STATE              INTEGER            NL,        NR
STATE              REAL*8             CL(MAXORB)
STATE              REAL*8             CR(300),   WT(40)
TEST               LOGICAL*1          RSCAN(MAXORB)
WAVE               INTEGER           +METH(MAXORB)
WAVE               REAL*8             E(MAXORB,MAXORB)
WAVE               REAL*8             SUM(MAXORB)