Saturday 3 July 2010

Fortran 77 and Force 3.0

After moving over to a Win Vista machine, the old Force 2.08 I had been using on the old XP laptop didn't seem to cut it. I tried the 2.09 version, but it didn't work as well as the former version in XP, so I'm glad when Force 3.0 came out. It has allowed me to return to programming again, albeit with a few minor problems. Folks who use it will know it is a GUI for gnu fortran compilers - what's that I hear you say - ancient? Yes, fortran 77 is ancient, older than I am, or rather fortran (formula translator) itself is ancient. But it's the only computer programming language I can think comfortably in, so use it the most. Force 3.0 can be downloaded from http://www.lepsch.com/.

I not a fan of writing large complexly coded computer programs. I tend to write small ones just to do a single job well enough to get the type of results I want and that's it. However, with Force 3.0, I've noticed a couple of things which are odd if not annoying.

No end in sight.

When one writes a f77 code, one must place either

stop
end

at the end of the main program or

return
end

at the end of subroutines and functions.

However, Force 3.0 will complain that the 'end' is missing if you just stop at the end of the 'end' word.

pi = 3.1415927
r = 21.0
print*,'circumference of a circle is =',2.0*pi*r
stop
end
[Error] Prog_name (f4): missing END statement inserted at end of file.

It runs though, and you do get a result in the DOS console. The error message appears in Force 3.0's Messages window, but disappears if one inserts a hard return after typing 'end' so you end your program with a blank line.

The other problem is a run-time proble it seems, and related to writing to files that already exist. That is, say you've already completed your coding and then compiled it and ran it. It has written to file, and all looks well. You then make some modification to your coding, and the output file is increased in size as a result of your changes. The console program will return a problem about which fortran statement was last used when the error was detected as an input-output problem when wrtiting to file. The trick here is to stop and close the console, and recompile and run it.

No comments: