Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deallocation error?

Status
Not open for further replies.

JohannesRS

Programmer
Jun 9, 2005
15
BR
Ok, those are two questions.

First one: have anybody here already got an deallocation error (maybe with ifort 8.1)? I'm using it, and in a program with a hell of variables, I just tracked down an "forrtl: severe (174): SIGSEGV, segmentation fault occurred" error to the deallocation of a 4-dimensional array which is allocated. The funny part is that this is to be deallocated together with 2 others, that are properly deallocated, no messages, but doesn't matter the ordering, the program fails to deallocate THE ONE array. ;) Have anyone got this sort of error? What was the cause? How did you go around it?

Second: I would like to use an "minloc" intrinsic on a vector (1D array) to get the position of its minimum value. No problem there, it gives me that, but as an array of one single position. What would be a good way to turn it on an integer? I'm looking for something less disgusting than an ugly use of "sum(minloc(vector))", which was the horroble way around I found. Any clues?

Thanks a lot in advance for any help on these issues. ;)
 
I've only used a 4D array once. The only thing I can think of are arrays going out of bounds in one of the dimensions and somehow clobbering the descriptors of some of the others.

A quick fix to see if this is the problem is to increase each dimension by 1. If it goes away, that might the problem. The difficult part is finding out where it is.

Re: minloc. Doesn't this work?
Code:
lowestindex = minloc (array)
See for an example
 
Hi xwb!

Well, nfortunatelly, at this time it can't be the bounds of the array. Cause it's not making sense, since I'm not trying to access a positon out of the bounds, neither trying to "write" something in the array but out of it's bounds. The thing that goes wrong, and is absolutelly nonsense, is just a "deallocate(sdfs)". Here, at least for what I know, bounds should not interfeer. :(

minloc: no, unfortunatelly that doesn't work. Cause "lowestindex" is an integer, while "minloc(array) = /integer/"... :(

So, I did the most non-sense thing ever:
"lowestindex = sum(minloc(array))"... :p Horroble.

Well, thanks a lot in advance for anything. ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top