Replicating formatting from Fortran code output

trung
Mon, 17 Mar 2025 03:07:07 +0000
General Usage

I am trying to replicate the formatting from a Fortran code output in Julia. Here is a MWE.

program formattest
    implicit none
    integer:: iyd
    real(4):: d(4),t

    iyd = 10000
    d = 9.999e-38
    t = 1.053e10

    open(77,file='outputtest.txt',status='replace')
    write(77,'(i7,4e13.4,f8.2)')  &
        iyd,d(1:4),t
    close(77)
end program

The output that I obtain is

10000   0.9999E-37   0.9999E-37   0.9999E-37   0.9999E-37  294.10

Is it possible to replicate the formatting from the “0.9999E-37” in Julia?

7 posts - 5 participants