Chris Theis
2006-10-11 09:27:42 UTC
Hello all,
I'm not a FORTRAN expert and I'm currently facing some behavior which
astonished me, so I would be grateful if you could shed some light on this.
We're developing a data analysis software in a language, which is OT here,
but we get data from software written in FORTRAN 77 (using GNU FORTRAN 77).
Just recently we found very numbers in the data which were written as
1.0614-238, which really astonished me. Our software balked because this was
seen as an expression but the original data content of the FORTRAN software
was 1.0614E-238. I wondered, but a quick check showed that FORTRAN is
actually able to read and interpret 1.0614-238 as 1.0614E-238 using the '*'
comment. However, with the non-specified '*' formatting I found that FORTRAN
is actually able to write out the number using proper scientific notation.
Consequently, I figured that the reason must be the format specifier in the
FORTRAN software which produces the data. Could anybody confirm this?
Finally, I wondered what would be the best solution (e.g. which formatting
specifier) to avoid such problems because in my opinion such an output
formatting is all but portable, especially if other programs or even other
FORTRAN software with specific formatting requirements is involved.
Thanks a lot
Chris
I'm not a FORTRAN expert and I'm currently facing some behavior which
astonished me, so I would be grateful if you could shed some light on this.
We're developing a data analysis software in a language, which is OT here,
but we get data from software written in FORTRAN 77 (using GNU FORTRAN 77).
Just recently we found very numbers in the data which were written as
1.0614-238, which really astonished me. Our software balked because this was
seen as an expression but the original data content of the FORTRAN software
was 1.0614E-238. I wondered, but a quick check showed that FORTRAN is
actually able to read and interpret 1.0614-238 as 1.0614E-238 using the '*'
comment. However, with the non-specified '*' formatting I found that FORTRAN
is actually able to write out the number using proper scientific notation.
Consequently, I figured that the reason must be the format specifier in the
FORTRAN software which produces the data. Could anybody confirm this?
Finally, I wondered what would be the best solution (e.g. which formatting
specifier) to avoid such problems because in my opinion such an output
formatting is all but portable, especially if other programs or even other
FORTRAN software with specific formatting requirements is involved.
Thanks a lot
Chris