------- Comment #4 from manfred99 at gmx dot ch 2008-11-20 16:09 ------- Consider !234567 program internalread3 implicit none character value*100000 integer i,j
DO j=1,9999 write(value,'(i4)') j write(*,*) value(1:4) read(value(1:LEN_TRIM(value)),*) i write(*,*) i ENDDO end program internalread3 gfortran4.4 (20081120, 64bit): 1.079s i.e. speedup by factor 23 ... but there are cases where the user can't solve the issue like this. And such basic optimizations are more efficiently done by the compiler. Besides this: This is an internal read, so the compiler has full control over the contents of this string variable. It can e.g. null terminate the string or similar, or it can carry on an index of the last character in string (set on assignment), or ... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38199