HOW TO USE NUMERICAL ALGORITHMS GROUP (NAG) FORTRAN COMPILER
The FORTRAN compiler described here is very similar in operation to other compilers. A list of options specific to this compiler are at the end of this document.
- The first step is to open Command Prompt (cmd). Command Prompt is found under accessories on the start menu.
-
Navigate to the directory where the files are stored using the change directory command (’cd’). Consider if the files were in the directory called C:/Users/Ben/Documents/3_Summer_2012/Fortran_tests. The command to go to this folder would be:
cd users/ben/documents/3_Summer_2012/fortran_tests
-
Next compile the code by typing nagfor < filename.f95 > − < option >
- Press Enter
- To run the program type the output file’s name in the Command Prompt. This name will depend on the options selected. If no name was entered the output name will be arbitrary, determined by the compiler program(The default is ’a.exe’). Otherwise enter the name used previously.
-
Options
-c Compile only do not link
-C= < option > Most runtime Checking
-
all perform all checks except for -C=undefinedarray Check Array boundsbits Check bit intrinsic argumentscalls check procedure referencesdangling check for dangling pointersdo check DO loops for zero step valuesnone do no checking: this is the defaultpresent check OPTIONAL referencespointer Check POINTER referencesrecursion Check for invalid recursionundefined Check for undefined variables
-double Double size of default INTEGER, REAL, LOGICALand COMPLEX.
-fixed Source files are in fixed form.
-free Source files are in free form.
Next Page →
Next Page →