EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rluset.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file rluset.f
1 
2 C*********************************************************************
3 
4  SUBROUTINE rluset(LFN,MOVE)
5 
6 C...Purpose: to read a state of the random number generator from a file
7 C...for subsequent generation from this state onwards.
8  common/ludatr/mrlu(6),rrlu(100)
9  SAVE /ludatr/
10  CHARACTER cherr*8
11 
12 C...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  100 backspace(lfn,err=120,iostat=ierr)
17  mrlu(6)=mrlu(6)-nbck
18  ENDIF
19 
20 C...Unformatted read from unit LFN.
21  nfor=1+max(0,move)
22  DO 110 ifor=1,nfor
23  110 READ(lfn,err=120,iostat=ierr) (mrlu(i1),i1=1,5),
24  &(rrlu(i2),i2=1,100)
25  mrlu(6)=mrlu(6)+nfor
26  RETURN
27 
28 C...Write error.
29  120 WRITE(cherr,'(I8)') ierr
30  CALL luerrm(18,'(RLUSET:) error when accessing file, IOSTAT ='//
31  &cherr)
32 
33  RETURN
34  END