CONOPT
Loading...
Searching...
No Matches
pindyck.f90
Go to the documentation of this file.
1!> @file pindyck.f90
2!! @ingroup FORT1THREAD_EXAMPLES
3!!
4!!
5!! This is a CONOPT implementation of the Pindyck model from the
6!! GAMS model library. The GAMS model follows as documentation:
7!!
8!! @verbatim
9!! $Ontext
10!!
11!! This model finds the optimal pricing and extraction of oil for
12!! the opec cartel.
13!!
14!! Reference: Pindyck R S, Gains to Producers from the
15!! Cartelization of Exhaustible Resources, Review of
16!! Economics and Statistics, Volume 60, pp 238-251, 1978.
17!!
18!! $Offtext
19!!
20!! Sets t overall time horizon / 1974*1990 /
21!! to(t) optimization period / 1975*1990 /
22!!
23!! Parameter demand(t) equilibrium world demand for fixed prices;
24!! demand(to) = 1. + 2.3*1.015**(ord(to)-1);
25!!
26!! Variables p(t) world price of oil
27!! td(t) total demand for oil
28!! s(t) supply of oil by non-opec contries
29!! cs(t) cummulative supply by non-opec contries
30!! d(t) demand for opec-oil
31!! r(t) opec reserves
32!! rev(t) revenues in each period
33!! profit
34!!
35!! Positive Variables p,td,s,cs,d,r
36!!
37!! Equations tdeq(t) total demand equation
38!! seq(t) supply equation for non-opec contries
39!! cseq(t) accounting equation for cummulative supply
40!! deq(t) demand equation for opec
41!! req(t) accounting equation for opec reserves
42!! drev(t) yearly objective function value
43!! tprofit total objective function;
44!!
45!! $Double
46!!
47!! tdeq(t-1).. td(t) =e= 0.87*td(t-1) - 0.13*p(t) + demand(t);
48!! seq(t-1).. s(t) =e= 0.75*s(t-1) + (1.1+0.1*p(t))*1.02**(-cs(t)/7);
49!! cseq(t-1).. cs(t) =e= cs(t-1) + s(t);
50!! deq(to).. d(to) =e= td(to) - s(to);
51!! req(t-1).. r(t) =e= r(t-1) - d(t);
52!! drev(to).. rev(to) =e= d(to)*(p(to)-250/r(to));
53!! tprofit.. profit =e= sum(to,rev(to)*1.05**(1-ord(to)));
54!!
55!! $Single
56!!
57!! *
58!! * fixed initial conditions
59!! *
60!! td.fx('1974') = 18; s.fx ('1974') = 6.5;
61!! r.fx ('1974') = 500; cs.fx('1974') = 0.0;
62!!
63!! td.l(to) = 18; s.l(to)= 7; cs.l(to) = 7*ord(to);
64!! d.l (to) = td.l(to)-s.l(to); p.l(to) = 14;
65!!
66!! Loop(t$to(t), r.l(t) = r.l(t-1)-d.l(t) );
67!!
68!! Display td.l, s.l, cs.l, d.l, r.l;
69!!
70!! Model robert / all /; Solve robert maximizing profit using nlp;
71!! @endverbatim
72!!
73!!
74!!
75!! For more information about the individual callbacks, please have a look at the source code.
76
77#if defined(_WIN32) && !defined(_WIN64)
78#define dec_directives_win32
79#endif
80
81!> Main program. A simple setup and call of CONOPT
82!!
83Program pindyck
84 Use proginfo
86 Use data_t
87 Implicit none
88!
89! Declare the user callback routines as Integer, External:
90!
91 Integer, External :: pin_readmatrix ! Mandatory Matrix definition routine defined below
92 Integer, External :: pin_fdeval ! Function and Derivative evaluation routine
93 ! needed a nonlinear model.
94 Integer, External :: std_status ! Standard callback for displaying solution status
95 Integer, External :: pin_solution ! Specialized callback for displaying solution values
96 Integer, External :: std_message ! Standard callback for managing messages
97 Integer, External :: std_errmsg ! Standard callback for managing error messages
98#ifdef dec_directives_win32
99!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_ReadMatrix
100!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_FDEval
101!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_Status
102!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_Solution
103!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_Message
104!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Std_ErrMsg
105#endif
106!
107! Control vector
108!
109 INTEGER, Dimension(:), Pointer :: cntvect
110 INTEGER :: coi_error
111!
112! Other variables
113!
114 INTEGER :: major, minor, patch
115
116 call startup
117!
118! Create and initialize a Control Vector
119!
120 coi_error = coi_create( cntvect )
121
122! Write which version of CONOPT we are using.
123
124 call coiget_version( major, minor, patch )
125 write(*,"('Solving Pindyck Model using CONOPT version ',i2,'.',i2,'.',i2)") major, minor, patch
126!
127! Define the number of time periods, T.
128!
129 t = 16
130!
131! Tell CONOPT about the size of the model by populating the Control Vector:
132!
133! Number of variables (excl. slacks): 7 per period
134!
135 coi_error = max( coi_error, coidef_numvar( cntvect, 7 * t ) )
136!
137! Number of equations: 1 objective + 6 per period
138!
139 coi_error = max( coi_error, coidef_numcon( cntvect, 1 + 6 * t ) )
140!
141! Number of nonzeros in the Jacobian. See the counting in ReadMatrix below:
142! For each period there is 1 in the objective, 16 for unlagged
143! variables and 4 for lagged variables.
144!
145 coi_error = max( coi_error, coidef_numnz( cntvect, 17 * t + 4 * (t-1) ) )
146!
147! Number of nonlinear nonzeros. 5 unlagged for each period.
148!
149 coi_error = max( coi_error, coidef_numnlnz( cntvect, 5 * t ) )
150!
151! Direction: +1 = maximization.
152!
153 coi_error = max( coi_error, coidef_optdir( cntvect, 1 ) )
154!
155! Objective: Constraint no 1
156!
157 coi_error = max( coi_error, coidef_objcon( cntvect, 1 ) )
158!
159! Define an options file
160!
161 coi_error = max( coi_error, coidef_optfile( cntvect, 'pindyck.opt' ) )
162!
163! Tell CONOPT about the callback routines:
164!
165 coi_error = max( coi_error, coidef_readmatrix( cntvect, pin_readmatrix ) )
166 coi_error = max( coi_error, coidef_fdeval( cntvect, pin_fdeval ) )
167 coi_error = max( coi_error, coidef_status( cntvect, std_status ) )
168 coi_error = max( coi_error, coidef_solution( cntvect, pin_solution ) )
169 coi_error = max( coi_error, coidef_message( cntvect, std_message ) )
170 coi_error = max( coi_error, coidef_errmsg( cntvect, std_errmsg ) )
171
172#if defined(CONOPT_LICENSE_INT_1) && defined(CONOPT_LICENSE_INT_2) && defined(CONOPT_LICENSE_INT_3) && defined(CONOPT_LICENSE_TEXT)
173 coi_error = max( coi_error, coidef_license( cntvect, conopt_license_int_1, conopt_license_int_2, conopt_license_int_3, conopt_license_text) )
174#endif
175
176 If ( coi_error .ne. 0 ) THEN
177 write(*,*)
178 write(*,*) '**** Fatal Error while loading CONOPT Callback routines.'
179 write(*,*)
180 call flog( "Skipping Solve due to setup errors", 1 )
181 ENDIF
182!
183! Save the solution so we can check the duals:
184!
185 do_allocate = .true.
186!
187! Start CONOPT:
188!
189 coi_error = coi_solve( cntvect )
190
191 write(*,*)
192 write(*,*) 'End of Pindyck Model. Return code=',coi_error
193
194 If ( coi_error /= 0 ) then
195 call flog( "Errors encountered during solution", 1 )
196 elseif ( stacalls == 0 .or. solcalls == 0 ) then
197 call flog( "Status or Solution routine was not called", 1 )
198 elseif ( sstat /= 1 .or. mstat /= 2 ) then
199 call flog( "Solver and Model Status was not as expected (1,2)", 1 )
200 elseif ( abs( obj-1170.4863d0 ) > 0.0001d0 ) then
201 call flog( "Incorrect objective returned", 1 )
202 Else
203 Call checkdual( 'Pindyck', maximize )
204 endif
205
206 if ( coi_free(cntvect) /= 0 ) call flog( "Error while freeing control vector",1)
207
208 call flog( "Successful Solve", 0 )
209!
210! Free solution memory
211!
212 call finalize
213
214end Program pindyck
215!
216! =====================================================================
217! Define information about the model structure
218!
219
220!> Define information about the model
221!!
222!! @include{doc} readMatrix_params.dox
223Integer Function pin_readmatrix( lower, curr, upper, vsta, type, rhs, esta, &
224 colsta, rowno, value, nlflag, n, m, nz, usrmem )
225#ifdef dec_directives_win32
226!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_ReadMatrix
227#endif
228 Use data_t
229 implicit none
230 integer, intent (in) :: n ! number of variables
231 integer, intent (in) :: m ! number of constraints
232 integer, intent (in) :: nz ! number of nonzeros
233 real*8, intent (in out), dimension(n) :: lower ! vector of lower bounds
234 real*8, intent (in out), dimension(n) :: curr ! vector of initial values
235 real*8, intent (in out), dimension(n) :: upper ! vector of upper bounds
236 integer, intent (in out), dimension(n) :: vsta ! vector of initial variable status
237 ! (not defined here)
238 integer, intent (out), dimension(m) :: type ! vector of equation types
239 integer, intent (in out), dimension(m) :: esta ! vector of initial equation status
240 ! (not defined here)
241 real*8, intent (in out), dimension(m) :: rhs ! vector of right hand sides
242 integer, intent (in out), dimension(n+1) :: colsta ! vector with start of column indices
243 integer, intent (out), dimension(nz) :: rowno ! vector of row numbers
244 integer, intent (in out), dimension(nz) :: nlflag ! vector of nonlinearity flags
245 real*8, intent (in out), dimension(nz) :: value ! vector of matrix values
246 real*8 usrmem(*) ! optional user memory
247
248 Integer :: it, is, i, icol, iz
249!
250! Define the information for the columns.
251!
252! We should not supply status information, vsta.
253!
254! We order the variables as follows:
255! td, cs, s, d, r, p, and rev. All variables for period 1 appears
256! first followed by all variables for period 2 etc.
257!
258! td, cs, s, and d have lower bounds of 0, r and p have lower
259! bounds of 1, and rev has no lower bound.
260! All have infinite upper bounds (default).
261! The initial value of td is 18, s is 7, cs is 7*t, d is td-s,
262! p is 14, and r is r(t-1)-d. No initial value for rev.
263!
264 do it = 1, t
265 is = 7*(it-1)
266 lower(is+1) = 0.d0
267 lower(is+2) = 0.d0
268 lower(is+3) = 0.d0
269 lower(is+4) = 0.d0
270 lower(is+5) = 1.d0
271 lower(is+6) = 1.d0
272 curr(is+1) = 18.d0
273 curr(is+2) = 7.d0*it
274 curr(is+3) = 7.d0
275 curr(is+4) = curr(is+1) - curr(is+3)
276 if ( it .gt. 1 ) then
277 curr(is+5) = curr(is+5-7) - curr(is+4)
278 else
279 curr(is+5) = 500.d0 - curr(is+4)
280 endif
281 curr(is+6) = 14.d0
282 enddo
283!
284! Define the information for the rows
285!
286! We order the constraints as follows: The objective is first,
287! followed by tddef, sdef, csdef, ddef, rdef, and revdef for
288! the first period, the same for the second period, etc.
289!
290! The objective is a nonbinding constraint:
291!
292 type(1) = 3
293!
294! All others are equalities:
295!
296 do i = 2, m
297 type(i) = 0
298 enddo
299!
300! Right hand sides: In all periods except the first, only tddef
301! has a nonzero right hand side of 1+2.3*1.015**(t-1).
302! In the initial period there are contributions from lagged
303! variables in the constraints that have lagged variables.
304!
305 do it = 1, t
306 is = 1 + 6*(it-1)
307 rhs(is+1) = 1.d0+2.3d0*1.015d0**(it-1)
308 enddo
309!
310! tddef: + 0.87*td(0)
311!
312 rhs(2) = rhs(2) + 0.87d0*18.d0
313!
314! sdef: +0.75*s(0)
315!
316 rhs(3) = 0.75d0*6.5d0
317!
318! csdef: +1*cs(0)
319!
320 rhs(4) = 0.d0
321!
322! rdef: +1*r(0)
323!
324 rhs(6) = 500.d0
325!
326! Define the structure and content of the Jacobian:
327! To help define the Jacobian pattern and values it can be useful to
328! make a picture of the Jacobian. We describe the variables for one
329! period and the constraints they are part of:
330!
331! td cs s d r p rev
332! Obj (1+r)**(1-t)
333! Period t:
334! tddef 1.0 0.13
335! sdef NL 1.0 NL
336! csdef 1.0 -1.0
337! ddef -1.0 1.0 1.0
338! rdef 1.0 1.0
339! revdef NL NL NL 1.0
340! Period t+1:
341! tddef -0.87
342! sdef -0.75
343! csdef -1.0
344! ddef
345! rdef -1.0
346! revdef
347!
348! The Jacobian has to be sorted column-wise so we will just define
349! the elements column by column according to the table above:
350!
351 iz = 1
352 icol = 1
353 do it = 1, t
354!
355! is points to the position before the first equation for the period
356!
357 is = 1 + 6*(it-1)
358!
359! Column td:
360!
361 colsta(icol) = iz
362 icol = icol + 1
363 rowno(iz) = is+1
364 value(iz) = +1.d0
365 nlflag(iz) = 0
366 iz = iz + 1
367 rowno(iz) = is+4
368 value(iz) = -1.d0
369 nlflag(iz) = 0
370 iz = iz + 1
371 if ( it .lt. t ) then
372 rowno(iz) = is+7
373 value(iz) = -0.87d0
374 nlflag(iz) = 0
375 iz = iz + 1
376 endif
377!
378! Column cs
379!
380 colsta(icol) = iz
381 icol = icol + 1
382 rowno(iz) = is+2
383 nlflag(iz) = 1
384 iz = iz + 1
385 rowno(iz) = is+3
386 value(iz) = +1.d0
387 nlflag(iz) = 0
388 iz = iz + 1
389 if ( it .lt. t ) then
390 rowno(iz) = is+9
391 value(iz) = -1.d0
392 nlflag(iz) = 0
393 iz = iz + 1
394 endif
395!
396! Column s
397!
398 colsta(icol) = iz
399 icol = icol + 1
400 rowno(iz) = is+2
401 value(iz) = +1.d0
402 nlflag(iz) = 0
403 iz = iz + 1
404 rowno(iz) = is+3
405 value(iz) = -1.d0
406 nlflag(iz) = 0
407 iz = iz + 1
408 rowno(iz) = is+4
409 value(iz) = +1.d0
410 nlflag(iz) = 0
411 iz = iz + 1
412 if ( it .lt. t ) then
413 rowno(iz) = is+8
414 value(iz) = -0.75d0
415 nlflag(iz) = 0
416 iz = iz + 1
417 endif
418!
419! Column d:
420!
421 colsta(icol) = iz
422 icol = icol + 1
423 rowno(iz) = is+4
424 value(iz) = +1.d0
425 nlflag(iz) = 0
426 iz = iz + 1
427 rowno(iz) = is+5
428 value(iz) = +1.d0
429 nlflag(iz) = 0
430 iz = iz + 1
431 rowno(iz) = is+6
432 nlflag(iz) = 1
433 iz = iz + 1
434!
435! Column r:
436!
437 colsta(icol) = iz
438 icol = icol + 1
439 rowno(iz) = is+5
440 value(iz) = +1.d0
441 nlflag(iz) = 0
442 iz = iz + 1
443 rowno(iz) = is+6
444 nlflag(iz) = 1
445 iz = iz + 1
446 if ( it .lt. t ) then
447 rowno(iz) = is+11
448 value(iz) = -1.d0
449 nlflag(iz) = 0
450 iz = iz + 1
451 endif
452!
453! Column p:
454!
455 colsta(icol) = iz
456 icol = icol + 1
457 rowno(iz) = is+1
458 value(iz) = +0.13d0
459 nlflag(iz) = 0
460 iz = iz + 1
461 rowno(iz) = is+2
462 nlflag(iz) = 1
463 iz = iz + 1
464 rowno(iz) = is+6
465 nlflag(iz) = 1
466 iz = iz + 1
467!
468! Column rev:
469!
470 colsta(icol) = iz
471 icol = icol + 1
472 rowno(iz) = +1
473 value(iz) = 1.05d0**(1-it)
474 nlflag(iz) = 0
475 iz = iz + 1
476 rowno(iz) = is+6
477 value(iz) = 1.d0
478 nlflag(iz) = 0
479 iz = iz + 1
480 enddo
481 colsta(icol) = iz
484
485end Function pin_readmatrix
486!
487! =====================================================================
488! Compute nonlinear terms and non-constant Jacobian elements
489!
490
491!> Compute nonlinear terms and non-constant Jacobian elements
492!!
493!! @include{doc} fdeval_params.dox
494Integer Function pin_fdeval( x, g, jac, rowno, jcnm, mode, ignerr, errcnt, &
495 n, nz, thread, usrmem )
496#ifdef dec_directives_win32
497!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_FDEval
498#endif
499 Use data_t
500 implicit none
501 integer, intent (in) :: n ! number of variables
502 integer, intent (in) :: rowno ! number of the row to be evaluated
503 integer, intent (in) :: nz ! number of nonzeros in this row
504 real*8, intent (in), dimension(n) :: x ! vector of current solution values
505 real*8, intent (in out) :: g ! constraint value
506 real*8, intent (in out), dimension(n) :: jac ! vector of derivatives for current constraint
507 integer, intent (in), dimension(nz) :: jcnm ! list of variables that appear nonlinearly
508 ! in this row. Ffor information only.
509 integer, intent (in) :: mode ! evaluation mode: 1 = function value
510 ! 2 = derivatives, 3 = both
511 integer, intent (in) :: ignerr ! if 1 then errors can be ignored as long
512 ! as errcnt is incremented
513 integer, intent (in out) :: errcnt ! error counter to be incremented in case
514 ! of function evaluation errors.
515 integer, intent (in) :: thread
516 real*8 usrmem(*) ! optional user memory
517
518 integer it, is
519 real*8 h1, h2
520!
521! Compute the number of the period
522!
523 pin_fdeval = 0
524 it = (rowno+4) / 6
525 is = 7*(it-1)
526 if ( rowno == (it-1)*6+3 ) then
527!
528! sdef equation. Nonlinear term = -(1.1+0.1*p)*1.02**(-cs/7)
529!
530 h1 = (1.1d0+0.1d0*x(is+6))
531 h2 = 1.02d0**(-x(is+2)/7.d0)
532 if ( mode == 1 .or. mode == 3 ) then
533 g = -h1*h2
534 endif
535 if ( mode == 2 .or. mode == 3 ) then
536 jac(is+2) = h1*h2*log(1.02d0)/7.d0
537 jac(is+6) = -h2*0.1d0
538 endif
539 elseif ( rowno == (it-1)*6+7 ) then
540!
541! revdef equation. Nonlinear term = -d*(p-250/r)
542!
543 if ( mode == 1 .or. mode == 3 ) then
544 g = -x(is+4)*(x(is+6)-250.d0/x(is+5))
545 endif
546 if ( mode == 2 .or. mode == 3 ) then
547 jac(is+4) = -(x(is+6)-250.d0/x(is+5))
548 jac(is+5) = -x(is+4)*250d0/x(is+5)**2
549 jac(is+6) = -x(is+4)
550 endif
551 else
552!
553! Error - this equation is not nonlinear
554!
555 write(*,*)
556 write(*,*) 'Error. FDEval called with rowno=',rowno
557 write(*,*)
558 pin_fdeval = 1
559 endif
560
561end Function pin_fdeval
562
563Integer Function pin_solution( XVAL, XMAR, XBAS, XSTA, YVAL, YMAR, YBAS, YSTA, N, M, USRMEM )
564#ifdef dec_directives_win32
565!DEC$ ATTRIBUTES STDCALL, REFERENCE, NOMIXED_STR_LEN_ARG :: Pin_Solution
566#endif
567!
568! Specialized solution callback routine with names for variables and constraints
569!
570 Use proginfo
571 Use data_t
572 IMPLICIT NONE
573 INTEGER, Intent(IN) :: n, m
574 INTEGER, Intent(IN), Dimension(N) :: xbas, xsta
575 INTEGER, Intent(IN), Dimension(M) :: ybas, ysta
576 real*8, Intent(IN), Dimension(N) :: xval, xmar
577 real*8, Intent(IN), Dimension(M) :: yval, ymar
578 real*8, Intent(IN OUT) :: usrmem(*)
579 character*6, parameter, dimension(7) :: vname = (/'td ','cs ','s ','d ','r ','p ','rev '/)
580 character*6, parameter, dimension(6) :: ename = (/'tddef ','sdef ','csdef ','ddef ','rdef ','revdef'/)
581
582 INTEGER :: i, it, i1
583 CHARACTER*5, Parameter, Dimension(4) :: stat = (/ 'Lower','Upper','Basic','Super' /)
584
585 WRITE(10,"(/' Variable Solution value Reduced cost B-stat'/)")
586 i = 0
587 do it = 1, t
588 DO i1 = 1, 7
589 i = i + 1
590 WRITE(10,"(1X,A6,i2,1p,E20.6,E16.6,4X,A5 )") vname(i1), it, xval(i), xmar(i), stat(1+xbas(i))
591 ENDDO
592 enddo
593
594 WRITE(10,"(/' Constrnt Activity level Marginal cost B-stat'/)")
595 i = 1
596 WRITE(10,"(1x,'Objective',1P,E19.6,E16.6,4X,A5 )") yval(i), ymar(i), stat(1+ybas(i))
597 do it = 1, t
598 do i1 = 1, 6
599 i = i + 1
600 WRITE(10,"(1x,A6,i2,1P,E20.6,E16.6,4X,A5 )") ename(i1),it, yval(i), ymar(i), stat(1+ybas(i))
601 enddo
602 ENDDO
603
604 solcalls = solcalls + 1
605 pin_solution = 0
606
607END Function pin_solution
Main program. A simple setup and call of CONOPT.
Definition pindyck.java:14
integer function std_status(modsta, solsta, iter, objval, usrmem)
Definition comdecl.f90:126
subroutine checkdual(case, minmax)
Definition comdecl.f90:432
integer function std_message(smsg, dmsg, nmsg, llen, usrmem, msgv)
Definition comdecl.f90:243
integer function std_errmsg(rowno, colno, posno, msglen, usrmem, msg)
Definition comdecl.f90:286
integer function pin_fdeval(x, g, jac, rowno, jcnm, mode, ignerr, errcnt, n, nz, thread, usrmem)
Compute nonlinear terms and non-constant Jacobian elements.
Definition fvboth.f90:429
integer function pin_readmatrix(lower, curr, upper, vsta, type, rhs, esta, colsta, rowno, value, nlflag, n, m, nz, usrmem)
Define information about the model.
Definition fvboth.f90:161
integer function pin_solution(xval, xmar, xbas, xsta, yval, ymar, ybas, ysta, n, m, usrmem)
Definition fvboth.f90:535
integer(c_int) function coidef_message(cntvect, coi_message)
define callback routine for handling messages returned during the solution process.
Definition conopt.f90:1265
integer(c_int) function coidef_solution(cntvect, coi_solution)
define callback routine for returning the final solution values.
Definition conopt.f90:1238
integer(c_int) function coidef_status(cntvect, coi_status)
define callback routine for returning the completion status.
Definition conopt.f90:1212
integer(c_int) function coidef_readmatrix(cntvect, coi_readmatrix)
define callback routine for providing the matrix data to CONOPT.
Definition conopt.f90:1111
integer(c_int) function coidef_errmsg(cntvect, coi_errmsg)
define callback routine for returning error messages for row, column or Jacobian elements.
Definition conopt.f90:1291
integer(c_int) function coidef_fdeval(cntvect, coi_fdeval)
define callback routine for performing function and derivative evaluations.
Definition conopt.f90:1135
integer(c_int) function coidef_optfile(cntvect, optfile)
define callback routine for defining an options file.
Definition conopt.f90:928
integer(c_int) function coidef_license(cntvect, licint1, licint2, licint3, licstring)
define the License Information.
Definition conopt.f90:293
integer(c_int) function coidef_numvar(cntvect, numvar)
defines the number of variables in the model.
Definition conopt.f90:97
integer(c_int) function coidef_numcon(cntvect, numcon)
defines the number of constraints in the model.
Definition conopt.f90:121
integer(c_int) function coidef_numnlnz(cntvect, numnlnz)
defines the Number of Nonlinear Nonzeros.
Definition conopt.f90:167
integer(c_int) function coidef_optdir(cntvect, optdir)
defines the Optimization Direction.
Definition conopt.f90:213
integer(c_int) function coidef_numnz(cntvect, numnz)
defines the number of nonzero elements in the Jacobian.
Definition conopt.f90:144
integer(c_int) function coidef_objcon(cntvect, objcon)
defines the Objective Constraint.
Definition conopt.f90:239
integer(c_int) function coi_create(cntvect)
initializes CONOPT and creates the control vector.
Definition conopt.f90:1726
integer(c_int) function coi_free(cntvect)
frees the control vector.
Definition conopt.f90:1749
subroutine coiget_version(major, minor, patch)
returns the version number. It can be used to ensure that the modeler is linked to the correct versio...
Definition conopt.f90:1645
integer(c_int) function coi_solve(cntvect)
method for starting the solving process of CONOPT.
Definition conopt.f90:1625
real *8 obj
Definition comdecl.f90:16
integer solcalls
Definition comdecl.f90:15
integer sstat
Definition comdecl.f90:18
subroutine finalize
Definition comdecl.f90:79
integer stacalls
Definition comdecl.f90:14
subroutine flog(msg, code)
Definition comdecl.f90:62
logical do_allocate
Definition comdecl.f90:27
integer, parameter maximize
Definition comdecl.f90:31
integer mstat
Definition comdecl.f90:17
subroutine startup
Definition comdecl.f90:41