| 9 |  |  | 
| 10 | c2f_error = 0 | c2f_error = 0 | 
| 11 |  |  | 
| 12 | c      if(C2F_DEBUG.eq.1)print * | c      if(C2F_DEBUG.EQ.1.eq.1)print * | 
| 13 | if(verbose)print * | if(verbose.eq.1)print * | 
| 14 | $     ,c2f_path(1:c2f_pathlen)//'trk-maskvk.dat' | $     ,c2f_path(1:c2f_pathlen)//'trk-maskvk.dat' | 
| 15 | open(10, | open(10, | 
| 16 | $     FILE=c2f_path(1:c2f_pathlen)//'trk-maskvk.dat' !<<<< C2F | $     FILE=c2f_path(1:c2f_pathlen)//'trk-maskvk.dat' !<<<< C2F | 
| 18 | $     ,IOSTAT=iostat | $     ,IOSTAT=iostat | 
| 19 | $     ) | $     ) | 
| 20 | if(iostat.ne.0)then | if(iostat.ne.0)then | 
| 21 | c         if(C2F_DEBUG.eq.1) | c         if(C2F_DEBUG.EQ.1.eq.1) | 
| 22 | if(debug) | if(debug.eq.1) | 
| 23 | $        print*,'READVKMASK: *** Error opening file ***' | $        print*,'READVKMASK: *** Error opening file ***' | 
| 24 | c2f_error = 1 | c2f_error = 1 | 
| 25 | return | return | 
| 30 | $        ) | $        ) | 
| 31 | $        (mask_vk(iv,i),i=1,24) | $        (mask_vk(iv,i),i=1,24) | 
| 32 | if(iostat.ne.0)then | if(iostat.ne.0)then | 
| 33 | c            if(C2F_DEBUG.eq.1) | c            if(C2F_DEBUG.EQ.1.eq.1) | 
| 34 | if(debug) | if(debug.eq.1) | 
| 35 | $           print*,'READVKMASK: *** Error reading file ***' | $           print*,'READVKMASK: *** Error reading file ***' | 
| 36 | c2f_error = 1 | c2f_error = 1 | 
| 37 | goto 1000 | goto 1000 | 
| 56 | 201  format('trk-LADDER',i1,'-mip.dat') | 201  format('trk-LADDER',i1,'-mip.dat') | 
| 57 | do ilad=1,nladders_view | do ilad=1,nladders_view | 
| 58 | write(fname_param,201)ilad | write(fname_param,201)ilad | 
| 59 | c         if(C2F_DEBUG.eq.1)print * | c         if(C2F_DEBUG.EQ.1.eq.1)print * | 
| 60 | if(VERBOSE)print * | if(VERBOSE.EQ.1)print * | 
| 61 | $        ,c2f_path(1:c2f_pathlen)!<<<< C2F | $        ,c2f_path(1:c2f_pathlen)!<<<< C2F | 
| 62 | $        //fname_param(1:LNBLNK(fname_param)) | $        //fname_param(1:LNBLNK(fname_param)) | 
| 63 | open(10, | open(10, | 
| 67 | $        ,IOSTAT=iostat | $        ,IOSTAT=iostat | 
| 68 | $        ) | $        ) | 
| 69 | if(iostat.ne.0)then | if(iostat.ne.0)then | 
| 70 | c            if(C2F_DEBUG.eq.1)print* | c            if(C2F_DEBUG.EQ.1.eq.1)print* | 
| 71 | if(DEBUG)print* | if(DEBUG.EQ.1)print* | 
| 72 | $           ,'READMIPPARAM: *** Error opening file *** ' | $           ,'READMIPPARAM: *** Error opening file *** ' | 
| 73 | c2f_error = 1 | c2f_error = 1 | 
| 74 | return | return | 
| 100 | 201  format('charge-l',i1,'.dat') | 201  format('charge-l',i1,'.dat') | 
| 101 | do ilad=1,nladders_view | do ilad=1,nladders_view | 
| 102 | write(fname_param,201)ilad | write(fname_param,201)ilad | 
| 103 | c         if(C2F_DEBUG.eq.1)print * | c         if(C2F_DEBUG.EQ.1.eq.1)print * | 
| 104 | if(VERBOSE)print * | if(VERBOSE.EQ.1)print * | 
| 105 | $        ,c2f_path(1:c2f_pathlen)!<<<< C2F | $        ,c2f_path(1:c2f_pathlen)!<<<< C2F | 
| 106 | $        //fname_param(1:LNBLNK(fname_param)) | $        //fname_param(1:LNBLNK(fname_param)) | 
| 107 | open(10, | open(10, | 
| 149 |  |  | 
| 150 | c2f_error = 0 | c2f_error = 0 | 
| 151 |  |  | 
| 152 | ******retrieve ANGULAR BINNING info | *     ====================================================== | 
| 153 |  | *     read ANGULAR BINNING info | 
| 154 |  | *     ====================================================== | 
| 155 | fname_binning='binning.dat' | fname_binning='binning.dat' | 
| 156 | c      if(C2F_DEBUG.eq.1) | c      if(C2F_DEBUG.EQ.1.eq.1) | 
| 157 | if(VERBOSE) | if(VERBOSE.EQ.1) | 
| 158 | $     print * | $     print * | 
| 159 | $     ,c2f_path(1:c2f_pathlen)     !<<<< C2F | $     ,c2f_path(1:c2f_pathlen)     !<<<< C2F | 
| 160 | $     //fname_binning(1:LNBLNK(fname_binning)) | $     //fname_binning(1:LNBLNK(fname_binning)) | 
| 165 | $     ,IOSTAT=iostat | $     ,IOSTAT=iostat | 
| 166 | $     ) | $     ) | 
| 167 | if(iostat.ne.0)then | if(iostat.ne.0)then | 
| 168 | c         if(C2F_DEBUG.eq.1) | c         if(C2F_DEBUG.EQ.1.eq.1) | 
| 169 | if(DEBUG) | if(DEBUG.EQ.1) | 
| 170 | $        print*,'READETAPARAM: *** Error in opening file *** ' | $        print*,'READETAPARAM: *** Error in opening file *** ' | 
| 171 | c2f_error = 1 | c2f_error = 1 | 
| 172 | return | return | 
| 190 |  |  | 
| 191 |  |  | 
| 192 |  |  | 
| 193 |  | *     ====================================================== | 
| 194 |  | *     read eta2-eta3-eta4 parameters | 
| 195 |  | *     ====================================================== | 
| 196 | do ieta=2,4               !loop on eta 2,3,4 | do ieta=2,4               !loop on eta 2,3,4 | 
|  | ******retrieve correction parameters |  | 
| 197 | 200     format(' Opening eta',i1,' files...') | 200     format(' Opening eta',i1,' files...') | 
| 198 | c         if(C2F_DEBUG.eq.1)write(*,200)ieta | c         if(C2F_DEBUG.EQ.1.eq.1)write(*,200)ieta | 
| 199 | if(VERBOSE)write(*,200)ieta | if(VERBOSE.EQ.1)write(*,200)ieta | 
| 200 |  |  | 
| 201 | 201     format('eta',i1,'-bin',i1,'-l',i1,'.dat') | 201     format('eta',i1,'-bin',i1,'-l',i1,'.dat') | 
| 202 | 202     format('eta',i1,'-bin',i2,'-l',i1,'.dat') | 202     format('eta',i1,'-bin',i2,'-l',i1,'.dat') | 
| 203 | do iang=1,nangbin | do iang=1,nangbin | 
| 204 | do ilad=1,nladders_view | do ilad=1,nladders_view | 
| 205 |  |  | 
| 206 | if(iang.lt.10)write(fname_param,201)ieta,iang,ilad | if(iang.lt.10)write(fname_param,201)ieta,iang,ilad | 
| 207 | if(iang.ge.10)write(fname_param,202)ieta,iang,ilad | if(iang.ge.10)write(fname_param,202)ieta,iang,ilad | 
| 208 | open(10, | open(10, | 
| 213 | $              ,IOSTAT=iostat | $              ,IOSTAT=iostat | 
| 214 | $              ) | $              ) | 
| 215 | if(iostat.ne.0)then | if(iostat.ne.0)then | 
| 216 | c                  if(C2F_DEBUG.eq.1) | c                  if(DEBUG.EQ.1) | 
| 217 | if(DEBUG) | if(.true.) | 
| 218 | $                 print*,'READETAPARAM: ** Error opening file ** ' | $                 print*,'READETAPARAM: ** Error opening file ** ' | 
| 219 | $                 ,c2f_path(1:c2f_pathlen) | $                 ,c2f_path(1:c2f_pathlen) | 
| 220 | $                 //fname_param(1:LNBLNK(fname_param)) | $                 //fname_param(1:LNBLNK(fname_param)) | 
| 221 | c2f_error = 1 | c                  c2f_error = 1 !! COMMENTATO TEMPORANEAMENTE | 
| 222 | return | c                  return | 
| 223 |  | goto 2001 | 
| 224 | endif | endif | 
| 225 | netaval=0 | netaval=0 | 
| 226 | do ival=1,netavalmax | do ival=1,netavalmax | 
| 241 | $                 (feta4(ival,iv,ilad,iang),iv=1,nviews) | $                 (feta4(ival,iv,ilad,iang),iv=1,nviews) | 
| 242 | if(iostat.ne.0)then | if(iostat.ne.0)then | 
| 243 | if(netaval.eq.0)then | if(netaval.eq.0)then | 
| 244 | c                        if(C2F_DEBUG.eq.1)print*,'READETAPARAM: ' | c                        if(C2F_DEBUG.EQ.1.eq.1)print*,'READETAPARAM: ' | 
| 245 | if(DEBUG)print*,'READETAPARAM: ' | c                        if(DEBUG.EQ.1) | 
| 246 |  | if(.true.) | 
| 247 |  | $                       print*,'READETAPARAM: ' | 
| 248 | $                       //'*** Error reading file *** ' | $                       //'*** Error reading file *** ' | 
| 249 | $                       ,c2f_path(1:c2f_pathlen) | $                       ,c2f_path(1:c2f_pathlen) | 
| 250 | $                       //fname_param(1:LNBLNK(fname_param)) | $                       //fname_param(1:LNBLNK(fname_param)) | 
| 256 | netaval=netaval+1 | netaval=netaval+1 | 
| 257 | enddo | enddo | 
| 258 | 2000          close(10) | 2000          close(10) | 
| 259 |  | 2001          continue | 
| 260 | *               print*,'... done' | *               print*,'... done' | 
| 261 | enddo | enddo | 
| 262 | enddo | enddo | 
| 263 |  |  | 
| 264 | enddo                     !end loop on eta 2,3,4 | enddo                     !end loop on eta 2,3,4 | 
| 265 |  |  | 
| 266 |  | *     ====================================================== | 
| 267 |  | *     read landi correction | 
| 268 |  | *     ====================================================== | 
| 269 |  | if(VERBOSE.eq.1)print*,' Opening landi-correction files...' | 
| 270 |  |  | 
| 271 |  | 301  format('lcorr-l',i1,'.dat') | 
| 272 |  | do ilad=1,nladders_view | 
| 273 |  |  | 
| 274 |  | write(fname_param,301)ilad | 
| 275 |  | open(10, | 
| 276 |  | $        FILE=c2f_path(1:c2f_pathlen) | 
| 277 |  | $        //fname_param(1:LNBLNK(fname_param)) | 
| 278 |  | $        ,STATUS='OLD' | 
| 279 |  | $        ,IOSTAT=iostat | 
| 280 |  | $        ) | 
| 281 |  | if(iostat.ne.0)then | 
| 282 |  | if(.true.) | 
| 283 |  | $           print*,'READETAPARAM: ** Error opening file ** ' | 
| 284 |  | $           ,c2f_path(1:c2f_pathlen) | 
| 285 |  | $           //fname_param(1:LNBLNK(fname_param)) | 
| 286 |  | c            c2f_error = 1 !tolto solo temporaneamente | 
| 287 |  | c     return | 
| 288 |  | goto 3001 | 
| 289 |  | endif | 
| 290 |  |  | 
| 291 |  | do iang=1,nangbin | 
| 292 |  |  | 
| 293 |  | read(10,*,IOSTAT=iostat) | 
| 294 |  | $           ii,aal,aar,(fcorr(iv,ilad,iang),iv=1,nviews) | 
| 295 |  |  | 
| 296 |  | c            write(*,*) | 
| 297 |  | c     $           ii,aal,aar,(fcorr(iv,ilad,iang),iv=1,nviews) | 
| 298 |  |  | 
| 299 |  | if(ii.ne.iang)print*,'parametri eta incasinati' | 
| 300 |  | if(aal.ne.angl(iang))print*,'parametri eta incasinati' | 
| 301 |  | if(aar.ne.angr(iang))print*,'parametri eta incasinati' | 
| 302 |  |  | 
| 303 |  | if(iostat.ne.0)then | 
| 304 |  | if(.true.) | 
| 305 |  | $              print*,'READETAPARAM: ' | 
| 306 |  | $              //'*** Error reading file *** ' | 
| 307 |  | $              ,c2f_path(1:c2f_pathlen) | 
| 308 |  | $              //fname_param(1:LNBLNK(fname_param)) | 
| 309 |  | c2f_error = 1 | 
| 310 |  | goto 3000 | 
| 311 |  | endif | 
| 312 |  |  | 
| 313 |  | enddo                  !end loop on angular bins | 
| 314 |  | 3000    close(10) | 
| 315 |  | 3001    continue | 
| 316 |  |  | 
| 317 |  | enddo                     ! end loop on ladders | 
| 318 |  |  | 
| 319 | return | return | 
| 320 | end | end | 
| 321 |  |  | 
| 347 | do is=1,2 | do is=1,2 | 
| 348 |  |  | 
| 349 | write(fname_param,100)ilad,is | write(fname_param,100)ilad,is | 
| 350 | c            if(C2F_DEBUG.eq.1)print * | c            if(C2F_DEBUG.EQ.1.eq.1)print * | 
| 351 | if(VERBOSE)print * | if(VERBOSE.EQ.1)print * | 
| 352 | $           ,c2f_path(1:c2f_pathlen) | $           ,c2f_path(1:c2f_pathlen) | 
| 353 | $           //fname_param | $           //fname_param | 
| 354 |  |  | 
| 424 |  |  | 
| 425 | c2f_error = 0 | c2f_error = 0 | 
| 426 |  |  | 
| 427 | c      if(C2F_DEBUG.eq.1)print * | c      if(C2F_DEBUG.EQ.1.eq.1)print * | 
| 428 | if(VERBOSE)print * | if(VERBOSE.EQ.1)print * | 
| 429 | $     ,c2f_path(1:c2f_pathlen)//'mech_pos.dat' | $     ,c2f_path(1:c2f_pathlen)//'mech_pos.dat' | 
| 430 | open(10 | open(10 | 
| 431 | $     ,FILE= | $     ,FILE= |