13 |
* |
* |
14 |
************************************************************************* |
************************************************************************* |
15 |
|
|
16 |
subroutine readB(cpath) |
c$$$ subroutine readB(cpath) |
17 |
|
c$$$ include 'common_c2f.f' |
18 |
|
c$$$ |
19 |
|
c$$$ LOGICAL DEBUG |
20 |
|
c$$$ LOGICAL VERBOSE |
21 |
|
c$$$ LOGICAL WARNING |
22 |
|
c$$$ COMMON/DBG/DEBUG,VERBOSE,WARNING |
23 |
|
c$$$ SAVE/DBG/ |
24 |
|
c$$$ |
25 |
|
c$$$ character*256 cpath |
26 |
|
c$$$ character*256 ppath |
27 |
|
c$$$ |
28 |
|
c$$$ |
29 |
|
c$$$ b_error=0 |
30 |
|
c$$$ ppath='' |
31 |
|
c$$$ |
32 |
|
c$$$ la=256 |
33 |
|
c$$$ do i=1,256 |
34 |
|
c$$$ if(cpath(i:i).eq.'/')la=i |
35 |
|
c$$$ enddo |
36 |
|
c$$$ ppath=cpath(1:la) |
37 |
|
c$$$ |
38 |
|
c$$$ b_path = ppath |
39 |
|
c$$$ b_pathlen = la |
40 |
|
c$$$ |
41 |
|
c$$$ if(DEBUG)print*,'Field loaded: ',b_loaded |
42 |
|
c$$$ if(b_loaded.eq.0)then |
43 |
|
c$$$ |
44 |
|
c$$$c call the subroutine which reads the maps of the measurements taken |
45 |
|
c$$$c inside the magnetic cavity |
46 |
|
c$$$ call readBinner(ppath) |
47 |
|
c$$$ if(b_error.eq.1)return |
48 |
|
c$$$ |
49 |
|
c$$$c call the subroutine which reads the maps of the measurements taken |
50 |
|
c$$$c outside the magnetic cavity |
51 |
|
c$$$ call readBouter(ppath) |
52 |
|
c$$$ if(b_error.eq.1)return |
53 |
|
c$$$ |
54 |
|
c$$$ b_loaded = 1 |
55 |
|
c$$$ endif |
56 |
|
c$$$ |
57 |
|
c$$$ return |
58 |
|
c$$$ end |
59 |
|
subroutine readB |
60 |
include 'common_c2f.f' |
include 'common_c2f.f' |
61 |
|
|
62 |
LOGICAL DEBUG |
c$$$ LOGICAL DEBUG |
63 |
LOGICAL VERBOSE |
c$$$ LOGICAL VERBOSE |
64 |
LOGICAL WARNING |
c$$$ LOGICAL WARNING |
65 |
COMMON/DBG/DEBUG,VERBOSE,WARNING |
c$$$ COMMON/DBG/DEBUG,VERBOSE,WARNING |
66 |
SAVE/DBG/ |
c$$$ SAVE/DBG/ |
67 |
|
INTEGER DEBUG |
68 |
|
INTEGER VERBOSE |
69 |
|
INTEGER WARNING |
70 |
|
COMMON/dbg/DEBUG,VERBOSE,WARNING |
71 |
|
SAVE/dbg/ |
72 |
|
|
73 |
character*256 cpath |
|
74 |
|
|
75 |
|
c$$$ character*256 cpath |
76 |
character*256 ppath |
character*256 ppath |
77 |
|
|
78 |
|
|
79 |
b_error=0 |
c2f_error=0 |
|
ppath='' |
|
80 |
|
|
81 |
la=256 |
ppath=c2f_path(1:c2f_pathlen) |
|
do i=1,256 |
|
|
if(cpath(i:i).eq.'/')la=i |
|
|
enddo |
|
|
ppath=cpath(1:la) |
|
82 |
|
|
|
b_path = ppath |
|
|
b_pathlen = la |
|
83 |
|
|
84 |
if(DEBUG)print*,'Field loaded: ',b_loaded |
c VERBOSE=.true. |
|
if(b_loaded.eq.0)then |
|
85 |
|
|
86 |
c call the subroutine which reads the maps of the measurements taken |
c call the subroutine which reads the maps of the measurements taken |
87 |
c inside the magnetic cavity |
c inside the magnetic cavity |
88 |
call readBinner(ppath) |
call readBinner(ppath) |
89 |
if(b_error.eq.1)return |
if(c2f_error.eq.1)return |
90 |
|
|
91 |
c call the subroutine which reads the maps of the measurements taken |
c call the subroutine which reads the maps of the measurements taken |
92 |
c outside the magnetic cavity |
c outside the magnetic cavity |
93 |
call readBouter(ppath) |
call readBouter(ppath) |
94 |
if(b_error.eq.1)return |
if(c2f_error.eq.1)return |
95 |
|
|
|
b_loaded = 1 |
|
|
endif |
|
96 |
|
|
97 |
return |
return |
98 |
end |
end |
126 |
include 'common_B.f' |
include 'common_B.f' |
127 |
include 'common_c2f.f' |
include 'common_c2f.f' |
128 |
|
|
129 |
LOGICAL DEBUG |
c$$$ LOGICAL DEBUG |
130 |
LOGICAL VERBOSE |
c$$$ LOGICAL VERBOSE |
131 |
LOGICAL WARNING |
c$$$ LOGICAL WARNING |
132 |
COMMON/DBG/DEBUG,VERBOSE,WARNING |
c$$$ COMMON/DBG/DEBUG,VERBOSE,WARNING |
133 |
SAVE/DBG/ |
c$$$ SAVE/DBG/ |
134 |
|
INTEGER DEBUG |
135 |
|
INTEGER VERBOSE |
136 |
|
INTEGER WARNING |
137 |
|
COMMON/dbg/DEBUG,VERBOSE,WARNING |
138 |
|
SAVE/dbg/ |
139 |
|
|
140 |
character*256 path |
character*256 path |
141 |
|
|
196 |
|
|
197 |
c opens magnetic field map first file |
c opens magnetic field map first file |
198 |
c if(b_debug.eq.1)print * |
c if(b_debug.eq.1)print * |
199 |
if(VERBOSE)print * |
if(VERBOSE.EQ.1)print * |
200 |
$ ,path(1:LNBLNK(path))//Bmap_file |
$ ,path(1:LNBLNK(path))//Bmap_file |
201 |
call HROPEN |
call HROPEN |
202 |
$ (lun_Bmap_file,'Bmap' |
$ (lun_Bmap_file,'Bmap' |
321 |
Bmap_file='measure_n4_110402_corrected.rz' |
Bmap_file='measure_n4_110402_corrected.rz' |
322 |
c opens magnetic field map first file |
c opens magnetic field map first file |
323 |
c if(b_debug.eq.1)print * !,'Opening file: ' |
c if(b_debug.eq.1)print * !,'Opening file: ' |
324 |
if(VERBOSE)print * !,'Opening file: ' |
if(VERBOSE.EQ.1)print * !,'Opening file: ' |
325 |
$ ,path(1:LNBLNK(path))//Bmap_file |
$ ,path(1:LNBLNK(path))//Bmap_file |
326 |
call HROPEN |
call HROPEN |
327 |
$ (lun_Bmap_file,'Bmap' |
$ (lun_Bmap_file,'Bmap' |
440 |
|
|
441 |
21 continue |
21 continue |
442 |
|
|
443 |
b_error = 1 |
c2f_error = 1 |
444 |
c if(b_debug.eq.1) |
c if(b_debug.eq.1) |
445 |
if(DEBUG) |
if(DEBUG.EQ.1) |
446 |
$ print* |
$ print* |
447 |
$ ,'read_B_inner: ERROR OPENING MAGNETIC FIELD MAP FILE: ' |
$ ,'read_B_inner: ERROR OPENING MAGNETIC FIELD MAP FILE: ' |
448 |
$ ,Bmap_file |
$ ,Bmap_file |
458 |
|
|
459 |
22 continue |
22 continue |
460 |
|
|
461 |
b_error = 1 |
c2f_error = 1 |
462 |
c if(b_debug.eq.1) |
c if(b_debug.eq.1.eq.1) |
463 |
if(DEBUG) |
if(DEBUG.EQ.1) |
464 |
$ print*,'read_B_inner: ERROR WHILE READING NTUPLE, at entry |
$ print*,'read_B_inner: ERROR WHILE READING NTUPLE, at entry |
465 |
$ : ',iev |
$ : ',iev |
466 |
|
|
503 |
include 'common_B.f' |
include 'common_B.f' |
504 |
include 'common_c2f.f' |
include 'common_c2f.f' |
505 |
C |
C |
506 |
LOGICAL DEBUG |
c$$$ LOGICAL DEBUG |
507 |
LOGICAL VERBOSE |
c$$$ LOGICAL VERBOSE |
508 |
LOGICAL WARNING |
c$$$ LOGICAL WARNING |
509 |
COMMON/DBG/DEBUG,VERBOSE,WARNING |
c$$$ COMMON/DBG/DEBUG,VERBOSE,WARNING |
510 |
SAVE/DBG/ |
c$$$ SAVE/DBG/ |
511 |
|
INTEGER DEBUG |
512 |
|
INTEGER VERBOSE |
513 |
|
INTEGER WARNING |
514 |
|
COMMON/dbg/DEBUG,VERBOSE,WARNING |
515 |
|
SAVE/dbg/ |
516 |
|
|
517 |
character*256 path |
character*256 path |
518 |
|
|
574 |
|
|
575 |
c opens magnetic field map first file |
c opens magnetic field map first file |
576 |
c if(b_debug.eq.1)print * |
c if(b_debug.eq.1)print * |
577 |
if(VERBOSE)print * |
if(VERBOSE.EQ.1)print * |
578 |
$ ,path(1:LNBLNK(path))//Bmap_file |
$ ,path(1:LNBLNK(path))//Bmap_file |
579 |
call HROPEN |
call HROPEN |
580 |
$ (lun_Bmap_file,'Bmap' |
$ (lun_Bmap_file,'Bmap' |
694 |
|
|
695 |
21 continue |
21 continue |
696 |
|
|
697 |
b_error = 1 |
c2f_error = 1 |
698 |
c if(b_debug.eq.1) |
c if(b_debug.eq.1) |
699 |
if(DEBUG) |
if(DEBUG.EQ.1) |
700 |
$ print* |
$ print* |
701 |
$ ,'read_B_inner: ERROR OPENING MAGNETIC FIELD MAP FILE: ' |
$ ,'read_B_inner: ERROR OPENING MAGNETIC FIELD MAP FILE: ' |
702 |
$ ,Bmap_file |
$ ,Bmap_file |
706 |
|
|
707 |
c------------------------------------------------------------------------ |
c------------------------------------------------------------------------ |
708 |
c |
c |
709 |
c ntuple event reading error |
c ntuple evevent reading error |
710 |
c |
c |
711 |
c------------------------------------------------------------------------ |
c------------------------------------------------------------------------ |
712 |
|
|
713 |
22 continue |
22 continue |
714 |
|
|
715 |
b_error = 1 |
c2f_error = 1 |
716 |
c if(b_debug.eq.1) |
c if(b_debug.eq.1) |
717 |
if(DEBUG) |
if(DEBUG.EQ.1) |
718 |
$ print* |
$ print* |
719 |
$ ,'read_B_inner: ERROR WHILE READING NTUPLE, at event |
$ ,'read_B_inner: ERROR WHILE READING NTUPLE, at event |
720 |
$ : ',iev |
$ : ',iev |