console manual impl
DESCRIPTION
The IMPL console executable (IMPL.exe) can be called from any DOS command prompt window where its Intel Fortran source code can be found in Appendix A. The IMPL console is useful given that it allows you to model and solve problems configured in an IML (Industrial Modeling Language) file. Problems coded using IPL (Industrial Programming Language) in many computer programming languages can use the IMPL console source code as a prototype. The IMPL console reads several input files and writes several output files which are described in this document. There are several console flags that can be specified as command line arguments and are described below.TRANSCRIPT
i M P l
Industrial Modeling & Programming Language
“Console Manual"
i n d u s t r I A L g o r i t h m s LLC. www.industrialgorithms.com
Version 1.0 April 2014
IAL-‐IMPL-‐CM-‐1-‐0.docx
Copyright and Property of Industrial Algorithms LLC.
Introduction
The IMPL console executable (IMPL.exe) can be called from any DOS command prompt window where
its Intel Fortran source code can be found in Appendix A. The IMPL console is useful given that it allows
you to model and solve problems configured in an IML (Industrial Modeling Language) file. Problems
coded using IPL (Industrial Programming Language) in many computer programming languages can use
the IMPL console source code as a prototype.
The IMPL console reads several input files and writes several output files which are described in this
document. There are several console flags that can be specified as command line arguments and are
described below.
IMPL Console Flags
There are twelve (12) flags or command line arguments that can be specified and they are as follows
with their respective possible values and defaults (shown in bolded italics).
-feed = IMLfile
The feed flag value must specify the path and file name (without the *.iml extension or file type) of the
IML file to be modeled and solved.
-form = sparsic | symbolic
For linear problems, the form flag values of sparsic and symbolic are equivalent given that the
problem matrix has no nonlinear or non-‐constant derivatives or expressions and IMPL supplies all of the
first-‐order partial derivatives or coefficients analytically. For nonlinear problems, IMPL represents the
model in a “sparsic” form where only the sparsity-‐pattern is supplied by IMPL for each constraint and
numerical perturbations are used to compute the non-‐constant or nonlinear first-‐order partial
derivatives using machine-‐coded constraint residual calculations i.e., the constraint equations are hard-‐
coded into IMPL’s native computer programming language. However, IMPL also supports a “symbolic”
form whereby the constraint residual calculations are computed using nonlinear expressions supplied by
IMPL in a byte-‐coded or parsed tokenized format sometimes referred to as postfix or reverse Polish
notation (RPN). The “symbolic” form is useful given that it can be used to output the nonlinear
constraint expressions into a human-‐readable flat-‐file.
-fit = discrete | distributed
The fit flag value of discrete assumes a uniform digitization of time i.e., discrete-‐time with a single
time-‐period duration and can be applied to quantity, logistics and quality types of problems whereas the
distributed fit flag value is not valid for logistics problems at this time. IMPL’s distributed-‐time
formulation is similar to a continuous-‐time model with a common or global time-‐grid except that in the
former the time-‐points are known exogenously.
-filter = quantity | logistics | quality
The filter flag value of quantity assumes that all logic variables are fixed to either 0 (zero) or 1 (one)
and there are no quality variables present and solves a linear programming (LP) problem. The filter flag
value of logistics solves a mixed-‐integer linear programming (MILP) problem where the logic variables
are finite i.e., lie between 0 or 1. The filter flag value of quality solves a nonlinear programming (NLP)
problem where the logic variables must be fixed to either 0 or 1. A fourth filter flag value of
qualogistics is possible but is not available where this would model and solve a mixed-‐integer
nonlinear programming (MINLP) problem (future implementation).
-focus = simulation | estimation | optimization
The focus flag value allows for simulation and estimation types of problems but currently only the
optimization value is supported.
-factor = 1.0
The factor flag value is a real positive number and can be used to scale quantity variables only i.e., rates,
flows and holdups.
-factorizer = semisolverless | y12m | ysmp | nspiv | ma28 | pardiso
The factorizer flag value is used to factorize or perform LU decomposition on a square system or set of
linear and/or nonlinear equations if it exists. If the number of free and/or finite quantity and quality
variables equals the number of linear and nonlinear equality constraints then simulation using direct
factorization of the sparse Jacobian matrix of first-‐order partial derivatives can be used to solve the
problem ignoring all inequality constraints and variable bounds. The factorizer flag pardiso requires the
Intel Math Kernel Library (MKL) to execute a parallel implementation of LU decomposition.
-fork = solverless | coinmp | glpk | lpsolve | scip | cplex | gurobi | lindo | xpress
ipopt | conopt | knitro
slpqpe_coinmp | slpqpe_glpk | slpqpe_lpsolve | slpqpe_scip |
slpqpe_cplex | slpqpe_gurobi | slpqpe_lindo | slpqpe_xpress
secqpe_y12m | secqpe_ysmp | secqpe_nspiv | secqpe_ma28 |
secqpe_pardiso
secqpe_sorve | secqpe_y12m_sorve | secqpe_ysmp_sorve |
secqpe_nspiv_sorve | secqpe_ma28_sorve | secqpe_pardiso_sorve
The fork flag value is used to solve LP, QP, MILP and NLP problems. The solvers slpqpe_ solve nonlinear
LP or QP problems using the various LP and QP solvers suffixed. The solvers secqpe_ solve nonlinear
equality-‐constrained QP problems using the various LU decompositions suffixed which are useful for
data reconciliation and regression problems (i.e., least squares, error-‐in-‐variables and parameter
estimation types of problems). The suffixed solvers with _sorve perform a post sensitivity analysis to
compute the observability, redundancy and variability estimates using the known sparse Jacobian matrix
from the secqpe_ solve. If variable bounds and constraint inequalities are required then solve with an
NLP first then warm-‐start with slpqpe_sorve to perform the post sensitivity analysis.
Note that the solvers scip, cplex, gurobi, lindo, xpress, conopt and knitro all require
commercial licensing agreements from their vendors.
-flashback = binaryfile | binaryram | flatfile
The flashback flag value is used to save or retain integer-‐feasible solutions found during the branch-‐and-‐
bound type of enumerative searches employed in MILP solvers. All integer-‐feasible solutions (variable
results or responses only) are saved to binary or unformatted files with extension *.bdt where a “_n” is
suffixed to the IML file problem name with “n” denoting the solution number found. The flashback flag
value of binaryram means that the solution is also saved to RAM memory and a value of flatfile will
save the solution in a formatted *.exl file.
-fanfare = 1073741823 (2^30 - 1)
The fanfare flag value is an integer bit mask with 0 to 30 bits. Depending on the value of fanfare, the
various IMPL output files will be written to the same directory as the IML file. For more details please
refer to Appendix A.
-fuse = coldstart | warmstart
The fuse flag value is only valid for nonlinear problems where a warmstart will use the solution variable
result values from a previous solve (if they exist) as initial-‐values or starting-‐points for the next solve.
-frequency = 0
The frequency flag value sets the number of solving cycles within a solving execution or run. It is
essentially a do-‐loop starting from 1 to frequency which will randomize the initial-‐values, starting-‐points
or default-‐results starting from the random seed setting and simply incrementing it by the loop iterate
or counter i.e., initial_value = (lower_bound+upper_bound)/2 + (upper_bound-
lower_bound)*random_number(random_seed).
IMPL Input Files
IMPL.lic
License file for IMPL that must be located in the same directory as the IMPL executable.
IMPL.set | *.set
Settings file for IMPL that may be located in the same directory as the IMPL executable or another *.set
file located in the same directory as the IML file with the same name.
IMPL.mem | *.mem
Memory file for IMPL that may be located in the same directory as the IMPL executable or another
*.mem file located in the same directory as the IML file with the same name. The memory file is used to
allocate the various resource-‐entities of IMPL.
IMPL.solver | *.solver
Individual solver settings files for the various IMPL solvers and they may be located in the same directory
as the IMPL executable or another *.solver file located in the same directory as the IML file with the
same name.
*.iml
Industrial (input) modeling language files containing the IML frames configuring a problem.
*.oml
Output modeling language files with the same name and location as the IML file where selected variable
results and constraint residuals can be written to user-‐specified files.
*.ups
UOPSS files (or universal production/process superstructure) written by the IALConstructer.py Python
2.3.5 code found in the Dia open-‐source application which can be included into any IMF file. This *.ups
file can contain the complete or partial construction data of the network, graph, diagram or flowsheet of
the problem.
*.ilp | *.inl
Foreign files with scalar-‐based variable and constraint names can be used to extend the IMPL modeling
with user-‐created and/or shared variables and user-‐created constraints. The format of these files is
similar to the CPLEX LP files where for nonlinear model extensions, the *.inl file allows nonlinear
expressions to be specified. If a quantity or logistics (LP, QP or MILP) problem is being solved then only
the *.ilp is recognized and if a quality (NLP) problem is being solved then only *.inl files are respected.
Both the *.ilp and *.inl files include the following sections: “Objective”, “Constraints” and “Bounds”.
There is also a “Binaries” section for *.ilp files only and both files must have the last statement as “End”
where in-‐line comments are indicated by the “\” backslash character.
IMPL Output Files
*.io
Input and output file containing the inputs and outputs for each IML file problem UOPSS superstructure.
*.iod
Input and output data file containing the input and output data for each IML file problem UOPSS
superstructure.
*.oi
Output and input file containing the outputs to inputs for each IML file problem UOPSS superstructure.
*.exl
Export files with the same name and location as the IML file where selected variable result values are
written in various EXL frames similar to the IML frames.
*.bdt
Binary (unformatted) files storing the independent sets, catalogs, lists, parameters and formulas. These
unformatted files are useful when re-‐running IMPL without having to re-‐read the *.iml file.
*_n.bdt
Binary (unformatted) files suffixed by an integer-‐feasible solution number “_n” with the same name and
location as the IML file where all variable results for a single integer-‐feasible solution found in the MILP
solvers are written in unformatted form.
*.ldt
Log files with the same name and location as the IML file where IMPL progress messages are displayed if
USELOGFILE = 1 is set else all messages will be sent to the console or command prompt window.
*.rdt
Report files with the same name and location as the IML file where IMPL resource-‐entity details are
displayed.
*.sdt
Summary files with the same name and location as the IML file where IMPL modeling and presolving
details are displayed such as the number of variables, constraints and derivatives included or excluded
from the problem.
*.tdt
Statics files with the same name and location as the IML file where if any IMPL presolved constraints are
found to be infeasible (i.e., violated greater than a tolerance) at a solution, are displayed. “Static”
constraints are IMPL’s term for constraints that are presolved or removed from the problem by IMPL
before the solvers (with their own presolving) are called where “dynamic” constraints in this context
mean constraints that are variable in the solver. The IMPL presolver may or may not “prempt” the
presolving if an infeasible or inconsistent constraint is found.
*.jdt
Sensitivity or derivatives files with the same name and location as the IML file where the first-‐order
partial derivative sparse Jacobian matrix elements are displayed.
*.ndt
Symbolic or mnemonic files with the same name and location as the IML file where a human-‐readable
form of both the linear and nonlinear constraints are displayed for every variable and constraint known
to the problem.
*.imp, *.imv, *.imc
Three files containing all of the parameters (including all of the sets, catalogs, lists and formulas),
variables and constraints created by IMPL to model the problem. These files can be used to reference
the names found in the *.dta files below.
*.dtr
Series-‐set (or range-‐set) files with the same name and location as the IML file where all SERIES-‐SET
resource-‐entity roster-‐enumerations are output.
*.dts
Simple-‐set files with the same name and location as the IML file where all SIMPLE-‐SET resource-‐entity
roster-‐enumerations are output.
*.dty
Symbol-‐set files with the same name and location as the IML file where all SYMBOL-‐SET resource-‐entity
roster-‐enumerations are output.
*.dtg
Catalog files with the same name and location as the IML file where all CATALOG resource-‐entity roster-‐
enumerations are output.
*.dtl
List files with the same name and location as the IML file where all LIST resource-‐entity roster-‐
enumerations are output.
*.dtp
Parameter files with the same name and location as the IML file where all PARAMETER resource-‐entity
roster-‐enumerations are output.
*.dtv
Variable files with the same name and location as the IML file where all VARIABLE resource-‐entity
roster-‐enumerations are output.
*.dtw
“Vetistic” (vetting) or statistic files with the same name and location as the IML file where all VARIABLE
and CONSTRAINT resource-‐entity roster-‐enumerations are output when the solvers suffixed with _sorve
are used. This file outputs the observability and redundancy metrics, variances, “maximum power”
gross-‐error detection statistics and confidence-‐intervals.
*.dtc
Constraint files with the same name and location as the IML file where all CONSTRAINT resource-‐entity
roster-‐enumerations are output.
*.dtf
Formula files with the same name and location as the IML file where all FORMULA resource-‐entity
roster-‐enumerations are output.
Appendix A – IMPL Console Source Code in Intel Fortran (IMPL.exe)
Provided below is the Intel Fortran source code which calls the various routines found in the IMPL
system architecture SIIMPLE (Server, Interacter, Interfacer, Modeler, Presolver Libraries). We have
included this source code to show how to call IMPL with SIIMPL from other computer programming
languages such as C, C++, C#, Java, Python, Excel/VBA, etc.
program IMPL use IFWIN use IMPLserver cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c INDUSTRIAL ALGORITHMS LLC. CONFIDENTIAL & PROPRIETARY cccccccccccccccccccccccc cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc implicit none c Project "feed" data name which also includes the path. character(BASESTRINGLEN*LINESTRINGLENMULT) :: feed c Problem "fact" data name which also includes the path. character(BASESTRINGLEN*LINESTRINGLENMULT) :: fact c Data "face" or stream i.e., either "import/out" or "export/in". integer(4) :: face c Model "factor" or scaling for dominant or primary phenomenological dimension. real(8) :: factor c Model "sipher" (cipher, secret-code) for encryption and deencryption. integer(8) :: fob c Model "form "or structure i.e., either "sparsic" or "symbolic". integer(4) :: form c Model "fit" or slot usually the temporal dimension. integer(4) :: fit c Model "filter" or select. integer(4) :: filter c Model "focus" or syllabus. integer(4) :: focus c Model "filler" or supplemental pointing to the supplierlib() routine. integer(4) :: filler c Model "foreign" ILP or INL file. character(BASESTRINGLEN*LINESTRINGLENMULT) :: foreign c Semi-solve "factorizer" or semi-solver. integer(4) :: factorizer c Solve "fork" or solver. integer(4) :: fork c Solve fresh or "stale". integer(4) :: fresh c Savings format for intermediate integer-feasible solutions when they are found during the search. integer(4) :: flashback c Feedback or callback "summons" routine. integer(4) :: feedback c Model and solve fanfare or "show". integer(4) :: fanfare c Solve from a previously solved solution (and not necessarily converged) i.e., "fuse" this new solution c with a preceding solution ("warm-start" v. "cold-start"). integer(4) :: fuse c Rerun/restart/repeat the modeling and solving in a loop a specified number of times by randomizing the initial-‐ c values or starting-‐points using the random-‐seed. c c The frequency ("stride") is the number of cycles plus one (+1) per execution or run of this console program where c zero (0) means only the initial, starting or default run is performed. integer(4) :: frequency integer(4) :: rseed
c Data frames separated by the ASCII NULL character i.e., CHAR(0) in fortran or "/n" in C. character(BASESTRINGLEN*PAGESTRINGLENMULT) :: frames integer(4) :: flag c Command line argument string value. character(BASESTRINGLEN*LINESTRINGLENMULT) :: sargument, sargument1, sargument2 interface function IMPLinterfaceri(fact,form,fit,filter,focus,face,factor,fob,frames) #if stdcalling == 1 cDEC$ ATTRIBUTES DLLIMPORT, STDCALL, REFERENCE, DECORATE, ALIAS : "IMPLinterfaceri" :: IMPLINTERFACERI #else cDEC$ ATTRIBUTES DLLIMPORT, ALIAS : "IMPLinterfaceri" :: IMPLINTERFACERI #endif integer(4) :: IMPLinterfaceri character(*), intent(in) :: fact cDEC$ ATTRIBUTES REFERENCE :: fact integer(4), intent(in) :: form cDEC$ ATTRIBUTES VALUE :: form integer(4), intent(in) :: fit cDEC$ ATTRIBUTES VALUE :: fit integer(4), intent(in) :: filter cDEC$ ATTRIBUTES VALUE :: filter integer(4), intent(in) :: focus cDEC$ ATTRIBUTES VALUE :: focus integer(4), intent(in) :: face cDEC$ ATTRIBUTES VALUE :: face real(8), intent(in) :: factor cDEC$ ATTRIBUTES VALUE :: factor integer(8), intent(in) :: fob cDEC$ ATTRIBUTES VALUE :: fob character(*), intent(in) :: frames cDEC$ ATTRIBUTES REFERENCE :: frames end function IMPLinterfaceri function IMPLinterfacere(fact,form,fit,filter,focus,face,factor,fob,frames) #if stdcalling == 1 cDEC$ ATTRIBUTES DLLIMPORT, STDCALL, REFERENCE, DECORATE, ALIAS : "IMPLinterfacere" :: IMPLINTERFACERE #else cDEC$ ATTRIBUTES DLLIMPORT, ALIAS : "IMPLinterfacere" :: IMPLINTERFACERE #endif integer(4) :: IMPLinterfacere character(*), intent(in) :: fact cDEC$ ATTRIBUTES REFERENCE :: fact integer(4), intent(in) :: form cDEC$ ATTRIBUTES VALUE :: form integer(4), intent(in) :: fit cDEC$ ATTRIBUTES VALUE :: fit integer(4), intent(in) :: filter cDEC$ ATTRIBUTES VALUE :: filter integer(4), intent(in) :: focus cDEC$ ATTRIBUTES VALUE :: focus integer(4), intent(in) :: face cDEC$ ATTRIBUTES VALUE :: face real(8), intent(in) :: factor cDEC$ ATTRIBUTES VALUE :: factor integer(8), intent(in) :: fob cDEC$ ATTRIBUTES VALUE :: fob character(*), intent(in) :: frames cDEC$ ATTRIBUTES REFERENCE :: frames end function IMPLinterfacere function IMPLmodelerv(fact,form,fit,filter,focus,filler,foreign,force) #if stdcalling == 1 cDEC$ ATTRIBUTES DLLIMPORT, STDCALL, REFERENCE, DECORATE, ALIAS : "IMPLmodelerv" :: IMPLMODELERV #else cDEC$ ATTRIBUTES DLLIMPORT, ALIAS : "IMPLmodelerv" :: IMPLMODELERV #endif integer(4) :: IMPLmodelerv character(*), intent(in) :: fact cDEC$ ATTRIBUTES REFERENCE :: fact integer(4), intent(in) :: form cDEC$ ATTRIBUTES VALUE :: form integer(4), intent(in) :: fit cDEC$ ATTRIBUTES VALUE :: fit integer(4), intent(in) :: filter cDEC$ ATTRIBUTES VALUE :: filter integer(4), intent(in) :: focus cDEC$ ATTRIBUTES VALUE :: focus integer(4), intent(in) :: filler cDEC$ ATTRIBUTES REFERENCE :: filler character(*), optional, intent(in) :: foreign cDEC$ ATTRIBUTES REFERENCE :: foreign integer(4), optional, intent(in) :: force cDEC$ ATTRIBUTES REFERENCE :: force end function IMPLmodelerv function IMPLmodelerc(fact,form,fit,filter,focus,filler,foreign,force) #if stdcalling == 1 cDEC$ ATTRIBUTES DLLIMPORT, STDCALL, REFERENCE, DECORATE, ALIAS : "IMPLmodelerc" :: IMPLMODELERC #else
cDEC$ ATTRIBUTES DLLIMPORT, ALIAS : "IMPLmodelerc" :: IMPLMODELERC #endif integer(4) :: IMPLmodelerc character(*), intent(in) :: fact cDEC$ ATTRIBUTES REFERENCE :: fact integer(4), intent(in) :: form cDEC$ ATTRIBUTES VALUE :: form integer(4), intent(in) :: fit cDEC$ ATTRIBUTES VALUE :: fit integer(4), intent(in) :: filter cDEC$ ATTRIBUTES VALUE :: filter integer(4), intent(in) :: focus cDEC$ ATTRIBUTES VALUE :: focus integer(4), intent(in) :: filler cDEC$ ATTRIBUTES REFERENCE :: filler character(*), optional, intent(in) :: foreign cDEC$ ATTRIBUTES REFERENCE :: foreign integer(4), optional, intent(in) :: force cDEC$ ATTRIBUTES REFERENCE :: force end function IMPLmodelerc function IMPLpresolver(fact,form,fit,filter,focus,factorizer,fork,fresh,flashback,feedback) #if stdcalling == 1 cDEC$ ATTRIBUTES DLLIMPORT, STDCALL, REFERENCE, DECORATE, ALIAS : "IMPLpresolver" :: IMPLPRESOLVER #else cDEC$ ATTRIBUTES DLLIMPORT, ALIAS : "IMPLpresolver" :: IMPLPRESOLVER #endif integer(4) :: IMPLpresolver character(*), intent(in) :: fact cDEC$ ATTRIBUTES REFERENCE :: fact integer(4), intent(in) :: form cDEC$ ATTRIBUTES VALUE :: form integer(4), intent(in) :: fit cDEC$ ATTRIBUTES VALUE :: fit integer(4), intent(in) :: filter cDEC$ ATTRIBUTES VALUE :: filter integer(4), intent(in) :: focus cDEC$ ATTRIBUTES VALUE :: focus integer(4), intent(in) :: factorizer cDEC$ ATTRIBUTES VALUE :: factorizer integer(4), intent(in) :: fork cDEC$ ATTRIBUTES VALUE :: fork integer(4), intent(in) :: fresh cDEC$ ATTRIBUTES VALUE :: fresh integer(4), intent(in) :: flashback cDEC$ ATTRIBUTES VALUE :: flashback integer(4), intent(in) :: feedback cDEC$ ATTRIBUTES REFERENCE :: feedback end function IMPLpresolver end interface c Integer pointer to modeling subroutine location. integer(4) :: ptr_IMPLmodelerc c Temporary allocatable storage when required. integer(4), allocatable :: ival(:) real(8), allocatable :: rval(:) character(BASESTRINGLEN), allocatable :: sval(:) c Miscellaneous. integer(4) :: i, rtnstat, lun character(BASESTRINGLEN*LINESTRINGLENMULT) :: logmessage character(BASESTRINGLEN) :: setting character(BASESTRINGLEN) :: startdate, finishdate, sizelimits, hostname, username c Timings for performance monitoring or profiling. c c * Note that to compute running times then use the following code. c c ftime = DCLOCK() c dttime = ftime-stime c ttime = ttime+dttime c stime = ftime c c * Note that CPU_TIME() returns the sum of time over all threads which does return the elapsed time. c Instead DCLOCK() returns the elapsed time and requires module IFPORT. real(8) :: stime, ftime, dttime, ttime, ttime2 c Start the clock. ttime = 0 stime = DCLOCK() cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c Specify a version number for which will be maintained as a standalone entity. c c Year.Month.DayIncrement i.e., 2007-12-05 5th increment per day = 7.12.055 (major.minor.update release). c c This versioning scheme is simple and accurate and only useful for tracking changes continuously. It is
c not a snapshot or build release number with "major.minor.patch" release structure. c * Note that "-1" means to write to standard output which is usually the screen. rtnstat = IMPLwritebanner(-1) write(*,"(1X,A)")"<<< i M P l - E x e c u t a b l e (console)" write(*,"(1X,A)")"<<<" write(*,"(1X,A)")"<<< Release # 1.0" write(*,"(1X,A)")"<<< Version # 12.5.141" write(*,"(1X,A)")"<<<" write(*,"(1X,4A)")"<<< Last Compiled: ",__DATE__," ",__TIME__ write(*,"(1X,A)")"<<<" cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c Parse the command line arguments for the required flags. feed = "c:\IMPL\IMLfile" fact = feed form = SPARSIC$ ! form = SYMBOLIC$ fit = DISCRETE$ ! fit = DISTRIBUTE$ filter = QUANTITY$ ! filter = LOGISTICS$ ! filter = QUALITY$ c Simulation, Estimation and Optimization "Interoperability". ! focus = SIMULATION$ ! focus = ESTIMATION$ focus = OPTIMIZATION$ factor = 1d+0 factorizer = SEMISOLVERLESS$ ! factorizer = Y12M$ ! factorizer = YSMP$ ! factorizer = NSPIV$ ! factorizer = MA28$ ! factorizer = PARDISO$ fork = SOLVERLESS$ ! fork = COINMP$ ! fork = GLPK$ ! fork = LPSOLVE$ ! fork = SCIP$ ! fork = CPLEX$ ! fork = GUROBI$ ! fork = LINDO$ ! fork = OPTONOMY$ ! fork = XPRESS$ !SQP's ! fork = IPOPT$ ! fork = CONOPT$ ! fork = KNITRO$ ! fork = NOVA$ ! fork = WORHP$ !SLP's ! fork = SLPQPE_COINMP$ ! fork = SLPQPE_GLPK$ ! fork = SLPQPE_LPSOLVE$ ! fork = SLPQPE_SCIP$ ! fork = SLPQPE_CPLEX$ ! fork = SLPQPE_GUROBI$ ! fork = SLPQPE_OPTONOMY$ ! fork = SLPQPE_XPRESS$ ! fork = SLPQPE_IPOPT$ ! fork = SECQPE_Y12M$ ! fork = SECQPE_YSMP$ ! fork = SECQPE_NSPIV$ ! fork = SECQPE_MA28$ ! fork = SECQPE_PARDISO$ ! fork = SECQPE_SORVE$ ! fork = SECQPE_Y12M_SORVE$ ! fork = SECQPE_YSMP_SORVE$ ! fork = SECQPE_NSPIV_SORVE$ ! fork = SECQPE_MA28_SORVE$ ! fork = SECQPE_PARDISO_SORVE$ c Suitability (svve), Steadyability (ssde) and Scrumability (sfcme). ! fork = SVVE$ ! fork = SSDE$ ! fork = SFCME$
fanfare = SHOWALL$ fuse = COLDSTART$ ! fuse = WARMSTART$ frequency = 0 fob = 0 frames = CHAR(0) c Get the library and function addresses for the filler, supplemental, external modeler, etc. which will provide the c necessary modeling for "black-blank" unit-operations. c c * Note that if the filler or supplemental routine is not found, then the return status is either negative or zero (0) and c hence filler = 0. filler = loadlibrary("C:\IndustrialAlgorithms\Platform\IMPL\IMPLsupplier\Debug\IMPLsupplier.dll"//CHAR(0)) if (filler > 0) then filler = getprocaddress(filler,"IMPLsupplierlib"//CHAR(0)) else filler = 0 end if fresh = FIRSTSESSION$ c Save, cache, store, persist, etc. integer-feasible solutions to an *.exl file as well as the default *.bdt binary file. flashback = FLATFILE$ c Point to the "recall()" routine provided by the "server". feedback = LOC(IMPLrecall) c The command line arguments (flags) can be specified as follows: c c * Note that if the second argument (after the "=" sign) is not recognizable as a valid value then an exception or c error occurs. c c impl.exe -feed="" c -form=sparsic c -fit=discrete c -filter=logistics c -focus=optimization c -factor=1 c -factorizer=y12m c -fork=lpsolve c -flashback=flatfile c -fanfare=1073741823 c -fuse=cold c -frequency=0 do i = 1,COMMAND_ARGUMENT_COUNT() call GET_COMMAND_ARGUMENT(i,sargument) sargument1 = sargument(1:INDEX(sargument,"=")) sargument2 = sargument(INDEX(sargument,"=")+1:BASESTRINGLEN*LINESTRINGLENMULT) select case (sargument1) case ("-feed=") if (TRIM(sargument2) /= "") then feed = TRIM(sargument2) fact = feed else write(*,*)"<<< %ERROR% - unknown -feed= argument present." stop end if write(*,*)"<<< feed = ",TRIM(sargument2) write(*,*)"<<< fact = ",TRIM(sargument2) case ("-form=") if (TRIM(sargument2) == "sparsic") then form = SPARSIC$ elseif (TRIM(sargument2) == "symbolic") then form = SYMBOLIC$ else write(*,*)"<<< %ERROR% - unknown -form= argument present." stop end if write(*,*)"<<< form = ",TRIM(sargument2)," = ",form case ("-fit=") if (TRIM(sargument2) == "discrete") then fit = DISCRETE$ elseif (TRIM(sargument2) == "distribute") then fit = DISTRIBUTE$ else write(*,*)"<<< %ERROR% - unknown -fit= argument present."
stop end if write(*,*)"<<< fit = ",TRIM(sargument2)," = ",fit case ("-filter=") if (TRIM(sargument2) == "quantity") then filter = QUANTITY$ elseif (TRIM(sargument2) == "logistics") then filter = LOGISTICS$ elseif (TRIM(sargument2) == "quality") then filter = QUALITY$ else write(*,*)"<<< %ERROR% - unknown -filter= argument present." stop end if write(*,*)"<<< filter = ",TRIM(sargument2)," = ",filter case ("-focus=") if (TRIM(sargument2) == "simulation") then focus = SIMULATION$ elseif (TRIM(sargument2) == "estimation") then focus = ESTIMATION$ elseif (TRIM(sargument2) == "optimization") then focus = OPTIMIZATION$ else write(*,*)"<<< %ERROR% - unknown -focus= argument present." stop end if write(*,*)"<<< focus = ",TRIM(sargument2)," = ",focus case ("-factor=") if (TRIM(sargument2) /= "") then read(sargument2,*)factor factor = ABS(MIN(INFIN,factor)) else write(*,*)"<<< %ERROR% - no -factor= argument present." stop end if write(*,*)"<<< factor = ",factor case ("-factorizer=") if (TRIM(sargument2) == "") then factorizer = SEMISOLVERLESS$ elseif (TRIM(sargument2) == "y12m") then factorizer = Y12M$ elseif (TRIM(sargument2) == "ysmp") then factorizer = YSMP$ elseif (TRIM(sargument2) == "nspiv") then factorizer = NSPIV$ elseif (TRIM(sargument2) == "ma28") then factorizer = MA28$ elseif (TRIM(sargument2) == "pardiso") then factorizer = PARDISO$ else write(*,*)"<<< %ERROR% - unknown -factorizer= argument present." stop end if write(*,*)"<<< factorizer = ",TRIM(sargument2)," = ",factorizer case ("-fork=") if (TRIM(sargument2) == "") then fork = SOLVERLESS$ elseif (TRIM(sargument2) == "coinmp") then fork = COINMP$ elseif (TRIM(sargument2) == "glpk") then fork = GLPK$ elseif (TRIM(sargument2) == "lpsolve") then fork = LPSOLVE$ elseif (TRIM(sargument2) == "scip") then fork = SCIP$ elseif (TRIM(sargument2) == "cplex") then fork = CPLEX$ elseif (TRIM(sargument2) == "gurobi") then fork = GUROBI$ elseif (TRIM(sargument2) == "xpress") then fork = XPRESS$ elseif (TRIM(sargument2) == "conopt") then fork = CONOPT$ elseif (TRIM(sargument2) == "ipopt") then fork = IPOPT$ elseif (TRIM(sargument2) == "knitro") then fork = KNITRO$ elseif (TRIM(sargument2) == "nova") then fork = NOVA$ elseif (TRIM(sargument2) == "worhp") then
fork = WORHP$ elseif (TRIM(sargument2) == "slpqpe_coinmp") then fork = SLPQPE_COINMP$ elseif (TRIM(sargument2) == "slpqpe_glpk") then fork = SLPQPE_GLPK$ elseif (TRIM(sargument2) == "slpqpe_lpsolve") then fork = SLPQPE_LPSOLVE$ elseif (TRIM(sargument2) == "slpqpe_scip") then fork = SLPQPE_SCIP$ elseif (TRIM(sargument2) == "slpqpe_cplex") then fork = SLPQPE_CPLEX$ elseif (TRIM(sargument2) == "slpqpe_gurobi") then fork = SLPQPE_GUROBI$ elseif (TRIM(sargument2) == "slpqpe_optonomy") then fork = SLPQPE_OPTONOMY$ elseif (TRIM(sargument2) == "slpqpe_xpress") then fork = SLPQPE_XPRESS$ elseif (TRIM(sargument2) == "secqpe_y12m") then fork = SECQPE_Y12M$ elseif (TRIM(sargument2) == "secqpe_ysmp") then fork = SECQPE_YSMP$ elseif (TRIM(sargument2) == "secqpe_nspiv") then fork = SECQPE_NSPIV$ elseif (TRIM(sargument2) == "secqpe_ma28") then fork = SECQPE_MA28$ elseif (TRIM(sargument2) == "secqpe_pardiso") then fork = SECQPE_PARDISO$ elseif (TRIM(sargument2) == "secqpe_sorve") then fork = SECQPE_SORVE$ elseif (TRIM(sargument2) == "secqpe_y12m_sorve") then fork = SECQPE_Y12M_SORVE$ elseif (TRIM(sargument2) == "secqpe_ysmp_sorve") then fork = SECQPE_YSMP_SORVE$ elseif (TRIM(sargument2) == "secqpe_nspiv_sorve") then fork = SECQPE_NSPIV_SORVE$ elseif (TRIM(sargument2) == "secqpe_ma28_sorve") then fork = SECQPE_MA28_SORVE$ elseif (TRIM(sargument2) == "secqpe_pardiso_sorve") then fork = SECQPE_PARDISO_SORVE$ else write(*,*)"<<< %ERROR% - unknown -fork= argument present." stop end if write(*,*)"<<< fork = ",TRIM(sargument2)," = ",fork case ("-flashback=") if (TRIM(sargument2) == "") then flashback = BINARYFILE$ elseif (TRIM(sargument2) == "binaryfile") then flashback = BINARYFILE$ elseif (TRIM(sargument2) == "binaryram") then flashback = BINARYRAM$ elseif (TRIM(sargument2) == "flatfile") then flashback = FLATFILE$ else write(*,*)"<<< %ERROR% - unknown -flashback= argument present." stop end if write(*,*)"<<< flashback = ",TRIM(sargument2)," = ",flashback case ("-fanfare=") if (TRIM(sargument2) /= "") then read(sargument2,*)fanfare fanfare = ABS(fanfare) show$ = fanfare end if write(*,*)"<<< fanfare = ",TRIM(sargument2)," = ",fanfare case ("-fuse=") if (TRIM(sargument2) == "cold") then fuse = COLDSTART$ elseif (TRIM(sargument2) == "warm") then fuse = WARMSTART$ else write(*,*)"<<< %ERROR% - unknown -fuse= argument present." stop end if write(*,*)"<<< fuse = ",TRIM(sargument2)," = ",fuse case ("-frequency=") if (TRIM(sargument2) /= "") then read(sargument2,*)frequency frequency = ABS(frequency) else write(*,*)"<<< %ERROR% - no -frequency= argument present." stop end if
write(*,*)"<<< frequency = ",frequency end select end do show$ = fanfare start$ = fuse stride$ = frequency c Specify the foreign ILP or INL file and if it exists, it will be used to augment or extend the matrix. foreign = TRIM(fact)//".ilp" if ((filter == QUALITY$) .or. (filter == QUALOGISTICS$)) then foreign = TRIM(fact)//".inl" end if supplementary$ = foreign c If "symbolic-form" specified but the solving-system is of the "sparsic-form" only then solve the c "sparsic-form". c c * Note that at the moment only IPOPT and SLPQPE can be of both the "sparsic" and "symbolic" forms. if ((fork == CONOPT$) .or. (fork == KNITRO$) .or. & (fork == NOVA$) .or. (fork == WORHP$)) then form = SPARSIC$ end if c Only allow "symbolic-form" with XPRESS-SLP and LINDO-SLP given that these are not possible to be called c using "sparsic-form". if ((fork == XPRESS$) .or. (fork == LINDO$)) then form = SYMBOLIC$ end if c Only allow discrete-time for logistics. if (filter == LOGISTICS$) then fit = DISCRETE$ end if c Only allow our nonlinear SLPQPE_ solver as the fork if filter equal "quality" and a LP solver has been specified. if (filter == QUALITY$) then if (fork == COINMP$) then fork = SLPQPE_COINMP$ elseif (fork == GLPK$) then fork = SLPQPE_GLPK$ elseif (fork == LPSOLVE$) then fork = SLPQPE_LPSOLVE$ elseif (fork == SCIP$) then fork = SLPQPE_SCIP$ elseif (fork == CPLEX$) then fork = SLPQPE_CPLEX$ elseif (fork == GUROBI$) then fork = SLPQPE_GUROBI$ end if end if write(*,*)"<<<" write(*,*)"<<<",TRIM(fact) write(*,*)"<<<" c Initialize or establish the environment using the settings and license files. rtnstat = IMPLroot(fact) if (rtnstat == INNON) then write(*,*)"<<< %ERROR% - Invalid or missing license file." stop elseif (rtnstat > 0) then write(*,*)"<<< %ERROR% - Missing settings file." stop elseif (rtnstat < 0) then write(*,*)"<<< %WARNING% - Number of missing settings = ",-rtnstat end if logmessage = "<<<" rtnstat = IMPLwritelog(logmessage) logmessage = "<<< Root successful." rtnstat = IMPLwritelog(logmessage) c Initialize or allocate the global memory using the memory file. rtnstat = IMPLreserve(fact,ALL) if (rtnstat == INNON) then write(*,*)"<<< %ERROR% - Invalid or missing license file." stop elseif (rtnstat > 0) then write(*,*)"<<< %ERROR% - Missing memory file." stop elseif (rtnstat < 0) then
write(*,*)"<<< %WARNING% - Missing memory setting." end if logmessage = "<<< Reserve successful." rtnstat = IMPLwritelog(logmessage) ftime = DCLOCK() dttime = ftime-stime ttime = ttime+dttime stime = ftime write(*,*)"<<<" write(*,*)"<<< Initialization time = ",dttime write(*,*)"<<<" c "Interface" the industrial/manufacturing optimization problem data. c c Interfacing the problem means reading in, inputing or importing the problem from the industrial/manufacturing c modeling language file (*.iml). face = IMPORT$ frames = CHAR(0) rtnstat = IMPLinterfaceri(fact,form,fit,filter,focus,face,factor,fob,frames) if (rtnstat == INNON) then write(*,*)"<<< %ERROR% - Invalid arguments." stop elseif (rtnstat > 0) then write(*,*)"<<< %ERROR% - Issue parsing import-file on line = ",rtnstat stop elseif (rtnstat < 0) then write(*,*)"<<< %WARNING% - Issue parsing import-file on line = ",ABS(rtnstat) end if rtnstat = IMPLreassure() if (rtnstat /= 0) then write(*,*)"<<< %ERROR% - Memory violation for resource-entity type = ",TRIM(IMPLreason(rtnstat)) stop end if logmessage = "<<< Reassure successful." rtnstat = IMPLwritelog(logmessage) ftime = DCLOCK() dttime = ftime-stime ttime = ttime+dttime stime = ftime write(*,*)"<<<" write(*,*)"<<< Import time = ",dttime write(*,*)"<<<" c "Serialize" or persist the problem-data i.e., sets, catalogs, lists, parameters and formulas representing the model-data c (master-data) and cycle-data (transactional-data). c c * Note that the "problem-data" (model-data and cycle-data) is converted to "matrix-data" in the "modeler" where it c creates/generates the variables (columns), constraints (rows) and derivatives (Jacobian/Hessian) (and expressions). rtnstat = IMPLrender(fact,ALL) if (rtnstat == 0) then logmessage = "<<< Render successful." rtnstat = IMPLwritelog(logmessage) else logmessage = "<<< Render unsuccessful." rtnstat = IMPLwritelog(logmessage) end if c "Model" the industrial/manufacturing optimization problem (IOP/MOP). c c Modeling the problem creates/generates the variables and constraints and any dependent sets, catalogs, lists and parameters c necessary to model all of the physical (structural), procedural (operational), projectional and phenomenological details. c In addition, the derivatives and expressions are also created or generated in the "modeler". c First, model the sets, catalogs, lists and parameters ("setup"). rtnstat = IMPLmodelerv(fact,form,fit,filter,focus,filler,foreign,force=PARAMETER) if (rtnstat == INNON) then write(*,*)"<<< %ERROR% - Invalid arguments." stop end if ftime = DCLOCK() dttime = ftime-stime ttime = ttime+dttime stime = ftime write(*,*)"<<<" write(*,*)"<<< Model (Sets, Lists, Parameters) time = ",dttime ttime2 = dttime c Second, model the variables ("specify"). rtnstat = IMPLmodelerv(fact,form,fit,filter,focus,filler,foreign,force=VARIABLE) if (rtnstat == INNON) then write(*,*)"<<< %ERROR% - Invalid arguments." stop end if ftime = DCLOCK() dttime = ftime-stime
ttime = ttime+dttime stime = ftime write(*,*)"<<< Model (Variables) time = ",dttime ttime2 = ttime2 + dttime c If this is a "warm-start" then open the variables' results data file if it exists and read in the result values c for the "original" problem i.e., previous solution-data. if ((fuse == WARMSTART$) .and. (fork /= SECQPE_SORVE$)) then lun = INILUN INQUIRE(UNIT=lun,OPENED=rtnstat) do while (rtnstat) lun = lun + 1 INQUIRE(UNIT=lun,OPENED=rtnstat) end do open(UNIT=lun, & FILE=TRIM(fact)//"_vv.dta", & STATUS="OLD", & ACCESS="SEQUENTIAL", & ACTION="READ", & FORM="FORMATTED", & SHARED, & IOSTAT=rtnstat) if (rtnstat == 0) then allocate(rval(1:vvc)) do i = 1,vvc read(lun,*)rval(i) end do close(lun) rtnstat = IMPLrevise2(VARIABLE,vvc,1,0,rval(1:vvc)) deallocate(rval) end if end if c Third (last), model the constraints ("specificate/simulate/stipulate"). c c * Note that only in the constraints section of the modeling do we require the formulas. rtnstat = IMPLmodelerc(fact,form,fit,filter,focus,filler,foreign,force=CONSTRAINT) if (rtnstat == INNON) then write(*,*)"<<< %ERROR% - Invalid arguments." stop elseif (rtnstat > 0) then write(*,*)"<<< %ERROR% - Invalid input." stop end if if ((fuse == WARMSTART$) .and. (fork == SECQPE_SORVE$)) then lun = INILUN INQUIRE(UNIT=lun,OPENED=rtnstat) do while (rtnstat) lun = lun + 1 INQUIRE(UNIT=lun,OPENED=rtnstat) end do open(UNIT=lun, & FILE=TRIM(fact)//"_vv.dta", & STATUS="OLD", & ACCESS="SEQUENTIAL", & ACTION="READ", & FORM="FORMATTED", & SHARED, & IOSTAT=rtnstat) if (rtnstat == 0) then allocate(rval(1:vvc)) do i = 1,vvc read(lun,*)rval(i) end do close(lun) rtnstat = IMPLrevise2(VARIABLE,vvc,1,0,rval(1:vvc)) deallocate(rval) end if end if ftime = DCLOCK() dttime = ftime-stime ttime = ttime+dttime stime = ftime write(*,*)"<<< Model (Constraints) time = ",dttime ttime2 = ttime2 + dttime write(*,*)"<<< Model time = ",ttime2 write(*,*)"<<<" rtnstat = IMPLreassure() if (rtnstat /= 0) then write(*,*)"<<< %ERROR% - Memory violation for resource-entity type = ",TRIM(IMPLreason(rtnstat)) stop end if logmessage = "<<< Reassure successful." rtnstat = IMPLwritelog(logmessage) c "Interface" the superstructure data i.e., export or write out the *.io, *.oi and *.iod files. face = INOUT$ rtnstat = IMPLinterfacere(fact,form,fit,filter,focus,face,factor,fob,frames)
face = OUTIN$ rtnstat = IMPLinterfacere(fact,form,fit,filter,focus,face,factor,fob,frames) face = INOUTDATA$ rtnstat = IMPLinterfacere(fact,form,fit,filter,focus,face,factor,fob,frames) c "Presolve" and "solve" the industrial/manufacturing optimization problem (IOP/MOP). rtnstat = IMPLpresolver(fact,form,fit,filter,focus,factorizer,fork,fresh,flashback,feedback) if (rtnstat == INNON) then write(*,*)"<<< %ERROR% - Invalid arguments." stop elseif (rtnstat > 0) then write(*,*)"<<< %ERROR% - Invalid input." stop elseif (rtnstat < 0) then write(*,*)"<<< %ERROR% - Not all variables/constraints converged - see *.tdt file." flag = 1 rtnstat = IMPLstatics(fact,CONTOL,flag) end if setting = "ECLOSURE2" write(*,*)"<<<" write(*,*)"<<< Solve closure = ",IMPLretrieveSTATISTIC(setting) write(*,*)"<<<" ftime = DCLOCK() dttime = ftime-stime ttime = ttime+dttime stime = ftime write(*,*)"<<<" write(*,*)"<<< Solve time = ",dttime write(*,*)"<<<" c Rerun/restart/repeat IMPL using different random-seeds by restoring the model-data and cycle-data from the c binary/unformatted *.bdt file (see the render() routine which writes this file). c c This is useful for non-convex nonlinear (quality) that exhibit several local optima. setting = "RANDSEED" rseed = INT(IMPLretrieveSETTING(setting)) do i = 1,frequency rtnstat = IMPLroot(fact) rtnstat = IMPLrefresh(ALL) rtnstat = IMPLrestore(fact,ALL) rtnstat = IMPLreceiveSETTING(setting,DBLE(rseed+i)) rtnstat = IMPLmodelerv(fact,form,fit,filter,focus,filler,foreign,force=PARAMETER) rtnstat = IMPLmodelerv(fact,form,fit,filter,focus,filler,foreign,force=VARIABLE) rtnstat = IMPLmodelerc(fact,form,fit,filter,focus,filler,foreign,force=CONSTRAINT) rtnstat = IMPLpresolver(fact,form,fit,filter,focus,factorizer,fork,fresh,flashback,feedback) end do c Save the solution-data ("original" problem) for the next run or execution if the warm-start is activated. if (fuse == WARMSTART$) then lun = INILUN INQUIRE(UNIT=lun,OPENED=rtnstat) do while (rtnstat) lun = lun + 1 INQUIRE(UNIT=lun,OPENED=rtnstat) end do open(UNIT=lun, & FILE=TRIM(fact)//"_vv.dta", & STATUS="UNKNOWN", & ACCESS="SEQUENTIAL", & ACTION="WRITE", & FORM="FORMATTED", & SHARED, & IOSTAT=rtnstat) if (rtnstat == 0) then allocate(rval(1:vvc)) call IMPLreview2(VARIABLE,vvc,1,0,rval(1:vvc)) do i = 1,vvc write(lun,*)rval(i) end do deallocate(rval) close(lun) end if end if c "Interface" the solution data i.e., export or write out the solution(s) in the *.exl file and using c *.oml file then "output" the selected solution variables results to the files specified. frames = CHAR(0) face = EXPORT$ rtnstat = IMPLinterfacere(fact,form,fit,filter,focus,face,factor,fob,frames) face = OUTPUT$ rtnstat = IMPLinterfacere(fact,form,fit,filter,focus,face,factor,fob,frames) ftime = DCLOCK() dttime = ftime-stime ttime = ttime+dttime stime = ftime write(*,*)"<<<"
write(*,*)"<<< Export time = ",dttime write(*,*)"<<<" ftime = DCLOCK() dttime = ftime-stime ttime = ttime+dttime stime = ftime write(*,*)"<<<" write(*,*)"<<< Serialization time = ",dttime write(*,*)"<<<" c "Show" the various data for problem-solving, debugging and troubleshooting. if (BTEST(fanfare,SHOWREPORT$)) then rtnstat = IMPLreport(fact) logmessage = "<<< Write report successful." rtnstat = IMPLwritelog(logmessage) end if if (BTEST(fanfare,SHOWSUMMARY$)) then rtnstat = IMPLsummary(fact) logmessage = "<<< Write summary successful." rtnstat = IMPLwritelog(logmessage) end if if (BTEST(fanfare,SHOWSTATICS$)) then flag = 1 rtnstat = IMPLstatics(fact,CONTOL,flag) logmessage = "<<< Write statics successful." rtnstat = IMPLwritelog(logmessage) end if if (BTEST(fanfare,SHOWSLACKNESS$)) then if (filter == QUALITY$) then ptr_IMPLmodelerc = LOC(IMPLmodelerc) rtnstat = IMPLslackness(fact,ptr_IMPLmodelerc,0d+0) logmessage = "<<< Write slackness successful." rtnstat = IMPLwritelog(logmessage) end if end if if (BTEST(fanfare,SHOWSCALINGS$)) then if ((form == SPARSIC$) .and. (filter == QUALITY$)) then rtnstat = IMPLscalings(fact) logmessage = "<<< Write scalings successful." rtnstat = IMPLwritelog(logmessage) end if end if if (BTEST(fanfare,SHOWSERIESSET$)) then rtnstat = IMPLwriteall(fact,SERIESSET,0,0) logmessage = "<<< Writeall series-set successful." rtnstat = IMPLwritelog(logmessage) end if if (BTEST(fanfare,SHOWSIMPLESET$)) then rtnstat = IMPLwriteall(fact,SIMPLESET,0,0) logmessage = "<<< Writeall simple-set successful." rtnstat = IMPLwritelog(logmessage) end if if (BTEST(fanfare,SHOWSYMBOLSET$)) then rtnstat = IMPLwriteall(fact,SYMBOLSET,0,0) logmessage = "<<< Writeall symbol-set successful." rtnstat = IMPLwritelog(logmessage) end if if (BTEST(fanfare,SHOWCATALOG$)) then rtnstat = IMPLwriteall(fact,CATALOG,0,0) logmessage = "<<< Writeall catalog successful." rtnstat = IMPLwritelog(logmessage) end if if (BTEST(fanfare,SHOWLIST$)) then rtnstat = IMPLwriteall(fact,LIST,0,0) logmessage = "<<< Writeall list successful." rtnstat = IMPLwritelog(logmessage) end if if (BTEST(fanfare,SHOWPARAMETER$)) then rtnstat = IMPLwriteall(fact,PARAMETER,0,0) logmessage = "<<< Writeall parameter successful." rtnstat = IMPLwritelog(logmessage) end if if (BTEST(fanfare,SHOWVARIABLE$)) then rtnstat = IMPLwriteall(fact,VARIABLE,0,0) logmessage = "<<< Writeall variable successful." rtnstat = IMPLwritelog(logmessage) end if if (BTEST(fanfare,SHOWCONSTRAINT$)) then rtnstat = IMPLwriteall(fact,CONSTRAINT,0,0) logmessage = "<<< Writeall constraint successful." rtnstat = IMPLwritelog(logmessage) end if if (BTEST(fanfare,SHOWFORMULA$)) then rtnstat = IMPLwriteall(fact,FORMULA,0,0) logmessage = "<<< Writeall formula successful." rtnstat = IMPLwritelog(logmessage) end if c Show the model sensitivity with sparsity-pattern. if (BTEST(fanfare,SHOWDERIVATIVE$)) then ptr_IMPLmodelerc = LOC(IMPLmodelerc)
flag = WRITESENSITIVITY rtnstat = IMPLwritesensitivity(fact,ptr_IMPLmodelerc,flag) logmessage = "<<< Write sensitivity successful." rtnstat = IMPLwritelog(logmessage) end if c Show model symbology with all variables and constraints as infix expressions. if (BTEST(fanfare,SHOWEXPRESSION$)) then if ((form == SYMBOLIC$) .or. & (filter == QUANTITY$) .or. (filter == LOGISTICS$)) then ptr_IMPLmodelerc = LOC(IMPLmodelerc) flag = WRITESYMBOLOGY rtnstat = IMPLwritesymbology(fact,ptr_IMPLmodelerc,flag) logmessage = "<<< Write symbology successful." rtnstat = IMPLwritelog(logmessage) end if end if c Show model sensability matrices i.e., A, B, C, Q, xm and z data files. if ((focus == ESTIMATION$) .and. (fork /= SVVE$) .and. (fork /= SSDE$)) then flag=0 rtnstat = IMPLwritesplitability(fact,ptr_IMPLmodelerc,flag) logmessage = "<<< Writeall splitability successful." rtnstat = IMPLwritelog(logmessage) end if c Deallocate global internal memory. rtnstat = IMPLrelease(ALL) if (rtnstat == 0) then logmessage = "<<< Release successful." rtnstat = IMPLwritelog(logmessage) else logmessage = "<<< Release unsuccessful." rtnstat = IMPLwritelog(logmessage) end if ftime = DCLOCK() dttime = ftime-stime ttime = ttime+dttime stime = ftime write(*,*)"<<<" write(*,*)"<<< Total time = ",ttime write(*,*)"<<<" c Finally, completely setup the problem again and show the symbolic representation of the problem if the form is "sparsic" c and the filter is "quality". if (BTEST(fanfare,SHOWEXPRESSION$)) then if ((form == SPARSIC$) .and. (filter == QUALITY$)) then rtnstat = IMPLroot(fact) rtnstat = IMPLreserve(fact,ALL) rtnstat = IMPLrestore(fact,ALL) form = SYMBOLIC$ rtnstat = IMPLmodelerv(fact,form,fit,filter,focus,filler,foreign,force=PARAMETER) rtnstat = IMPLmodelerv(fact,form,fit,filter,focus,filler,foreign,force=VARIABLE) rtnstat = IMPLmodelerc(fact,form,fit,filter,focus,filler,foreign,force=CONSTRAINT) fork = SOLVERLESS$ fresh = FIRSTSESSION$ rtnstat = IMPLpresolver(fact,form,fit,filter,focus,factorizer,fork,fresh,flashback,feedback) flag = WRITESYMBOLOGY rtnstat = IMPLwritesymbology(fact,ptr_IMPLmodelerc,flag) rtnstat = IMPLrelease(ALL) logmessage = "<<< Write symbology successful." rtnstat = IMPLwritelog(logmessage) end if end if end program IMPL