Quantcast
Channel: Intel® Fortran Composer XE
Viewing all articles
Browse latest Browse all 1424

Allocatable arrays in modules

$
0
0

In my code, there is a data container module that includes allocatable arrays. 

The main subroutine, calls a subroutine to initialize the arrays. Both main subroutine and initialize subroutines, use the data_container module. 

The problem is that after the arrays are initialized, the main subruotine, does not see the initialization of the array:

module data_container
real (8), dimension (:), allocatable:: A
end module data_container

subroutine initialize
use data_container
allocate (A(10))
end subroutine initialize

recursive subroutine main_subroutine
use data_container
call initialize

end subroutine main_subroutine


The real program is more complicated and the array is a complex data type. 

Thanks,

Alireza


Viewing all articles
Browse latest Browse all 1424

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>