Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fortran PROGRAM name never used

Tags:

fortran

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.

like image 230
Raul Laasner Avatar asked Dec 20 '22 03:12

Raul Laasner


2 Answers

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.

like image 179
wallyk Avatar answered Jan 09 '23 01:01

wallyk


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
like image 44
milancurcic Avatar answered Jan 09 '23 01:01

milancurcic