This is an extension of my previous post - passing allocatable array between subroutines...thanks xwb for that! I have an allocatable array (assumed shape array) in a subroutine - where it's size determined in the subroutine and I want to use this array in the main program. How can it be done?
Code:
Program calc2
real, allocatable:: y(:)
how it can be allocated and get the values of y from subroutine x
End program calc2
!----------------------------------------
Subroutine x(y??)
real, allocatable :: y(:)
integer:: n
call --
call --
process size of y
allocate (y(n))
call --- get values of y
processs---
End subroutine x