I performed a very simple test and the results surprised me. First I wrote a very large number of data ( double percision numbers) on a text file. Then I wrote the same data on a Binary file. I measured the process time for each case and surprisingly writing on the text file was faster. Is that correct or I am doing something wrong?
CALL CPU_TIME(Time1) OPEN( 1, FILE='Cyrus_In.bin', STATUS='UNKNOWN', ACCESS='STREAM') //I want to use stream access. DO 200 I=1,NDOF WRITE (1) (Number(I)) 200 CONTINUE CLOSE(1) CALL CPU_TIME(Time2) Time3 = Time2 - Time1
CALL CPU_TIME(Time1) OPEN (1,FILE='Cyrus_In.txt',STATUS='UNKNOWN') DO 270 I=1,NDOF WRITE (1,2760) (Number(I)) //2760 FORMAT(E25.15) 270 CONTINUE CLOSE(1) CALL CPU_TIME(Time2) Time3 = Time2 - Time1