Hi all,
I am new to Fortran programming. My work is concentrated on arrays.
After writing a subroutine for simple multiplication of 2 arrays (1 dimensional), when I used it, the compiler gave an error:
" Fortran runtime error: Integer overflow when calculating the amount of memory to allocate "
I am surprised to see this error, because I think this subroutine is very clear and simple.
Please give me a hint about the cause of error.
---------------------------------------------------------
subroutine dyad(A, B, C)
real, intent(in) :: A)
real, intent(in) :: B)
real, dimension,, intent(out) :: C
real, dimension,, allocatable :: D
integer :: i, j, na, nb
na=size(A)
nb=size(B)
allocate(D(na,nb))
do i=1,na
do j=1,nb
D(i,j)=A(i)*B(j)
end do
end do
C=D
end subroutine dyad
I am new to Fortran programming. My work is concentrated on arrays.
After writing a subroutine for simple multiplication of 2 arrays (1 dimensional), when I used it, the compiler gave an error:
" Fortran runtime error: Integer overflow when calculating the amount of memory to allocate "
I am surprised to see this error, because I think this subroutine is very clear and simple.
Please give me a hint about the cause of error.
---------------------------------------------------------
subroutine dyad(A, B, C)
real, intent(in) :: A)
real, intent(in) :: B)
real, dimension,, intent(out) :: C
real, dimension,, allocatable :: D
integer :: i, j, na, nb
na=size(A)
nb=size(B)
allocate(D(na,nb))
do i=1,na
do j=1,nb
D(i,j)=A(i)*B(j)
end do
end do
C=D
end subroutine dyad