We were cleaning out old kludges from some old codes and I could swear there is now a standard way to use edit descriptors to left-justify strings and can not find it. Did that not happen?
In addition to the standard tricks for amusement here are some of the ways people were accomplishing left justification of strings:
implicit none
character(len=80),parameter :: LH=repeat(' ',80)
! LEFT JUSTIFICATION
! pretty straight-forward
write(*,"('A and Tnn gives left justification')")
write(*,'(a,t11,a,t21,a)')'one','two','three'
! truncation can be a good thing
write(*,"('repeat A10 with intentional truncation gives left justification (useful truncation!)')")
write(*,'(*(a10))')'one'//LH,'two'//LH,'three'//LH
! cleaner than internal WRITE and adjustl() solutions usually used but a bit verbose
write(*,"('A edit descriptor and pad()')")
write(*,'(*(a))')pad('one',10),pad('two',10),pad('three',10)
write(*,"('A with separate writes and TAB NO ADVANCE gives left justification')")
write(*,'(*(a,t11))',advance='no')'one'
write(*,'(*(a,t11))',advance='no')'two'
write(*,'(*(a,t11))',advance='no')'three'
write(*,*)
! relatively new so this has been a problem for a long time and seems like it still is
write(*,"('repeat G0 (or A) with length set gives left justification')")
write(*,'(*(g0))')[character(len=10) :: 'one','two','three']
contains
function pad(line,length) result(strout)
character(len=*),intent(in) :: line
integer,intent(in) :: length
character(len=max(length,len(trim(line)))) :: strout ! do not truncate
strout=line
end function pad