]>
Commit | Line | Data |
---|---|---|
fe4da5cc | 1 | *CMZ : 17/07/98 15.44.33 by Federico Carminati |
2 | *-- Author : | |
3 | C********************************************************************* | |
4 | ||
5 | SUBROUTINE RLUSET(LFN,MOVE) | |
6 | ||
7 | C...Purpose: to read a state of the random number generator from a file | |
8 | C...for subsequent generation 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=120,IOSTAT=IERR) | |
20 | MRLU(6)=MRLU(6)-NBCK | |
21 | ENDIF | |
22 | ||
23 | C...Unformatted read from unit LFN. | |
24 | NFOR=1+MAX(0,MOVE) | |
25 | DO 110 IFOR=1,NFOR | |
26 | 110 READ(LFN,ERR=120,IOSTAT=IERR) (MRLU(I1),I1=1,5), | |
27 | &(RRLU(I2),I2=1,100) | |
28 | MRLU(6)=MRLU(6)+NFOR | |
29 | RETURN | |
30 | ||
31 | C...Write error. | |
32 | 120 WRITE(CHERR,'(I8)') IERR | |
33 | CALL LUERRM(18,'(RLUSET:) error when accessing file, IOSTAT ='// | |
34 | &CHERR) | |
35 | ||
36 | RETURN | |
37 | END |