1 |
************************************************************************* |
2 |
* |
3 |
* Subroutine read_B.f |
4 |
* |
5 |
* it calls the subroutines which read the magnetic field maps for |
6 |
* the PAMELA spectrometer |
7 |
* |
8 |
* needs: |
9 |
* - ./read_B_inner.f inner map reading subroutine |
10 |
* - ./read_B_outer.f outer map reading subroutine |
11 |
* |
12 |
* to be called before ./inter_B.f (interpolation subroutine) |
13 |
* |
14 |
************************************************************************* |
15 |
|
16 |
function readb2maps(idata_dir) |
17 |
c subroutine read_B(idata_dir) |
18 |
CHARACTER*250 idata_dir |
19 |
integer lastnb2 |
20 |
c integer lung |
21 |
parameter(NWPAWC=8500000) |
22 |
common/pawc/hmem(NWPAWC) |
23 |
save/pawc/ |
24 |
common/quest/iquest(100) |
25 |
save/quest/ |
26 |
call hlimit(nwpawc) |
27 |
c |
28 |
lastnb2 = length(idata_dir)+1 |
29 |
c call the subroutine which reads the maps of the measurements taken |
30 |
c inside the magnetic cavity |
31 |
call read_B_inner(idata_dir(1:lastnb2)) |
32 |
|
33 |
c call the subroutine which reads the maps of the measurements taken |
34 |
c outside the magnetic cavity |
35 |
cc call read_B_outer(idata_dir(1:lastnb2)) |
36 |
|
37 |
return |
38 |
end |
39 |
|
40 |
include './read_B_inner.for' |
41 |
c include './read_B_outer.for' |
42 |
|
43 |
|
44 |
integer function length(str) |
45 |
c return the string length without the blanks characters |
46 |
|
47 |
implicit integer (k-l) |
48 |
character *(*) str |
49 |
|
50 |
lmax=len(str) |
51 |
|
52 |
c search the last non blank character |
53 |
do i = 1, lmax |
54 |
if( str(i:i).eq.'.' )then |
55 |
length=i |
56 |
return |
57 |
endif |
58 |
enddo |
59 |
|
60 |
length=lmax |
61 |
|
62 |
return |
63 |
end |
64 |
|