program main !*****************************************************************************80 ! !! MAIN is the main program for FAURE_DATASET. ! ! Discussion: ! ! FAURE_DATASET generates a Faure dataset and writes it to a file. ! ! Modified: ! ! 15 January 2005 ! ! Author: ! ! John Burkardt ! implicit none integer base integer dim_num character ( len = 80 ) :: file_out_name integer ios integer n integer prime_ge real ( kind = 8 ), allocatable, dimension ( :, : ) :: r integer skip integer skip_suggest call timestamp ( ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'FAURE_DATASET' write ( *, '(a)' ) ' FORTRAN90 version' write ( *, '(a)' ) ' Generate a Faure dataset.' do write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Enter DIM_NUM, the spatial dimension:' write ( *, '(a)' ) ' (0 or any negative value terminates execution).' read ( *, *, iostat = ios ) dim_num if ( ios /= 0 ) then exit end if if ( dim_num <= 0 ) then exit end if write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Enter N, the number of points to generate:' write ( *, '(a)' ) ' (0 or any negative value terminates execution).' read ( *, *, iostat = ios ) n if ( ios /= 0 ) then exit end if if ( n <= 0 ) then exit end if base = prime_ge ( dim_num ) skip_suggest = base**4 - 1 write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' Enter SKIP, the number of initial points to skip:' write ( *, '(a)' ) ' (0 is a common choice).' write ( *, '(a,i6,a)' ) ' (', skip_suggest, ' is a recommended choice).' write ( *, '(a)' ) ' (a negative value terminates execution.)' read ( *, *, iostat = ios ) skip if ( ios /= 0 ) then exit end if if ( skip < 0 ) then exit end if allocate ( r(1:dim_num,1:n) ) call faure_generate ( dim_num, n, skip, base, r ) write ( file_out_name, '(a,i2.2,a,i5.5,a)' ) & 'faure_', dim_num, '_', n, '.txt' call faure_write ( dim_num, n, skip, base, r, file_out_name ) deallocate ( r ) write ( *, '(a)' ) ' ' write ( *, '(a)' ) ' The Faure data was written to the file "' & // trim ( file_out_name ) // '".' end do write ( *, '(a)' ) ' ' write ( *, '(a)' ) 'FAURE_DATASET' write ( *, '(a)' ) ' Normal end of execution.' write ( *, '(a)' ) ' ' call timestamp ( ) stop end