mecej4's summary of write performance gives a good indication of Fortran formatted write performance, especially,
FTN95 /32 is comparatively good for formatted write
FTN95 /64 is slow for Format Write
gFortran is incredibly slow for Format write.
The function approach is faster and may provide a use if there are specific changes to output, say for 0. or -0.000, or if using gFortran !
regarding READ performance, I have reviewed the internal read options, using a variation of mecej4's post on 15 Nov and Dan's free format layout of 16 Nov.
The test options I considered are:
1 read fixed format using 10F10.3
2 read fixed format using mecej4's read_val routine
3 read fixed format using read_val routine for optional decimal
4 read free format layout, using Dan's layout example, with numbers separated by a space or comma
5 parse string only, using Dan's layout example, with numbers separated by a space or comma
I have tested this for FTN95 /32, FTN95 /64 and gFortran 64-bit.
ftn95/32 ftn95/64 gfortran Test
1.102 0.665 6.331 1 Fortran FORMAT read
0.233 0.405 0.284 2 function read - fixed field length
0.272 0.499 0.328 3 function read - optional fraction value, fixed field length
0.622 1.033 0.755 4 function read - optional fraction value, variable field length
0.211 0.410 0.485 5 get_next_field only
These results do not show the variation that the write test did show, although the parse string code (finding each number string) is surprisingly slow compared to the reading times.
My guess is that the test #4 approach does give greater flexibility reading number strings, but is about the same speed as FORMAT reads.
FTN95 and gFortran does offer comma support in the standard F format.
gFortran FORMAT read is again slow in comparison.
The advantage of the function approach for large data sets is you can change the valid number formats to suit the equipment that writes the file, eg tab or colon delimited fields, as well as space or comma can be supported.
The test program is on this link
https://www.dropbox.com/s/ut82pkdexc3si5h/intlRead.f90?dl=0
Neither of the functions listed support E format reading, although this would need to be included if required.
Based on this, and previous posts, I estimate that a read speed for external text files is of the order of 100 mb/sec for HDD and 300 mb/sec for SSD, which would be limited by the read conversion. This is faster than some of Dan's performance reports, which may be due to other disk type problems.
Unfortunately when reading large files, they are typically not buffered.
It has always been my preference to use a free format function approach, where I also provide other error and character checking reports. This is easiest using stream I/O. Checking and other field definitions will reduce read rates. At the end of reading, providing statistics of character counts etc is useful to give confidence about the reading process. eg counts of lines read, control characters, delimiters and fields per line always help.
John