Fortran notes for Atmos 6150 (revised 2/13) ------------------------------------------------------------------------ enscript enscript prints a file in a specified format to your default printer. To print a file two pages per sheet in landscape format, use enscript -2r This is very handy for Fortran code. ------------------------------------------------------------------------ Fortran 90 To run Fortran on a CHPC computer, use the command pgf90. Type pgf90 -help for a (long) list of options. Type man pgf90 for more details. Suffixes of source file names indicate the type of processing to be done: .f fixed-format Fortran source; compile .f90 free-format Fortran source; compile .o object file; passed to linker a.out executable output file Some useful pgf90 options (or switches): -Mextend Allow source lines up to 132 characters -Mfixed Assume fixed-format source -M[no]free[form] Assume free-format source -c Skip the link step; compile and assemble only. -o Use as the name of the executable program, rather than the default a.out. -flags Show all compiler switches -C Generate code to check array bounds -Mbounds Generate code to check array bounds -Mstandard Flag non-ANSI-Fortran usage. -u Passed to linker; generate undefined reference -fast Common optimizations ------------------------------------------------------------------------ Example: pgf90 -c print.f pgf90 -o qcom QCOM.f90 print.o ./qcom ------------------------------------------------------------------------