The following compiles ok with no error messages but gives
Segmentation fault - invalid memory reference. when run the executable
module inc
integer*1:: i,j,nps
integer*1,allocatable::ib)
type mixed ; integer*1,allocatable :: ib) ; real val ; end type mixed
type(mixed), allocatable :: dout)
contains
subroutine dd(dout,nps);integer*1:: i,j,nps; type(mixed) dout)
do i=1,size(dout) ;do j=1,3*nps;dout(i)%ib(j)=i/j;enddo;dout(i)%val=real(i)/j;enddo
end
end module inc
use inc
nps=3
allocate(ib(3*nps))
allocate(dout(2*nps**2))
call dd(dout,nps)
end
Why would one get this error ?
Segmentation fault - invalid memory reference. when run the executable
Code:
integer*1:: i,j,nps
integer*1,allocatable::ib)
type mixed ; integer*1,allocatable :: ib) ; real val ; end type mixed
type(mixed), allocatable :: dout)
contains
subroutine dd(dout,nps);integer*1:: i,j,nps; type(mixed) dout)
do i=1,size(dout) ;do j=1,3*nps;dout(i)%ib(j)=i/j;enddo;dout(i)%val=real(i)/j;enddo
end
end module inc
use inc
nps=3
allocate(ib(3*nps))
allocate(dout(2*nps**2))
call dd(dout,nps)
end
Code:
Why would one get this error ?