1

I an currently working on a code that is ,as far as I know, compiling well with ifort. I tried to compile it with gfortran and I got the following error:

WRITE(100, '(8ES18.10E)') a 1 Error: Positive exponent width required in format string at (1) 

I am puzzle by this format:8ES18.10E, what is supposed to mean the last E? Is it a ifort/gfortran incompatibility?

Thanks for advice

7
  • Not sure, by head, but maybe the second E in the format should not be present. Commented Jul 23, 2020 at 16:03
  • 2
    I think that gfortran is correct to reject that format without a digit or two after the final E. It doesn't surprise me that Intel Fortran doesn't reject it, it's but the latest incarnation of a long line of compilers extending back to the 60s. Along the way it has picked up many, many non-standard features (or features which are no longer standard) and through an unbounded enthusiasm for backward compatibility not dropped (m)any of them, though judicious use of flags can persuade it to be more ruthless in this regard. Commented Jul 23, 2020 at 16:17
  • I suppose someone should explain the format, ES18.10E, and why gfortran correctly rejects it. 18 is the overall width of the formatted number. 10 is the number of digits that follows the decimal point. The trailing E requires an integer value to specify the number of digits in the exponent. As @HighPerformanceMark states Intel is accepting an extension to the Fortran standard. Intel provides an option to request conformance to the Fortran standard (see its documentation). Commented Jul 23, 2020 at 17:38
  • 2
    It isn't so much that ifort accepts as an extension ES18.10E so much as it's under no obligation whatsoever to tell you that ES18.10E isn't a valid format item. Commented Jul 23, 2020 at 22:52
  • All of the comments above are on point, except that it can't be considered an extension, as it's meaningless. As to what ifort does at run time with the invalid format, my guess is that the trailing E would be ignored, but this would need to be tested with each major version. It's disappointing if it's not possible to get it checked, and a problem report would be justified. Any level of standards checking in ifort should require f95 compliance. As francescalus pointed out, Fortran standard doesn't require ability to check all aspects of compliance. Commented Jul 24, 2020 at 13:03

1 Answer 1

1

ifort interprets WRITE(100, '(8ES18.10E)') as WRITE(100, '(8ES18.10E2)') ) at least in the example I found

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.