hi all I already posted a subroutine which compute some stuff from a binary file. I was declaring the the dimensions of the output of my subroutine but now i changed that so these output are allocatable. the compiler told me (core dumped).
this is the calling program:
program ttz implicit none integer,parameteriwp = selected_real_kind(8) integer Fileunit=18,Nnodes character(len=9)::Filename='bgpdt.op2' real(iwp),allocatable ::dcoor(:,:) ! call newstuff(Fileunit,Filename,Nnodes,dcoor) ! end program ttz
and this is my subroutine
subroutine newstuff(Fileunit,Filename,Nnodes,dcoor) implicit none integer,parameter::iwp = selected_real_kind(8) type xyzcoord sequence integer,dimension(6)::wert real(iwp),dimension(3)xyz end type xyzcoord integeri,ii,j integer,intent(in)::Fileunit integer,intent(out)::Nnodes integer,dimension(7)::Ta character(len=*),intent(in)Filename type(xyzcoord),allocatabledata(:) real(iwp),allocatable,intent(out)::dcoor(:,:) ! open(unit=Fileunit,file=Filename,status='old',form='unformatted',action='read') ! rewind(Fileunit) ! i=1 do while(i.LT.13) read(Fileunit) i=i+1 end do read(Fileunit)(Ta(i),i=1,7) Nnodes=Ta(2) allocate(dcoor(Nnodes,3),data(Nnodes)) ! j=1 do while(i.LT.10) read(Fileunit) j=j+1 end do ! read(Fileunit)data ! forall(ii=1:Nnodes)dcoor(ii,:) = data(ii)%xyz ! close(Fileunit) end subroutine newstuff
my feeling is that i need to use an interface statement or something similar. since i am new to fortran these advanced methods are difficult to me . please help me