Skip to content

Commit

Permalink
Merge pull request fortran-lang#89 from pdebuyl/qsavetxt_format_string
Browse files Browse the repository at this point in the history
Use explicit formatting in qsavetxt
  • Loading branch information
certik authored Jan 6, 2020
2 parents c3e4816 + d845f2d commit 57d99f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/stdlib_experimental_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,12 @@ subroutine qsavetxt(filename, d)
! call savetxt("log.txt", data)

integer :: s, i
character(len=14) :: format_string

write(format_string, '(a1,i06,a7)') '(', size(d, 2), 'f40.34)'
s = open(filename, "w")
do i = 1, size(d, 1)
write(s, *) d(i, :)
write(s, format_string) d(i, :)
end do
close(s)
end subroutine
Expand Down

0 comments on commit 57d99f8

Please sign in to comment.