0

I am getting a runtime error using Fortran 95:

At line 73 of file calcCenterOfMass.f95
Fortran runtime error: End of record

Code in line 73 is

WRITE(TIMEDIR, '(f10.2)') CURRENTTIME

where TIMEDIR is a string and CURRENTTIME a real.

I guess the problem is that TIMEDIR has a length of four because the string has to be of the shape 0.00, 0.01 etc. But a default length real is longer than four characters.

Is that the problem, and then, how to solve it?

  • 1
    Yes, `timedir` has to be of length at least 10. See, for example, [this](http://stackoverflow.com/q/29489388), [this](http://stackoverflow.com/q/27462619) and [this](http://stackoverflow.com/q/32684816). – francescalus Jan 08 '17 at 23:20

1 Answers1

2

The Format f10.2 means 10 characters in length, with 2 decimals. (So it will be xxxxxxx.xx)

If you want 0.01 or so, you need format f4.2

chw21
  • 7,970
  • 1
  • 16
  • 31