I don't know why the following program throw overflow, since all the large arrays are dynamic, this is just an example, y = sum(u) works, but why partial sum does not work?
program test
implicit none
integer, parameter :: n = 1000000, m = 10
real(8), allocatable, dimension(:,:) :: x
real(8) :: y
allocate(x(n,m))
x = 1.0d0
call tt(x,y,n,m)
print *, y
end
subroutine tt(x,y,n,m)
implicit none
integer, intent(in) :: n, m
real(8), intent(in), dimension(n,m) :: x
real(8), intent(out) :: y
real(8), allocatable, dimension(:) :: z
real(8), allocatable, dimension(:,:) :: u
allocate(z(n),u(n,m))
u = exp(x)
z = sum(u,2)
y = sum(z)
return
endMany thanks