- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think I have a memory Problem. I have the folloving subroutines
subroutine UniPtr2UniType(ptr,prop)
implicit none
! input variables
type(ULitem),pointer :: ptr ! patient pointer
type(UniType) prop ! patient type (strings)
.
.
end subroutine
subroutine Test
implicit none
type(ULitem),pointer :: ptr ! patient pointer
type(UniType) prop
call UniPtr2UniType(ptr,prop)
.
.
end subroutine
when I'm debugging, and at position call UnitPtr2UniType, the pointer ptr is defined.
Stepping into the subroutine, the pointer is not more defined, and the program hangs up if I use the ptr-pointer
I used the same subroutines in an other programm and there all worked, but in the current (a large project) It does not work. I think that's a memory problem, but how can I solve that ?
subroutine UniPtr2UniType(ptr,prop)
implicit none
! input variables
type(ULitem),pointer :: ptr ! patient pointer
type(UniType) prop ! patient type (strings)
.
.
end subroutine
subroutine Test
implicit none
type(ULitem),pointer :: ptr ! patient pointer
type(UniType) prop
call UniPtr2UniType(ptr,prop)
.
.
end subroutine
when I'm debugging, and at position call UnitPtr2UniType, the pointer ptr is defined.
Stepping into the subroutine, the pointer is not more defined, and the program hangs up if I use the ptr-pointer
I used the same subroutines in an other programm and there all worked, but in the current (a large project) It does not work. I think that's a memory problem, but how can I solve that ?
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is an explicit interface to UniPtr2UniT visible to the caller? That's required. Put a PRINT (or similar) of the value inside the subroutine - does it give the proper value? A "hang" is not usually a "memory problem".
I'll repeat a past observation - when someone posts a few sample lines from a program and says he thinks this is where the problem is, he is usually mistaken. Try to construct a small but complete test case - in many times this will lead you to the solution.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is an explicit interface to UniPtr2UniT visible to the caller? That's required. Put a PRINT (or similar) of the value inside the subroutine - does it give the proper value? A "hang" is not usually a "memory problem".
I'll repeat a past observation - when someone posts a few sample lines from a program and says he thinks this is where the problem is, he is usually mistaken. Try to construct a small but complete test case - in many times this will lead you to the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
Is an explicit interface to UniPtr2UniT visible to the caller? That's required. Put a PRINT (or similar) of the value inside the subroutine - does it give the proper value? A "hang" is not usually a "memory problem".
I'll repeat a past observation - when someone posts a few sample lines from a program and says he thinks this is where the problem is, he is usually mistaken. Try to construct a small but complete test case - in many times this will lead you to the solution.
The problem was, that there was no explicit interface visible. I did not know that I have to do that. I packed all subroutines (UniPtr2UniT,.. ) into a module, so it worked without explicit interface definition for the caller.
Thanks
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Putting the routines in a module and USEing the module provides the explicit interface. That is a fine way to handle it. If you had built with generated interface checking enabled, the compiler probably would have warned you about this.
See also Doctor Fortran Gets Explicit.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page