accing a fortran 'module' in a 'function defined in some other file
- by cppb
hello,
I am using fortran 90
I have defined a fortran module in fileA.f as:
module getArr
double precision a(100)
end module getArr
The same fileA.f contains a subroutine that uses this module
subroutine my_sub
use getArr
implicit none
getArr%a(1) = 10.5
end subroutine
In fileB.f, I have a fortrtan function. I am trying to access the value of getArr%a(1) as:
double precision function my_func(R)
use getArr
double precision x
x = getArr%a(1)
return
end
But I am getting errors at the compile time. It says it is unable to access the module getArr.
How should I declare it??
Thanks