SUBROUTINE CHIO(N,S2,ANU,NITER,H) C This routine draws from N independent chi square distributions, subject C to the restriction that the realizations are monotonically nondescending. C Inputs: C N Number of distributions C S2(Nx1) Constant parameters for distributions C ANU(Nx1) Degrees of freedom parameters for distributions C NITER Number of Gibbs iterations to perform C Input/outputs: C H Random vector IMPLICIT REAL*8 (A-H,O-Z) DIMENSION S2(N),ANU(N),H(N) DIMENSION V1(10) V1(1)=CHI(S2(1),ANU(1)) DO 10 I=2,N V1(I)=CHI(S2(I),ANU(I)) 10 IF(V1(I).LE.V1(I-1))RETURN CALL DCOPY(N,V1,1,H,1) RETURN END