]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/shaker/rluget.f
Corrections thanks to A.Angelis
[u/mrichter/AliRoot.git] / PHOS / shaker / rluget.f
1 *CMZ :          17/07/98  15.44.33  by  Federico Carminati
2 *-- Author :
3 C*********************************************************************
4
5       SUBROUTINE RLUGET(LFN,MOVE)
6
7 C...Purpose: to dump the state of the random number generator on a file
8 C...for subsequent startup from this state onwards.
9 *KEEP,LUDATR.
10       COMMON /LUDATR/ MRLU(6),RRLU(100)
11       SAVE /LUDATR/
12 *KEND.
13       CHARACTER CHERR*8
14
15 C...Backspace required number of records (or as many as there are).
16       IF(MOVE.LT.0) THEN
17         NBCK=MIN(MRLU(6),-MOVE)
18         DO 100 IBCK=1,NBCK
19   100   BACKSPACE(LFN,ERR=110,IOSTAT=IERR)
20         MRLU(6)=MRLU(6)-NBCK
21       ENDIF
22
23 C...Unformatted write on unit LFN.
24       WRITE(LFN,ERR=110,IOSTAT=IERR) (MRLU(I1),I1=1,5),
25      &(RRLU(I2),I2=1,100)
26       MRLU(6)=MRLU(6)+1
27       RETURN
28
29 C...Write error.
30   110 WRITE(CHERR,'(I8)') IERR
31       CALL LUERRM(18,'(RLUGET:) error when accessing file, IOSTAT ='//
32      &CHERR)
33
34       RETURN
35       END