Cours sur le langage Fortran
262 pages
Français

Cours sur le langage Fortran

-

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
262 pages
Français
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

Support de cours sur le langage Fortran, qui est un langage de programmation utilisé principalement pour des calculs scientifiques.

Sujets

Informations

Publié par
Nombre de lectures 54
Licence : En savoir +
Paternité, pas d'utilisation commerciale, partage des conditions initiales à l'identique
Langue Français
Poids de l'ouvrage 1 Mo

Extrait

Langage Fortran

Support de cours

Patrick Corde
Anne Fouilloux
Messagerie : Prenom.Nom@idris.fr

´
INSTITUT DU DEVELOPPEMENT
ET DES RESSOURCES
EN INFORMATIQUE SCIENTIFIQUE

1

Cours langage Fortran– 2 octobre 2007
Patrick Corde et Anne Fouilloux

1 –Introduction. . . . . . . . . . . . . . . .
1.1 –Historique. . . . . . . . . . . . . . . .
1.2 –bibliographie. . . . . . . . . . . . . . .
1.3 –documentation. . . . . . . . . . . . . .
2 –tie´relae´´nsG. . . . . . . . . . . . . . . . .
2.1 –sdenBasearitmue´no. . . . . . . . . . .
2.2 –n´eesr´epRitatnesenodsedno. . . . . . .
2.2.1 –ndioenesertiseRrpe´estnta. . . . . .
2.2.2 –rse´noedatitseneRe´lrspe. . . . . . .
2.2.3 –oitatnese´rpeRsxelempcoesnd. . . .
2.2.4 –Rpe´rseseudeslogiqentation. . . . . .
2.2.5 –taenontiepResr´acarscdeesert`. . . . .
2.3 –acedueJ`ereracts. . . . . . . . . . . . .
2.4 –mmareoNitd’onitunde´eogpr. . . . . .
´
2.5 –ixuqseEl´ementssynta. . . . . . . . . .
2.5.1 –Format libre. . . . . . . . . . . . .
2.5.2 –Commentaires. . . . . . . . . . . . .
3 –ralcoitanse´D. . . . . . . . . . . . . . . .
3.1 –Identificateurs. . . . . . . . . . . . . .

´
INSTITUT DU DEVELOPPEMENT
ET DES RESSOURCES
EN INFORMATIQUE SCIENTIFIQUE

8
9
12
15
17
18
20
20
21
23
24
25
28
29
30
30
32
33
34

2

Cours langage Fortran– 2 octobre 2007
Patrick Corde et Anne Fouilloux

3.2 –nest´ffrepetiyDs. . . . . . . . . . . . . .35
3.3 –Syntaxe. . . . . . . . . . . . . . . . . .37
3.3.1 –oFmrgetiralaeconlare´ne´´denu’de37. .
3.3.2 –Cas particulier : le type CHARACTER38
3.4 –Instruction IMPLICIT NONE39. . . . . .
3.5 –anteslitt´eralesCnots40. . . . . . . . . . .
3.5.1 –Cnotsnaetestneri`es. . . . . . . . . .40
3.5.2 –icisrpe´noeellesr´mpleessisnoCtnat. .41
3.5.3 –icisnoodselleee´rpelbunsCor´esntta. .42
3.5.4 –Constantes complexes43. . . . . . . . .
3.5.5 –restce`acarseedˆanınttachesnsCo44. . .
3.6 –Initialisation. . . . . . . . . . . . . . .45
3.6.1 –L’instruction DATA45. . . . . . . . . .
3.6.2 –Le symbole ”=”47. . . . . . . . . . . .
3.7 –Constantes symboliques. . . . . . . . .48
3.8 –Instruction EQUIVALENCE. . . . . . .49
4 –re´puetaOsiessonetrsprex52. . . . . . . . .
4.1 –pOseuqitesarithm´´erateur. . . . . . . .53

´
INSTITUT DU DEVELOPPEMENT
ET DES RESSOURCES
EN INFORMATIQUE SCIENTIFIQUE

3

Cours langage Fortran– 2 octobre 2007
Patrick Corde et Anne Fouilloux

4.1.1 –rseLos´pretaue. . . . . . . . . . . .
4.1.2 –Les expressions. . . . . . . . . . . .
4.1.3 –Conversion implicite. . . . . . . . .
4.2 –elsrurteelsnnioatare´pO. . . . . . . . . .
4.3 –quessrueigol´pOtare. . . . . . . . . . .
4.3.1 –´eiterv´deseatlbseL. . . . . . . . . .
4.4 –´enancatdecoteurare´pOitno. . . . . . .
4.5 –´pOtaredrueeffa’atctnio. . . . . . . . . .
4.5.1 –snyatexg´en´erale. . . . . . . . . . .
4.5.2 –tydeesgle`Rgepa. . . . . . . . . . .
4.6 –Pir´edeoriteratesuOrps´. . . . . . . . .
5 –cenoerdscuutSrtleˆotr. . . . . . . . . . .
5.1 –Les tests. . . . . . . . . . . . . . . . .
5.1.1 –Le bloc IF. . . . . . . . . . . . . . .
5.1.2 –Le bloc SELECTCASE. . . . . . .
5.2 –Lessnoratiit´e. . . . . . . . . . . . . . .
5.2.1 –L’instruction GOTO. . . . . . . . .
5.2.2 –Les bloucles DO. . . . . . . . . . .
6 –Tableaux. . . . . . . . . . . . . . . . . .

´
INSTITUT DU DEVELOPPEMENT
ET DES RESSOURCES
EN INFORMATIQUE SCIENTIFIQUE

53
54
56
58
59
60
61
62
62
62
64
66
67
67
69
71
71
72
79

4

Cours langage Fortran– 2 octobre 2007
Patrick Corde et Anne Fouilloux

6.1 –laration´Dce. . . . . . . . . . . . . . . .80
6.2 –e)endu,´etr´oDfilniefiontiras(,png82. . . .
6.3 –Initialisation85. . . . . . . . . . . . . . .
6.3.1 –Le symbole ”=”85. . . . . . . . . . . .
6.3.2 –Le constructeur de vecteurs86. . . . . .
6.3.3 –L’instruction DATA. . . . . . . . . .88
6.4 –Manipulation de tableaux89. . . . . . . .
6.4.1 –Expressions de type tableau89. . . . .
6.4.2 –Sections de tableaux. . . . . . . . .90
7 –EnseitroSsee´rt93. . . . . . . . . . . . . . .
7.1 –Introduction94. . . . . . . . . . . . . . .
7.2 –´sseeuqe`ccAntiel. . . . . . . . . . . . .96
7.2.1 –´sqieFehuctenibrniiaeriel. . . . . . .97
7.2.2 –xetr´setiFeihclueeqient99. . . . . . . .
7.3 –dsricce`Aect. . . . . . . . . . . . . . .136
7.3.1 –ihciF`eccaae`irnabiersdirect. . . . .137
7.3.2 –aae``eccirsdtecFciihreettx. . . . . .139
7.4 –Fichier temporaire144. . . . . . . . . . . .

´
INSTITUT DU DEVELOPPEMENT
ET DES RESSOURCES
EN INFORMATIQUE SCIENTIFIQUE

5

Cours langage Fortran– 2 octobre 2007
Patrick Corde et Anne Fouilloux

7.5 –Destruction d’un fichier. . . . . . . . .145
7.6 –Fichier interne146. . . . . . . . . . . . . .
7.7 –Instructions de positionnement149. . . . . .
7.8 –Instruction INQUIRE. . . . . . . . . .152
7.9 –Remarques. . . . . . . . . . . . . . . .154
8 –e´corPserud161. . . . . . . . . . . . . . . . .
8.1 –Arguments. . . . . . . . . . . . . . . .162
8.2 –Subroutines. . . . . . . . . . . . . . . .164
8.3 –Fonctions165. . . . . . . . . . . . . . . . .
8.4 –edenıˆahcepytedsntmeguArarace`tcser. 167
8.5 –Arguments de type tableau169. . . . . . . .
8.6 –pepytedsrude´coreArgument172. . . . . .
8.7 –udercoe´reenistnsPr174. . . . . . . . . . .
8.8 –eursentificatevedetieD´eurde´tdiseisivilib177
8.9 –sueeqs`intrderuseniPor´c. . . . . . . . .179
9 –Common. . . . . . . . . . . . . . . . . .180
9.1 –L’instruction COMMON181. . . . . . . . .
9.2 –Common blanc182. . . . . . . . . . . . . .
9.3 –moomC´nteqieu´te. . . . . . . . . . . .184

´
INSTITUT DU DEVELOPPEMENT
ET DES RESSOURCES
EN INFORMATIQUE SCIENTIFIQUE

6

Cours langage Fortran– 2 octobre 2007
Patrick Corde et Anne Fouilloux

9.3.1 –Initialisation : BLOCK DATA185. . . .
9.3.2 –Instruction SAVE et COMMON187. . .
9.4 –R`eglesetrestricitnos189. . . . . . . . . . .
10 –Include192. . . . . . . . . . . . . . . . . . .
10.1 –La directive INCLUDE. . . . . . . . .193
11 –rtiessor´ee:entxeAeAnnsexatnyss. . . .195
12 –questnirsne`e´uderisocprB:xeneAn213. . . .
13 –An`eolstetcepsbosexensa:C. . . . . . . .225
14 –dece`tmealitmoipAnnon:sysexeD229. . . .
15 –Annexe E : exercices233. . . . . . . . . . . .

´
INSTITUT DU DEVELOPPEMENT
ET DES RESSOURCES
EN INFORMATIQUE SCIENTIFIQUE

7

Cours langage Fortran– 2 octobre 2007
Patrick Corde et Anne Fouilloux

1 – Introduction

1.1 Historique
+
1.2 Bibliographie
+
1.3 Documentation
+

´
INSTITUT DU DEVELOPPEMENT
ET DES RESSOURCES
EN INFORMATIQUE SCIENTIFIQUE

8

Cours langage Fortran– 2 octobre 2007
Patrick Corde et Anne Fouilloux

1.1 –Historique

Code machine(tionnotareqiun´mcoateune.l)
+
Assembleurses.ddocenmseome´uqin
+
1954–Projetcr´eationdupremierlangage
+
symboliquepar John Backus d’IBM=⇒FOR
TRAN(MathematicalFORmulaTRANslating
System) :
Efficacite´ducodege´n´ere´(performance).
ó
Langage quasi naturel pour scientifiques (pro
ó
ductivite´,maintenance,lisibilit´e).
1957–Livraison des premiers compilateurs.
+
1958–Fortran II(IBM)=⇒sousprogrammes
+
compilablesdefac¸oninde´pendante.

´
INSTITUT DU DEVELOPPEMENT
ET DES RESSOURCES
EN INFORMATIQUE SCIENTIFIQUE

9

Cours langage Fortran– 2 octobre 2007
Patrick Corde et Anne Fouilloux

Ge´ne´ralisationauxautresconstructeursmais:
+
divergences des extensions =⇒ecssne´edtie´
ó
normalisation,
ASAAmerican Standards Association(=⇒ANSI
ó
American Nat. Standards Institute´eom

  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents