]>
Commit | Line | Data |
---|---|---|
fe4da5cc | 1 | |
2 | C********************************************************************* | |
3 | ||
4 | SUBROUTINE RLUGET(LFN,MOVE) | |
5 | ||
6 | C...Purpose: to dump the state of the random number generator on a file | |
7 | C...for subsequent startup 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 | BACKSPACE(LFN,ERR=110,IOSTAT=IERR) | |
17 | 100 CONTINUE | |
18 | MRLU(6)=MRLU(6)-NBCK | |
19 | ENDIF | |
20 | ||
21 | C...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 | ||
27 | C...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 |