Hi! I would appreciate very much if anybody could give me a hint on how to reallocate the two-dimensional table (integer and DP) in Fortran 90? Reallocation of one-dimensional tables I do by using the tools from Numerical Recipes. Thanks in advance for your help!
program move_alloc_test implicit none real(8), allocatable :: a(:,:),temp(:,:) integer :: x,y allocate(a(5,5)) do y=1,ubound(a,2) do x=1,ubound(a,1) a(x,y) = x*100+y enddo enddo print *,size(a) print *,a ! increase size of each dimension of a allocate(temp(ubound(a,1)+2,ubound(a,2)+2)) temp(1:ubound(a,1), 1:ubound(a,2)) = a temp(ubound(a,1)+1:, ubound(a,2)+1:) = 0.0 call move_alloc(temp, a) print *,size(a) print *,a end program move_alloc_test