74 INTEGER :: numcallback
75 INTEGER,
Dimension(:),
Pointer :: cntvect
85 Allocate( cntvect(numcallback) )
95 coi_error = max( coi_error,
coidef_optfile( cntvect,
'cns03.opt' ) )
105#if defined(LICENSE_INT_1) && defined(LICENSE_INT_2) && defined(LICENSE_INT_3) && defined(LICENSE_TEXT)
106 coi_error = max( coi_error,
coidef_license( cntvect, license_int_1, license_int_2, license_int_3, license_text) )
109 If ( coi_error .ne. 0 )
THEN
111 write(*,*)
'**** Fatal Error while loading CONOPT Callback routines.'
113 call flog(
"Skipping Solve due to setup errors", 1 )
125 If ( coi_error /= 0 )
then
126 call flog(
"Errors encountered during solution", 1 )
128 call flog(
"Status or Solution routine was not called", 1 )
129 elseif (
sstat /= 1 )
then
130 call flog(
"Solver Status was not 1 as expected.", 1 )
132 if (
mstat == 5 )
then
134 call flog(
"Mstat = 5 and Count of infeasibilities was not positive.", 1 )
136 call flog(
"Mstat = 4 and Count of dependencies was not positive.", 1 )
138 elseif (
mstat == 17 )
then
140 call flog(
"Mstat = 17 and Count of infeasibilities was not zero.", 1 )
142 call flog(
"Mstat = 17 and Count of dependencies was not positive.", 1 )
145 elseif (
mstat == 16 )
then
148 call flog(
"Model Status was not as expected 5, 16, or 17.", 1 )
152 if ( abs(
xprim(2)+
xprim(3)-2.0d0) > 1.d-8 )
then
153 call flog(
"Bad levels for x2 + x3.", 1 )
154 else if ( abs(
uprim(1)-5.0d0) > 1.d-8 )
then
155 call flog(
"Bad e1 level.", 1 )
156 else if ( abs(
uprim(2)-7.0d0) > 1.d-8 )
then
157 call flog(
"Bad e2 level.", 1 )
162 write(*,*)
'End of Cns03 example. Return code=',coi_error
164 if ( coi_free(cntvect) /= 0 )
call flog(
"Error while freeing control vector",1)
166 call flog(
"Successful Solve", 0 )
178 colsta, rowno, value, nlflag, n, m, nz, &
184 integer,
intent (in) :: n
185 integer,
intent (in) :: m
186 integer,
intent (in) :: nz
187 real*8,
intent (in out),
dimension(n) :: lower
188 real*8,
intent (in out),
dimension(n) :: curr
189 real*8,
intent (in out),
dimension(n) :: upper
190 integer,
intent (in out),
dimension(n) :: vsta
192 integer,
intent (out),
dimension(m) ::
type
193 integer,
intent (in out),
dimension(m) :: esta
195 real*8,
intent (in out),
dimension(m) :: rhs
196 integer,
intent (in out),
dimension(n+1) :: colsta
197 integer,
intent (out),
dimension(nz) :: rowno
198 integer,
intent (in out),
dimension(nz) :: nlflag
199 real*8,
intent (in out),
dimension(nz) ::
value
integer function cns03_readmatrix(lower, curr, upper, vsta, type, rhs, esta, colsta, rowno, value, nlflag, n, m, nz, usrmem)
Define information about the model.
program cns03
Main program. A simple setup and call of CONOPT.
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_errmsg(rowno, colno, posno, msglen, usrmem, msg)
integer function coidef_errmsg(cntvect, coi_errmsg)
define callback routine for returning error messages for row, column or Jacobian elements.
integer function coidef_message(cntvect, coi_message)
define callback routine for handling messages returned during the solution process.
integer function coidef_readmatrix(cntvect, coi_readmatrix)
define callback routine for providing the matrix data to CONOPT.
integer function coidef_status(cntvect, coi_status)
define callback routine for returning the completion status.
integer function coidef_solution(cntvect, coi_solution)
define callback routine for returning the final solution values.
integer function coidef_optfile(cntvect, optfile)
define callback routine for defining an options file.
integer function coidef_square(cntvect, square)
square models.
integer function coidef_license(cntvect, licint1, licint2, licint3, licstring)
define the License Information.
integer function coidef_numvar(cntvect, numvar)
defines the number of variables in the model.
integer function coidef_numnz(cntvect, numnz)
defines the number of nonzero elements in the Jacobian.
integer function coidef_numnlnz(cntvect, numnlnz)
defines the Number of Nonlinear Nonzeros.
integer function coidef_numcon(cntvect, numcon)
defines the number of constraints in the model.
integer function coidef_size()
returns the size the Control Vector must have, measured in standard Integer units.
integer function coidef_inifort(cntvect)
initialisation method for Fortran applications.
integer function coi_solve(cntvect)
method for starting the solving process of CONOPT.
subroutine flog(msg, code)
real *8, dimension(:), pointer xprim
real *8, dimension(:), pointer uprim