--- DarthVader/TrackerLevel2/src/F77/readB.f 2006/11/02 15:31:06 1.5 +++ DarthVader/TrackerLevel2/src/F77/readB.f 2006/11/08 16:42:28 1.6 @@ -13,7 +13,50 @@ * ************************************************************************* - 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' LOGICAL DEBUG @@ -22,37 +65,27 @@ COMMON/DBG/DEBUG,VERBOSE,WARNING SAVE/DBG/ - character*256 cpath +c$$$ character*256 cpath character*256 ppath - b_error=0 - ppath='' + c2f_error=0 - la=256 - do i=1,256 - if(cpath(i:i).eq.'/')la=i - enddo - ppath=cpath(1:la) + ppath=c2f_path(1:c2f_pathlen) - b_path = ppath - b_pathlen = la - if(DEBUG)print*,'Field loaded: ',b_loaded - if(b_loaded.eq.0)then + 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 @@ -395,7 +428,7 @@ 21 continue - b_error = 1 + c2f_error = 1 c if(b_debug.eq.1) if(DEBUG) $ print* @@ -413,7 +446,7 @@ 22 continue - b_error = 1 + c2f_error = 1 c if(b_debug.eq.1) if(DEBUG) $ print*,'read_B_inner: ERROR WHILE READING NTUPLE, at entry @@ -644,7 +677,7 @@ 21 continue - b_error = 1 + c2f_error = 1 c if(b_debug.eq.1) if(DEBUG) $ print* @@ -662,7 +695,7 @@ 22 continue - b_error = 1 + c2f_error = 1 c if(b_debug.eq.1) if(DEBUG) $ print*