Fortran Programming: A Summary for Scientists and Engineers, Summaries of Research Methodology

A summary of fortran programming, focusing on its use for scientists and engineers. Topics covered include the importance of coding rules and logical planning, fortran statement rules, data types, variables, and input/output operations. Recommended reading is hahn's 'fortran 90 for scientists and engineers'.

Typology: Summaries

2012/2013

Uploaded on 10/03/2013

abani
abani 🇮🇳

4.4

(34)

81 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Fortran Summary
(Compiled from Hahn [1994])
Successful problem solving with a computer requires knowledge of the coding rules and a sound logical
plan
The compiler translates the program statements into machine code
Fortran statements may be up to 132 characters long and may start anywhere on the line
All statements, except assignments, start with a keyword
A Fortran token is a sequence of characters forming a label, keyword, name, constant, operator or
separator
Blanks should be used to improve readability, except inside keywords and names
Comments may be typed after the exclamation! They should be used liberally to describe variables and
to explain how a program works
A statement with & as its last non-blank character will be continued onto the next line
There are five intrinsic data types: integer, real, complex, logical and character
Values of each data type are represented by literal constants
Integer constants may also be represented in binary, octal and hexadecimal
Real constants are represented in fixed point or floating point (exponential) form
Alphanumeric characters are the letters, digits and the underscore
Names may contain up to 31 alphanumeric characters, starting with a letter
A variable is the symbolic name of a memory location
The IMPLICIT NONE statement should be used to avoid variables being given a type implicitly
A numeric variable should be declared integer or real in a type declaration statement
Numeric expressions may be formed from constants and variables with the five numeric intrinsic
operators, which operate according to strict rules of precedence
Decimal parts are truncated when integers are divided, or when integers are assigned to reals
Numeric assignment computes the value of a numeric expression and assigns it to a real or integer
variable
Groups of variables may be given initial values in a DATA statement
PRINT* is used to print (display) output
READ* is used to input data from the keyboard while a program is running
Data may also be read from an external file (e.g., a disk file)
References
Hahn, B.D., Fortran 90 for Scientist and Engineers, Butterworth-Heinemann, Woburn, MA, 1994.

Partial preview of the text

Download Fortran Programming: A Summary for Scientists and Engineers and more Summaries Research Methodology in PDF only on Docsity!

1

Fortran Summary (Compiled from Hahn [1994])

  • Successful problem solving with a computer requires knowledge of the coding rules and a sound logical plan
  • The compiler translates the program statements into machine code
  • Fortran statements may be up to 132 characters long and may start anywhere on the line
  • All statements, except assignments, start with a keyword
  • A Fortran token is a sequence of characters forming a label, keyword, name, constant, operator or separator
  • Blanks should be used to improve readability, except inside keywords and names
  • Comments may be typed after the exclamation! They should be used liberally to describe variables and to explain how a program works
  • A statement with & as its last non-blank character will be continued onto the next line
  • There are five intrinsic data types: integer, real, complex, logical and character
  • Values of each data type are represented by literal constants
  • Integer constants may also be represented in binary, octal and hexadecimal
  • Real constants are represented in fixed point or floating point (exponential) form
  • Alphanumeric characters are the letters, digits and the underscore
  • Names may contain up to 31 alphanumeric characters, starting with a letter
  • A variable is the symbolic name of a memory location
  • The IMPLICIT NONE statement should be used to avoid variables being given a type implicitly
  • A numeric variable should be declared integer or real in a type declaration statement
  • Numeric expressions may be formed from constants and variables with the five numeric intrinsic operators, which operate according to strict rules of precedence
  • Decimal parts are truncated when integers are divided, or when integers are assigned to reals
  • Numeric assignment computes the value of a numeric expression and assigns it to a real or integer variable
  • Groups of variables may be given initial values in a DATA statement
  • PRINT* is used to print (display) output
  • READ* is used to input data from the keyboard while a program is running
  • Data may also be read from an external file (e.g., a disk file)

References

Hahn, B.D., Fortran 90 for Scientist and Engineers , Butterworth-Heinemann, Woburn, MA, 1994.