Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pyrget.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pyrget.f
1 
2 C*********************************************************************
3 
4 C...PYRGET
5 C...Dumps the state of the random number generator on a file
6 C...for subsequent startup from this state onwards.
7 
8  SUBROUTINE pyrget(LFN,MOVE)
9 
10 C...Double precision and integer declarations.
11  IMPLICIT DOUBLE PRECISION(a-h, o-z)
12  IMPLICIT INTEGER(i-n)
13  INTEGER pyk,pychge,pycomp
14 C...Commonblocks.
15  common/pydatr/mrpy(6),rrpy(100)
16  SAVE /pydatr/
17 C...Local character variable.
18  CHARACTER cherr*8
19 
20 C...Backspace required number of records (or as many as there are).
21  IF(move.LT.0) THEN
22  nbck=min(mrpy(6),-move)
23  DO 100 ibck=1,nbck
24  backspace(lfn,err=110,iostat=ierr)
25  100 CONTINUE
26  mrpy(6)=mrpy(6)-nbck
27  ENDIF
28 
29 C...Unformatted write on unit LFN.
30  WRITE(lfn,err=110,iostat=ierr) (mrpy(i1),i1=1,5),
31  &(rrpy(i2),i2=1,100)
32  mrpy(6)=mrpy(6)+1
33  RETURN
34 
35 C...Write error.
36  110 WRITE(cherr,'(I8)') ierr
37  CALL pyerrm(18,'(PYRGET:) error when accessing file, IOSTAT ='//
38  &cherr)
39 
40  RETURN
41  END