!------------------------------------ Test memory allocation Module Structures integer, parameter :: N = 1004 real, allocatable, dimension(:,:) :: Arr end module Structures Program Mem use Structures print *,' Memory required ',4.*(2.*N+1.)**2/1024.**2,' Mb' i=0 Do i =i+1 if(mod(i,10000)==0)print *,' i=' Call One(i) EndDo write (*,*) ' Done N=',N end program Mem !---------------------------------------------------- Subroutine One(iC) use Structures M =min(mod(iC*427+N/4+1,N),N) !print *,' M=',M,iC allocate (Arr(-M:M,-M:M)) !$OMP PARALLEL DO DEFAULT(SHARED) & !$OMP PRIVATE (i,j) do i=-M,M do j=-M,M arr(j,i) =exp(1./(i**2+j**2)) endDo EndDo deallocate (Arr) end Subroutine One