QuickStart Fortran

Fortran is a general-purpose, compiled imperative programming language that is especially suited to numeric computation and scientific computing.

Case: You have old FORTRAN code that you need to test whether it compiles and runs on the HPC.

VPN: connect to vpn-groups.kennesaw.edu

SSH: ssh your_netid@hpc.kennesaw.edu

There are two different FORTRAN compilers on the KSU HPC; GNU FORTRAN and Intel FORTRAN.

Note: It is acceptable to perform the compilation on the login node

Note: If your executable is resource intensive or long-running, you will need to run your code from within an interact session or a qsub reservation.

GNU FORTRAN is built on the GNU C Compiler architecture and accepts all of the same options as the gcc compiler.  There is one version built into the operating system and several others that depend on environment modules.  

Built-in GNU FORTRAN
Compile: $ gfortran -o exec_name your_code.f90
Execute: $ ./exec_name

GNU FORTRAN Module Example
(omitting -o option, executable will be named a.out):
Load Module: $ module load gcc/10.2.0
Compile: $ gfortran your_code.f90
Execute: $ ./a.out


Intel FORTRAN is part of the Intel oneAPI Environment. You will need to load environment modules to compile and run the final executable.

Intel FORTRAN Module Example
Load Module: $ module load oneAPI-compiler
Compile: $ ifort -o exec_name your_code.f90
Execute: $ ./exec_name


For more on Fortran, visit Fortran Programming Language.