Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:21:15

0001  
0002 C*********************************************************************
0003  
0004 C...PYRSET
0005 C...Reads a state of the random number generator from a file
0006 C...for subsequent generation from this state onwards.
0007  
0008       SUBROUTINE PYRSET(LFN,MOVE)
0009  
0010 C...Double precision and integer declarations.
0011       IMPLICIT DOUBLE PRECISION(A-H, O-Z)
0012       IMPLICIT INTEGER(I-N)
0013       INTEGER PYK,PYCHGE,PYCOMP
0014 C...Commonblocks.
0015       COMMON/PYDATR/MRPY(6),RRPY(100)
0016       SAVE /PYDATR/
0017 C...Local character variable.
0018       CHARACTER CHERR*8
0019  
0020 C...Backspace required number of records (or as many as there are).
0021       IF(MOVE.LT.0) THEN
0022         NBCK=MIN(MRPY(6),-MOVE)
0023         DO 100 IBCK=1,NBCK
0024           BACKSPACE(LFN,ERR=120,IOSTAT=IERR)
0025   100   CONTINUE
0026         MRPY(6)=MRPY(6)-NBCK
0027       ENDIF
0028  
0029 C...Unformatted read from unit LFN.
0030       NFOR=1+MAX(0,MOVE)
0031       DO 110 IFOR=1,NFOR
0032         READ(LFN,ERR=120,IOSTAT=IERR) (MRPY(I1),I1=1,5),
0033      &  (RRPY(I2),I2=1,100)
0034   110 CONTINUE
0035       MRPY(6)=MRPY(6)+NFOR
0036       RETURN
0037  
0038 C...Write error.
0039   120 WRITE(CHERR,'(I8)') IERR
0040       CALL PYERRM(18,'(PYRSET:) error when accessing file, IOSTAT ='//
0041      &CHERR)
0042  
0043       RETURN
0044       END