integer*2 nums(49) character*30 title, filename write (*,'(A\)') ' Name of data file:' read (*,'(A)') filename open (1,file=filename) read (1,'(A)') TITLE max=0 do i=1,1000 read (1,'(1x,49(I4,3x))',end=1) (NUMS(J),j=1,49) do j=1,48 if (NUMS(J).gt.0.and.NUMS(J+1).gt.0) THEN if (max.lt.nums(j)) max=nums(j) if (max.lt.nums(j+1)) max=nums(j+1) endif enddo enddo 1 close (1) open (1,file=filename) open (2,file='sea.net') write (2,'(A,3i4)') '*Vertices', max do i=1,max write (2,'(3i4)') i enddo write (2,'(A,3i4)') '*Arcs' ii=i-1 open (1,file=filename) read (1,'(A)') TITLE do i=1,ii read (1,'(1x,49(I4,3x))',end=2) (NUMS(J),j=1,49) do j=1,48 if (NUMS(J).gt.0.and.NUMS(J+1).gt.0) THEN write (2,'(3i4)') nums(j), nums(j+1), 1 endif if (NUMS(J).gt.0.and.NUMS(J+1).lt.0) THEN write (2,'(3i4)') nums(j), -nums(j+1), 2 endif if (NUMS(J).lt.0.and.NUMS(J+1).gt.0) THEN write (2,'(3i4)') -nums(j), nums(j+1), 3 endif if (NUMS(J).lt.0.and.NUMS(J+1).lt.0) THEN write (2,'(3i4)') -nums(j+1), -nums(j), 1 endif enddo enddo 2 end CENTAILMENT CHAINS: 10% C2345444412344441234444123 C 11 >> 29 >> 26 >> 8 >> 35 >> 23 >> 28 >> 31 >> 1 C 16 >> 18 >> 15 >> 14 >> 13 >> 31 C 7 >> 4 >> 32 >> 31 C 24 >> 25 >> 30 >> 27 >> 31