SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ pb_sran()

real function pb_sran ( integer  idumm)

Definition at line 2627 of file pcblastim.f.

2628*
2629* -- PBLAS test routine (version 2.0) --
2630* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
2631* and University of California, Berkeley.
2632* April 1, 1998
2633*
2634* .. Scalar Arguments ..
2635 INTEGER IDUMM
2636* ..
2637*
2638* Purpose
2639* =======
2640*
2641* PB_SRAN generates the next number in the random sequence.
2642*
2643* Arguments
2644* =========
2645*
2646* IDUMM (local input) INTEGER
2647* This argument is ignored, but necessary to a FORTRAN 77 func-
2648* tion.
2649*
2650* Further Details
2651* ===============
2652*
2653* On entry, the array IRAND stored in the common block RANCOM contains
2654* the information (2 integers) required to generate the next number in
2655* the sequence X( n ). This number is computed as
2656*
2657* X( n ) = ( 2^16 * IRAND( 2 ) + IRAND( 1 ) ) / d,
2658*
2659* where the constant d is the largest 32 bit positive integer. The
2660* array IRAND is then updated for the generation of the next number
2661* X( n+1 ) in the random sequence as follows X( n+1 ) = a * X( n ) + c.
2662* The constants a and c should have been preliminarily stored in the
2663* array IACS as 2 pairs of integers. The initial set up of IRAND and
2664* IACS is performed by the routine PB_SETRAN.
2665*
2666* -- Written on April 1, 1998 by
2667* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
2668*
2669* =====================================================================
2670*
2671* .. Parameters ..
2672 REAL DIVFAC, POW16
2673 parameter( divfac = 2.147483648e+9,
2674 $ pow16 = 6.5536e+4 )
2675* ..
2676* .. Local Arrays ..
2677 INTEGER J( 2 )
2678* ..
2679* .. External Subroutines ..
2680 EXTERNAL pb_ladd, pb_lmul
2681* ..
2682* .. Intrinsic Functions ..
2683 INTRINSIC real
2684* ..
2685* .. Common Blocks ..
2686 INTEGER IACS( 4 ), IRAND( 2 )
2687 COMMON /rancom/ irand, iacs
2688* ..
2689* .. Save Statements ..
2690 SAVE /rancom/
2691* ..
2692* .. Executable Statements ..
2693*
2694 pb_sran = ( real( irand( 1 ) ) + pow16 * real( irand( 2 ) ) ) /
2695 $ divfac
2696*
2697 CALL pb_lmul( irand, iacs, j )
2698 CALL pb_ladd( j, iacs( 3 ), irand )
2699*
2700 RETURN
2701*
2702* End of PB_SRAN
2703*
subroutine pb_ladd(j, k, i)
Definition pblastst.f:4480
subroutine pb_lmul(k, j, i)
Definition pblastst.f:4559
real function pb_sran(idumm)
Here is the call graph for this function: