Why is it required to put a name after the PROGRAM keyword when programming in Fortran? Does it make a difference? Did it have some use in the past? I can't think of any effect it has on the rest of the code other than that the name is now reserved for the main program and can't be used for any other variable or procedure.
It works the same as pascal, to provide a module name for some operating systems and environments which need an explicit job name. Examples include KRONOS, OS/360, RSX-11, and GCOS. Three of those run on iron dinosaurs. RSX-11 may have been partially designed to appeal to iron dinosaur programmers, but I notice that stuff was dropped by VAX/VMS.
Otherwise, the program name is all but useless. Maybe there are some compilation error messages which use it.
It may be useful to have a program name to easily distinguish different programs, if for nothing else. But note that PROGRAM
statement is not necessary in a Fortran program at all. The only mandatory statement, which also makes the shortest Fortran program possible (although not particularly useful), is:
END
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With