COSMOS v7.655  COSMOSv7655
(AirShowerMC)
mncrck.f
Go to the documentation of this file.
1 *
2 * $Id: mncrck.F,v 1.1.1.1 1996/03/07 14:31:29 mclareni Exp $
3 *
4 * $Log: mncrck.F,v $
5 * Revision 1.1.1.1 1996/03/07 14:31:29 mclareni
6 * Minuit
7 *
8 *
9  SUBROUTINE mncrck(CRDBUF,MAXCWD,COMAND,LNC,
10  + MXP, PLIST, LLIST,IERR,ISYSWR)
11 *
12 * $Id: d506dp.inc,v 1.1.1.1 1996/03/07 14:31:32 mclareni Exp $
13 *
14 * $Log: d506dp.inc,v $
15 * Revision 1.1.1.1 1996/03/07 14:31:32 mclareni
16 * Minuit
17 *
18 *
19 *
20 *
21 * d506dp.inc
22 *
23 C ************ DOUBLE PRECISION VERSION *************
24  IMPLICIT DOUBLE PRECISION (a-h,o-z)
25 CC
26 CC Called from MNREAD.
27 CC Cracks the free-format input, expecting zero or more
28 CC alphanumeric fields (which it joins into COMAND(1:LNC))
29 CC followed by one or more numeric fields separated by
30 CC blanks and/or one comma. The numeric fields are put into
31 CC the LLIST (but at most MXP) elements of PLIST.
32 CC IERR = 0 if no errors,
33 CC = 1 if error(s).
34 CC Diagnostic messages are written to ISYSWR
35 CC
36  parameter(maxelm=25, mxlnel=19)
37  CHARACTER*(*) COMAND, CRDBUF
38  CHARACTER CNUMER*13, CELMNT(maxelm)*(mxlnel), CNULL*15
39  dimension lelmnt(maxelm),plist(mxp)
40  DATA cnull /')NULL STRING '/
41  DATA cnumer/'123456789-.0+'/
42  ielmnt = 0
43  lend = len(crdbuf)
44  nextb = 1
45  ierr = 0
46 C . . . . loop over words CELMNT
47  10 CONTINUE
48  DO 100 ipos= nextb,lend
49  ibegin = ipos
50  IF (crdbuf(ipos:ipos).EQ.' ') GO TO 100
51  IF (crdbuf(ipos:ipos).EQ.',') GO TO 250
52  GO TO 150
53  100 CONTINUE
54  GO TO 300
55  150 CONTINUE
56 C found beginning of word, look for end
57  DO 180 ipos = ibegin+1,lend
58  IF (crdbuf(ipos:ipos).EQ.' ') GO TO 250
59  IF (crdbuf(ipos:ipos).EQ.',') GO TO 250
60  180 CONTINUE
61  ipos = lend+1
62  250 iend = ipos-1
63  ielmnt = ielmnt + 1
64  IF (iend .GE. ibegin) THEN
65  celmnt(ielmnt) = crdbuf(ibegin:iend)
66  ELSE
67  celmnt(ielmnt) = cnull
68  ENDIF
69  lelmnt(ielmnt) = iend-ibegin+1
70  IF (lelmnt(ielmnt) .GT. mxlnel) THEN
71  WRITE (isyswr, 253) crdbuf(ibegin:iend),celmnt(ielmnt)
72  253 FORMAT (' MINUIT WARNING: INPUT DATA WORD TOO LONG.'
73  + /' ORIGINAL:',a
74  + /' TRUNCATED TO:',a)
75  lelmnt(ielmnt) = mxlnel
76  ENDIF
77  IF (ipos .GE. lend) GO TO 300
78  IF (ielmnt .GE. maxelm) GO TO 300
79 C look for comma or beginning of next word
80  DO 280 ipos= iend+1,lend
81  IF (crdbuf(ipos:ipos) .EQ. ' ') GO TO 280
82  nextb = ipos
83  IF (crdbuf(ipos:ipos) .EQ. ',') nextb = ipos+1
84  GO TO 10
85  280 CONTINUE
86 C All elements found, join the alphabetic ones to
87 C form a command
88  300 CONTINUE
89  nelmnt = ielmnt
90  comand = ' '
91  lnc = 1
92  plist(1) = 0.
93  llist = 0
94  IF (ielmnt .EQ. 0) GO TO 900
95  kcmnd = 0
96  DO 400 ielmnt = 1, nelmnt
97  IF (celmnt(ielmnt) .EQ. cnull) GO TO 450
98  DO 350 ic= 1, 13
99  IF (celmnt(ielmnt)(1:1) .EQ. cnumer(ic:ic)) GO TO 450
100  350 CONTINUE
101  IF (kcmnd .GE. maxcwd) GO TO 400
102  left = maxcwd-kcmnd
103  ltoadd = lelmnt(ielmnt)
104  IF (ltoadd .GT. left) ltoadd=left
105  comand(kcmnd+1:kcmnd+ltoadd) = celmnt(ielmnt)(1:ltoadd)
106  kcmnd = kcmnd + ltoadd
107  IF (kcmnd .EQ. maxcwd) GO TO 400
108  kcmnd = kcmnd + 1
109  comand(kcmnd:kcmnd) = ' '
110  400 CONTINUE
111  lnc = kcmnd
112  GO TO 900
113  450 CONTINUE
114  lnc = kcmnd
115 C . . . . we have come to a numeric field
116  llist = 0
117  DO 600 ifld= ielmnt,nelmnt
118  llist = llist + 1
119  IF (llist .GT. mxp) THEN
120  nreq = nelmnt-ielmnt+1
121  WRITE (isyswr,511) nreq,mxp
122  511 FORMAT (/' MINUIT WARNING IN MNCRCK: '/ ' COMMAND HAS INPUT',i5,
123  + ' NUMERIC FIELDS, BUT MINUIT CAN ACCEPT ONLY',i3)
124  GO TO 900
125  ENDIF
126  IF (celmnt(ifld) .EQ. cnull) THEN
127  plist(llist) = 0.
128  ELSE
129  READ (celmnt(ifld), '(BN,F19.0)',err=575) plist(llist)
130  ENDIF
131  GO TO 600
132  575 WRITE (isyswr,'(A,A,A)') ' FORMAT ERROR IN NUMERIC FIELD: "',
133  + celmnt(ifld)(1:lelmnt(ifld)),'"'
134  ierr = 1
135  plist(llist) = 0.
136  600 CONTINUE
137 C end loop over numeric fields
138  900 CONTINUE
139  IF (lnc .LE. 0) lnc=1
140  RETURN
141  END
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
nodes z
subroutine mncrck(CRDBUF, MAXCWD, COMAND, LNC, MXP, PLIST, LLIST, IERR, ISYSWR)
Definition: mncrck.f:11
struct ob o[NpMax]
Definition: Zprivate.h:34
nodes a
dE dx *! Nuc Int sampling table h
Definition: cblkMuInt.h:130