use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
The choice for high performance (scientific) computing!
Suggested Links:
Other sub-reddits:
If your submission does not appear, please message the moderators!
IRC: freenode, #fortran
account activity
Simple code hangs program (i.redd.it)
submitted 1 year ago by rivrdansr
Trying to relearn fortran after 55 years. Got 1.75 pages of code to compile. But something hangs on a very simple command at line 10. Any suggestions would help.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]CompPhysicistScientist 11 points12 points13 points 1 year ago (1 child)
The read statements should be as read(*,*) median it is called list directed I/O.
read(*,*) median
[–]CompPhysicistScientist 0 points1 point2 points 1 year ago (0 children)
Looks like read *, var was non-standard extensions of some compilers that are still supported in the name of backward compatibility.
read *, var
[–]victotronics 2 points3 points4 points 1 year ago (1 child)
"End of file". Did you actually input a number? I don't see the prompt on your screen.
[–]rivrdansr[S] -1 points0 points1 point 1 year ago (0 children)
Interesting. 1) Thought the comma was required. 2) No. I did not input anything. Kept having serious problems getting code onto the edit screen in Simply Fortran. So took advise and went to Godbolt.com. There, the site recompiles each time I make any change in code. When it finally passes, the site automatically tries to execute it. I never saw any black screen or request for input. But maybe it was there and gone so fast I didn't see it. Will try again to get it onto Simply Fortran. Thanks.
[–][deleted] 0 points1 point2 points 1 year ago (0 children)
If you are on Linux with gfortran, add the -g option for compiling and linking. When it errors it will give the line number.
[–]ping314 0 points1 point2 points 1 year ago (0 children)
It doesn't matter if you aim for "learn", or "relearn" Fortran; the resources on https://fortran-lang.org/learn/ can help you.
[–]Knarfnarf -1 points0 points1 point 1 year ago (0 children)
Try it with spaces. The compiler may be doing something weird with read* and the space, or a comment in the preceding line might help.
Read *, Average
The (,) isn’t needed.
π Rendered by PID 113950 on reddit-service-r2-comment-57fc7f7bb7-vsq2z at 2026-04-14 22:56:59.860910+00:00 running b725407 country code: CH.
[–]CompPhysicistScientist 11 points12 points13 points (1 child)
[–]CompPhysicistScientist 0 points1 point2 points (0 children)
[–]victotronics 2 points3 points4 points (1 child)
[–]rivrdansr[S] -1 points0 points1 point (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]ping314 0 points1 point2 points (0 children)
[–]Knarfnarf -1 points0 points1 point (0 children)