Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Fortran95-"random_seed()" function : problem!help!!
Hello everone!So i am writing this code where I am producoing random numbers from a generator through a subroutine.Then I call the subroutine and pass them through a Gaussian distribution.I have problem with my seed subroutine: my program compiles but when i try to execute it complain that "Random_seed(): PUT array too small" i have no idea what does this means!
Here is my subroutine:
subroutine setSEED (seed)
integer, dimension(2), intent(inout):: seed
if (seed(1) == 0.0) &
seed = floor(1000*secnds(0.0)) +(/0, 37 /) <--- this is where it complains
call random_seed(put=seed) <---...and here
end subroutine setSEED
and my gaussian distribution :
Real*8 Function gasdev(idum)
integer, intent(inout) :: idum
real*8, dimension(2) :: x
real*8, save :: gset
if (idum.lt.0) iset=0
if (iset.eq.0) then
rsq = 0.0
do while (rsq > 1.0.or.rsq==0)
end Function gasdev
....AND MY MAIN PROGRAM:
integer, dimension(2) :: seed = 0
end program mainprog
Do you guys think can help me?its so frustrating!!!thank you all!!!