U of A University Information Technology Services
FORTRANFORTRAN77 [f77], FORTRAN90 [f90], and FORTRAN95 [f95] are available on our comp.uark.edu server. FORTRAN77 is compliant with the ANSI-1978 and ISO-1980 standards for the language and FORTRAN90 and FORTRAN95 are compliant with ANSI X3.198-1992 standard and ISO/IEC 1539:1991. These offer many extensions including recursion, pointers, structures, do while loops, and extended precision for both real and complex variables. This page provides basic information which will get you started running FORTRAN. It is assumed that you are already familiar with the FORTRAN language. The material here is adapted from various Sun Microsystems sources. For details and additional information, type: The following information is for FORTRAN77: The f77 command is used to compile and link a FORTRAN source program to form an executable file. In the simplest case, you type:
to produce an executable file and then type:
to run the program. In this example, you replace "progname" with whatever word you are using for your own program source. The .f suffix (f77 also accepts .for) and the a.out are typed as shown. Also note the Solaris operating system is case sensitive and normally expects lower case user input. If your program resides in several source files, just type the entry point file name first and follow with the other source file names, for example:
would compile the three source files in order to produce the executable a.out. Since a.out is always the default executable name, one of the most common options for f77 is the -o option which allows you to set the executable name:
In this example the "mysource.f" file is compiled into executable "myprog". Type
to run the program. Another popular option, especially for newly written source files, is the -c option which does only the compile step and does not produce an executable:
The -C option (note the upper case) is also useful during program debugging work because it enables subscript checking in the executable. Finally, you can obtain a line numbered and cross referenced program listing with the -Xlist option:
which will produce the file newsource.lst containing the listing. Naturally, multiple options (so long as they are compatible) may be declared:
will compile only and produce freshone.lst.
|
http://uits.uark.edu/main/index_4206_ENG_HTML.htm
