Beginner Fortran 90 tutorial

Download Free course and training document about Fortran 90, tutorial on 20 pages for beginners by Guy Munhoven.

Table of contents

  • Basic program structure in Fortran
  • Exercise
  • Outputting data
  • Reading data
  • Do loops
  • Functions
  • Arrays
  • Subroutines

General structure of a Fortran 90 program

Fortran 90 distinguishes the following program units (scoping units):

  • main program;
  • subroutines: subroutines and functions;
  • modules;
  • block data.

At first, we will not deal with modules or block data. It should be noted that the modules are among the most useful innovations of Fortran 90.

Main program

The main program has the following structure:

[PROGRAM [program name]]
specification and declaration instructions
executable instructions
[CONTAINS internal procedures]
END [PROGRAM [program name]]

Everything enclosed in square brackets ([...]) is optional (the brackets themselves are to be omitted in all cases). The PROGRAM statement is not mandatory, but the END statement. The latter can be completed by the PROGRAM attribute which must then be followed by the name of the program

name of the program. Different types of content (specification instructions
and declaration, executable instructions, etc.) are described below.

Subroutines

The subroutine subroutines have a structure similar to that of the main program:

SUBROUTINE name of the subroutine [(arguments)]
specification and declaration instructions
executable instructions
[CONTAINS internal procedures]
END [SUBROUTINE name of the subroutine]

The END statement is mandatory, but not the SUBROUTINE additional specification. If it is given, which is recommended, especially in the case where several subroutines are gathered in the same file, it must be
completed by the name of the subroutine, exactly as specified on the SUBROUTIN line.
Subroutines are run using the CALL command name of the subroutine [(arguments)]

functions

Function type subroutines return a result by calling them by name:

[type] FUNCTION function name ([argument list])
specification and declaration instructions
executable instructions
[CONTAINS internal procedures]
END [FUNCTION function name]

The type (see below) can be specified (recommended); otherwise, it is determined by the default typing rules (see below).

Size : 134.745 Kb
File type : pdf
Downloads: 169
Created: 2018-05-21
Beginner Fortran 90 tutorial

Others Fortran Tutorials

Fortran 90/95 Programming Manual

Programming in Fortran 95

Fortran 90 for Beginners

Introduction to programming with Fortran 95

Introduction to Programming using Fortran 95/2003/2008

Others related eBooks about Beginner Fortran 90 tutorial

Scratch programming guide in PDF

Download Scratch programming tutorial by Julian Screawn, Scratch facilitate learning programming by designing and using blocks to create animation, games and videos....

Fundamentals of C++ Programming

Download free course Fundamentals of C++ Programming, pdf file on 766 pages by Richard L. Halterman....

Essential Android

This book written to provide clear and concise explanation of topics for programmers both starting to learn the Android programming as well as those diving in more complex topics. Most examples are linked to online playground that allows you to change the code and re-run it....

Xamarin.IOS tutorial in PDF

Download free Xamarin.IOS tutorial course in PDF, training file in 23 chapters and 95 pages. Free unaffiliated ebook created from Stack OverFlow contributor....

Test-Driven Development with Python

Download free course Test-Driven Development with Python, pdf file on 502 pages by Harry J. W. Percival....

Fundamentals of C# programming

This tutorial is designated to learn the C# language and think like a programmer ,it's a free PDF document under 1122 pages for all level users....

I Love Ruby

Download free course I Love Ruby, pdf file on 314 pages by Karthikeyan A K....

Problem Solving with Algorithms and Data Structures Using Python

THIS TEXTBOOK is about computer science. It is also about Python. However, there is much more. The study of algorithms and data structures is central to understanding what computer science is all about. Learning computer science is not unlike learning any other type of difficult subject matter. Th...

IPython Interactive Computing and Visualization Cookbook

This book contains many ready-to-use, focused recipes for high-performance scientific computing and data analysis, from the latest IPython/Jupyter features to the most advanced tricks, to help you write better and faster code. You will apply these state-of-the-art methods to various real-world examp...

Making Games with Python & Pygame

Download free course Making Games with Python & Pygame, pdf file on 365 pages by Al Sweigart....