C  LINK ORGANIZER TO DYNAMICS
	SUBROUTINE STRUCT
	LOGICAL B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,LP
	DIMENSION ICEN(2,9),IREL(6,15),IATCH(2,15)
	COMMON/LPEN/LP,IX,IY,IADRS
	COMMON/BOX/B1,B2,B3,B4,B5,B6,B7,B8,B9,B10
	COMMON/LINKS/IPART(6,200),MODNET(2,9)
	COMMON/FILE/LYNUM,LINE(4,200)
	COMMON/BOOKKP/LINSAV(200),MODSAV(50),ITAG
	JX=500
	JY=500
	DO 2 I=1,15
	DO 2 J=1,6
2	IREL(J,I)=0
5	CALL LIST(NN)
	GO TO (10,20,30,40,50,60,90),NN
C
C  SELECT MODULE NO.
10	CALL LITPEN(LP,IX,IY,IADRS)
	CALL WRKMOV(LINE,MODSAV,LINSAV,IADRS,LP,B1,ITAG,1)
	MOD=ITAG
	GO TO 5
C  GET CENTRE OF THIS MOD.
20	CALL CROSS(.TRUE.,JX,JY)
	B2=.FALSE.
6	IF(.NOT.B2)GO TO 6
	CALL CROSS(.FALSE.,JX,JY)
	ICEN(1,MOD)=JX
	ICEN(2,MOD)=JY
	GOTO 5
C   GET PARENT
30	IREL(1,MOD)=0
	IS=1
	GO TO 5
C  GET PARENT MODULE.
40	CALL LITPEN(LP,IX,IY,IADRS)
	CALL WRKMOV(LINE,MODSAV,LINSAV,IADRS,LP,B1,ITAG,1)
	IREL(1,MOD)=ITAG
	GO TO 5
C  JOIN MOD TO PARENT WITH CROSS
50	CALL CROSS(.TRUE.,JX,JY)
	B2=.FALSE.
7	IF(.NOT.B2)GO TO 7
	CALL CROSS(.FALSE.,JX,JY)
	IATCH(1,MOD)=JX
	IATCH(2,MOD)=JY
	IS=1
	GO TO 5
C  GET ALL SONS
60	CALL LITPEN(LP,IX,IY,IADRS)
	CALL WRKMOV(LINE,MODSAV,LINSAV,IADRS,LP,B1,ITAG,1)
	IS=IS+1
	IREL(IS,MOD)=ITAG
	GO TO 5
C
C  SHIFT  ATTACH PTS
90	DO 91 I=1,9
	IPAR=IREL(1,I)
	IF(IPAR.EQ.0)GO TO 92
	IATCH(1,I)=IATCH(1,I)-ICEN(1,IPAR)
	IATCH(2,I)=IATCH(2,I)-ICEN(2,IPAR)
	GO TO 91
92	IATCH(1,I)=0
	IATCH(2,I)=0
91	CONTINUE
C
C  CALL LINK
	CALL LINK(IPART,LINE,MODNET,MODSAV)
C  SET PTS TO ABSOLUTE VALUE
	DO 15 I=1,9
	M=MODNET(1,I)
	N=MODNET(2,I)
	IF((M.EQ.0).OR.(N.EQ.0))GO TO 15
	DO 15 J=M,N
	IPART(1,J)=IPART(1,J)-ICEN(1,I)
	IPART(2,J)=IPART(2,J)-ICEN(2,I)
	IPART(4,J)=IPART(4,J)-ICEN(1,I)
	IPART(5,J)=IPART(5,J)-ICEN(2,I)
15	CONTINUE
C
C
C  OUTPUT A TAPE
C  MODNET
	XMIN=-1024.
	XMAX=1024.
	YMIN=-1024.
	YMAX=1024.
	N=0
	Z=0.
	WRITE(6,1)((MODNET(I,J),I=1,2),J=1,9)
1	FORMAT(1X2I4)
	DO 25 L=1,6
25	WRITE(6,1)N,N
C
	DO 26 I=1,9
	M=MODNET(1,I)
	N=MODNET(2,I)
	IF(M.EQ.0)GO TO 26
	DO 26 J=M,N
	X=IPART(1,J)
	Y=IPART(2,J)
	X1=IPART(4,J)
	Y1=IPART(5,J)
	X=X/51.2
	Y=Y/51.2
	X1=X1/51.2
	Y1=Y1/51.2
	WRITE(6,3)X,Y,Z,X1,Y1,Z
3	FORMAT(1X6F5.1)
26	CONTINUE
C  PRINT  RELATIONSHIPS
	WRITE(6,4)((IREL(I,J),J=1,15),I=1,6)
4	FORMAT(1X15I3)
C  PRITN ATTACHMENTS
	DO 31 I=1,15
	X=IATCH(1,I)
	Y=IATCH(2,I)
	X=X/51.2
	Y=Y/51.2
	WRITE(6,51)X,Y,Z
51	FORMAT(1X3F5.1)
31	CONTINUE
C  SCALERS
	WRITE(6,3)XMIN,XMAX,YMIN,YMAX
	RETURN
	END
