Re: Size of Largest Array?
From: Herman D. Knoble (SkipKnobleLESS_at_SPAMpsu.edu)
Date: 01/30/04
- Next message: Steve Lionel: "Re: Size of Largest Array?"
- Previous message: David Ham: "Re: Size of Largest Array?"
- In reply to: TLowe: "Size of Largest Array?"
- Next in thread: Steve Lionel: "Re: Size of Largest Array?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jan 2004 13:56:27 -0500
T: For arrays this large to be part of the object code is not reasonable. To
use such large arrays use Allocate(able) arrays. For example:
see Metcalf's example at: http://ftp.cac.psu.edu/pub/ger/fortran/hdk/dyng.f90
or a somewhat cruder example:
integer ierror, MB, na, nb
double precision a
allocatable a
dimension a(:,:)
print*, "How many MB to Allocate?"
read(unit=*,fmt=*) na
MB=1024**2
!---DOUBLE PRECISION array assumed to have 8-byte elements.
nb=MB/8
allocate( a(na,nb), stat=ierror)
if (ierror.ne.0) then
print *, "?? Cannot allocate',na,'MB of virtual storage."
print *, "At least this much free disk space for swap file", &
" is needed."
stop
endif
!---Initialize all elements of that array (for example's sake here).
call anysub(a, na,nb)
!---Deallocate the array and quit.
deallocate( a)
print *, "Double Presion Array of dimension (",na,",",nb,")"
print *, "was succesfully allocated, used, and deallocated."
end
subroutine anysub(a, n1,n2)
integer i,j,n1,n2
double precision a(n1,n2)
!---Access the array in row major order - by columns - (least paging).
do j=1,n2
do i=1,n1
a(i,j)=i+j
end do
end do
end
Skip Knoble, Penn State
On 30 Jan 2004 10:06:30 -0800, rcl7820@owl.forestry.uga.edu (TLowe) wrote:
-|Hey Folks,
-|
-|Can anybody tell me the size of the largest array I can dimension?
-|I am using Lahey FORTRAN 90. I was able to dimension and populate
-|4 arrays, each with 100,000,000 elements. When I added another, I
-|received an error stating that the compiled executable was not a
-|legal Win32 application.
-|
-|I get the idea that I can only use 2 gigs of memory. I have a machine
-|with 6 gigs of memory (running Win 2000 Advanced Server). I want to
-|use as much as possible. Can somebody fill me in if there is a switch
-|I can use when compiling to let the program use more memory?
-|
-|Thanks,
-|
-|TLowe
-|WSFR, UGA
Herman D. (Skip) Knoble, Research Associate
(a computing professional for 38 years)
Email: SkipKnobleLESS@SPAMpsu.edu
Web: http://www.personal.psu.edu/hdk
Penn State Information Technology Services
Academic Services and Emerging Technologies
Graduate Education and Research Services
Penn State University
214C Computer Building
University Park, PA 16802-21013
Phone:+1 814 865-0818 Fax:+1 814 863-7049
- Next message: Steve Lionel: "Re: Size of Largest Array?"
- Previous message: David Ham: "Re: Size of Largest Array?"
- In reply to: TLowe: "Size of Largest Array?"
- Next in thread: Steve Lionel: "Re: Size of Largest Array?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|