1#if defined(_WIN32) && !defined(_WIN64)
2#define dec_directives_win32
13 Character(len=128):: Progname
14 Logical :: Nameread = .false.
15 Integer :: stacalls = 0
16 Integer :: solcalls = 0
32 read(*,
"(A)") progname
33 call flog(
"Starting to execute", 0 )
37 open(10,file=trim(progname) //
'.lst',status=
'Unknown')
38 open(11,file=trim(progname) //
'.sta',status=
'Unknown')
45 Subroutine flog( Msg, Code )
47 character(len=*),
Intent(IN) :: Msg
48 Integer,
Intent(IN) :: Code
50 open(15,file=trim(progname) //
'.rc',action=
'write',form=
'formatted',status=
'unknown')
51 write(15,
"(A,': ',A)") trim(progname), msg
71Integer Function std_status( MODSTA, SOLSTA, ITER, OBJVAL, USRMEM )
72#ifdef dec_directives_win32
80 INTEGER,
Intent(IN) :: modsta, solsta, iter
81 real*8,
Intent(IN) :: objval
82 real*8,
Intent(IN OUT) :: usrmem(*)
85 WRITE(*,*)
'CONOPT has finished optimizing.'
86 WRITE(*,*)
'Model status =',modsta
87 WRITE(*,*)
'Solver status =',solsta
88 WRITE(*,*)
'Iteration count=',iter
89 WRITE(*,*)
'Objective value=',objval
92 WRITE(10,*)
'CONOPT has finished optimizing.'
93 WRITE(10,*)
'Model status =',modsta
94 WRITE(10,*)
'Solver status =',solsta
95 WRITE(10,*)
'Iteration count=',iter
96 WRITE(10,*)
'Objective value=',objval
99 WRITE(11,*)
'Model status =',modsta
100 WRITE(11,*)
'Solver status =',solsta
101 WRITE(11,*)
'Objective value=',objval
105 stacalls = stacalls + 1
115Integer Function std_solution( XVAL, XMAR, XBAS, XSTA, YVAL, YMAR, YBAS, YSTA, N, M, USRMEM )
116#ifdef dec_directives_win32
125 INTEGER,
Intent(IN) :: n, m
126 INTEGER,
Intent(IN),
Dimension(N) :: xbas, xsta
127 INTEGER,
Intent(IN),
Dimension(M) :: ybas, ysta
128 real*8,
Intent(IN),
Dimension(N) :: xval, xmar
129 real*8,
Intent(IN),
Dimension(M) :: yval, ymar
130 real*8,
Intent(IN OUT) :: usrmem(*)
133 CHARACTER*5,
Parameter,
Dimension(4) :: basc = (/
'Lower',
'Upper',
'Basic',
'Super' /)
134 CHARACTER*6,
Parameter,
Dimension(4) :: stat = (/
'Normal',
'NonOpt',
'Infeas',
'Unbnd ' /)
136 WRITE(10,
"(/' Variable Solution value Reduced cost Var-Basc Var-stat')")
138 WRITE(10,
"(1P,I7,E20.6,E16.6,4X,A5,7X,A6 )") i, xval(i), xmar(i), basc(1+xbas(i)), stat(1+xsta(i))
141 WRITE(10,
"(/' Constrnt Activity level Marginal cost Con-Basc Con-stat')")
143 WRITE(10,
"(1P,I7,E20.6,E16.6,4X,A5,7X,A6 )") i, yval(i), ymar(i), basc(1+ybas(i)), stat(1+ysta(i))
147 solcalls = solcalls + 1
152Integer Function std_message( SMSG, DMSG, NMSG, LLEN, USRMEM, MSGV )
153#ifdef dec_directives_win32
164 INTEGER,
Intent(IN) :: smsg, dmsg, nmsg
165 INTEGER,
Intent(IN) ,
Dimension(*) :: llen
166 CHARACTER(len=133),
Intent(IN),
Dimension(*) :: msgv
167 real*8,
Intent(IN OUT) :: usrmem(*)
174 write(*,
"(A)") msgv(i)(1:llen(i))
180 write(11,
"(A)") msgv(i)(1:llen(i))
186 write(10,
"(A)") msgv(i)(1:llen(i))
195Integer Function std_errmsg( ROWNO, COLNO, POSNO, MSGLEN, USRMEM, MSG )
196#ifdef dec_directives_win32
208 INTEGER,
Intent(IN) :: rowno, colno, posno, msglen
209 CHARACTER(Len=*),
Intent(IN) :: msg
210 real*8,
Intent(IN OUT) :: usrmem(*)
216 IF ( rowno .EQ. 0 )
THEN
217 WRITE(10,1001) colno, msg(1:msglen)
218 WRITE(11,1001) colno, msg(1:msglen)
219 ELSEIF ( colno .EQ. 0 )
THEN
220 WRITE(10,1002) rowno, msg(1:msglen)
221 WRITE(11,1002) rowno, msg(1:msglen)
223 WRITE(10,1000) colno, rowno, msg(1:msglen)
224 WRITE(11,1000) colno, rowno, msg(1:msglen)
2281001
FORMAT(
'Variable',i8,
' : ',a)
2291002
FORMAT(
'Equation',i8,
' : ',a)
2301000
FORMAT(
'Variable',i8,
' appearing in Equation',i8,
' : ',a)
236Integer Function std_triord( Mode, Type, Status, Irow, Icol, Inf, Value, Resid, Usrmem )
237#ifdef dec_directives_win32
244 INTEGER,
INTENT(IN) :: mode,
Type, status, irow, icol, inf
245 real*8,
INTENT(IN) ::
VALUE, resid
246 real*8,
Intent(IN OUT) :: usrmem(*)
248 Integer,
Parameter :: pretriangular = 1, &
266 pretriainfeasb = 11, &
268 pretriainfeasp = 12, &
270 forcinginfeas = 13, &
275 If ( mode == -1 )
THEN
276 write(10,
"(/'The preprocessing transformation are described below in detection order:'/)")
277 Else if ( mode == -2 )
Then
278 write(10,
"(//'The order of the critical transformations is:'/)")
283 WRITE(10,
"('Equation',i7,' solved with respect to variable',i7,'. Value=',1p,e18.10)") irow, icol,
value
284 Elseif ( inf == 1 )
Then
285 WRITE(10,
"('Equation',i7,' solved with respect to variable',i7,'. Value=',9x,'+Infinity')") irow, icol
287 WRITE(10,
"('Equation',i7,' solved with respect to variable',i7,'. Value=',9x,'-Infinity')") irow, icol
290 WRITE(10,
"('Variable',i7,' fixed at value=',1p,e18.10)") icol,
value
292 WRITE(10,
"('Equation',i7,' is dependent (all variables are fixed.)')") irow
294 WRITE(10,
"('Equation',i7,' is redundant (will later be solved with respect to the slack.)')") irow
296 WRITE(10,
"('Equation',i7,' turned into lower bound on variable',i7,'. Bound=',1p,e18.10)") irow, icol,
value
298 WRITE(10,
"('Equation',i7,' turned into upper bound on variable',i7,'. Bound=',1p,e18.10)") irow, icol,
value
300 WRITE(10,
"('Variable',i7,' forced to lower bound=',1p,e18.10)") icol,
value
302 WRITE(10,
"('Variable',i7,' forced to upper bound=',1p,e18.10)") icol,
value
304 WRITE(10,
"('Previous variables were forced by equation',i7,' binding as a less than or equal constraint.')") irow
306 WRITE(10,
"('Previous variables were forced by equation',i7,' binding as a greater than or equal constraint.')") irow
307 Case (pretriainfeasb)
308 WRITE(10,
"('Equation',i7,' cannot be solved with respect to variable',i7,' due to bounds. Value=',1p,e18.10)") &
310 Case (pretriainfeasp)
312 "('Equation',i7,' cannot be solved with respect to variable',i7,'. Infeasibility has local minimum at',1p,e18.10)") &
315 WRITE(10,
"('Equation',i7,' is still infeasible after the above variables have been moved to the best bounds.')") irow
316 Case (inconsistentrow)
317 WRITE(10,
"('Equation',i7,' cannot be solved. No free variables left.')") irow
319 WRITE(10,
"('Pretriangular action=',i7,' not implemented yet.')")
type
322 If ( resid /= 0.d0 )
write(10,
"('Residual after last transformation=',1p,e18.10)") resid
integer function std_solution(xval, xmar, xbas, xsta, yval, ymar, ybas, ysta, n, m, usrmem)
integer function std_status(modsta, solsta, iter, objval, usrmem)
integer function std_message(smsg, dmsg, nmsg, llen, usrmem, msgv)
integer function std_triord(mode, type, status, irow, icol, inf, value, resid, usrmem)
integer function std_errmsg(rowno, colno, posno, msglen, usrmem, msg)
subroutine flog(msg, code)