12.07.2015 Views

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

Intel® Fortran Libraries Reference

SHOW MORE
SHOW LESS

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

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

Descriptions of the Library Routines 2Module: USE IFPORTSyntaxresult = DRAND (iflag)result = DRANDM (iflag)iflag(Input) INTEGER(4). Controls the way the random number is selected.Results:The result type is REAL(8). Return values are:Value of iflagSelection process1 The generator is restarted and the first random value is selected.0 The next random number in the sequence is selected.Otherwise The generator is reseeded using iflag, then restarted, and the first randomvalue is selected.There is no difference between DRAND and DRANDM. Both functions are included to insureportability of existing code that references one or both of them.CompatibilityCONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS LIBSee Also: the RANDOM_NUMBER and RANDOM_SEED intrinsic procedures in the Language<strong>Reference</strong>ExampleUSE IFPORTREAL(8) numINTEGER(4) ff=1CALL print_randf=0CALL print_randf=22CALL print_randCONTAINSSUBROUTINE print_randnum = drand(f)print *, 'f= ',f,':',num2-71

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

Saved successfully!

Ooh no, something went wrong!