Blame view

fortranTest/main.f90 622 Bytes
af19620a   Kévin Duquette   Add all files
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
program main
  implicit none
integer mainVar
integer para
parameter (para=3)
real mat1(10,10), mat2(10,10)


mat1(:,:) = 0 
mat2 = mat1

!mainVar =1
! 
!  call sub1(mainVar)

write(*,*) 'mainVar in Main' ,mainVar
write(*,*) 'para in Main', para

end program main

subroutine sub1(mainVar)
  implicit none
integer mainVar, para
real var1
parameter (var1=3.1416)

write(*,*) 'para in sub1 ', para
write(*,*) 'mainVar In sub1', mainVar
call sub2(mainVar)
end

subroutine sub2(mainVar)
  implicit none
integer mainVar, para
real var1

mainVar = var1
write(*,*) 'mainVar in sub2', mainVar
write(*,*) 'para in sub2 ', para
end