COSMOS v7.655  COSMOSv7655
(AirShowerMC)
mnstin.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine mnstin (CRDBUF, IERR)
 

Function/Subroutine Documentation

◆ mnstin()

subroutine mnstin ( character, dimension(*)  CRDBUF,
  IERR 
)

Definition at line 10 of file mnstin.f.

References a, b, c, d, e, f, false, g, h, softenpik::half, i, j, m, maxp, n, o, p, parameter(), true, up(), x, xs, and z.

Referenced by mnread().

10 *
11 * $Id: d506dp.inc,v 1.1.1.1 1996/03/07 14:31:32 mclareni Exp $
12 *
13 * $Log: d506dp.inc,v $
14 * Revision 1.1.1.1 1996/03/07 14:31:32 mclareni
15 * Minuit
16 *
17 *
18 *
19 *
20 * d506dp.inc
21 *
22 C ************ DOUBLE PRECISION VERSION *************
23  IMPLICIT DOUBLE PRECISION (a-h,o-z)
24 CC Called from MNREAD.
25 CC Implements the SET INPUT command to change input units.
26 CC If command is: 'SET INPUT' 'SET INPUT 0' or '*EOF',
27 CC or 'SET INPUT , , ',
28 CC reverts to previous input unit number,if any.
29 CC
30 CC If it is: 'SET INPUT n' or 'SET INPUT n filename',
31 CC changes to new input file, added to stack
32 CC
33 CC IERR = 0: reading terminated normally
34 CC 2: end-of-data on primary input file
35 CC 3: unrecoverable read error
36 CC 4: unable to process request
37 CC
38 *
39 * $Id: d506cm.inc,v 1.1.1.1 1996/03/07 14:31:32 mclareni Exp $
40 *
41 * $Log: d506cm.inc,v $
42 * Revision 1.1.1.1 1996/03/07 14:31:32 mclareni
43 * Minuit
44 *
45 *
46 *
47 *
48 * d506cm.inc
49 *
50  parameter(mne=100 , mni=50)
51  parameter(mnihl=mni*(mni+1)/2)
52  CHARACTER*10 cpnam
53  COMMON
54  1/mn7nam/ cpnam(mne)
55  2/mn7ext/ u(mne) ,alim(mne) ,blim(mne)
56  3/mn7err/ erp(mni) ,ern(mni) ,werr(mni) ,globcc(mni)
57  4/mn7inx/ nvarl(mne) ,niofex(mne),nexofi(mni)
58  5/mn7int/ x(mni) ,xt(mni) ,dirin(mni)
59  6/mn7fx2/ xs(mni) ,xts(mni) ,dirins(mni)
60  7/mn7der/ grd(mni) ,g2(mni) ,gstep(mni) ,gin(mne) ,dgrd(mni)
61  8/mn7fx3/ grds(mni) ,g2s(mni) ,gsteps(mni)
62  9/mn7fx1/ ipfix(mni) ,npfix
63  a/mn7var/ vhmat(mnihl)
64  b/mn7vat/ vthmat(mnihl)
65  c/mn7sim/ p(mni,mni+1),pstar(mni),pstst(mni) ,pbar(mni),prho(mni)
66 C
67  parameter(maxdbg=10, maxstk=10, maxcwd=20, maxp=30, maxcpt=101)
68  parameter(zero=0.0, one=1.0, half=0.5)
69  COMMON
70  d/mn7npr/ maxint ,npar ,maxext ,nu
71  e/mn7iou/ isysrd ,isyswr ,isyssa ,npagwd ,npagln ,newpag
72  e/mn7io2/ istkrd(maxstk) ,nstkrd ,istkwr(maxstk) ,nstkwr
73  f/mn7tit/ cfrom ,cstatu ,ctitl ,cword ,cundef ,cvrsn ,covmes
74  g/mn7flg/ isw(7) ,idbg(0:maxdbg) ,nblock ,icomnd
75  h/mn7min/ amin ,up ,edm ,fval3 ,epsi ,apsi ,dcovar
76  i/mn7cnv/ nfcn ,nfcnmx ,nfcnlc ,nfcnfr ,itaur,istrat,nwrmes(2)
77  j/mn7arg/ word7(maxp)
78  k/mn7log/ lwarn ,lrepor ,limset ,lnolim ,lnewmn ,lphead
79  l/mn7cns/ epsmac ,epsma2 ,vlimlo ,vlimhi ,undefi ,bigedm,updflt
80  m/mn7rpt/ xpt(maxcpt) ,ypt(maxcpt)
81  n/mn7cpt/ chpt(maxcpt)
82  o/mn7xcr/ xmidcr ,ymidcr ,xdircr ,ydircr ,ke1cr ,ke2cr
83  CHARACTER ctitl*50, cword*(maxcwd), cundef*10, cfrom*8,
84  + cvrsn*6, covmes(0:3)*22, cstatu*10, chpt*1
85  LOGICAL lwarn, lrepor, limset, lnolim, lnewmn, lphead
86  CHARACTER crdbuf*(*),cunit*10,cfname*64,cgname*64,canswr*1
87  CHARACTER cmode*16
88  LOGICAL lopen,lrewin,noname,lname,mnunpt
89  noname = .true.
90  ierr = 0
91  IF (index(crdbuf,'*EOF') .EQ. 1) GO TO 190
92  IF (index(crdbuf,'*eof') .EQ. 1) GO TO 190
93  lend = len(crdbuf)
94 C look for end of SET INPUT command
95  DO 20 ic= 8,lend
96  IF (crdbuf(ic:ic) .EQ. ' ') GO TO 25
97  IF (crdbuf(ic:ic) .EQ. ',') GO TO 53
98  20 CONTINUE
99  GO TO 200
100  25 CONTINUE
101 C look for end of separator between command and first argument
102  icol = ic+1
103  DO 50 ic= icol,lend
104  IF (crdbuf(ic:ic) .EQ. ' ') GO TO 50
105  IF (crdbuf(ic:ic) .EQ. ',') GO TO 53
106  GO TO 55
107  50 CONTINUE
108  GO TO 200
109  53 ic = ic + 1
110  55 ic1 = ic
111 C see if "REWIND" was requested in command
112  lrewin = .false.
113  IF (index(crdbuf(1:ic1),'REW') .GT. 5) lrewin=.true.
114  IF (index(crdbuf(1:ic1),'rew') .GT. 5) lrewin=.true.
115 C first argument begins in or after col IC1
116  DO 75 ic= ic1,lend
117  IF (crdbuf(ic:ic) .EQ. ' ') GO TO 75
118  IF (crdbuf(ic:ic) .EQ. ',') GO TO 200
119  GO TO 80
120  75 CONTINUE
121  GO TO 200
122  80 ic1 = ic
123 C first argument really begins in col IC1
124  DO 100 ic= ic1+1,lend
125  IF (crdbuf(ic:ic) .EQ. ' ') GO TO 108
126  IF (crdbuf(ic:ic) .EQ. ',') GO TO 108
127  100 CONTINUE
128  ic = lend + 1
129  108 ic2 = ic-1
130 C end of first argument is in col IC2
131  110 CONTINUE
132  cunit = crdbuf(ic1:ic2)
133  WRITE (isyswr,'(A,A)') ' UNIT NO. :',cunit
134  READ (cunit,'(BN,F10.0)',err=500) funit
135  iunit = funit
136  IF (iunit .EQ. 0) GO TO 200
137 C skip blanks and commas, find file name
138  DO 120 ic= ic2+1,lend
139  IF (crdbuf(ic:ic) .EQ. ' ') GO TO 120
140  IF (crdbuf(ic:ic) .EQ. ',') GO TO 120
141  GO TO 130
142  120 CONTINUE
143  GO TO 131
144  130 CONTINUE
145  cfname = crdbuf(ic:lend)
146  noname = .false.
147  WRITE (isyswr, '(A,A)') ' FILE NAME IS:',cfname
148 C ask if file exists, if not ask for name and open it
149  131 CONTINUE
150  INQUIRE(unit=iunit,opened=lopen,named=lname,name=cgname)
151  IF (lopen) THEN
152  IF (noname) THEN
153  GO TO 136
154  ELSE
155  IF (.NOT.lname) cgname='unknown'
156  WRITE (isyswr,132) iunit,cgname,cfname
157  132 FORMAT (' UNIT',i3,' ALREADY OPENED WITH NAME:',a/
158  + ' NEW NAME IGNORED:',a)
159  ENDIF
160  ELSE
161 C new file, open it
162  WRITE (isyswr,135) iunit
163  135 FORMAT (' UNIT',i3,' IS NOT OPENED.')
164  IF (noname) THEN
165  WRITE (isyswr,'(A)') ' NO FILE NAME GIVEN IN COMMAND.'
166  IF (isw(6) .LT. 1) GO TO 800
167  WRITE (isyswr,'(A)') ' PLEASE GIVE FILE NAME:'
168  READ (isysrd,'(A)') cfname
169  ENDIF
170  OPEN (unit=iunit,file=cfname,status='OLD',err=600)
171  WRITE (isyswr,'(A)') ' FILE OPENED SUCCESSFULLY.'
172  ENDIF
173 C . . file is correctly opened
174  136 IF (lrewin) GO TO 150
175  IF (isw(6) .LT. 1) GO TO 300
176  WRITE (isyswr,137) iunit
177  137 FORMAT (' SHOULD UNIT',i3,' BE REWOUND?' )
178  READ (isysrd,'(A)') canswr
179  IF (canswr.NE.'Y' .AND. canswr.NE.'y') GO TO 300
180  150 rewind iunit
181  GO TO 300
182 C *EOF
183  190 CONTINUE
184  IF (nstkrd .EQ. 0) THEN
185  ierr = 2
186  GO TO 900
187  ENDIF
188 C revert to previous input file
189  200 CONTINUE
190  IF (nstkrd .EQ. 0) THEN
191  WRITE (isyswr, '(A,A)') ' COMMAND IGNORED:',crdbuf
192  WRITE (isyswr, '(A)') ' ALREADY READING FROM PRIMARY INPUT'
193  ELSE
194  isysrd = istkrd(nstkrd)
195  nstkrd = nstkrd - 1
196  IF (nstkrd .EQ. 0) isw(6) = iabs(isw(6))
197  IF (isw(5) .GE. 0) THEN
198  INQUIRE(unit=isysrd,named=lname,name=cfname)
199  cmode = 'BATCH MODE '
200  IF (isw(6) .EQ. 1) cmode = 'INTERACTIVE MODE'
201  IF (.NOT.lname) cfname='unknown'
202  IF (mnunpt(cfname)) cfname='unprintable'
203  WRITE (isyswr,290) cmode,isysrd,cfname
204  290 FORMAT (' INPUT WILL NOW BE READ IN ',a,' FROM UNIT NO.',i3/
205  + ' FILENAME: ',a)
206  ENDIF
207  ENDIF
208  GO TO 900
209 C switch to new input file, add to stack
210  300 CONTINUE
211  IF (nstkrd .GE. maxstk) THEN
212  WRITE (isyswr, '(A)') ' INPUT FILE STACK SIZE EXCEEDED.'
213  GO TO 800
214  ENDIF
215  nstkrd = nstkrd + 1
216  istkrd(nstkrd) = isysrd
217  isysrd = iunit
218 C ISW(6) = 0 for batch, =1 for interactive, and
219 C =-1 for originally interactive temporarily batch
220  IF (isw(6) .EQ. 1) isw(6) = -1
221  GO TO 900
222 C format error
223  500 CONTINUE
224  WRITE (isyswr,'(A,A)') ' CANNOT READ FOLLOWING AS INTEGER:',cunit
225  GO TO 800
226  600 CONTINUE
227  WRITE (isyswr, 601) cfname
228  601 FORMAT (' SYSTEM IS UNABLE TO OPEN FILE:',a)
229 C serious error
230  800 CONTINUE
231  ierr = 3
232  900 CONTINUE
233  RETURN
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
nodes z
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data h g *is for param c g data up(2, 1)/7.0d0/
dE dx *! Nuc Int sampling table e
Definition: cblkMuInt.h:130
nodes i
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 mnunpt(CFNAME)
Definition: mnunpt.f:10
real(4), dimension(:), allocatable, save h
Definition: cNRLAtmos.f:28
! constants thru Cosmos real ! if multiplied to deg radian Torad ! light velocity m sec ! infinty ! kg m2 *Togpcm2 g cm2 ! g cm2 *Tokgpm2 kg m2 ! cm *Tom m ! m *Tocm cm ! g cm3 *Tokgpm3 kg m3 ! kg m3 *Togpcm3 g cm3 ! sec *Tonsec nsec ! Tesla m ! Avogadro *A2deninv ! mfp *n * xs
Definition: Zglobalc.h:18
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
struct ob o[NpMax]
Definition: Zprivate.h:34
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
Definition: ZlatfitBD.h:35
real(4), save a
Definition: cNRLAtmos.f:20
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
dE dx *! Nuc Int sampling table g
Definition: cblkMuInt.h:130
real(4), save b
Definition: cNRLAtmos.f:21
!onst int maxp
Definition: Zprivate.h:3
integer n
Definition: Zcinippxc.h:1
integer, parameter half
Definition: csoftenPiK.f:108
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
Definition: Zptcl.h:21
dE dx *! Nuc Int sampling table f
Definition: cblkMuInt.h:130
dE dx *! Nuc Int sampling table c
Definition: cblkMuInt.h:130
Here is the call graph for this function:
Here is the caller graph for this function: