gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1617 Posts in 535 Topics by 779 Members - Latest Member: rhoronjeff@comcast.net November 27, 2022, 09:02:49 PM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  Macintosh  |  Absoft10.1 & F77 Random Numbers
gfx
gfxgfx
 

Author Topic: Absoft10.1 & F77 Random Numbers  (Read 5297 times)

sgleiman

  • Newbie
  • *
  • Posts: 1
Absoft10.1 & F77 Random Numbers
« on: September 12, 2008, 01:09:06 PM »
I just installed 10.1 on my MBP and am trying to compile some old F77 code.  The portion of code that causes the compiler failure is:

          xn=int(rand()*dfloat(nx))+1

and the error is:

          xn=int(rand()*dfloat(nx))+1
                 ^                   
cf90-452 af90fe: ERROR TEST, File = test.f, Line = 329, Column = 18
  This reference to subroutine RAND is not in a CALL statement.

Earlier in the code I have:

call srand(seed)

and this doesn't cause any problems.  What is the appropriate syntax for generating a random number?  What are the arguments?  I haven't been able to find any man pages or help for this.

TIA,

  - Seth



Mike Linacre

  • Sr. Member
  • ****
  • Posts: 259
Re: Absoft10.1 & F77 Random Numbers
« Reply #1 on: September 12, 2008, 02:34:19 PM »
Seth, be sure you are including the unix compatibility library (unix.lib)
rand(0) for the next random number in the series.
rand(number) to start a new series with seed, number.

Absoft User Forum  |  Support  |  Macintosh  |  Absoft10.1 & F77 Random Numbers
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!