problem with pointers, runtime error
From: Anton Ishmurzin (narod_at_izh.com)
Date: 12/19/03
- Next message: Charles Russell: "Re: g77 and DVF works fine but ifc causes a run-time error! Any ideas?"
- Previous message: Tim Prince: "Re: g77 and DVF works fine but ifc causes a run-time error! Any ideas?"
- Next in thread: Herman D. Knoble: "Re: problem with pointers, runtime error"
- Reply: Herman D. Knoble: "Re: problem with pointers, runtime error"
- Reply: Michael Metcalf: "Re: problem with pointers, runtime error"
- Reply: Steve Lionel: "Re: problem with pointers, runtime error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Charles Russell: "Re: g77 and DVF works fine but ifc causes a run-time error! Any ideas?"
- Previous message: Tim Prince: "Re: g77 and DVF works fine but ifc causes a run-time error! Any ideas?"
- Next in thread: Herman D. Knoble: "Re: problem with pointers, runtime error"
- Reply: Herman D. Knoble: "Re: problem with pointers, runtime error"
- Reply: Michael Metcalf: "Re: problem with pointers, runtime error"
- Reply: Steve Lionel: "Re: problem with pointers, runtime error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|