character(len=) no handled properly

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Apr 10 03:37:00 GMT 2004


Paul, Bud, et al.

Consider

program z
   implicit none
   character(len=20) fmt1, fmt2
   write(fmt1,'(A)') '(ES12.4)'
   fmt2 = '(I12.4)'
   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

NAG's compiler gives

 fmt1 = (ES12.4) 8
 fmt2 = (I12.4) 7
 fmt1//fmt2 = (ES12.4)            (I12.4) 27

gfortran gives

troutmask:sgk[374] ./z
fmt1 = (ES12.4)











           20
fmt2 = (I12.4)            7
fmt1//fmt2 = (ES12.4)











(I12.4)           27


The strings fmt1 and fmt2 should be padded with spaces.  It also
appears that the TRIM() intrinsic is broken.

-- 
Steve



More information about the Fortran mailing list