Re: uniform distribution with a random dimension usign IMSL
- From: Dave Seaman <dseaman@xxxxxxxxxxxx>
- Date: Sat, 17 Feb 2007 04:51:06 +0000 (UTC)
On 16 Feb 2007 16:32:53 -0800, fortee wrote:
I tried to made a code with a poisson and a uniform distribution in
IMSL. There is no problem in compiling the following code in Intel
Fortran Complier. But when I try to execute the code, a error message
pops up.
I want to draw a vector x1 from a unifrom distribution[0,1] with a
random dimension (n) which is drawn from a poisson distribution(mean
5000). I mean
iter1 x1(4999 dimension)
iter2 x1(4988 dimension)
...
iter10 x1(4898 dimension)
Dimensions are random
Please help me. I am so frustrated now.
program brownian
INCLUDE 'link_f90_static.h'
use rnpoi_int
use rnset_int
use rnun_int
implicit none
integer, dimension(1)::len
integer:: i
real, parameter:: ns=5000
integer, dimension(1):: dummy
integer:: N
real, allocatable::x1(:)
real:: dum
integer, parameter:: r=10
real:: ks(r)
do i=1,r
call rnpoi(ns, len)
dummy(:)=len
N=dummy(1)
allocate(x1(N))
call rnun(x1)
ks(r)=sum(x1)
enddo
dum=sum(ks)/r
end program brownian
Your IMSL calls appear to be ok. The problem is that you have an
ALLOCATE statement inside a DO loop, but no DEALLOCATE anywhere. This
results in an error when you attempt to allocate the same array for the
second time.
--
Dave Seaman
U.S. Court of Appeals to review three issues
concerning case of Mumia Abu-Jamal.
<http://www.mumia2000.org/>
.
- Follow-Ups:
- References:
- Prev by Date: Re: uniform distribution with a random dimension usign IMSL
- Next by Date: Re: Pointer-valued function to access inner components
- Previous by thread: Re: uniform distribution with a random dimension usign IMSL
- Next by thread: Re: uniform distribution with a random dimension usign IMSL
- Index(es):
Relevant Pages
|
|