Category: Fortran

  • Environment Setup

    Setting up Fortran in Windows

    G95 is the GNU Fortran multi-architechtural compiler, used for setting up Fortran in Windows. The windows version emulates a unix environment using MingW under windows. The installer takes care of this and automatically adds g95 to the windows PATH variable.

    You can get the stable version of G95 from here

    installer setup
    mini installer setup

    AD

    https://delivery.adrecover.com/recover.html?siteId=18107&dataDogLoggingEnabled=false&dataDogLoggingVersion=1

    How to use G95

    During installation, g95 is automatically added to your PATH variable if you select the option “RECOMMENDED”. This means that you can simply open a new Command Prompt window and type “g95” to bring up the compiler. Find some basic commands below to get you started.

    Sr.NoCommand & Description
    1g95 –c hello.f90Compiles hello.f90 to an object file named hello.o
    2g95 hello.f90Compiles hello.f90 and links it to produce an executable a.out
    3g95 -c h1.f90 h2.f90 h3.f90Compiles multiple source files. If all goes well, object files h1.o, h2.o and h3.o are created
    4g95 -o hello h1.f90 h2.f90 h3.f90Compiles multiple source files and links them together to an executable file named ‘hello’

    Command line options for G95

    -c Compile only, do not run the linker.
    -o Specify the name of the output file, either an object file or the executable.
    

    Multiple source and object files can be specified at once. Fortran files are indicated by names ending in “.f”, “.F”, “.for”, “.FOR”, “.f90”, “.F90”, “.f95”, “.F95”, “.f03” and “.F03”. Multiple source files can be specified. Object files can be specified as well and will be linked to form an executable file.

  • Overview

    Fortran, as derived from Formula Translating System, is a general-purpose, imperative programming language. It is used for numeric and scientific computing.

    Fortran was originally developed by IBM in the 1950s for scientific and engineering applications. Fortran ruled this programming area for a long time and became very popular for high performance computing, because.

    It supports −

    • Numerical analysis and scientific computation
    • Structured programming
    • Array programming
    • Modular programming
    • Generic programming
    • High performance computing on supercomputers
    • Object oriented programming
    • Concurrent programming
    • Reasonable degree of portability between computer systems

    AD

    https://delivery.adrecover.com/recover.html?siteId=18107&dataDogLoggingEnabled=false&dataDogLoggingVersion=1

    Facts about Fortran

    • Fortran was created by a team, led by John Backus at IBM in 1957.
    • Initially the name used to be written in all capital, but current standards and implementations only require the first letter to be capital.
    • Fortran stands for FORmula TRANslator.
    • Originally developed for scientific calculations, it had very limited support for character strings and other structures needed for general purpose programming.
    • Later extensions and developments made it into a high level programming language with good degree of portability.
    • Original versions, Fortran I, II and III are considered obsolete now.
    • Oldest version still in use is Fortran IV, and Fortran 66.
    • Most commonly used versions today are : Fortran 77, Fortran 90, and Fortran 95.
    • Fortran 77 added strings as a distinct type.
    • Fortran 90 added various sorts of threading, and direct array processing.