Violaine Louvet (CNRS/ICJ) Fortran Rabat, 9-12/04/2012 19 / 105. Run your last program again. It's up to you, just use your imagination. A Fortran 2003 introduction by examples Gunnar Wollan 2012 1 Introduction The purpose of this book is to give a good insight in the Fortran 2003 program-ming language.by going through a number of examples showing how computa-tional problems and the reading and writing data to files can b e solved. Saving the contents of Output Window. We start by looking at a simple example where we calculate the area of a circle: program circle real r, area c This program reads a real number r and prints c the area of a circle with radius r. write (*,*) 'Give radius r:' It could, for example, print out their year of birth with a suitable message. A type describes what kind of data the variable is expected to contain. Variables can also be used to store non-numeric values such as text, letters, and words, for example. 2 Why use Fortran? Fortran - 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 b Example of a Fortran 90 Program. Fortran permet d’initialiser une variable lors de sa déclaration à l’aide du symbole «=» I Dans ce cas, les caractères: :sont obligatoires I Ces variables héritent aussi de l’attributSAVE Exemples REAL a,b, c INTEGER n DATA a,b,n/1.0 , 2.0 , 17/ LOGICAL: : flag = .TRUE. Consider the following example Fortran 90 program: PROGRAM Triangle IMPLICIT NONE REAL :: a, b, c, Area PRINT *, 'Welcome, please enter the& &lengths of the 3 sides.' READ *, a, b, c PRINT *, 'Triangle''s area: ', Area(a,b,c) END PROGRAM Triangle FUNCTION Area(x,y,z) IMPLICIT NONE REAL :: Area ! The text has to follow a certain syntax to be a valid Fortran program. An example might be a program that asks people questions, including things like their age and name and so on. FORTRAN 90 Matmeca 1`ere ann´ee ENSEIRB-MATMECA Luc Mieussens Luc.Mieussens@math.u-bordeaux1.fr - ´equipe Calcul Scientifique et Mod´elisation - Institut de Math´ematiques de Bordeaux Universit´e de Bordeaux version du 28 septembre 2011 1. Le but de ce cours est d’apprendre `a programmer en fortran 90. For example, the expression x = 3 we could say that x … The best text and video tutorials to provide simple and easy learning of various technical and non-technical subjects with suitable examples and code snippets. We refer to variables in Fortran as having certain Types. When the black output window opens right click on the Plato icon in the top left corner . A Fortran program is just a sequence of lines of text. In the last 15 to 20 years Fortran has been looked upon as an old …