--- DarthVader/TrackerLevel2/src/F77/readB.f 2006/05/30 16:30:37 1.2 +++ DarthVader/TrackerLevel2/src/F77/readB.f 2006/11/15 17:55:07 1.7 @@ -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,39 +65,27 @@ COMMON/DBG/DEBUG,VERBOSE,WARNING SAVE/DBG/ - character*80 cpath - character*80 ppath +c$$$ character*256 cpath + character*256 ppath - b_error=0 + c2f_error=0 - la=80 - do i=1,80 - if(cpath(i:i).eq.'/')la=i - enddo - ppath=cpath(1:la) - - b_path = ppath - b_pathlen = la + ppath=c2f_path(1:c2f_pathlen) -c FUNZIONAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!!!! -c if(b_debug.eq.1)print*,'Field loaded: ',b_loaded - if(DEBUG)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 @@ -94,7 +125,7 @@ COMMON/DBG/DEBUG,VERBOSE,WARNING SAVE/DBG/ - character*80 path + character*256 path C REAL hmemor(10000000) @@ -397,7 +428,7 @@ 21 continue - b_error = 1 + c2f_error = 1 c if(b_debug.eq.1) if(DEBUG) $ print* @@ -415,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 @@ -466,7 +497,7 @@ COMMON/DBG/DEBUG,VERBOSE,WARNING SAVE/DBG/ - character*80 path + character*256 path REAL hmemor(10000000) integer Iquest(100) @@ -646,7 +677,7 @@ 21 continue - b_error = 1 + c2f_error = 1 c if(b_debug.eq.1) if(DEBUG) $ print* @@ -664,7 +695,7 @@ 22 continue - b_error = 1 + c2f_error = 1 c if(b_debug.eq.1) if(DEBUG) $ print*