Category: 02. Fortran

  • Characters

    The Fortran language can treat characters as single character or contiguous strings. Characters could be any symbol taken from the basic character set, i.e., from the letters, the decimal digits, the underscore, and 21 special characters. A character constant is a fixed valued character string. The intrinsic data type character stores characters and strings. The length of…

  • Loops

    There may be a situation, when you need to execute a block of code several number of times. In general, statements are executed sequentially : The first statement in a function is executed first, followed by the second, and so on. Programming languages provide various control structures that allow for more complicated execution paths. A…

  • Decisions

    Decision making structures require that the programmer specify one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed, if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to be false. Following is the…

  • Operators

    An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. Fortran provides the following types of operators − Let us look at all these types of operators one by one. Arithmetic Operators Following table shows all the arithmetic operators supported by Fortran. Assume variable A holds 5 and variable B holds 3 then…

  • Constants

    The constants refer to the fixed values that the program cannot alter during its execution. These fixed values are also called literals. Constants can be of any of the basic data types like an integer constant, a floating constant, a character constant, a complex constant, or a string literal. There are only two logical constants : .true. and .false.…

  • Variables

    A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable should have a specific type, which determines the size and layout of the variable’s memory; the range of values that can be stored within that memory; and the set of operations that can be applied to…

  • Data Types

    Fortran provides five intrinsic data types, however, you can derive your own data types as well. The five intrinsic types are − Integer Type The integer types can hold only integer values. The following example extracts the largest value that can be held in a usual four byte integer − Live Demo program testingInt implicit…

  • Basic Syntax

    A Fortran program is made of a collection of program units like a main program, modules, and external subprograms or procedures. Each program contains one main program and may or may not contain other program units. The syntax of the main program is as follows − program program_name implicit none ! type declaration statements !…

  • 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 How…

  • 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…