Coby Needle wrote:
>
> Dear list members,
>
> I've been having great difficulty with allocatable arrays in Compaq
> Visual Fortran - hopefully someone can suggest a fix.
>
These kinds of questions are hard to answer without more details.
First, are you sure you have the most recent version of CVF. They
always fix bugs and the newer releases are better than older ones.
> My code has 5 global allocatable arrays, and some 10 or 15
> further allocatable arrays within a subroutine. All runs smoothly
> until I try to deallocate these subroutine arrays, whereupon the program
> crashes with the line:
>
> severe (157): Program Exception - access violation
>
> and asking for details yields the following:
>
> invalid page fault in MSVCRT.DLL
>
> All this is very odd, because the array in question certainly does exist.
Are you sure it esists? Have you tried using allocated just before
trying the deallocate and seeing if that returns true? have you
tried using the stat= keyword on the deallocate? Things in subroutines
usually go away when you do a return, are you sure you are doing things
as alloacate ... deallocate ... return rather than allocating in
one instance of the subroutine, doing a return, and then trying to
deallocate/reallocate on the next instance of the subroutine?
Hope this helps,
Dick Hendrickson
> I can avoid the problem by fixing the sizes of all arrays to be larger than
> I could possibly need, but this defeats the purpose of dynamic
> allocation. Any advice?
>
> Many thanks,
>
> Coby Needle.
>
> Coby L. Needle, BSc MSc MIMA C.Math
>
> Senior Scientific Officer (B3) Tel. +44 0 1224 295456
> FRS Marine Laboratory Fax. +44 0 1224 295511
> PO Box 101
> Victoria Road
> Aberdeen AB11 9DB email. [log in to unmask]
> Scotland WWW. http://www.marlab.ac.uk/
|