      SUBROUTINE REASHP(CFLSHP,IDVOUT,IDVSHP,A1,A2,CDESCR,MXNAT,NAT,
     &                  IXYZ,ICOMP,MXN3,NAT3)
C Arguments:
      INTEGER IDVOUT,IDVSHP,MXNAT,NAT,MXN3,NAT3
      CHARACTER CDESCR*67,CFLSHP*(*)
      INTEGER*2 IXYZ(MXNAT,3),ICOMP(MXNAT,3)
      REAL A1(3),A2(3)
C Local variables:
      INTEGER J,JJ
C***********************************************************************
C Given:
C    CFLSHP = name of (unformatted) file containing target description
C    IDVSHP  = device number to use in reading this file
C    IDVOUT = device number to use for "running" output
C    MXNAT,MXN3 = dimensioning information
C Returns:
C    A1(3)  = target axis 1
C    A2(3)  = target axis 2
C    CDESCR = string describing target
C    NAT    = number of dipoles in target
C    NAT3   = 3*NAT
C    IXYZ(1-NAT,1-3) = lattice coordinates of dipoles
C    ICOMP(1-NAT,1-3)= composition for directions x,y,z (in Target
C                      Frame) of dipoles 1-NAT.
C
C Note: It is expected that many users will wish to modify this routine
C       to be consistent with whatever target generation software they
C       use.  However, as an example (and for test purposes) this routine
C       is supplied with code compatible with the "target.out" files which
C       are generated by the "calltarget" program when called for
C       homogenous isotropic targets (shape.dat files do not include
C       information on target composition).
C       Also provided below (commented out) are
C       * a module of code appropriate for reading formatted target.out
C         file generated by the routine tarcel.f (concentric ellipsoids)
C         as an example of an inhomogeneous target.
C       * a module of code appropriate for reading an unformatted 
C         "shape.dat" file for a general target, assuming user's
C         target generation routine writes an unformatted file with
C         the same structure.
C
C
C***********************************************************************
C History:
C 91.05.02 (BTD): Added IDVOUT to argument list.
C 91.05.23 (BTD): Added A1, A2 to argument list.
C 91.11.11 (BTD): Modified for compatibility with WRITE statements in
C                 program CALLTARGET; Changed dimensioning of ICOMP from
C                 ICOMP(MXN3) to ICOMP(MXNAT,3)
C 93.09.24 (BTD): Modified to include examples of READ statements
C                 for both unformatted and formatted shape.dat files.
C                 Leave the formatted example (compatible with the
C                 "target.out" files generated by "calltarget") in effect.
C 95.04.07 (BTD): Changed CDESCR*60 -> CDESCR*67 for compatibility with
C                 calling routine TARGET
C 95.05.15 (BTD): Changed  READ(DVSHP,FMT='(A60)') to ..(A67)..
C                 Added module for inhomogeneous/anisotropic targets
C 96.01.26 (BTD): Replaced IX,IY,IZ by IXYZ
C end history
C
C Copyright (C) 1993,1995,1996 B.T. Draine and P.J. Flatau
C This code is covered by the GNU General Public License.
C***********************************************************************
C
C Enable following module of code if "shape.dat" file has been written
C in formatted form consistent with the "target.out" files generated by
C routines tar2el.f, tar3el.f, tarcyl.f, tarell.f, tarhex.f, tarrec.f,
C and tartet.f (in particular, this assumes homogeneous target):
C
      OPEN(UNIT=IDVSHP,FILE=CFLSHP,STATUS='OLD',FORM='FORMATTED')
      READ(IDVSHP,FMT='(A67)')CDESCR
      READ(IDVSHP,*)NAT
      READ(IDVSHP,*)A1
      READ(IDVSHP,*)A2
      READ(IDVSHP,*)
      READ(IDVSHP,*)(JJ,IXYZ(J,1),IXYZ(J,2),IXYZ(J,3),J=1,NAT)
      DO 0200 JJ=1,3
         DO 0100 J=1,NAT
            ICOMP(J,JJ)=1
 0100    CONTINUE
 0200 CONTINUE
      CLOSE(IDVSHP)
C
C***********************************************************************
C
C Enable following module of code if "shape.dat" file has been written
C in formatted form consistent with the "target.out" files generated by
C routine tarcel.f (inhomogenous target):
C
C      OPEN(UNIT=IDVSHP,FILE=CFLSHP,STATUS='OLD',FORM='FORMATTED')
C      READ(IDVSHP,FMT='(A67)')CDESCR
C      READ(IDVSHP,*)NAT
C      READ(IDVSHP,*)A1
C      READ(IDVSHP,*)A2
C      READ(IDVSHP,*)
C      READ(IDVSHP,*)(JJ,IXYZ(J,1),IXYZ(J,2),IXYZ(J,3),
C     &               ICOMP(J,1),ICOMP(J,2),ICOMP(J,3),J=1,NAT)
C      CLOSE(IDVSHP)
C
C***********************************************************************
C
C Enable following module of code if "shape.dat" file has been written
C in unformatted form consistent with these read statements:
C
C      INTEGER JX,JY,JZ
C      OPEN(UNIT=IDVSHP,FILE=CFLSHP,STATUS='OLD',FORM='UNFORMATTED')
C      READ(IDVSHP)CDESCR,NAT,A1,A2
C      READ(IDVSHP)((IXYZ(JX,JY),JX=1,NAT),JY=1,3),
C     &            ((ICOMP(J,JJ),J=1,NAT),JJ=1,3)
C      CLOSE(IDVSHP)
C
C***********************************************************************
      NAT3=3*NAT
      RETURN
      END

