Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001     
0002 C*********************************************************************  
0003     
0004       SUBROUTINE RLUSET(LFN,MOVE)   
0005     
0006 C...Purpose: to read a state of the random number generator from a file 
0007 C...for subsequent generation from this state onwards.  
0008       COMMON/LUDATR/MRLU(6),RRLU(100)   
0009       SAVE /LUDATR/ 
0010       CHARACTER CHERR*8 
0011     
0012 C...Backspace required number of records (or as many as there are). 
0013       IF(MOVE.LT.0) THEN    
0014         NBCK=MIN(MRLU(6),-MOVE) 
0015         DO 100 IBCK=1,NBCK  
0016   100   BACKSPACE(LFN,ERR=120,IOSTAT=IERR)  
0017         MRLU(6)=MRLU(6)-NBCK    
0018       ENDIF 
0019     
0020 C...Unformatted read from unit LFN. 
0021       NFOR=1+MAX(0,MOVE)    
0022       DO 110 IFOR=1,NFOR    
0023   110 READ(LFN,ERR=120,IOSTAT=IERR) (MRLU(I1),I1=1,5),  
0024      &(RRLU(I2),I2=1,100)   
0025       MRLU(6)=MRLU(6)+NFOR  
0026       RETURN    
0027     
0028 C...Write error.    
0029   120 WRITE(CHERR,'(I8)') IERR  
0030       CALL LUERRM(18,'(RLUSET:) error when accessing file, IOSTAT ='//  
0031      &CHERR)    
0032     
0033       RETURN    
0034       END