New functions and constructors added and some other fixes.
[u/mrichter/AliRoot.git] / PYTHIA / jetset / rluget.F
CommitLineData
fe4da5cc 1
2C*********************************************************************
3
4 SUBROUTINE RLUGET(LFN,MOVE)
5
6C...Purpose: to dump the state of the random number generator on a file
7C...for subsequent startup from this state onwards.
8 COMMON/LUDATR/MRLU(6),RRLU(100)
9 SAVE /LUDATR/
10 CHARACTER CHERR*8
11
12C...Backspace required number of records (or as many as there are).
13 IF(MOVE.LT.0) THEN
14 NBCK=MIN(MRLU(6),-MOVE)
15 DO 100 IBCK=1,NBCK
16 BACKSPACE(LFN,ERR=110,IOSTAT=IERR)
17 100 CONTINUE
18 MRLU(6)=MRLU(6)-NBCK
19 ENDIF
20
21C...Unformatted write on unit LFN.
22 WRITE(LFN,ERR=110,IOSTAT=IERR) (MRLU(I1),I1=1,5),
23 &(RRLU(I2),I2=1,100)
24 MRLU(6)=MRLU(6)+1
25 RETURN
26
27C...Write error.
28 110 WRITE(CHERR,'(I8)') IERR
29 CALL LUERRM(18,'(RLUGET:) error when accessing file, IOSTAT ='//
30 &CHERR)
31
32 RETURN
33 END