source: Sophya/trunk/SophyaExt/CodeMinuit/code/mncomd.F

Last change on this file was 2403, checked in by cmv, 22 years ago

Creation du module de code source de MINUIT (CERNLIB) extrait par CMV

cmv 11/06/2003

File size: 3.2 KB
RevLine 
[2403]1*
2* $Id: mncomd.F,v 1.1.1.1 2003-06-11 14:18:26 cmv Exp $
3*
4* $Log: not supported by cvs2svn $
5* Revision 1.1.1.1 1996/03/07 14:31:29 mclareni
6* Minuit
7*
8*
9#include "minuit/pilot.h"
10 SUBROUTINE MNCOMD(FCN,CRDBIN,ICONDN,FUTIL)
11#include "minuit/d506dp.inc"
12CC Called by user. 'Reads' a command string and executes.
13CC Equivalent to MNEXCM except that the command is given as a
14CC character string.
15CC
16CC ICONDN = 0: command executed normally
17CC 1: command is blank, ignored
18CC 2: command line unreadable, ignored
19CC 3: unknown command, ignored
20CC 4: abnormal termination (e.g., MIGRAD not converged)
21CC 5: command is a request to read PARAMETER definitions
22CC 6: 'SET INPUT' command
23CC 7: 'SET TITLE' command
24CC 8: 'SET COVAR' command
25CC 9: reserved
26CC 10: END command
27CC 11: EXIT or STOP command
28CC 12: RETURN command
29CC
30#include "minuit/d506cm.inc"
31 DIMENSION PLIST(MAXP)
32 CHARACTER COMAND*(MAXCWD)
33 CHARACTER CLOWER*26, CUPPER*26
34 LOGICAL LEADER
35C
36 EXTERNAL FCN,FUTIL
37 CHARACTER*(*) CRDBIN
38 CHARACTER*100 CRDBUF
39 DATA CLOWER/'abcdefghijklmnopqrstuvwxyz'/
40 DATA CUPPER/'ABCDEFGHIJKLMNOPQRSTUVWXYZ'/
41C
42 LENBUF = LEN(CRDBIN)
43 CRDBUF = CRDBIN
44 ICONDN = 0
45C record not case-sensitive, get upper case, strip leading blanks
46 LEADER = .TRUE.
47 IPOS = 1
48 DO 110 I= 1, MIN(MAXCWD,LENBUF)
49 IF (CRDBUF(I:I) .EQ. '''') GO TO 111
50 IF (CRDBUF(I:I) .EQ. ' ') THEN
51 IF (LEADER) IPOS = IPOS + 1
52 GO TO 110
53 ENDIF
54 LEADER = .FALSE.
55 DO 108 IC= 1, 26
56 IF (CRDBUF(I:I) .EQ. CLOWER(IC:IC)) CRDBUF(I:I)=CUPPER(IC:IC)
57 108 CONTINUE
58 110 CONTINUE
59 111 CONTINUE
60C blank or null command
61 IF (IPOS .GT. LENBUF) THEN
62 WRITE (ISYSWR,'(A)') ' BLANK COMMAND IGNORED.'
63 ICONDN = 1
64 GO TO 900
65 ENDIF
66C . . preemptive commands
67C if command is 'PARAMETER'
68 IF (CRDBUF(IPOS:IPOS+2) .EQ. 'PAR') THEN
69 ICONDN = 5
70 LPHEAD = .TRUE.
71 GO TO 900
72 ENDIF
73C if command is 'SET INPUT'
74 IF (CRDBUF(IPOS:IPOS+6) .EQ. 'SET INP') THEN
75 ICONDN = 6
76 LPHEAD = .TRUE.
77 GO TO 900
78 ENDIF
79C if command is 'SET TITLE'
80 IF (CRDBUF(IPOS:IPOS+6) .EQ. 'SET TIT') THEN
81 ICONDN = 7
82 LPHEAD = .TRUE.
83 GO TO 900
84 ENDIF
85C if command is 'SET COVARIANCE'
86 IF (CRDBUF(IPOS:IPOS+6) .EQ. 'SET COV') THEN
87 ICONDN = 8
88 LPHEAD = .TRUE.
89 GO TO 900
90 ENDIF
91C crack the command . . . . . . . . . . . . . . . .
92 CALL MNCRCK(CRDBUF(IPOS:LENBUF),MAXCWD,COMAND,LNC,
93 + MAXP, PLIST, LLIST, IERR,ISYSWR)
94 IF (IERR .GT. 0) THEN
95 WRITE (ISYSWR,'(A)') ' COMMAND CANNOT BE INTERPRETED'
96 ICONDN = 2
97 GO TO 900
98 ENDIF
99C
100 CALL MNEXCM(FCN,COMAND(1:LNC),PLIST,LLIST,IERR,FUTIL)
101 ICONDN = IERR
102 900 RETURN
103 END
Note: See TracBrowser for help on using the repository browser.