20 integer,
Parameter ::
n = 15000
55 INTEGER :: numcallback
56 INTEGER,
Dimension(:),
Pointer :: cntvect
64 Allocate( cntvect(numcallback) )
101 coi_error = max( coi_error,
coidef_optfile( cntvect,
'stress1.opt' ) )
114#if defined(LICENSE_INT_1) && defined(LICENSE_INT_2) && defined(LICENSE_INT_3) && defined(LICENSE_TEXT)
115 coi_error = max( coi_error,
coidef_license( cntvect, license_int_1, license_int_2, license_int_3, license_text) )
118 If ( coi_error .ne. 0 )
THEN
120 write(*,*)
'**** Fatal Error while loading CONOPT Callback routines.'
122 call flog(
"Skipping First Solve due to setup errors", 1 )
128 If ( coi_error .ne. 0 )
THEN
130 write(*,*)
'**** Fatal Error while Solving model. Return Code=',coi_error
132 call flog(
"Errors encountered during Solve.", 1 )
134 call flog(
"Status or Solution routine was not called during Solve", 1 )
136 call flog(
"Incorrect Model or Solver Status during solve", 1 )
140 write(*,*)
'End of Stress1 Model. Return code=',coi_error
142 if ( coi_free(cntvect) /= 0 )
call flog(
"Error while freeing control vector",1)
144 call flog(
"Successful Solve", 0 )
156 colsta, rowno, value, nlflag, nc, mc, nz, usrmem )
162 integer,
intent (in) :: nc
163 integer,
intent (in) :: mc
164 integer,
intent (in) :: nz
165 real*8,
intent (in out),
dimension(nc) :: lower
166 real*8,
intent (in out),
dimension(nc) :: curr
167 real*8,
intent (in out),
dimension(nc) :: upper
168 integer,
intent (in out),
dimension(nc) :: vsta
170 integer,
intent (out),
dimension(mc) ::
type
171 integer,
intent (in out),
dimension(mc) :: esta
173 real*8,
intent (in out),
dimension(mc) :: rhs
174 integer,
intent (in out),
dimension(nc+1) :: colsta
175 integer,
intent (out),
dimension(nz) :: rowno
176 integer,
intent (in out),
dimension(nz) :: nlflag
177 real*8,
intent (in out),
dimension(nz) ::
value
221Integer Function stress_fdeval( x, g, jac, rowno, jcnm, mode, ignerr, errcnt, &
222 nc, nz, thread, usrmem )
228 integer,
intent (in) :: nc
229 integer,
intent (in) :: rowno
230 integer,
intent (in) :: nz
231 real*8,
intent (in),
dimension(nc) :: x
232 real*8,
intent (in out) :: g
233 real*8,
intent (in out),
dimension(nc) :: jac
234 integer,
intent (in),
dimension(nz) :: jcnm
236 integer,
intent (in) :: mode
238 integer,
intent (in) :: ignerr
240 integer,
intent (in out) :: errcnt
242 integer,
intent (in) :: thread
248 if ( rowno == 1 )
then
251 obj = obj * x(i)*x(i)
253 if ( mode == 1 .or. mode == 3 )
then
256 if ( mode == 2 .or. mode == 3 )
then
258 jac(i) = 2.d0*obj/x(i)
266 write(*,*)
'Error. FDEval called with rowno=',rowno
286 Integer,
Intent (IN) :: nc, mc, nhess
287 Integer,
Intent (IN OUT) :: nodrv
288 Integer,
Dimension(NHess),
Intent (Out) :: hsrw, hscl
289 real*8,
Intent(IN OUT) :: usrmem(*)
296 write(*,*)
'Struct: Number of variables should be=',
n,
' but CONOPT uses',nc
301 write(*,*)
'Struct: Number of equations should be=',+1,
' but CONOPT uses',mc
304 if ( nhess /=
n*(
n+1)/2 )
then
305 write(*,*)
'Struct: Number of Hessian elements should be=',
n*(
n+1)/2,
' but CONOPT uses',nhess
332 Integer,
Intent (IN) :: nc, mc, nhess
333 Integer,
Intent (IN OUT) :: nodrv
334 real*8,
Dimension(Nc),
Intent (IN) :: x
335 real*8,
Dimension(Mc),
Intent (IN) :: u
336 Integer,
Dimension(Nhess),
Intent (IN) :: hsrw, hscl
337 real*8,
Dimension(NHess),
Intent (Out) :: hsvl
338 real*8,
Intent(IN OUT) :: usrmem(*)
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_fdeval(cntvect, coi_fdeval)
define callback routine for performing function and derivative evaluations.
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_2dlagrstr(cntvect, coi_2dlagrstr)
define callback routine for providing the structure of the second derivatives of the Lagrangian.
integer function coidef_optfile(cntvect, optfile)
define callback routine for defining an options file.
integer function coidef_2dlagrval(cntvect, coi_2dlagrval)
define callback routine for computing the values of the second derivatives of the Lagrangian.
integer function coidef_debug2d(cntvect, debug2d)
turn debugging of 2nd derivatives on and off.
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_objcon(cntvect, objcon)
defines the Objective Constraint.
integer function coidef_numnz(cntvect, numnz)
defines the number of nonzero elements in the Jacobian.
integer function coidef_optdir(cntvect, optdir)
defines the Optimization Direction.
integer function coidef_numnlnz(cntvect, numnlnz)
defines the Number of Nonlinear Nonzeros.
integer function coidef_numhess(cntvect, numhess)
defines the Number of Hessian 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)
integer function stress_2dlagrstr(hsrw, hscl, nodrv, nc, mc, nhess, usrmem)
Specify the structure of the Lagrangian of the Hessian.
integer function stress_readmatrix(lower, curr, upper, vsta, type, rhs, esta, colsta, rowno, value, nlflag, nc, mc, nz, usrmem)
Define information about the model.
integer function stress_2dlagrval(x, u, hsrw, hscl, hsvl, nodrv, nc, mc, nhess, usrmem)
Compute the Lagrangian of the Hessian.
program stress1
Main program. A simple setup and call of CONOPT.
integer function stress_fdeval(x, g, jac, rowno, jcnm, mode, ignerr, errcnt, nc, nz, thread, usrmem)
Compute nonlinear terms and non-constant Jacobian elements.