                   APSUP

            Array Processor related routines


I. [.FPS] : True AP-120B routines done in house

A. Pseudo-Fortran versions (X => not converted to meet standards)

APGRID   Appl      Float, scale, taper, and grid UV data in AP
APRFT    FFT util  Computes real, inverse FT from arbitrarily spaced
                   data
BOXSUM   Util      Box car sum of data in AP memory
CLNSUB   Appl      Cleans portion of map residing in AP
CSQTRN   Util      In place matrix transpose
CVCMUL   Util      Multiply complex scalar and vector
DIRADD   Util      Directed complex add: B(a(*)) = B(a(*)) + a(*+1)
GRDFIN   Appl      Finish up gridding: shift phases to force center,
                   add in beam, do conj. near u=0.
HIST     Util      Makes histogram of vector
MAXMIN   Util      Find max and min of vector
MCALC    Appl      Calculate model visibilities (for ASCAL)
RECT     Util      Convert rectangular to polar coords (fix of FPS)
TPVF1
TPVF2
VIDIV    Util      Divide vector by integer
VTRANS   FFT util  Transposes matrix in AP memory



B. Vector Function Chainer routines

APGRID   Appl      Float, scale, taper, and grid UV data in AP
                   Calls micro routines: APGRD1, APGRD2
APRFT    FFT util  Computes real, inverse FT from arbitrarily spaced
                   data.  Calls micro routines: PHSROT
GRDFIN   Appl      Finish up gridding: shift phases to force center,
                   add in beam, do conj. near u=0.
                   Calls micro routines: PHSROT
MCALC    Appl      Calculates model visibilities (for ASCAL)
PTSUB    Appl      Subtracts CLEAN components from uv data.



C. Microcode

CLNSUB   Appl      Cleans portion of map residing in AP
DIRADD   Util      Directed complex add: B(a(*)) = B(a(*)) + a(*+1)

WDC      Util/appl Contains following micro routines:
APGRD1   Appl      Grids IPOL UV data accumulates gridded vis's,
                   weights, counts
HIST     Util      Computes histogram of a vector
CSQTRN   Util      In place square complex matrix transpose
CVCMUL   Util      Real vector = complx scalar * conj (complx vector)
MAKMSK   Util      Mask vector from comparison of vector & scalar
MAXMIN   Util      Finds max & min of vector
VIDIV    Util      Divides vector by product 2 unsigned integers
CVJADD   Util      Adds cmplx vector to conjugate of another cmplx vect
MOVE1    Util      Moves one variable from a to b
SUB1     Util      Scalar C = A - B
SQMUL    Util      Scalar D = C * (float(iv)**2)
PHSROT   Appl      Adds phase gradient to complex vector
BOXSUM   Util      Boxcar sum of a vector
APGRD2   Appl      Convolves linear polarization UV data to grid
BAKSUB   Util      Back directed subtract: for k = n-2,1,-1
                   A(K) = (A(K)-B(K)*A(K+1)-C(K)*A(K+2)) * D(K)
VTRANS   Util      Transpose row-stored MxN array of row vectors
IMOD     Util      DPX(0) = mod (dpx(0), dpy(0))
IMULT    Util      DPX(0) = dpx(0) * dpy(0)
IADD     Util      DPX(0) = dpx(0) + dpy(0)
ISUB     Util      DPX(0) = dpx(0) - dpy(0)



II. [.PSAP] Pseudo array-processor (CPU based)
    Until further notice, all are regarded as not standard

APGET    FPS util  Get data from the AP
APGRD1   Appl      Grids IPOL UV data accumulates gridded vis's,
                   weights, counts
APGRD2   Appl      Convolves linear polarization UV data to grid
APGRID   Appl      Float, scale, taper, and grid UV data in AP
APGSP    Util      Returns contents of "AP" scratch pad registers
APINIT   FPS util  Inits AP for calling task; here just declares
APPUT    FPS util  Put data into AP
APRFT    FFT util  Computes real, inverse FT from arbitrarily spaced
                   data
APRLSE   FPS util  Releases AP for other users; here null
APWAIT   FPS util  Wait for AP transfers and execution
APWD     FPS util  Wait for data transfer
APWR     FPS util  Wait for AP execution
BAKSUB   Util      Back directed subtract: for k = n-2,1,-1
                   A(K) = (A(K)-B(K)*A(K+1)-C(K)*A(K+2)) * D(K)
BOXSUM   Util      Box car sum of data in AP memory
BPRLSE   Util      Releases AP with time delay for low priority (null 
                   in pseudo-AP case)
CFFT     FPS util  Complex to complex FFT (in place)
CLNSUB   Appl      Cleans portion of map residing in AP
CRVMUL   FPS util  Complex vector = complx vector * real vector
CSQTRN   Util      In place matrix transpose
CVCMUL   Util      Multiply complex scalar and vector
CVEXP    Util      Out vector = exp (i * input-vector)
CVJADD   Util      Adds cmplx vector to conjugate of another cmplx vect
CVMAGS   FPS util  Vector = squared magnitude of a complec vector
CVMUL    FPS util  Cmplx vector = scalar * cmplx vector
DIRADD   Util      Directed complex add: B(a(*)) = B(a(*)) + a(*+1)
GRDFIN   Appl      Finish up gridding: shift phases to force center,
                   add in beam, do conj. near u=0.
HIST     Util      Makes histogram of vector
LVGT     FPS util  Logical vector greater than: C(*) = 1.0 if A(*) >
                   B(*) else C(*) = 0.0
MAKMSK   Util      Mask vector from comparison of vector & scalar
MAXMIN   Util      Find max and min of vector
MAXV     FPS util  Find max of vector
MCALC    Appl      Computes model visibilities (for ASCAL)
MINV     FPS util  Find min of vector
MOVE1    Util      Moves one variable from a to b
MTRANS   FPS util  Matrix transpose
PHSROT   Appl      Adds phase gradient to complex vector
RFFT     FPS util  Real to complex FFT (in place)
SQMUL    Util      Scalar D = C * (float(iv)**2)
SUB1     Util      Scalar C = A - B
SVE      FPS util  Sum of elements of vector
VABS     FPS util  Vector = abs (vector)
VADD     FPS util  Vector = sum of two vectors
VCLIP    FPS util  Vector = vector clipped at some max & min
VCLR     FPS util  Zero elements of a vector
VCOS     FPS util  Vector = cosine of a vector
VDIV     FPS util  Vector = element ratio of 2 vectors
VEXP     FPS util  Vector = exponential (vector)
VFILL    FPS util  Fill vector with constant
VFIX     FPS util  Integer vector = FIX (floating vector)
VFLT     FPS util  Floating vector = FLOAT (integer vector)
VIDIV    Util      Divide vector by integer
VMOV     FPS util  Moves one vector into another
VMUL     FPS util  Vector = element product of 2 vectors
VNEG     FPS util  Vector = negative of another vecor
VRVRS    FPS util  Reverse element order in vector
VSADD    FPS util  Vector = vector + constant
VSIN     FPS util  Vector = sine (vector)
VSMA     Util      Out vector = scalar * vectora  +  vectorb
VSMAFX   FPS util  Integer vector = FIX ( scalar1 * vector + scalar2)
VSMSA    FPS util  Vector = constant * vector  +  constant2
VSMUL    FPS util  Vector = constant * vector
VSQ      FPS util  Vector = (vector) ** 2
VTSMUL   Util      Out vector = in-vector * element from table memory
XFOUR    FFT util  FFt routine (both .FOR and .MAR)
