c readform.f 12/04/98 by Matthias K. Gobbert c c readform reads the finite element data tri, x, y, z c from a file with filename given in string filename and outputs these c to files tri.dat, x.dat, y.dat, and z.dat. c c --- subprogram readfile ------------------------------------------------ c subroutine readfile (title, itri, x, y, z, nnodes, nelem, 1 lin, filename, nnodmx, nelemx) implicit none integer nnodmx, nelemx integer i, nnodes, nelem, lin character title*72, filename*60 integer itri(nelemx,3) double precision x(nnodmx), y(nnodmx), z(nnodmx) ! ... open input file: open (unit=lin, file=filename, status='unknown') ! ... read one void line: read (lin, *) ! ... read problem title: read (lin, '(A72)') title write (*, *) 'title: ', title ! ... read 2 void lines: read (lin, *) read (lin, *) ! ... read number of nodes: read (lin, *) nnodes WRITE (*, *) 'nnodes = ', nnodes ! ... read 5 void lines: read (lin, *) read (lin, *) read (lin, *) read (lin, *) read (lin, *) ! ... read x-, y-, and z-data: do i = 1, nnodes read (lin, *) x(i), y(i), z(i) enddo ! ... read 2 void lines: read (lin, *) read (lin, *) ! ... read number of elements: read (lin, *) nelem WRITE (*, *) 'nelem = ', nelem ! ... read 5 void lines: read (lin, *) read (lin, *) read (lin, *) read (lin, *) read (lin, *) ! ... read connectivity data: do i = 1, nelem read (lin, *) itri(i,1), itri(i,2), itri(i,3) enddo ! ... close input file: close (lin, status='keep') ! ... clean up: return end c === subprogram readfile ================================================