subroutine file_sequence_read ( file_name, file_dim, file_num, x ) !*****************************************************************************80 ! !! file_sequence_read() reads the data from a file sequence. ! ! Licensing: ! ! This code is distributed under the MIT license. ! ! Modified: ! ! 07 October 2008 ! ! Author: ! ! John Burkardt ! ! Parameters: ! ! Input, character ( len = * ) FILE_NAME, the name of the first file ! in the sequence. ! ! Input, integer FILE_DIM, the number of entries in a file. ! ! Input, integer FILE_NUM, the number of files. ! ! Output, real ( kind = rk ) DOT(FILE_DIM,FILE_NUM), the file data. ! implicit none integer, parameter :: rk = kind ( 1.0D+00 ) integer file_dim integer file_num real ( kind = rk ) dot(file_dim,file_num) character ( len = * ) file_name integer input_status integer file_unit integer i integer j do j = 1, file_num call get_unit ( file_unit ) open ( unit = file_unit, file = file_name, status = 'old', & iostat = file_status ) if ( file_status /= 0 ) then write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'FILE_SEQUENCE_READ - Fatal error!' write ( *, '(a,i8)' ) ' Could not open the input file "' // & trim ( file_name ) // '" on unit ', file_unit stop end if ! i = 0 ! do while ( i < file_dim ) ! if line empty, read another line ! call s_to_r8 ( s, dval, ierror, length ) ! dot(i,j) = dval ! end do close ( unit = file_unit ) call file_name_inc ( file_name ) end do return end