real function dstg i (ai,k7, m rn1) c c + + + PURPOSE + + + c Provides numbers from a gamma distribution, given two random numbers. c c + + + ARGUMENT DECLARATIONS + + + real ai,rn1 integer k7(4) c c + + + ARGUMENT DEFINITIONS + + + c ai - c k7 - Seed for random number generation. c rn1 - ??? -- used for precip gamma dsn c include 'crandom.inc' c c + + + FUNCTION DECLARATIONS + + + real randn c c + + + LOCAL VARIABLES + + + real xn1, rn c + + + DATA INITIALIZATIONS + + + c data xn1/10.0/ c c Modified by Bofu Yu on July 4, 1999 c based on break-point data, B.YU data xn1/6.28/ c c + + + END SPECIFICATIONS + + + c c -- XXX -- Changed 1/5/2000 -- CRM: c double precision xx double precision fu,xx 10 dstg=rn1 xx=rn1*ai rn=randn(k7) fu=xx**xn1*exp(xn1*(1.0-xx)) rn1=rn if (fu.lt.rn) goto 10 c return end