SUBROUTINE FQMON
*-- Author :    Girish D. Patel   07/12/93
      SUBROUTINE FQMON
                                                                        
*KEEP,FMOTOT.                                                                                                 
      PARAMETER(LENST=66)                                               
      COMMON/FMOTOT/ ISTSUM(LENST)                                      
*KEEP,FMOLUN.                                                                                                 
      COMMON/FMOLUN/ LUNH, LUNS, LMES                                   
*KEEP,FMORUN.                                                                                                 
      LOGICAL PLANAR,RADIAL                                             
      COMMON /FMORUN/  NRUN,NRUN0,NRUN1,MAXEV,PLANAR,RADIAL             
*KEEP,FMOSUM.                                                                                                 
      COMMON/FMOSUM/ NDATE0,NTIME0,ISTATP(20),ISTATR(20),IFRHV,IFPHV,   
     &               NEVENT,NFIEL0,NPRES0,NECUR0,NPCUR0,IRTE0,IRTP0,    
     &               IEVIN,NFPEVT,NHITSP,NFREVT,NHITSR,NMIN92,          
     &               TOTL,H1L,RTIME,REFF,ILRET                          
*     TOTL   total run luminosity (mb^-1)                                                                     
*     H1L    H1 gated run luminosity (mb^-1)                                                                  
*     RTIME  total run time (sec)                                                                             
*     REFF   run efficiency = (1 - dead_time/run_time)                                                        
*     ILRET  return flag: 0 - ok,  1 - no inf. found in H1DB                                                  
*KEEP,FMOHIS.                                                                                                 
      INTEGER IHS(28)                                                   
      COMMON/FMOHIS/ IHS                                                
*KEND.                                                                                                        
      LOGICAL LDATE,LTIME,LFIELD,LPRESS,LECURR,LPCURR,LFIRST            
      DATA    LDATE ,LTIME ,LFIELD,LPRESS,LECURR,LPCURR,LFIRST/         
     &        .TRUE.,.TRUE., .TRUE.,.TRUE.,.TRUE.,.TRUE.,.TRUE./        
                                                                        
      DATA NRUNL/0/                                                     
                                                                        
      IEVIN = IEVIN + 1                                                 
      CALL SHSW(IHS(26),0,66.,1.)                                                                      
                                                                        
      NRUN =  JRDATA('NRUN',IRTN)                                       
      NEVENT = JRDATA('NEVENT',IRTE)                                    
      IF( IRTN.EQ.0 ) THEN                                              
                                                                        
         IF( LFIRST) THEN                                               
            NRUN0 = NRUN                                                
            NRUN1 = NRUN                                                
            ISTSUM(1) = NRUN                                            
            CALL SHSW(IHS(26),0,1.,FLOAT(ISTSUM(1)))                                                   
            LFIRST = .FALSE.                                            
         ENDIF                                                          
                                                                        
         IF( LDATE )THEN ! try to get date                              
            NDATE = JRDATA('IDATE',IRTN)                                
         IF( IRTN.EQ.0 )THEN ! successful                               
            LDATE = .FALSE.                                             
            NDATE0 = NDATE                                              
            ISTSUM(2) = NDATE                                           
            CALL SHSW(IHS(26),0,2.,FLOAT(ISTSUM(2)))                                                   
         ENDIF                                                          
         ENDIF                                                          
                                                                        
         IF( LTIME )THEN ! try to get time                              
            NTIME = JRDATA('ITIME',IRTN)                                
         IF( IRTN.EQ.0 )THEN ! successful                               
            LTIME = .FALSE.                                             
            NTIME0 = NTIME                                              
            ISTSUM(3) = NTIME                                           
            CALL SHSW(IHS(26),0,3.,FLOAT(ISTSUM(3)))                                                   
         ENDIF                                                          
         ENDIF                                                          
                                                                        
         IF( LFIELD )THEN ! try to get H1 field                         
            NFIELD = JRDATA('BFIELD',IRTN)                              
         IF( IRTN.EQ.0 )THEN ! successful                               
            LFIELD = .FALSE.                                            
            NFIEL0 = NFIELD                                             
            ISTSUM(4) = NFIELD                                          
            CALL SHSW(IHS(26),0,4.,FLOAT(ISTSUM(4)))                                                   
         ENDIF                                                          
         ENDIF                                                          
                                                                        
         IF( LPRESS )THEN ! try to get atmospheric pressure             
            NPRESS = JRDATA('PRESSURE',IRTN)                            
         IF( IRTN.EQ.0 )THEN ! successful                               
            LPRESS = .FALSE.                                            
            NPRES0 = NPRESS                                             
            ISTSUM(5) = NPRESS                                          
            CALL SHSW(IHS(26),0,5.,FLOAT(ISTSUM(5)))                                                   
         ENDIF                                                          
         ENDIF                                                          
                                                                        
         IF( LECURR )THEN ! try to get electron beam current            
            NECURR = JRDATA('ECURRENT',IRTN)                            
         IF( IRTN.EQ.0 )THEN ! successful                               
            LECURR = .FALSE.                                            
            NECUR0 = NECURR                                             
            IRTE0  = 0                                                  
            ISTSUM(6) = NECURR                                          
            CALL SHSW(IHS(26),0,6.,FLOAT(ISTSUM(6)))                                                   
         ENDIF                                                          
         ENDIF                                                          
                                                                        
         IF( LPCURR )THEN ! try to get proton beam current              
            NPCURR = JRDATA('PCURRENT',IRTN)                            
         IF( IRTN.EQ.0 )THEN ! successful                               
            LPCURR = .FALSE.                                            
            NPCUR0 = NPCURR                                             
            IRTP0  = 0                                                  
            ISTSUM(7) = NPCURR                                          
            CALL SHSW(IHS(26),0,7.,FLOAT(ISTSUM(7)))                                                   
         ENDIF                                                          
         ENDIF                                                          
                                                                        
      ENDIF   ! IRTN ok for NRUN                                        
                                                                        
      IF (NRUN.NE.NRUNL) THEN                                           
         NRUNL = NRUN                                                   
         NRUN1 = NRUN                                                   
      ENDIF                                                             
                                                                        
  100 RETURN                                                            
      END                                                               
*