COSMOS v7.655  COSMOSv7655
(AirShowerMC)
creadSoftenPara.f
Go to the documentation of this file.
1  subroutine creadsoftenpara(io)
2  implicit none
3  integer,intent(in):: io ! logical dev. #
4  character*24 vname
5  character*100 vvalue
6 
7 
8  call cskipsep(io)
9  do while( cgetparmn(io, vname, vvalue ) )
10  select case(vname)
11  case('mode')
12  call creadparai(vvalue, mode)
13  case('xth')
14  call creadparar(vvalue, xth)
15  case('E0th')
16  call creadparar(vvalue, e0th)
17  case('fwbw')
18  call creadparai(vvalue, fwbw)
19  case('pw')
20  call creadparar(vvalue, pw)
21  case('repeat')
22  call creadparar(vvalue, repeat)
23  case('special')
24  call creadparal(vvalue, special)
25  case('leadingPiK')
26  call creadparal(vvalue, leadingpik)
27  case('useXinCMS')
28  call creadparal(vvalue, usexincms)
29  end select
30  enddo
31  end subroutine creadsoftenpara
32 ! *************
33  subroutine cwritesoftenpara(io)
34  implicit none
35  integer,intent(in):: io
36 
37  write(io,*)'----------------------'
38  call cwriteparai(io,'mode', mode)
39  call cwriteparar(io,'xth', xth)
40  call cwriteparar(io,'E0th', e0th)
41  call cwriteparai(io,'fwbw', fwbw)
42  call cwriteparar(io,'pw', pw)
43  call cwriteparar(io,'repeat',repeat)
44  call cwriteparal(io,'special',special)
45  call cwriteparal(io,'leadingPiK',leadingpik)
46  call cwriteparal(io,'useXinCMS', usexincms)
47  end subroutine cwritesoftenpara
48 
49 
50  subroutine cskipsep(io)
51  implicit none
52  integer io
53  character(10) sep
54  do while (.true.)
55  read(io, '(a)') sep
56  if(sep(2:10) == '---------') exit
57  enddo
58  end subroutine cskipsep
59 ! ************************* real*8 data
60  subroutine creadparar(vvalue, x)
61  implicit none
62  integer io
63  character*(*) vvalue
64  real*8 x
65 ! read(vvalue, *) x, x
66  read(vvalue, *) x
67  end subroutine creadparar
68  subroutine creadparar2(vvalue, x, n)
69  implicit none
70  integer io
71  character*(*) vvalue
72  integer n
73  real*8 x(n)
74  read(vvalue, *) x
75  end subroutine creadparar2
76 
77 ! ************************* complex data
78  subroutine creadparacx(vvalue, c)
79  implicit none
80  character*(*) vvalue
81  complex*8 c
82  read( vvalue, *) c
83  end subroutine creadparacx
84 ! ************************ integer data
85  subroutine creadparai(vvalue, i)
86  implicit none
87  character*(*) vvalue
88  integer i
89  read(vvalue, *) i
90  end subroutine creadparai
91 ! ************************* character data
92  subroutine creadparac(vvalue, cha)
93  implicit none
94  character*(*) vvalue
95  character*(*) cha
96  read(vvalue, *) cha
97  end subroutine creadparac
98 ! ***************************** logical data
99  subroutine creadparal(vvalue, logi)
100  implicit none
101  character*(*) vvalue
102  logical logi
103  read(vvalue, *) logi
104  end subroutine creadparal
105 ! ---------------------------------------------
106  subroutine cwriteparar(io, vname, x)
107  implicit none
108  integer io
109  character*(*) vname
110  real*8 x
111 
112  write(io, *) ' ', vname,' ', x,' /'
113  end subroutine cwriteparar
114  subroutine cwriteparar2(io, vname, x, n)
115  implicit none
116  integer io
117  integer n ! arra size of x
118  character*(*) vname
119  real*8 x(n)
120 
121  write(io,*) ' ', vname,' ', x,' /'
122  end subroutine cwriteparar2
123 
124  subroutine cwriteparacx(io, vname, c)
125  implicit none
126  integer io
127  character*(*) vname
128  complex*8 c
129  write(io, *) ' ', vname,' ', c,' /'
130  end subroutine cwriteparacx
131 
132  subroutine cwriteparai(io, vname, i)
133  implicit none
134  integer io
135  character*(*) vname
136  integer i
137 
138  write(io, *) ' ', vname,' ', i,' /'
139  end subroutine cwriteparai
140 
141  subroutine cwriteparac(io, vname, cha)
142  implicit none
143  integer io
144  character*(*) vname
145  character*(*) cha
146  integer klena
147  character*2 qmk/" '"/ ! '
148  if(klena(cha) .gt. 0) then
149  write(io, *) ' ', vname, qmk, cha(1:klena(cha)),
150  * qmk,' /'
151  else
152  write(io, *) ' ', vname, qmk, ' ', qmk, ' /'
153  endif
154  end subroutine cwriteparac
155  subroutine cwriteparal(io, vname, logi)
156  implicit none
157  integer io
158  character*(*) vname
159  logical logi
160 
161  write(io, *) ' ', vname,' ', logi,' /'
162  end subroutine cwriteparal
163 
164  function cgetparmn( io, vname, vv ) result(ans)
165 ! get parameter variable name and given value(s) from io
166  implicit none
167  integer io
168  character*(*) vname, vv ! output
169  logical ans
170 
171  integer linel
172  parameter( linel = 100)
173  character*(linel) line
174  integer loc, loc2
175  vname = " "
176  do while(.true.)
177  read(io, '(a)', end=100 ) line
178  if( line(1:1) .eq. " " .and. line(2:2) .ne. " ") then
179  loc = index( line(3:linel), " ") + 2
180  vname = line(2:loc-1)
181  loc2 = index( line, "/")
182  if(loc2 .eq. 0 ) then
183  write(0,* ) ' "/" is missing in the input data file '
184  write(0,*) ' The line is: ', line
185  stop 1234
186  endif
187  vv = line(loc+1:linel) ! some data containes '/' such as '../../Media' so put all
188  ! data.
189  goto 50
190  endif
191  enddo
192  50 continue
193  ans = .true.
194  return
195  100 continue
196  ans =.false.
197  end function cgetparmn
198 
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine cwriteparai(io, vname, i)
subroutine creadparac(vvalue, cha)
subroutine creadparal(vvalue, logi)
subroutine creadparar2(vvalue, x, n)
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon true
Definition: cblkElemag.h:7
logical function cgetparmn(io, vname, vv)
subroutine creadsoftenpara(io)
subroutine creadparar(vvalue, x)
subroutine cwriteparacx(io, vname, c)
subroutine cwriteparal(io, vname, logi)
subroutine creadparacx(vvalue, c)
subroutine cwriteparar2(io, vname, x, n)
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon ! knockon is considered Obsolete *PhotoProd false
Definition: cblkElemag.h:7
subroutine cwriteparac(io, vname, cha)
subroutine creadparai(vvalue, i)
subroutine cwriteparar(io, vname, x)
subroutine cwritesoftenpara(io)
subroutine cskipsep(io)