Hi:
I've had problems like this using Lahey Fortran which of course isn't CVF, but
for what its worth:
1. The usual cause is an out-of-bounds reference somewhere previously in the
program. If its not caught by bounds checking, which is possible, particularly
if you are using pointers, the system memory allocation algorithm seems to get a
headache, even if you are only "reading" an out-of-bounds location, and
eventually fails this way when you later call it explicitly with ALLOCATE or
DEALLOCATE. The fact that you can solve the problem by making your arrays
bigger than needed is consistent.
2. You don't say what kind of machine/operating system you are using, but if its
WINx, look carefully at all other processes running concurrently, and start
removing them one-by-one.
good luck
Mike
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.
>
> 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.
> 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/
|