If I have a variable called var
which is in a common block named myCB
may I use the same name to pass an argument between two other subroutines which are not using the common block myCB
?
The code is like below.
Subroutine SR1(Var)
!something here using Var
end Subroutine SR1
Subroutine SR2()
....
Call SR1(B)
....
end Subroutine SR2
Subroutine SR3()
common \myCB\ Var
...
! something using the other Var shared with SR4
......
end Subroutine SR3
Subroutine SR4()
common \myCB\ Var
....
... ! something using the other Var shared with SR3
....
end Subroutine SR4
I do have problem with Var
passing between SR1
and SR2
, could the problem come from the other named Var
in the common block ?