parent
2106a6020c
commit
f7465c0887
5 changed files with 21 additions and 10 deletions
@ -0,0 +1,6 @@ |
||||
module line! inline comment |
||||
implicit none |
||||
|
||||
real :: length |
||||
|
||||
end module line |
@ -1,4 +1,4 @@ |
||||
project('modules', 'fortran') |
||||
|
||||
e = executable('modprog', 'stuff.f90', 'prog.f90') |
||||
e = executable('modprog', 'mymod.f90', 'prog.f90', 'comment_mod.f90') |
||||
test('moduletest', e) |
||||
|
@ -0,0 +1,6 @@ |
||||
module circle |
||||
implicit none |
||||
|
||||
real, parameter :: pi = 4.*atan(1.) |
||||
real :: radius |
||||
end module circle |
@ -1,7 +1,11 @@ |
||||
PROGRAM prog |
||||
use circle, only: pi |
||||
use line, only: length |
||||
implicit none |
||||
|
||||
use Circle |
||||
IMPLICIT NONE |
||||
print *,'pi=',pi |
||||
|
||||
END PROGRAM prog |
||||
length = pi |
||||
print *, length |
||||
|
||||
end program |
||||
|
||||
|
@ -1,5 +0,0 @@ |
||||
MODULE Circle |
||||
REAL, PARAMETER :: Pi = 3.1415927 |
||||
REAL :: radius |
||||
END MODULE Circle |
||||
|
Loading…
Reference in new issue