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...PYRGET
0005 C...Dumps the state of the random number generator on a file
0006 C...for subsequent startup from this state onwards.
0007  
0008       SUBROUTINE PYRGET(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=110,IOSTAT=IERR)
0025   100   CONTINUE
0026         MRPY(6)=MRPY(6)-NBCK
0027       ENDIF
0028  
0029 C...Unformatted write on unit LFN.
0030       WRITE(LFN,ERR=110,IOSTAT=IERR) (MRPY(I1),I1=1,5),
0031      &(RRPY(I2),I2=1,100)
0032       MRPY(6)=MRPY(6)+1
0033       RETURN
0034  
0035 C...Write error.
0036   110 WRITE(CHERR,'(I8)') IERR
0037       CALL PYERRM(18,'(PYRGET:) error when accessing file, IOSTAT ='//
0038      &CHERR)
0039  
0040       RETURN
0041       END