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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3F Functions and VAX SubroutinesSynopsissubroutine qsort(array, len, isize, compar)dimension array(*)integer leninteger isizeexternal comparinteger comparDescriptionqsort sorts the elements of the one dimensional array, array. len is the number of elements inthe array and isize is the size of an element. compar is the name of an integer function thatdetermines the sorting order. This function is called with 2 arguments (arg1 and arg2) which areelements of array. <strong>The</strong> function returns:negativeif arg1 is considered to precede arg2zeroif arg1 is equivalent to arg2positiveif arg1 is considered to follow arg29.1.50. rand, irand, srandRandom number generator.Synopsisdouble precision function rand()integer function irand()subroutine srand(iseed)integer iseedDescription<strong>The</strong> functions rand and irand generate successive pseudo-random integers or double precisionnumbers. srand uses its argument, iseed, to re-initialize the seed for successive invocations ofrand and irand.irandreturns a positive integer in the range 0 through 2147483647.randreturns a value in the range 0 through 1.0.9.1.51. random, irandm, drandmReturn the next random number value.<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 204

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

Saved successfully!

Ooh no, something went wrong!