[gfortran] Patch for PR 14901 Internal writes do not pad with blanks

Steve Kargl sgk@troutmask.apl.washington.edu
Sun Apr 11 11:34:00 GMT 2004


On Fri, Apr 09, 2004 at 09:23:49PM -0500, Bud Davis wrote:
> 
> 
> program z
>    implicit none
>    character(len=20) fmt1, fmt2
>    write(fmt1,'(A)') '(ES12.4)'
>    fmt2 = '(I12.4)'
>    print*,fmt1
>    print *,'fmt1 = ', trim(fmt1), len_trim(fmt1)
>    print *,'fmt2 = ', trim(fmt2), len_trim(fmt2)
>    print *,'fmt1//fmt2 = ', trim(fmt1//fmt2), len_trim(fmt1//fmt2)
> end program z
> $ gfc x.f90
> $ ./a.out
> (ES12.4)
> fmt1 = (ES12.4)            8
> fmt2 = (I12.4)            7
> fmt1//fmt2 = (ES12.4)            (I12.4)           27
> 

I believe these are still wrong.  You have you have 
"fmt1 = (ES12.4)             8"
which should be
"fmt1 = (ES12.4) 8"

The trim() function should remove the trailing whitespace.
The problem probably lies within trim().

-- 
Steve



More information about the Fortran mailing list