--- DarthVader/TrackerLevel2/src/F77/readB.f 2006/05/19 13:15:56 1.1 +++ DarthVader/TrackerLevel2/src/F77/readB.f 2006/11/15 17:55:07 1.7 @@ -13,40 +13,79 @@ * ************************************************************************* - subroutine readB(cpath) +c$$$ subroutine readB(cpath) +c$$$ include 'common_c2f.f' +c$$$ +c$$$ LOGICAL DEBUG +c$$$ LOGICAL VERBOSE +c$$$ LOGICAL WARNING +c$$$ COMMON/DBG/DEBUG,VERBOSE,WARNING +c$$$ SAVE/DBG/ +c$$$ +c$$$ character*256 cpath +c$$$ character*256 ppath +c$$$ +c$$$ +c$$$ b_error=0 +c$$$ ppath='' +c$$$ +c$$$ la=256 +c$$$ do i=1,256 +c$$$ if(cpath(i:i).eq.'/')la=i +c$$$ enddo +c$$$ ppath=cpath(1:la) +c$$$ +c$$$ b_path = ppath +c$$$ b_pathlen = la +c$$$ +c$$$ if(DEBUG)print*,'Field loaded: ',b_loaded +c$$$ if(b_loaded.eq.0)then +c$$$ +c$$$c call the subroutine which reads the maps of the measurements taken +c$$$c inside the magnetic cavity +c$$$ call readBinner(ppath) +c$$$ if(b_error.eq.1)return +c$$$ +c$$$c call the subroutine which reads the maps of the measurements taken +c$$$c outside the magnetic cavity +c$$$ call readBouter(ppath) +c$$$ if(b_error.eq.1)return +c$$$ +c$$$ b_loaded = 1 +c$$$ endif +c$$$ +c$$$ return +c$$$ end + subroutine readB include 'common_c2f.f' - character*80 cpath - character*80 ppath - - b_error=0 + LOGICAL DEBUG + LOGICAL VERBOSE + LOGICAL WARNING + COMMON/DBG/DEBUG,VERBOSE,WARNING + SAVE/DBG/ - la=80 - do i=1,80 - if(cpath(i:i).eq.'/')la=i - enddo - ppath=cpath(1:la) +c$$$ character*256 cpath + character*256 ppath - b_path = ppath - b_pathlen = la + + c2f_error=0 -c FUNZIONAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!!!! + ppath=c2f_path(1:c2f_pathlen) - if(b_debug.eq.1)print*,'Field loaded: ',b_loaded - if(b_loaded.eq.0)then + +c VERBOSE=.true. c call the subroutine which reads the maps of the measurements taken c inside the magnetic cavity - call readBinner(ppath) - if(b_error.eq.1)return - + call readBinner(ppath) + if(c2f_error.eq.1)return + c call the subroutine which reads the maps of the measurements taken c outside the magnetic cavity - call readBouter(ppath) - if(b_error.eq.1)return + call readBouter(ppath) + if(c2f_error.eq.1)return - b_loaded = 1 - endif return end @@ -79,7 +118,14 @@ c implicit double precision (a-h,o-z) include 'common_B.f' include 'common_c2f.f' - character*80 path + + LOGICAL DEBUG + LOGICAL VERBOSE + LOGICAL WARNING + COMMON/DBG/DEBUG,VERBOSE,WARNING + SAVE/DBG/ + + character*256 path C REAL hmemor(10000000) @@ -137,7 +183,8 @@ Bmap_file='measure_n3_290302.rz' c opens magnetic field map first file - if(b_debug.eq.1)print * +c if(b_debug.eq.1)print * + if(VERBOSE)print * $ ,path(1:LNBLNK(path))//Bmap_file call HROPEN $ (lun_Bmap_file,'Bmap' @@ -261,7 +308,8 @@ Bmap_file='measure_n4_110402_corrected.rz' c opens magnetic field map first file - if(b_debug.eq.1)print * !,'Opening file: ' +c if(b_debug.eq.1)print * !,'Opening file: ' + if(VERBOSE)print * !,'Opening file: ' $ ,path(1:LNBLNK(path))//Bmap_file call HROPEN $ (lun_Bmap_file,'Bmap' @@ -380,8 +428,9 @@ 21 continue - b_error = 1 - if(b_debug.eq.1) + c2f_error = 1 +c if(b_debug.eq.1) + if(DEBUG) $ print* $ ,'read_B_inner: ERROR OPENING MAGNETIC FIELD MAP FILE: ' $ ,Bmap_file @@ -397,8 +446,9 @@ 22 continue - b_error = 1 - if(b_debug.eq.1) + c2f_error = 1 +c if(b_debug.eq.1) + if(DEBUG) $ print*,'read_B_inner: ERROR WHILE READING NTUPLE, at entry $ : ',iev @@ -441,7 +491,13 @@ include 'common_B.f' include 'common_c2f.f' C - character*80 path + LOGICAL DEBUG + LOGICAL VERBOSE + LOGICAL WARNING + COMMON/DBG/DEBUG,VERBOSE,WARNING + SAVE/DBG/ + + character*256 path REAL hmemor(10000000) integer Iquest(100) @@ -500,7 +556,8 @@ Bmap_file='External_top_map_n4_150402.rz' c opens magnetic field map first file - if(b_debug.eq.1)print * +c if(b_debug.eq.1)print * + if(VERBOSE)print * $ ,path(1:LNBLNK(path))//Bmap_file call HROPEN $ (lun_Bmap_file,'Bmap' @@ -620,8 +677,9 @@ 21 continue - b_error = 1 - if(b_debug.eq.1) + c2f_error = 1 +c if(b_debug.eq.1) + if(DEBUG) $ print* $ ,'read_B_inner: ERROR OPENING MAGNETIC FIELD MAP FILE: ' $ ,Bmap_file @@ -637,8 +695,9 @@ 22 continue - b_error = 1 - if(b_debug.eq.1) + c2f_error = 1 +c if(b_debug.eq.1) + if(DEBUG) $ print* $ ,'read_B_inner: ERROR WHILE READING NTUPLE, at event $ : ',iev