10.07.2015 Views

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3F Functions and VAX Subroutinesthan or equal to 32 (less than or equal to 64 if the source or destination is INTEGER*8). It has theform:CALL MVBITS(src, a2, a3, dest, a5)Where:srcis an integer variable or array element that represents the source location.a2is an integer expression that identifies the first position in the field transferred from src.a3is an integer expression that identifies the length of the field transferred from src.destis an integer variable or array element that represents the destination location.a5is an integer expression that identifies the starting position within a4, for the bits beingtransferred.RAN<strong>The</strong> RAN subroutine returns the next number from a sequence of pseudo-random numbers ofuniform distribution over the range 0 to 1. <strong>The</strong> result is a floating point number that is uniformlydistributed in the range between 0.0 and 1.0 exclusive. It has the form:y = RAN(i)where y is set equal to the value associated by the function with the seed argument i. <strong>The</strong>argument i must be an INTEGER*4 variable or INTEGER*4 array element.<strong>The</strong> argument i should initially be set to a large, odd integer value. <strong>The</strong> RAN function stores avalue in the argument that it later uses to calculate the next random number.<strong>The</strong>re are no restrictions on the seed, although it should be initialized with different values onseparate runs in order to obtain different random numbers. <strong>The</strong> seed is updated automatically, andRAN uses the following algorithm to update the seed passed as the parameter:SEED = 6969 * SEED + 1 ! MOD2**32<strong>The</strong> value of SEED is a 32-bit number whose high-order 24 bits are converted to floating pointand returned as the result.If the command-line option to treat all REAL declarations as DOUBLE PRECISION declarationsis in effect, RAN returns a DOUBLE PRECISION value.SECNDS<strong>The</strong> SECNDS subroutine provides system time of day, or elapsed time, as a floating point valuein seconds. It has the form:y = SECNDS(x)<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 214

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!