Fortran 95

University of Cambridge. Department of Physics. Computational Physics. Self- study guide 2. Programming in Fortran Dr. Rachael Padman. Michaelmas.
Table of contents

The example below has a maximum length of 10 characters allowed for a person's name — this might not always be enough!


  1. Urban Stormwater: Best-Practice Environmental Management Guidelines.
  2. ?
  3. Legally Lucky!
  4. FORTRAN Tutorial - Free Guide to Programming Fortran 90/95 - Introduction;
  5. Fortran 95 Features.

You have to make a judgement here. In the bad old days of programming, declaration of variables was thought to be unnecessary and the old FORTRAN compilers used an implicit convention that integers have names starting with the letters in the range i — n, all the others being real. Time has shown that one of the commonest reasons for error in a program is the incorrect use of variables.

You might include different types of variables, for example real , integer , and character. Include input and output using read and print.

Worksheet 1 - Basics

It could, for example, print out their year of birth with a suitable message. It's up to you, just use your imagination. Run your last program again. When the black output window opens right click on the Plato icon in the top left corner. Worksheet 1 - Basics.

Navigation menu

This worksheet is also available in PDF format. Aims By the end of this worksheet, you will be able to: Save a copy of your output in Word. The program statements are executed sequentially. Notice the inclusion of the line: Always use implicit none at the start of every program. Privacy and cookies policy.

FTN Fortran 95 for Windows

You can use pointers to access user-managed storage by dynamically associating variables to particular locations in a block of storage. Cray pointers allow accessing absolute memory locations. Cray pointers do not provide convenient manipulation of linked lists because for optimization purposes it is assumed that no two pointers have the same value.

Tutorial Fortran 95

Cray pointers are declared as follows: Fortran pointers are declared as follows: The two kinds of pointers cannot be mixed. Cray pointers can be assigned values as follows: Use Cray pointers as described above. Remarks about the above example: For purposes of optimization, f95 assumes the storage of a pointee is never overlaid on the storage of another variable--it assumes that a pointee is not associated with another variable.

Such association could occur in either of two ways: These kinds of association are sometimes done deliberately, as in array equivalencing, but then results can differ depending on whether optimization is turned on or off. Above, because b and c have the same pointer, assigning 2. Therefore b prints out as 2. Notes on the above table: P The name can be passed as an argument. NP The name cannot be passed as an argument. E External code for the intrinsic is called at run time. I f95 generates inline code for the intrinsic procedure.

A compiler directive directs the compiler to do some special action. Directives are also called pragmas. A compiler directive is inserted into the source program as one or more lines of text. Each line looks like a comment, but has additional characters that identify it as more than a comment for this compiler. For most other compilers, it is treated as a comment, so there is some code portability.

Sun-style directives are the default with f95 and f These have the following syntax: These directives specify the source form of lines following the directive line. A parallelization directive is a special comment that directs the compiler to attempt to parallelize the next DO loop.

FTN95: Fortran 95 for Windows

Use of non-standard extensions, such as VMS Fortran features, are not compatible and may not compile with Sun Fortran The f77 compiler allows up to 20 array subscripts while f90 only allows 7. Such compatibility includes the following two situations: The numbers read back in may or may not equal the numbers written out. Future releases of f95 are intended to be source code compatible with this release.


  • Caleb Williams (Oxford Worlds Classics)?
  • Life in the Soil: A Guide for Naturalists and Gardeners?
  • Fortran 95 language features.
  • ;
  • The Basics.
  • ?
  • Triplets Found: The Virgins Makeover / Take a Chance on Me / And Then There Were Three (Mills & Boon.
  • Module information files generated by this release of f95 are not guaranteed to be compatible with future releases. On Solaris systems, routines written in C can be combined with Fortran programs, since these languages have common calling conventions.


    1. Fortran 95 Features and Differences.
    2. .
    3. !
    4. ;
    5. .

    By default, such files are usually sought in the current working directory.