program example1 c c This is a simple example of creating and writing a binary file using c routines from the PPMLIB Library. c character*8 filename real*4 data(100) c c create a data set consisting of the square roots of the number 1 to 100 c do i=1,100 data(i) = sqrt( float(i) ) enddo c c Open a file name "DATA" and assign it to FORTRAN unit 10 c If an existing file named "DATA" destroy it. c filename = 'DATA' iunit = 10 call ppm98_binopen_trunc( filename, iunit ) c c write the contents of the array "data" to it. Data contains 100*4 bytes c nbytes = 100 * 4 call ppm98_binwrite( iunit, data(1), nbytes ) c c The file "DATA" should contain exactly "nbytes" bytes. c c close the file c call ppm98_binclose( iunit ) c stop end c endprogram example1