pgf90 Memory Limit for dynamically allocated array

I have a program that needs to dynamically allocate a 2d array in fortran and I have apparently hit some type of limit on the size of this array; it is around 8.2 gigs. Is there some compile flag that I’m missing here?
To quickly replicate this problem I have created the following sample code with dynamically allocates an array n x 2n. Using my standard compile statement/flags (
pgf90 -r8 -O2 -Munroll -pc 64 -fast -Mcache_align -byteswapio -Kieee test.f) I cannot allocate an array with n > 33,000 with pgf90 (yes it is 64bit).

However if I compile the program with ifort I can allocate all 32 gigs of memory the system has.

Test.f
{
allocatable a(:,:)
read (,) n
allocate (a(n,2n))
x = n
y = x
2x4/1.0E09
a(n,2n) = 1
write (
,*) y
end
}

Hi,

Please use with -mcmodel=medium for data and code that has > 2GB.

Hongyon