|
|
program ProgramName ... (Program body) ... [stop] end [program ProgramName] |
subroutine SubroutineName(parameters) ... (Subroutine body) ... return end [subroutine] |
function FunctionName(parameters) ... (Function body) ... return(...) end [function] |
module ModuleName definition of variables CONTAINS definition of function end [module] |
The module was inspired by C++'s classes
print *, "Hello" print *, var |
read *, var |
|
f90 [ options ] prog.f f90 [ options ] prog.f90 |
program Hello print *,"Hello World !"; end program Hello |
Compile with:
f90 Hello.f90 |
Example:
program Hello print *,"Hello World !"; ! This is a comment end program Hello |
Example:
program Hello print *,"Hello World !" ! One statment print *,"Hello Again !" ! Another statment end program Hello |
Example:
program Hello print *, "Hello World !" end program Hello |
You will get compile errors !!!
Example:
program Hello print *, & "Hello World !" end program Hello |
Example:
print *,"H"; print *,"E"; |
Example:
include 'filename.f90' |
That's the same as #include "filename.f90" in C/C++
Example:
INTEGER i1 INTEGER i 1 IN TEGER i 1All will define a variable "i1" in F77... |
integer i 1 in tegeri2 i 1=1 2 3 4 print *, "i1 = ", i1 i 2 = 23 45 print *, "i2 = ", i2 |