genunf.f

Go to the documentation of this file.
00001       REAL FUNCTION genunf(low,high)
00002 C**********************************************************************
00003 C
00004 C     REAL FUNCTION GENUNF( LOW, HIGH )
00005 C
00006 C               GeNerate Uniform Real between LOW and HIGH
00007 C
00008 C
00009 C                              Function
00010 C
00011 C
00012 C     Generates a real uniformly distributed between LOW and HIGH.
00013 C
00014 C
00015 C                              Arguments
00016 C
00017 C
00018 C     LOW --> Low bound (exclusive) on real value to be generated
00019 C                         REAL LOW
00020 C
00021 C     HIGH --> High bound (exclusive) on real value to be generated
00022 C                         REAL HIGH
00023 C
00024 C**********************************************************************
00025 C     .. Scalar Arguments ..
00026       REAL high,low
00027 C     ..
00028 C     .. External Functions ..
00029       REAL ranf
00030       EXTERNAL ranf
00031 C     ..
00032 C     .. Executable Statements ..
00033       IF (.NOT. (low.GT.high)) GO TO 10
00034       WRITE (*,*) 'LOW > HIGH in GENUNF: LOW ',low,' HIGH: ',high
00035       WRITE (*,*) 'Abort'
00036       CALL XSTOPX ('LOW > High in GENUNF - Abort')
00037 
00038    10 genunf = low + (high-low)*ranf()
00039 
00040       RETURN
00041 
00042       END
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines