I am having difficulty with memory allocation when the variables were
declared in a module. For example,
MODULE MOD1
READ, DIMENSION(:), ALLOCATABLE :: A, B
END MODULE MOD1
PROGRAM MAIN
.
REAL, DIMENSION(:), ALLOCATABLE :: C, D
.
ALLOCATE(C(NUM_NODE), STAT=STATUS)
ALLOCATE(D(NUM_NODE), STAT=STATUS)
.
ALLOCATE(A(MAX_NUM_TSTEP), STAT=STATUS)
ALLOCATE(B(MAX_NUM_TSTEP), STAT=STATUS)
.
END PROGRAM MAIN
When I examine the variables C and D using my debugger, they are
allocated properly. However, when I examine variables A and B, the
debugger indicates "unallocated pointer" and any reference to variables
A or B causes the code to crash. Is it not possible to use allocate in
conjunction with modules?
Thanks,
Ben
Ben Blackwell, PhD, PE
LA Reg. No. 17701
Blackwell Engineering
PO Box 2879
822 Camino de Lucia
Corrales, NM 87048
505/897-5090
|