Hi,
I've got two codes, which I want to combine. In one code I've got type:
TYPE, PUBLIC ::m_type INTEGER :: m, REAL ( KIND( 1.0D+0 ) ), ALLOCATABLE, DIMENSION(:) :: val END TYPE
and subroutine which uses this type as an input:
subroutine sub(m) type(m_type), intent(in) :: matrix .... end subroutine
In the second code, which calls the subroutine sub(), I have already allocated array, let say x(:), and I don't want to allocate once more memory for m%val, just for copying data, because size of x(:) is huge. Is there any way to assign m%val with values of x(:) without allocating additional memory? In C pointer will do the trick, but I don't know how I could use it here. I dont want to change subroutine sub(), because it will cause changes not only in my part of the code.
Any ideas?