Fortran
[Pages:66]Fortran
#fortran
1
1: Fortran
2
2
2
Examples
2
2
2
3
4
2: C
5
Examples
5
FortranC
5
CFortran
5
3: I / O
7
7
Examples
7
I / O.
7
7
8
4:
10
10
Examples
10
PACK
10
5:
12
Examples
12
12
if
13
DO
13
14
15
16
GOTO
18
GOTO
18
18
19
6:
21
Examples
21
21
SELECT CASE
22
DO
22
WHERE
24
7:
26
Examples
26
26
27
27
29
30
31
31
32
8:
33
Examples
33
33
33
34
35
36
36
36
36
36
37
37
37
37
38
38
38
39
39
39
39
40
40
40
9:
41
Examples
41
/
41
42
10:
43
Examples
43
43
43
44
45
46
11: .f.f90.f95...
48
48
Examples
48
48
12: -
49
49
Examples
49
49
49
50
50
51
13:
53
Examples
53
Fortran
53
54
54
54
55
55
14:
57
Examples
57
57
57
58
58
59
61
You can share this PDF with anyone you feel could benefit from it, downloaded the latest version from: fortran
It is an unofficial and free Fortran ebook created for educational purposes. All the content is extracted from Stack Overflow Documentation, which is written by many hardworking individuals at Stack Overflow. It is neither affiliated with Stack Overflow nor official Fortran.
The content is released under Creative Commons BY-SA, and the list of contributors to each chapter are provided in the credits section at the end of this book. Images may be copyright of their respective owners unless otherwise specified. All trademarks and registered trademarks are the property of their respective company owners.
Use the content presented in this book at your own risk; it is not guaranteed to be correct nor accurate, please send your feedback and corrections to info@
1
1: Fortran
Fortran FortranGNUIntelPGICray
FORTRAN 66 ASAANSI 196637
FORTRAN 77
1978415
Fortran 90
ISO
1991615
Fortran 95
1997615
Fortran 2003
200444
Fortran 2008
2010-09-10
Examples
Fortran
FortranGNU FortrangfortranGNUGCCGNU Linux gfortran
? PathScaleEKOPath ? LLVMDragonEgg ? Oracle Developer Studio ? Absoft Fortran ? Fortran ? NAG Fortran ? PGI
HPC-SystemsIBMCray
Fortran 95 ACM FortranFortran 2003Fortran 2008Fortran Wiki
FortranendFortran
end
"helloworld"
print *, "Hello, world"
2
end
write
write(*,*) "Hello, world" end
program endFortranimplicit noneFortran
program hello implicit none write(*,*) 'Hello world!'
end program hello
hello worldLinuxshellshellfortran ++vivimemacsgeditkatehello hello.f90hello.f90 hello.f90
>gfortran -o hello hello.f90
hello world
>./hello
shell
> Hello world!
"Hello World"
Fortran
program quadratic !a comment !should be present in every separate program unit implicit none real :: a, b, c real :: discriminant real :: x1, x2 print *, "Enter the quadratic equation coefficients a, b and c:" read *, a, b, c discriminant = b**2 - 4*a*c if ( discriminant>0 ) then x1 = ( -b + sqrt(discriminant)) / (2 * a) x2 = ( -b - sqrt(discriminant)) / (2 * a) print *, "Real roots:" print *, x1, x2
3
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.