Skip to content

Fortran dy lib on Solaris

2 messages · V Nyirongo, Jin Shusong

#
Dear all,

Am new on this list but need help:

I have a fortran code which I compile into a dynamic library (on Solaris).

My probem is that when I call this code soon after starting R, it runs ok. But 
it doesn't for the second time without exiting R first. In this code I have to 
generate some random numbers. The problem is not about setting the seed.

Anyone with an idea what might be going on?

Thanks,
Vysaul.
#
On Thu, Apr 28, 2005 at 05:11:11PM +0100, V Nyirongo wrote:
Dear Vysaul,

  You can call srand to set the seed.

       implicit none
       integer i,seed,time
       seed=time()*2-13
       call srand(seed)
       print*,rand(0)
       do 10 i= 1, 10
         print*, rand(0)
10     continue
       end
 
  At least g77 can support srand and rand

  Good luck.