The following program is quite simple and it should be possible to compile and run this program with no errors.
program pgm
implicit none
real, dimension(:,:), allocatable :: ev
integer i, nsub, mi
nsub = 10
mi = 5
ev = reshape( gaussian(nsub*mi),(/mi,nsub/) )
print *,(ev(1,i),i=1,5)
contains
function gaussian(n)
! return an array of gaussian random variates with variance 1
integer :: n
real, dimension(n) :: gaussian
real, dimension(n) :: rn
real :: rn1,rn2,arg,x1,x2,x3
real, parameter :: pi=4.0d0*atan(1.0)
integer :: i
if(mod(n,2) /= 0)stop 'Gaussian: argument must be an even integer'
call random_number(rn)
do i=1,n/2
rn1=rn(2*i-1)
rn2=rn(2*i)
arg=2.0*pi*rn1
x1=sin(arg)
x2=cos(arg)
x3=sqrt(-2.0*log(rn2))
gaussian(2*i-1)=x1*x3
gaussian(2*i)=x2*x3
enddo
end function gaussian
end program
With no options or with /debug, the program aborts with
Error: Nonconformant arrays
With /64 /check, the program aborts with
Integer arithmetic overflow