Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Fortran 2008

Assignment

Submitted by:

Md. Nazmus Sakib


id # 19103216
sec: D
Course code: CSC 461

Nazmus
19103216@iubat.edu
Fortran 2008
Fortran 2008 is a compiled imperative & general-purpose programming language which can
especially suited to numeric computation and scientific computing. It was originally developed
by IBM in the 1950s for scientific and engineering applications, and then subsequently came to
dominate scientific computing. Fortran has been in use for over six decades in computationally
intensive areas such as numerical weather prediction, finite element analysis, computational fluid
dynamics, geophysics, computational physics, crystallography and computational chemistry. Fortran
is a popular language for high-performance computing and is used for programs that benchmark and

rank the world's fastest supercomputers.

History
The FORTRAN is derived from Formula Translating System, Formula Translator, Formula
Translation, or Formulaic Translation. The names of earlier versions of the language through
FORTRAN 77 which conventionally spelled in all-uppercase. FORTRAN 77 which was the last
version in which the Fortran character set included only uppercase letters. The official
language standards for Fortran have referred to the language as "Fortran" with initial caps where
rather than "FORTRAN" in all-uppercase since Fortran 90.

In 1953, John W. Backus submitted a proposal to his superiors at IBM to develop a more practical
alternative of assembly language for programming in IBM 704 mainframe computer. Then Backus
FORTRAN team consisted the programmers Richard Goldberg, Sheldon F. Best, Harlan Herrick,
Peter Sheridan, Roy Nutt, Robert Nelson, Irving Ziller, Harold Stern, Lois Haibt, and David
Sayre. Here the concepts included easier and entry of equations into a computer, an idea developed
by J. Halcombe Laning and demonstrated in the Laning and Zierler system of 1952.

Here the specification for The IBM Mathematical Formula Translating System which was completed
by November 1954. The first manual for FORTRAN appeared in October 1956, then the first
FORTRAN compiler delivered in April 1957. This was the first optimizing compiler, because
customers were reluctant to use a high-level programming language unless it’s compiler could
generate code with performance approaching that of hand-coded assembly language.
The Fortran paralleled the early evolution of compiler technology, and many advances in the theory
and design of compilers were specifically motivated by the need to generate efficient code for
Fortran programs.
Environment
The initial release of FORTRAN for the IBM 704 contained 32 statements.
Including the below features:

 Dimension and Equivalence statements


 Assignment statements
 Three-way arithmetic if statement, which passed control to one of three locations in the
program depending on whether the result of the arithmetic statement was negative,
zero, or positive
 IF statements for checking exceptions and IF statements for manipulating sense
switches and sense lights
 Go TO computed GO TO, Assign and assigned GO TO
 DO loops
 Formatted I/O: format, read, read input tape, write, write output tape, print, and punch
 Unformatted I/O: read tape, read drum, write tape, and write drum
 Other I/O: end file, rewind, and backspace
 Pause, stop & continue.
 Frequency statement (for providing optimization hints to the compiler).

The new features of Fortran 2008 that are supported by the NAG Fortran Compiler
can be grouped as follows:

 SPMD programming with coarrays;


 data declaration;
 data usage and computation;
 execution control;
 intrinsic procedures and modules;
 input/output extensions;
 programs and procedures.

Any IBM Power Systems server as long as it is supported by your operating system
distribution.
 Approximately 350 MB for product packages
 Minimum of 2 GB hard drive space for paging
 Minimum of 512 MB for temporary files
 2 GB RAM minimum; 4 GB or more RAM recommended
Features & Contributions
Legend: Y = Yes, N = No, P = Partial, U = Unconfirmed
Fortran 2008 Abs Cra GNU H IBM Int NA Ora PathS PGI Fla
features oft y (gfortr P el G cle cale ng
an)
Compiler Version 14 8.4 9.x 16. 19 6. 8.8 6.0 18. 5.0
Number .0 1.5 .0 2 10
Submodules N Y Y N Y Y N N N Y
(201)
Coarrays N Y Y N N Y N N Y N
(301)
Data Declaration Abs Cra GNU H IBM Int NA Ora PathS PGI Fla
oft y P el G cle cale ng
Maximum rank + N Y Y N Y Y Y N N N
corank = 15 (701)
Long integers Y Y Y N Y Y Y Y ? Y
(10
0)
Allocatable N Y Y N Y Y N Y N N
components of
recursive type
Implied-shape N Y Y N Y Y Y N N N
array
Pointer N Y Y N Y Y N N N Y
initialization (60
0)
Data statement ? Y N ? N Y N N N N
restrictions lifted
Type statement for ? Y Y ? Y Y Y N N N
intrinsic types
Value attribute is ? Y Y ? P Y ? N ? N
permitted for any (10
nonallocatable 8)
nonpointer
noncoarray
Accessing data Abs Cra GNU H IBM Int NA Ora PathS PGI Fla
objects oft y P el G cle cale ng
Simply contiguous N Y Y N Y Y Y N N Y
arrays rank
remapping to
rank>1 target
Omitting an ? Y N ? Y Y Y N N N
ALLOCATABLE
component in a
structure
constructor
Copying the ? Y N ? Y Y Y N N Y
properties of an (201)
object in an
ALLOCATE
statement
MOLD= specifier ? Y Y ? Y Y Y Y N Y
for ALLOCATE
Pointer function N Y P N N Y N N N N
reference is a (201)
variable
Elemental dummy ? Y Y ? N Y N N ? Y
argument
restrictions lifted
Input/Output Abs Cra GNU H IBM Int NA Ora PathS PGI Fla
oft y P el G cle cale ng
Finding a unit N Y Y N Y Y Y N N Y Y
when opening a
file (newunit=u)
Recursive I/O N Y Y N N Y Y Y Y Y
Execution control Abs Cra GNU H IBM Int NA Ora PathS PGI Fla
oft y P el G cle cale ng
The BLOCK N Y Y N Y Y Y N N N
construct
Exit statement N Y Y N Y Y Y N N Y
Stop code N Y Y N Y Y Y N N Y
ERROR STOP ? ? Y ? Y Y ? ? ? N N
Intrinsic Abs Cra GNU H IBM Int NA Ora PathS PGI Fla
procedures for bit oft y P el G cle cale ng
processsing
Bit sequence Y Y Y N N Y Y N N N
comparison
Combined shifting Y Y Y N Y Y Y N N N
Counting bits Y Y Y N Y Y Y N P P
(212) (21
4)
Masking bits N Y Y N Y Y Y N N N
Merging bits Y Y Y N Y Y Y N N N
Bit N Y Y N N Y Y N N N
transformational
functions
Intrinsic Abs Cra GNU H IBM Int NA Ora PathS PGI Fla
procedures and oft y P el G cle cale ng
modules
Storage size N Y Y N Y Y Y N N Y Y
Optional argument N Y Y N Y Y Y N N N
RADIX added to
SELECTED REAL
KIND
Execute command Y Y Y N Y Y Y N N Y N
line
Find location in an ? Y Y N Y Y N N N Y
array
Constants N Y P N Y Y Y N N Y
(203)
Function for C size ? Y Y ? Y Y N N ? Y
of
Added optional ? Y Y ? Y Y Y N ? Y
argument for
IEEE_SELECTED_R
EAL_KIND
Programs and Abs Cra GNU H IBM Int NA Ora PathS PGI Fla
procedures oft y P el G cle cale ng
Form of end ? Y Y ? Y Y Y N N Y
statement for
internal and
module procedures
Internal procedure N Y Y N Y Y Y N N Y
as an actual
argument
Entry statement Y Y Y N Y Y Y N N Y
becomes
obsolescent
Source form Abs Cra GNU H IBM Int NA Ora PathS PGI Fla
oft y P el G cle cale ng
Semicolon at line Y Y Y ? Y Y Y N Y Y
start
LIMITATION OF FORTAN 2008
Fortran has rather liberal rules & an extensive system of default values: mean while this
reduces programming effort this also makes the program harder for the system to detect the
bugs or error.
Six major limitations are:
• Lack of inherent parallelism. ...
• Lack of dynamic storage. ...
• Lack of numeric portability. ...
• Lack of user-defined data structures. ...
• Lack of explicit recursion. ...
• Reliance on unsafe storage and sequence association features
Lack of dynamic storage:
FORTRAN 2008 only allows static storage for example, this means temporary short-lived
arrays cannot be created on-the-fly nor can pointers, which are useful for implementing
intuitive data structures, be used. FORTRAN 2008 programs must declare arrays `big enough’
for any future problem size which is an awkward and very unattractive restriction absent.
Lack of numeric portability:
With precision when porting FORTRAN 2008 code from one machine to another. Many
FORTRAN 2008 systems implement their own extensions to give greater precision, it means that
the code becomes non-portable.
Lack of user-defined data structures:
FORTRAN 2008 intuitive (user-defined) data types not available as they are in ADA, Algol, C,
Pascal etc.. It’s presence would make programming more robust and simpler. Here is no way of
defining compound objects.

Lack of explicit recursion:


FORTRAN 2008 does not support recursion. This had to be simulated using a user defined
stack and access routines to manipulate stack entries. Recursion is a fairly simple and a code
efficient concept and was, to all intents and purposes, unavailable.
Reliance on unsafe storage and sequence association features:
In FORTRAN 77, global data is only accessible via the notoriously open-to-abuse COMMON
block. The rules which applied to COMMON blocks are very lax and the user could inadvertently
do quite horrendous things. Fortran 90 presents a new method of obtaining global data.
Another technique which is equally as open to abuse as COMMON blocks is that a user is
allowed to alias an array using an EQUIVALENCE statement.

Examples of code
A simple example program to generate 100 random integer numbers, each between 1 and 100,
is as follows:
program rand

implicit none
integer, parameter :: rcount=100
integer :: i
integer, dimension(rcount) :: nums
real :: x
call random_seed()
do i = 1, rcount
call random_number(x)
nums(i) = int(x*100.0) + 1
end do
write (*,'(a)') "Random Numbers:"
do i = 1, rcount
write (*,'(i3,2x)', advance="no") nums(i)
if (mod(i,10)==0) write (*,*)
end do
end program rand
Output:
Random Numbers:
100 57 97 75 37 49 8 1 35 35
22 14 91 39 45 67 2 66 65 33
86 41 21 97 60 68 46 34 11 76
61 72 90 66 16 62 98 100 26 56
66 56 98 91 66 73 41 93 15 68
77 34 12 62 83 95 74 50 38 43
56 100 100 75 96 10 74 76 95 71
82 56 7 49 60 14 59 52 89 31
67 67 51 27 8 11 55 38 2 80
63 78 96 12 32 60 5 12 22 11

You might also like