combine.f

00001       PROGRAM MAIN
00002 C     ***********************************      
00003       IMPLICIT DOUBLE PRECISION (A-H,O-Z)
00004       COMMON / INOUT  / NINP,NOUT  
00005       DIMENSION  X(400),ER(100)
00006       CHARACTER*20 typop,file1,file2,file3,stop,merge
00007       DATA stop  /'stop'/
00008       DATA merge /'merge'/
00009 
00010       write(6,*) '>>>---------------------------------------<<<'
00011       write(6,*) '>>>        Welcome to   COMBINE           <<<'
00012       write(6,*) '>>>  Program for adding histogram files   <<<'
00013       write(6,*) '>>>---------------------------------------<<<'
00014       CALL GLK_Initialize
00015       NINP=  5           
00016       NOUT= 16           
00017       OPEN( NOUT, file='combine.out') 
00018       CALL GLK_SetNout(nout)
00019 
00020 ! Get target file name
00021       write(6,*) '>>> Give name of the TARGET file'
00022       read(5,'(a)') file3
00023 ! Get type of operation
00024       write(6,*) '>>> add or merge?'
00025       read(5,'(a)') typop
00026 ! Get total number of histos
00027       write(6,*) '>>> Give total number of histos'
00028       read(5,*) Ntot
00029 !
00030 ! Restore first histogram
00031       write(6,*) '>>> Give name of the FIRST histogram file on the disk'
00032       read(5,'(a)') file1
00033       NINPH=0 
00034 !*******************************************
00035       OPEN(10+NINPH,file=file1)
00036 !*******************************************
00037       write(6,*) '>>> restoring:: ', file1
00038       CALL GLK_hrfile(10+NINPH,' ',' ')
00039       CALL GLK_hrin(   0,9999,0)
00040 
00041 
00042  600  CONTINUE
00043 ! Restore second histogram and ADD to first            
00044       write(6,*) '>>> Give name of the NEXT histogram or type stop'
00045       read(5,'(a)') file2
00046       NINPH=NINPH+1
00047       IF(file2 .EQ. stop) GOTO 900
00048       IF(NINPH .EQ. Ntot) GOTO 900
00049 !*******************************************
00050       OPEN(10+NINPH,file=file2)
00051 !*******************************************
00052       CALL GLK_hrfile(10+NINPH,' ',' ')
00053       IF(typop .EQ. merge) THEN
00054 ! Identical histos APPEND with id=>id+1000000
00055          write(6,*) '>>> appending::    ', file2 
00056          CALL GLK_hrin(   0,9999,0)
00057       ELSE
00058 ! Identical histos ADD directly
00059          write(6,*) '>>> adding::    ', file2
00060          CALL GLK_hrin2(   0,9999,0)
00061       ENDIF
00062       GOTO 600
00063          
00064 C ------------dumping histogram  -------------------------------- 
00065  900  CONTINUE
00066       write(6,*) '>>> Dumping result into::  ',file3
00067       NOUTH=7   
00068 !*******************************************
00069       OPEN(NOUTH,file=file3)
00070       REWIND(NOUTH)
00071 !*******************************************
00072       CALL GLK_hrfile(NOUTH,' ','N') 
00073       CALL GLK_hrout( 0,ICY,' ')       
00074       CALL GLK_hrend(' ')  
00075 C ------------THE END OF HISTO WRITING -------------------------       
00076       CLOSE(NOUT)              
00077 C     ***********          
00078       END
00079 
Generated on Sun Oct 20 20:24:08 2013 for C++InterfacetoTauola by  doxygen 1.6.3