Ive made a dummymodule in which ive included a global commonareadefinition through an include-statement. like this
module Commonarea INCLUDE MyCommonArea.for' contains subroutine dummy end subroutine dummy end module Commonarea
The reason for this is to be able to use the commonarea in both *.for and *.f90-files.
In one of the subroutines in my program Im storing the common in an unformatted file. Ive created a huge integerarray and using an equivalencestatement between the first item in the integerarray and the first item in the common to map the memory into my integerarray.
If im using the Use-statement, this doesnt work, but if Im using INCLUDE MyCommonArea.for' instead then it works
! Alt 1, not working USE Commonarea ! Alt 2, working INCLUDE MyCommonArea.for'
equivalence(FirstItemInCommon, intarr(1) )
intNo = 1 ! DummyCode
end subroutine test
Can anyone explain the difference or suggest a solution to my problem.