Fortran 77 dynamic memory allocation 1# Computation - 科学计算
y*r
1 楼
这个是使用cray pointer的方法,很简单啊。
INTEGER*8 MALLOC
EXTERNAL MALLOC
INTEGER WORK(10)
POINTER (P, WORK)
C
READ(*,*) N
P = MALLOC(N*4)
DO I=1,N
WORK(I) = I
ENDDO
C
CALL FREE(P)
END
INTEGER*8 MALLOC
EXTERNAL MALLOC
INTEGER WORK(10)
POINTER (P, WORK)
C
READ(*,*) N
P = MALLOC(N*4)
DO I=1,N
WORK(I) = I
ENDDO
C
CALL FREE(P)
END