/****************************************************************************** * FILE: iotest.f * DESCRIPTION: * Comparison of binary and formatted I/O and large vs. small record sizes. ******************************************************************************/ program iotest integer SIZE parameter(SIZE=1024) real(8) a(SIZE,SIZE) integer i,j integer(8) T1, T2, IRTC do j=1,SIZE do i=1,SIZE a(i,j) = 1.0 enddo enddo C Test 1: formatted I/O with individual records open (unit=11, file="/localscratch/iotest.out1", status="new", + form="formatted") T1 = IRTC() do j=1,SIZE do i=1,SIZE write (11,*) a(i,j) enddo enddo close(11) T2 = IRTC() write(*,*)'Test 1 took ', (T2-T1)/1000000, 'msec' C Test 2: unformatted I/O with individual records open (unit=22, file="/localscratch/iotest.out2", status="new", + form="unformatted") T1 = IRTC() do j=1,SIZE do i=1,SIZE write (22) a(i,j) enddo enddo close(22) T2 = IRTC() write(*,*)'Test 2 took ', (T2-T1)/1000000, 'msec' C Test 3: formatted I/O with one record open (unit=33, file="/localscratch/iotest.out3", status="new", + form="formatted") T1 = IRTC() write (33,*) a close(33) T2 = IRTC() write(*,*)'Test 3 took ', (T2-T1)/1000000, 'msec' C Test 4: unformatted I/O with one record open (unit=44, file="/localscratch/iotest.out4", status="new", + form="unformatted") T1 = IRTC() write (44) a close(44) T2 = IRTC() write(*,*)'Test 4 took ', (T2-T1)/1000000, 'msec' end