Fortran, scientific computing, high-performance language, syntax, variables, arrays, control flow, subroutines, functions, input/output, computational physics, computational chemistry, engineering.
Define and Display a Matrix The program reads the first input as (1,1), the second input as (1,2), and the third one as (1,3). This means that first the loop runs for I=1 for all values of J. Then, it runs for I=2 and then for I=3. Adding two matrices For addition, size of two […]
A computer program works the same way a child learns to carry out complex mathematical sums from kindergarten to intermediate classes. By acknowledging the process, we can easily understand the concept using which a computer program can be written. Arranging numbers in ascending or descending order are what a child learns in the starting years […]
FORTRAN programs become very lengthy while solving real engineering problems. To deal with such lengthy codes, the sequences of codes are identified that perform the same operation on different data. Then the user defines a subprogram that performs the above function. This subprogram is invoked within the main program whenever required. Subprograms are of two […]
IF Statements Logical IF statement IF statements execute conditional instructions. These statements make the program naughty. For every single task, it sets one condition in advance. If a particularly given condition (given by logical_expression) holds true, then only the program will execute a given statement (executable_statement). IF (logical_expression) executable_statement Block IF statement The naughtiness of […]
Read & Write statements A file is a sequence of records that itself is a sequence of values or characters. A FORTRAN program can read from and write to the files stored on an external storage device. Instead of the usual READ statement, file processing employs a more general form of READ statement. Also, WRITE […]
An input statement reads the information from an input device or a file. It then separates the info into separate items converting them into binary form understood to computer. Finally, each item resides in a separate variable allocated to it for further processing. On the other hand, output statements read the items from the processed […]
1. Arithmetic Operations Arithmetic operations are denoted by following arithmetic operators: Addition + Subtraction – Multiplication * Division / Exponentiation ** Order of Precedence Operands of an arithmetic operation may be a numeric constant, numeric variable or an arithmetic expression in parentheses. Two operators cannot be written consecutively. Operations must be defined in a particular […]
In the earlier posts, we have provided the details on how to get started with FORTRAN77 and install a FORTRAN compiler with an editor. Knowledge of dimension and parameter statements leads us one step ahead. Dimension statement This statement declares the dimensions and rank of arrays in a program. For example, the code below is […]
FORTRAN is a general-purpose, the first-ever high-level programming language used for mathematical computations. It is an acronym for FORmula TRANslation. It was started in the 1950s at IBM and since then many updated versions of FORTRAN have been released. Fortran 66 Fortran 77 Fortran 90 Fortran 2003 Fortran 2008 FORTRAN 77 is still very popular […]