Fortran

Guide To Learn

Fortran

Programming Style

Programming style is all about following some rules while developing programs. These good practices impart values like readability, and unambiguity into your program. A good program should have the following characteristics − For example, if you make a comment like the following, it will not be of much help − However, if you are calculating […]

Numeric Precision

We have already discussed that, in older versions of Fortran, there were two real types: the default real type and double precision type. However, Fortran 90/95 provides more control over the precision of real and integer data types through the kind specifie. The Kind Attribute Different kind of numbers are stored differently inside the computer. The kind attribute allows you to specify how […]

Modules

A module is like a package where you can keep your functions and subroutines, in case you are writing a very big program, or your functions or subroutines can be used in more than one program. Modules provide you a way of splitting your programs between multiple files. Modules are used for − Syntax of […]

Procedures

A procedure is a group of statements that perform a well-defined task and can be invoked from your program. Information (or data) is passed to the calling program, to the procedure as arguments. There are two types of procedures − Function A function is a procedure that returns a single quantity. A function should not modify its […]

Basic Input Output

We have so far seen that we can read data from keyboard using the read * statement, and display output to the screen using the print* statement, respectively. This form of input-output is free format I/O, and it is called list-directed input-output. The free format simple I/O has the form − However the formatted I/O gives you more flexibility over data transfer. Formatted […]

Pointers

In most programming languages, a pointer variable stores the memory address of an object. However, in Fortran, a pointer is a data object that has more functionalities than just storing the memory address. It contains more information about a particular object, like type, rank, extents, and memory address. A pointer is associated with a target […]

Scroll to top