problem with pointers, runtime error

From: Anton Ishmurzin (narod_at_izh.com)
Date: 12/19/03


Date: Fri, 19 Dec 2003 15:25:52 +0100

Hi All,

I use ifc 6.0 under Linux SusE 8.1, and try to do some pointers manipulations.

One of my subroutines has a variable "w" of type "liste". "liste" is a list:

type liste
    sequence
    integer:: ikoord(maxdim)
    integer:: tiefe
    integer::test
    Type(liste),pointer ::link_g,link_k,link_v
    Type(zell_ar_t),pointer:: zell_ar
    integer:: flag
    real,pointer,dimension(:):: daten1
    real,pointer,dimension(:):: daten2
end type liste

As you see, each node of the list contains pointers to two arrays: "daten1"
and "daten2". I surely know their bounds, say, they equal to 46 and 3.

And in order to get access to the fields "daten1" and "daten2" it calls the
subroutine "check_all_flags":

recursive subroutine check_all_flags(w)

         type(liste), pointer :: w

         print *, "current flag = ", w%flag

1: print *, "ikoord(1:",maxdim,")= ", (w%ikoord(i), i=1,maxdim)

2: daten1 => w%daten1

3: print *, "w%daten1= ", (daten1(i), i=1,46)

         if (associated(w%link_k)) call check_all_flags(w%link_k)
         if (associated(w%link_g)) call check_all_flags(w%link_g)

endsubroutine check_all_flags

So the question:

When i compile all of it without lines marked with "2" and "3" it's
compiles with no errors and runs without any runtime error too.

But when i add them (lines "2" and "3") the program spits the following:

** Address Error **

End of diagnostics

I read Programmer's Reference on ifc 6.0, Metakalf's Fotran 90/95
Explained, but they both have just a little information about pointers in
fortran. Please help.

Thanks a lot in advance,
Anton.



Relevant Pages

  • Re: problem with pointers, runtime error
    ... Anton Ishmurzin wrote: ... > end type liste ... > compiles with no errors and runs without any runtime error too. ... but they both have just a little information about pointers ...
    (comp.lang.fortran)
  • Re: Access violation error
    ... //if i uncomment below line,then it throwing access violation error during ... i have only runtime error. ... I suppose that the method E3Des is defined somewhere, but you know, without TELLING US ... space to initialize those pointers. ...
    (microsoft.public.vc.mfc)
  • Re: problem with pointers, runtime error
    ... -|I use ifc 6.0 under Linux SusE 8.1, and try to do some pointers manipulations. ... each node of the list contains pointers to two arrays: "daten1" ... -|When i compile all of it without lines marked with "2" and "3" it's ...
    (comp.lang.fortran)
  • Re: Pointers and dynamic data structures in Fortran 90/95
    ... allowed inside derived types. ... Using pointers for aliasing array sub-objects and deeply embedded elements ... ifc 7.1 says about synax error. ... ifc 8.1, 9.0 translates normally,and at least under ...
    (comp.lang.fortran)
  • Re: Mixing ATL smart pointers with regular calls
    ... Certain pointers are then passes to other ... I believe that it is the cause of a runtime error. ... There is no problem mixing smart pointers with regular calls. ...
    (microsoft.public.win32.programmer.directx.video)