      CHARACTER*5 SCHNAM
      CHARACTER*10 HMNAME
      INTEGER JB(2,3,30),XYZ(3,30),NPOS(30)
      INTEGER XYZWM(3,48),JAM(2,3,48)
      CHARACTER*1 MPOS(30),A

      OPEN(3,FILE='generator',IOSTAT=ISO,STATUS='OLD')
      WRITE(6,*) ISO
      IF(ISO.NE.0) STOP
      OPEN(4,FILE='wycoff',IOSTAT=ISO,STATUS='OLD')
      WRITE(6,*) ISO
      IF(ISO.NE.0) STOP

      DO 1 I=1,230
         NN=I
         CALL TSNTNM(NN,3,NC,SCHNAM,HMNAME)
            write(6,*) nn,'  nc= ',nc
         DO 2 IC=1,NC
            NNC=IC
            CALL TSPNGE(NN,NNC,3)
            CALL TSWYRD(NN,NNC,4,NUC,NPOS,MPOS,XYZ,JB)
            DO 3 IWP=1,NUC
               WRITE(6,600)  NPOS(IWP),MPOS(IWP)
     &              ,(XYZ(K,IWP),(JB(J,K,IWP),J=1,2),K=1,3)
  600          FORMAT(I5,A1,3(I4,I2,'/',I1))
               A=MPOS(IWP)
               CALL TSWYCF(A,NUC,NPOS,MPOS,XYZ,JB
     &              ,NSITE,XYZWM,JAM)
                  DO 4 ISIT=1,NSITE
                     WRITE(6,601) ISIT,(XYZWM(K,ISIT),
     &                    (JAM(J,K,ISIT),J=1,2),K=1,3)
  601                FORMAT(I3,3(I4,I2,'/',I2))
    4             CONTINUE   
    3       CONTINUE
            pause
    2    CONTINUE
    1 CONTINUE

      CLOSE(3)
      CLOSE(4)
      STOP
      END
