CONOPT
|
Enables the user to provide an options file and set individual options.
Non-default tolerances or non-standard operations can be defined with two different methods. They can be defined in an Option File, also called a "Control program", or they can be defined with a sequence of callback calls, or with a combination of both methods.
You select the method by supplying one or more callback routines. You can define an Option file by registering an OptFile callback routine using coidef_optfile(). The callback routine must define the name of the file with the Option file. An Option callback routine can be registered using coidef_option().
If this callback routine has been registered it is called by CONOPT immediately after start. It lets the modeler define a file with an Option file or Control program. If LFILNM
is positive, CONOPT will open the file named FILENM
, read it, and close it immediately. If FNLEN
is zero, CONOPT will not use an Option file.
where:
LFILNM
: The length of the file name, returned by the modeler. Maximum 255. A length of zero indicates that there is no Option file.FILENM
: Characters making up a file name defined by the modeler. Only the first FNLEN
characters are used.USRMEM
: User memory as defined in coidef_usrmem() (Only for Fortran and C API).The special C-argument, LENFN
holds the allocated length of FILENM
, i.e. 255.
OptFile
, if OptFile
returns LFILNM = 0
, or if the file define by Optfile
cannot be found.The format of the CONOPT Options file consists in its simplest form of a number of lines like these:
rtmaxv := 1.e8; lfnsup := 500;
An optional "set" verb can be added in front of the assignment statements, and the separators :, =, and ; are silently ignored, so the first line could also be written as "set rtmaxv 1.e8" or simply "rtmaxv 1.e8". Lower case letters are converted to upper case so the second line could also be written as "LFNSUP :=
500;". The assignment or set statement is used to assign a new value to internal CONOPT variables, so-called CR-Cells
. The optional set verb, the name of the CR-Cell
, and the value must be separated by blanks, tabs, commas, colons, and/or equal signs. The value must be written using legal Fortran format with a maximum of 10 characters, i.e. a real number may contain an optional E
and D
exponent, but a number may not contain blanks. The value must have the same type as the CR-Cell
, i.e. real CR-Cells
must be assigned real values, integer CR-Cells
must be assigned integer values, and logical CR-Cells
must be assigned logical values. Values can also be the name of a CR-Cell
of the same type.
This callback routine will (if registered using coidef_option()) be called after OptFile
has been called and after the Option file has been read so the options defined using the Option callback will overwrite options in the Option file. Option defines one option in each call and it will be called repeatedly until the modeler returns a blank NAME
. This way, the modeler can define any number of CR-cells
. If NAME
is not a legal CR-cell
name CONOPT will write a message to the listing file and otherwise ignore the call.
where:
NCALL
: The sequence number of the call. NCALL
is defined by CONOPT and starts with Base (0 for C and 1 for Fortran) first time Option is called. If Option is called from within MemEst and later from CONOPT itself then NCALL
starts from Base in each sequence of calls.NAME
: The name of a CONOPT CR-cell
defined by the modeler. See Options for a list of user definable CR-cells
and their interpretation. Note that the name has 8 characters and all 8 characters must be defined, if necessary with trailing blanks. When the modeler returns a name with 8 blanks, it indicates that there are no more definitions for CR-cells
.RVAL
: The value to be assigned to 'NAME' if the cell contains a real value.IVAL
: The value to be assigned to 'NAME' if the cell contains an integer value.LVAL
: The value to be assigned to 'NAME' if the cell contains a logical value. A zero represents .false. and a nonzero value represents .true.USRMEM
: User memory as defined in coidef_usrmem() (Only for Fortran and C API).