Professional Documents
Culture Documents
0
Development Kit
Programmer's Guide
USIM PAC
DEVELOPMENT KIT
BRGM Software
DEVELOPMENT KIT
Version 3.0.7.0
Caspeo
3 avenue Claude Guillemin - BP 6009
45060 ORLEANS CEDEX 2 FRANCE
Tel: +33-238-643615
Fax: +33-238-259742
E-mail: info@caspeo.net
USIM PAC
BRGM Software
USIM PAC
DEVELOPMENT KIT
BRGM Software
DEVELOPMENT KIT
USIM PAC
BRGM Software
DEVELOPMENT KIT
USIM PAC
BRGM Software
DEVELOPMENT KIT
USIM PAC
BRGM Software
DEVELOPMENT KIT
USIM PAC
BRGM Software
DEVELOPMENT KIT
GETPARAMDUPLI2PHA............................................................................................ 129
GETPARAMDUPLIPARAM ........................................................................................ 130
GETPARAMDUPLIPARAM1CRIT .............................................................................. 131
GETPARAMDUPLIPARAMPHASE ............................................................................ 131
GETPARAMDUPLIPHASE......................................................................................... 132
GETPARAMREAC...................................................................................................... 132
GETPARAMSTRING .................................................................................................. 134
GETPHADENSANDVOLFLOW .................................................................................. 134
GETPHASEDENSITY................................................................................................. 135
GETPHASELHV ......................................................................................................... 135
GETREALFORCOST ................................................................................................. 136
GETROSINRAMMLER ............................................................................................... 137
GETSIZEFRACTIONS................................................................................................ 138
GETSTOECHIOMOL.................................................................................................. 139
GETSTOECHIOMAS.................................................................................................. 139
GETSTREAMPHASEDENSITY.................................................................................. 140
GETUNITPARAM ....................................................................................................... 141
GETUNITPARAMDUPLI1CRIT .................................................................................. 141
GETUNITPARAMDUPLI2CRIT .................................................................................. 142
GETUNITPARAMDUPLI2PHA ................................................................................... 143
GETUNITPARAMDUPLIPARAM ................................................................................ 144
GETUNITPARAMDUPLIPARAM1CRIT...................................................................... 144
GETUNITPARAMDUPLIPARAMPHASE.................................................................... 145
GETUNITPARAMDUPLIPHASE ................................................................................ 146
GETUNITPARAMSTRING.......................................................................................... 147
GETVOLFLOWPERCOMP......................................................................................... 148
GETVOLFLOWRATE ................................................................................................. 148
MESSCONCAT .......................................................................................................... 149
MESSMODEL............................................................................................................. 149
MESSMODELINT ....................................................................................................... 150
MESSMODELNEWLINE ............................................................................................ 151
MESSMODELREAL ................................................................................................... 151
MESSMODELTAB...................................................................................................... 152
MESSMODELTEXT.................................................................................................... 153
MESSTOCONV .......................................................................................................... 154
MESSTOCOST........................................................................................................... 154
MESSTOPOWER ....................................................................................................... 154
USIM PAC
BRGM Software
10
DEVELOPMENT KIT
MESSTOSCREEN...................................................................................................... 155
NBCLASSCRIT........................................................................................................... 155
NBCRIT ...................................................................................................................... 156
NBHIER ...................................................................................................................... 156
NBHIER1D.................................................................................................................. 156
NBHIER2D.................................................................................................................. 157
NBPHA ....................................................................................................................... 157
NBPHATYP ................................................................................................................ 158
NBSORTIE ................................................................................................................. 158
NTYPPHA................................................................................................................... 158
NUMCRITYP .............................................................................................................. 159
NUMHIER0D .............................................................................................................. 159
NUMHIER1D .............................................................................................................. 159
NUMHIER2D .............................................................................................................. 160
NUMHIERSYS............................................................................................................ 161
NUMSHAREDHIERSYS............................................................................................. 161
NUMPHATYP ............................................................................................................. 162
PHASENAME ............................................................................................................. 162
PHAUTE ..................................................................................................................... 163
PERFPARREAC......................................................................................................... 163
PERFPARREAC0....................................................................................................... 164
PERFREAC0 .............................................................................................................. 165
PERFREACTION........................................................................................................ 166
PERFREACTION0...................................................................................................... 167
RECTAN ..................................................................................................................... 168
REGD ......................................................................................................................... 169
SEND0DTOSTREAMS............................................................................................... 169
SEND1DTOSTREAMS............................................................................................... 170
SEND2DTOSTREAMS............................................................................................... 171
SENDPHASEDENSITYTOSTREAMS........................................................................ 171
SENDTOPARAM ........................................................................................................ 172
SENDTOPARAMDUPLIPARAM................................................................................. 172
SENDTOPARAMNEXTAPP ....................................................................................... 173
SETCOMMINUTION................................................................................................... 173
SETCOST................................................................................................................... 174
SETFLOATPROP ....................................................................................................... 174
SETGROUP................................................................................................................ 175
USIM PAC
BRGM Software
DEVELOPMENT KIT
11
SETGROUPPARAM................................................................................................... 176
SETINFMODHIER ...................................................................................................... 176
SETINFOHELP........................................................................................................... 177
SETINFOMODEL ....................................................................................................... 177
SETNAME .................................................................................................................. 177
SETPARAMDATABASENAME .................................................................................. 178
SETPARAMDIALOGTYPE ......................................................................................... 178
SETPARAMDUPLI1CRIT ........................................................................................... 179
SETPARAMDUPLI2CRIT ........................................................................................... 180
SETPARAMDUPLI2PHA ............................................................................................ 180
SETPARAMDUPLIPARAM......................................................................................... 181
SETPARAMDUPLIPARAMPHASE............................................................................. 182
SETPARAMDUPLIPARAM1CRIT .............................................................................. 182
SETPARAMDUPLIPHASE ......................................................................................... 183
SETPARAMFILENAME .............................................................................................. 184
SETPARAMSTRING .................................................................................................. 184
SETPHA ..................................................................................................................... 185
SETPHASLIQ ............................................................................................................. 185
SETROSINRAMMLER ............................................................................................... 186
SETTYPE ................................................................................................................... 187
SHOWERROR............................................................................................................ 187
SIZECLASSNAME...................................................................................................... 188
SORTIE ...................................................................................................................... 188
TESTHIERTYP ........................................................................................................... 189
TESTPHAORE ........................................................................................................... 189
TESTPHASMOD ........................................................................................................ 189
TESTSIZECOMPFLOW ............................................................................................. 190
TESTSIZEFLOW ........................................................................................................ 190
TRACE........................................................................................................................ 190
ZEROPHA .................................................................................................................. 191
ZONERECT ................................................................................................................ 191
USIM PAC
BRGM Software
12
INCORPORATION OF ICONS
A - INCORPORATION OF ICONS
USIM PAC
BRGM Software
INCORPORATION OF ICONS
USIM PAC
13
BRGM Software
14
INCORPORATION OF ICONS
A.1 - INTRODUCTION
The principal function of the Flowsheet Drawing option is the preparation, for a
complete project, of a file containing the description of a flowsheet, not only in terms of
graphical characteristics, but also in terms of simulation logic. This logic is controlled by
USIM PAC before being able to use the flowsheet for further uses.
Thus an icon introduction results not only in the creation of a FORTRAN drawing
subroutine (VISUAL FORTRAN 6.6) but also in the insertion of the icon parameter
description (how many outputs, etc.).
The presence test is called to determine the icon list of the library.
The icon attributes are:
for each output location, the output number and the position of the location
center,
They are used to determine the number of outputs in the flowsheet drawing.
The icon drawing is called everywhere an icon is drawn (i.e., flowsheet display,
equipment description and icon configuration).
Icon
Presence test
Icon attributes
Icon drawing
USIM PAC
BRGM Software
INCORPORATION OF ICONS
15
When you are in the UPDK workspace, open the file Icouser.for by double clicking on
its name in the list:
USIM PAC
BRGM Software
16
INCORPORATION OF ICONS
C**********************************************************************
C*
USIM PAC 3.0
**
C*
Module: LIBICON
**
C*
File: ICOUSER.FOR
**
C*
Version: 3.0
**
C*
Date:
**
C*
Author:
**
C*
**
C**********************************************************************
C
C Subroutine beginning
C
INTEGER FUNCTION ICONUSER (XC, YC, NUM, BELONG)
INTEGER XC
INTEGER YC
INTEGER NUM
INTEGER BELONG
C
INCLUDE 'ICONS.FI'
C
INTEGER EXAMPLE
C
C Orientation depends on the unit number (NUM)
C
SELECT CASE (NUM)
C--------------------------------------------------------------------C
TRAINING SAMPLE
C---------------------------------------------------------------------CASE (USER+1)
ICONUSER = EXAMPLE (XC, YC, BELONG)
RETURN
C--------------------------------------------------------------------C---------------------------------------------------------------------CASE DEFAULT
ICONUSER = 0
RETURN
END SELECT
END
C--------------------------------------------------------------------C
TRAINING SAMPLE
C---------------------------------------------------------------------INTEGER FUNCTION EXAMPLE (XC, YC, BELONG)
INTEGER XC
INTEGER YC
INTEGER BELONG
C
INCLUDE 'ICONS.FI'
C
C Orientation depends on the working mode (BELONG)
C
SELECT CASE (BELONG)
CASE (UP_PRESENT)
EXAMPLE = 0
CASE (UP_PARAM)
CALL NBSORTIE (USER+1, 3)
CALL SORTIE (1, 1, XC+16, YC)
CALL SORTIE (2, 1, XC-16, YC)
CALL SORTIE (3, 2, XC, YC-16)
CALL ZONERECT (XC-32, XC+32, YC+20, YC-20)
ICONNAME = 'EXAMPLE' C
CALL SETNAME (ICONNAME)
CALL SETTYPE (USER+1)
EXAMPLE = 0
CASE (UP_DRAW)
CALL PHAUTE (XC, YC+16)
CALL TRACE (XC, YC-16)
CALL PHAUTE (XC-16, YC)
CALL TRACE (XC+16, YC)
CALL CERCLE (XC, YC, 16)
USIM PAC
BRGM Software
INCORPORATION OF ICONS
17
The function ICONUSER is called by the USIM PAC flowsheet drawing or by different
icon parameter determinations.
The four parameters of the ICONUSER function are:
BELONG, a flag that allows the function to run in three different working
modes.
The NUM parameter is the icon number. It allows calling the desired icon following the
associated CASE statement.
The value of NUM for the user defined icons must be greater than USER + 1. The first
icon can take the number USER + 1 such as in the example.
The parameter BELONG determines a working mode. It can take the values:
UP_PRESENT, UP_PARAM and UP_DRAW.
To add your icon, with the number ??, in the library, insert the following lines in the
ICONUSER function:
CASE (USER + ??)
ICONUSER = MYICON (XC, YC, BELONG)
RETURN
between your last icon call and the CASE DEFAULT statement.
MYICON is the function that contains the program code of your icon as the function
EXAMPLE in file Icouser.for.
This icon function can be programmed into another file. To do that:
enter the new file name with extension .for in the File name box (for example
Myicon.for),
click on OK. The new file is created, opened and added into the Source Files
list.
USIM PAC
BRGM Software
18
INCORPORATION OF ICONS
The function ICONUSER must recognize the type of your function MYICON. Then you
must add the line:
INTEGER MYICON
Now you can program your icon function at the end of the file ICOUSER.FOR file or in
another file as explained previously. The second solution is recommended to avoid
overwriting your own icons during an installation of a future version.
The description of the icon programming is detailed in section A.4.
When the icon programming is complete, build the new user-defined library. For that,
choose the menu item Build / Build LibIcon32.dll. The compilation of the *.for files
and the link utility are run to create the new version of LibIcon32.dll.
If no errors or warnings appear, quit the Visual Studio environment.
Run the USIM PAC application to adjust the configuration file ICONS.CNF to the new
library.
Choose the icon configuration to set a name to the new icon, to put it in the hierarchy
using the Parent menu and to associate the appropriate models to it.
The icon configuration is described in the part B.
USIM PAC
BRGM Software
INCORPORATION OF ICONS
19
The example selected to illustrate the icon programming is a magnetic separator icon.
We will take USER + 1 as the icon number.
The new icon is inserted in the library by means of an icon function MAGSEP. This
function is called by the ICONUSER function. Replace the line:
ICONUSER = EXAMPLE (XC, YC, BELONG)
by the line:
ICONUSER = MAGSEP (XC, YC, BELONG)
by the line:
INTEGER MYICON
C
INCLUDE 'ICONS.FI'
C
SELECT CASE (BELONG)
CASE (UP_PRESENT)
XXX = 1
CASE (UP_PARAM)
CALL NBSORTIE (, )
CALL SORTIE (, , XC+, YC-)
CALL ZONERECT (XC-, XC+, YC+, YC-)
ICONNAME = 'NAME OF XXX' C
CALL SETNAME (ICONNAME)
CALL SETTYPE ()
XXX = 1
CASE (UP_DRAW)
XXX = 1
USIM PAC
BRGM Software
20
INCORPORATION OF ICONS
CASE DEFAULT
XXX = 0
END SELECT
RETURN
C
END
C
You can automatically include this shell into your file by using a Visual Studio macro.
To have access to this macro, you need to add the macro file in the Visual Studio
macro file list. This operation has to be done only once:
in the Customize box, select the Add-ins and Macro Files thumb,
click on the Browse button and select the file Updk.dsm in the subdirectory
UPDK Files of the USIM PAC installation directory,
put the cursor where you want to insert the function shell,
select the menu item Tools / Macro and click on the OK button of the
information message if it appears (you can remove this information message by
unchecking Show this next time),
in the Macro Name list, select IconShell and click on Run to insert the shell.
Now you can replace the function name XXX by your function name MAGSEP.
In the UP_PRESENT case, the ICON function can take two values: 1 if the icon has to
be present, 0 if it does not. Thus, if a user wants to remove icons from the Toolbox
library, in the Flowsheet Drawing window, he does not need to delete the code or to put
it in comment lines, he just has to give the value 0 to the function return value in the
UP_PRESENT case.
By default, the icon shell gives 1 as the return value. The icon is present:
CASE (UP_PRESENT)
MAGSEP = 1
In this working mode, five kinds of functions must be called. The first one, NBSORTIE,
gives the number of output locations of the icon; the second, SORTIE, gives the output
location parameters (number, type, coordinates); the third, ZONERECT, gives the
USIM PAC
BRGM Software
INCORPORATION OF ICONS
21
coordinates of the icon influence area; the fourth, SETNAME, gives the default name of
the icon; and the fifth, SETTYPE, gives the location of the icon into the hierarchy.
An icon can have several output locations. Some of these output locations can be
equivalent for symmetry reasons in which case they have the same type.
The first parameter of the NBSORTIE function is the icon number (here: USER+1). For
the user-defined icons, the icon number must be "USER + X" where X is an integer
equal or greater than 1. For each icon, the X number must be different.
The second parameter of the NBSORTIE function is the number of output locations for
this icon. This number includes all the outputs, not only the real ones, but also all the
equivalent ones. For instance, a ball or a rod mill has got two output locations (two
possible ones) but only one real one.
The first parameter of the SORTIE function is the output location number. The numbers
must begin at 1. The second parameter is the output type, as explained above, the real
output number. The third and the fourth are the (x,y)-coordinates of the output area
center (a 1212-square), given from the icon center coordinates.
In our example, we have four output locations but two real outputs. The output
locations 1 and 3 are relative to real output 1 and the output locations 2 and 4 are
relative to real output 2 (see program display below).
The ZONERECT function defines the coordinates of the icon influence area, given from
the icon center coordinates. The parameters are:
The icon influence area must enclose the entire icon drawing and its output areas to
prevent icon superposition.
The SETNAME function gives a default name to the icon. This name is stored in the
predefined string variable (255 characters) ICONNAME which is passed as parameter
in the function. This variable is initialized like this:
ICONNAME = 'MAGNETIC SEPARATOR' C
USIM PAC
BRGM Software
22
INCORPORATION OF ICONS
The SETTYPE function sets the icon in a family represented by a generic icon (see
part B). Its parameter is the number of the generic icon. A generic icon must be an
existing icon. If the type is the current icon number, this icon becomes a generic icon.
In our example, we choose the type 29, which is the number of the existing magnetic
separator.
The return value of the UP_PARAM block is set to 1.
CASE (UP_PARAM)
CALL NBSORTIE (USER+1, 4)
CALL SORTIE (1, 1, XC-20, YC-10)
CALL SORTIE (2, 2, XC+20, YC+2)
CALL SORTIE (3, 1, XC+20, YC-10)
CALL SORTIE (4, 2, XC-20, YC+2)
CALL ZONERECT (XC-44, XC+44, YC+32, YC-24)
ICONNAME = 'MAGNETIC SEPARATOR' C
CALL SETNAME (ICONNAME)
CALL SETTYPE (29)
MAGSEP = 1
PHAUTE (X, Y) moves the pen to (X, Y) point without drawing a line.
TRACE (X, Y) draws a line from the current point to the (X, Y) point.
RECTAN (L, H, X, Y) draws a rectangle with length L and height H; (X, Y) is the
upper-left corner.
CERCLE (X, Y, R) draws a circle with (X, Y) as center coordinates and the R
radius.
ARCINF (X, Y, R, IARC) draws a lower circle arc, center on (X, Y) with an R
radius. IARC is the percentage of a complete circle (50 for a half circle, 25 for a
quarter).
ARCSUP (X, Y, R, IARC) draws an upper circle arc. The parameters have the
same meaning as the ARCINF ones.
Remark
It is possible to draw a new icon from an existing icon drawing by plotting function
addition. This is only possible with the UP_DRAW mode:
USIM PAC
BRGM Software
INCORPORATION OF ICONS
23
CASE (UP_DRAW)
MYICON = OLDICON (XC, YC, BELONG)
Additional drawing
MYICON = 1
C
INCLUDE 'ICONS.FI'
C
SELECT CASE (BELONG)
CASE (UP_PRESENT)
MAGSEP = 1
CASE (UP_PARAM)
CALL NBSORTIE (USER+1, 4)
CALL SORTIE (1, 1, XC-20, YC-10)
CALL SORTIE (2, 2, XC+20, YC+2)
CALL SORTIE (3, 1, XC+20, YC-10)
CALL SORTIE (4, 2, XC-20, YC+2)
CALL ZONERECT (XC-44, XC+44, YC+32, YC-24)
ICONNAME = 'MAGNETIC SEPARATOR' C
CALL SETNAME (ICONNAME)
CALL SETTYPE (29)
MAGSEP = 1
CASE (UP_DRAW)
USIM PAC
BRGM Software
24
INCORPORATION OF ICONS
The function call is made by the following part of the ICONUSER function:
CASE (USER + 1)
ICONUSER = MAGSEP (XC, YC, BELONG)
RETURN
Replace all
INTEGER*2
by
INTEGER.
Remove all
[FAR].
by
INCLUDE 'ICONS.FI'
USIM PAC
BRGM Software
INCORPORATION OF MODELS
25
B - INCORPORATION OF MODELS
USIM PAC
BRGM Software
26
USIM PAC
INCORPORATION OF MODELS
BRGM Software
INCORPORATION OF MODELS
27
B.1 - INTRODUCTION
This chapter explains how a new model is incorporated into the simulator. It does not
explain the principles of model design and specification.
the model is then getting the data it needs, making calculations, and answering
(or not),
Section B.4 explains in detail the different "working modes" of the models, and what the
models do when they are called.
USIM PAC
BRGM Software
28
INCORPORATION OF MODELS
This workspace opens two projects: LibIcon32 and LibUser32. It displays their names
in the left part of the Visual framework.
Activate the project LibUser32 by clicking with the right button of the mouse to display
the popup menu and select the menu item Set as active project. The name of the
project is then displayed in bold face.
To display the list of source files, expand the LibUser32 project by double clicking on
the corresponding line then expand the Source Files folder. Three files appear:
Messages.txt, Moduser.for and ModUser.lib. They must remain all together in this
list but you can add your own FORTRAN source files (files with extension .for).
Only the files Messages.txt and Moduser.for will be modified.
Remark
To be able to reload automatically the UPDK workspace during the Visual FORTRAN
startup:
When you are in the UPDK workspace, open the file Moduser.for by double clicking on
its name in the list:
C*********************************************************************
C*
USIM PAC 3.0
*
C*
Module: User defined models library
*
C*
File: MODUSER.FOR
*
C*
Version: 3.0
*
C*
Date:
*
C*
Author:
*
C*********************************************************************
C
C
C List of models
C
INTEGER FUNCTION MODELUSER (NUM, USE, USEOPT)
!DEC$ ATTRIBUTES DLLEXPORT :: MODELUSER
INTEGER NUM
INTEGER USE
INTEGER USEOPT
C
INCLUDE 'MODELS.FI'
C
INTEGER EXAMPLE
C
C Orientation depends on the unit number (NUM)
C
SELECT CASE (NUM)
C
CASE (NUMMOD_USER)
C
MODELUSER = EXAMPLE (USE, USEOPT)
C
RETURN
USIM PAC
BRGM Software
INCORPORATION OF MODELS
29
CASE DEFAULT
MODELUSER = 0
END SELECT
RETURN
END
C
enter the new file name with extension .for in the File name box (for example
Mymodel.for),
click on OK. The new file is created, opened and added in the Source Files list.
USIM PAC
BRGM Software
30
INCORPORATION OF MODELS
INTEGER MYMODEL
just after:
INTEGER EXAMPLE
Now you can program your model function at the end of the file MODUSER.FOR or in
another file as explained previously. The second solution is recommended to avoid
overwriting your own models during an installation of a future version.
The description of the model programming is detailed in section B.4.
When the model programming is complete, build the new user-defined library. For that,
choose the menu item Build / Build LibUser32.dll. The compilation of the *.for files
and the link utility are run to create the new version of LibUser.dll.
If no errors or warnings appear, quit the Visual Studio environment.
Run the USIM PAC application to adjust the configuration file MODELS.CNF to the
new library.
Choose the model parameters configuration to name the new model and its
parameters, then define the type of each parameter.
The model parameters configuration is described in part B. If you have the
Development Kit option, some options are available in addition in the configuration tool
(such as edition of minimum and maximum code or choice between integer and real).
To test your model, use it in different situations and observe the messages that are
sent.
USIM PAC
BRGM Software
INCORPORATION OF MODELS
31
The new model is inserted in the user-defined library by means of a model function
FLOG. This function is called by the MODELUSER function:
CASE (NUMMOD_USER + 1)
MODELUSER = FLOG (USE, USEOPT)
RETURN
C
C
USIM PAC
CASE (UP_PARAM)
SELECT CASE (USEOPT)
CASE (UP_PARAM_DIALOGTYPE)
CALL SETPARAMDIALOGTYPE (TP_SIMPLEPARAM)
List of the parameters:
1 :
XXX = 1
BRGM Software
32
INCORPORATION OF MODELS
END SELECT
RETURN
CASE (UP_COMP)
SELECT CASE (USEOPT)
CASE (UP_COMP_NECESSAIRE)
XXX = 1
CASE (UP_COMP_TRAITE)
XXX = 1
END SELECT
RETURN
CASE (UP_MODEL)
IF (USEOPT.EQ.UP_MODEL_MESSAGE) THEN
ANSWER = '' C
CALL MESSMODELNEWLINE (ANSWER)
CALL MESSMODEL (MODELNAME, 1, ANSWER)
CALL MESSMODELNEWLINE (ANSWER)
CALL MESSTOCONV (ANSWER)
ENDIF
XXX = 1
RETURN
CASE (UP_COST)
SELECT CASE (USEOPT)
CASE (UP_COST_CALC)
COUT = 0.D0
IF (COUT.EQ.0.D0) THEN
CALL SETCOST (0, ,COUT)
ELSE
CALL SETCOST (1, ,COUT)
ENDIF
XXX = 1
END SELECT
RETURN
CASE (UP_HELP)
SELECT CASE (USEOPT)
CASE (UP_HELP_INFO)
MODELHELPFILE = 'XXX.HLP' C
CALL SETINFOHELP (MODELHELPFILE, )
XXX = 1
END SELECT
RETURN
CASE DEFAULT
XXX = 0
RETURN
END SELECT
END
C
You can automatically include this shell into your file by using a Visual Studio macro.
To have access to this macro, you need to add the macro file in the Visual Studio
macro file list. This operation has to be done only one time (it is not necessary to do it if
you already did it for the icon incorporation):
in the Customize box select the Add-ins and Macro Files thumb,
click on the Browse button and select the file Updk.dsm in the subdirectory
UPDK Files of the USIM PAC installation directory,
USIM PAC
BRGM Software
INCORPORATION OF MODELS
33
put the cursor where you want to insert the function shell,
select the menu item Tools / Macro and click on the OK button of the
information message if it appears (you can remove this information message by
unchecking Show this next time),
in the Macro Name list select ModelShell and click on Run to insert the shell.
Now you can replace the function name XXX by your function name FLOG.
the material description elements that are not conserved (used for the material
balance tool).
CASE (UP_PRESENT)
SELECT CASE (USEOPT)
CASE (UP_PRESENT_TEST)
FLOG = 1
CASE (UP_PRESENT_INFO)
CALL SETINFOMODEL (NUMMOD_USER+1, 2, 8)
FLOG = 1
END SELECT
RETURN
The function SETINFOMODEL sets the model number, the number of output streams
and the number of parameters. This function must be called for each model.
If there is no information about the material conservation, the USIM PAC material
balance assumes that the model conserves the whole material. Otherwise, you must
indicate all the material description elements that will not be conserved.
The function SETINFMODHIER asserts that there are no conservation laws.
USIM PAC
BRGM Software
34
INCORPORATION OF MODELS
The function SETCOMMINUTION asserts that the size distribution is not kept (the
partial flowrate per size fraction is not conserved).
To take into account the model information, the return value must be 1.
C
C
C
C
C
C
The function SETPARAMDIALOGTYPE sets the dialog box type. Here, there are four
types of dialog boxes:
TP_NOPARAM
TP_SIMPLEPARAM
parameters,
dialog
TP_DUPLIPARAM
TP_CRUSHPARAM
database.
box
for
model
without
any
multiple
Version 3.0 doesn't take into account the type of the dialog box. It is automatically detected. The
different types are kept only for compatibility with previous versions.
USIM PAC
BRGM Software
INCORPORATION OF MODELS
35
The function SETPARAMDUPLI1CRIT declares the criterion and the phase type on
which the multiple parameter is duplicated (for more information about the phase
model, see part B).
In our example, parameters 5, 6 and 7 are multiple parameters. They are duplicated for
all the components of the ore or solid type phases.
As they have exactly the same duplication, these three parameters can be grouped in
one table with components in the lines and parameters in the columns. The function
SETGROUP (NUM, ANSWER) declares a group of parameters with the number NUM
and the name ANSWER. The name is stored in the file MESSAGES.TXT.
The function MESSMODEL (SEQUENCEKEYWORD, MESSAGEKEYWORD,
ANSWER) adds the message designated by MESSAGEKEYWORD of the sequence
SEQUENCEKEYWORD found in file MESSAGES.TXT to the string ANSWER.
In all models, it is advised to designate the sequence by MODELNAME and the
message by a number.
Notes
The string can be defined in the code with
ANSWER = 'TEXT' C
(The C attribute is necessary for compatibility with the C.), but it will not be
possible to modify it without compiling and linking.
The file MESSAGES.TXT can be edited with Visual Studio
Other usable functions for message formatting are described in parts C and D.
Example of [FLOG] sequence in the MESSAGES.TXT file:
[FLOG]
1=---> Flotation (2B)
2=Number of banks is 0.
3=Number of cells is 0.
4=Cell volume is 0 m3.
5=-> Cell\t%i
6=Phase %s\t
7=Recovery in cell (fraction)\t
8=Cumulative recovery (fraction)\t
9=%s\t
10=%g\t
11=Total weight recovery (fraction)\t%g
12=Error: Flotation (2B) - this model needs the floating ability
description of every component of the ore and solid phases.
13=Warning! Too high water flowrate in the concentrate. Verify your data.
14=Cumulative residence time (s)\t%g
20=Flotation parameters per component
You can also duplicate a parameter along the different phases, along two criteria of a
phase type, along one criterion of a phase type and one criterion of an another phase
type, along another parameter (integer parameter), along another parameter and a
criterion. For more details, see the function list in the part C.
To take into account the parameter information, the return value must be 1.
USIM PAC
BRGM Software
36
INCORPORATION OF MODELS
The function TESTPHASMOD tests the phase model coherence with an industrial
domain. The two domains considered here are:
The first domain requires the presence of at least one ore type phase and a size
distribution in this phase. The second one requires the presence of at least one ore
type phase and a component grade per size class in this phase.
The functions TESTPHAORE, TESTSIZEFLOW and TESTSIZECOMPFLOW can be
used in the UP_COMP working mode. All the functions used in the UP_MODEL
working mode relative to the phase model can be used in this working mode.
If the test is positive, the return value must be 1, else 0.
If the UP_COMP working mode in the model function is omitted (as in our example
FLOG), the return value will be 0 and the compatibility of the model with the phase
model could be negative in a future version of USIM PAC. So we recommend to insert
systematically the lines:
CASE (UP_COMP)
SELECT CASE (USEOPT)
CASE (UP_COMP_NECESSAIRE)
FLOG = 1
CASE (UP_COMP_TRAITE)
FLOG = 1
END SELECT
RETURN
USIM PAC
BRGM Software
INCORPORATION OF MODELS
37
C
C
C
The function GETPARAM (NUMBER, VALUE) is used for simple parameters (not
duplicated). VALUE must be declared as REAL*8. If the parameter is an integer,
VALUE has to be converted into INTEGER using the IIDINT intrinsic FORTRAN
function.
Testing parameter values and displaying messages on the screen
ANSWER = '' C
IF (NOMB.LE.0) THEN
CALL MESSMODEL (MODELNAME, 2, ANSWER)
CALL MESSTOSCREEN (ANSWER)
FLOG = 0
USIM PAC
BRGM Software
38
INCORPORATION OF MODELS
RETURN
ENDIF
IF (NOCELL.LE.0) THEN
CALL MESSMODEL (MODELNAME, 3, ANSWER)
CALL MESSTOSCREEN (ANSWER)
FLOG = 0
RETURN
ENDIF
IF(CELVOL.LE.0.D0) THEN
CALL MESSMODEL (MODELNAME, 4, ANSWER)
CALL MESSTOSCREEN (ANSWER)
FLOG = 0
RETURN
ENDIF
USIM PAC
BRGM Software
INCORPORATION OF MODELS
39
Note
Other usable function: GETOREFLOWRATE (NUMFLUX, DSOL).
In the case of no solids (null ore or solid phase flowrates), the calculation is stopped
with a return value of 1. The simulation continues and the output streams will be
calculated by default (everything in output 1 - tailings).
Testing the phase model
&
NCGMAX = 0
NTYMAX = 0
NBPHASOL = 0
DO NPHA = 1, NBPHA ()
IF (NTYPPHA (NPHA).EQ.TYPGAZ) THEN
OK = COPYPHA (2, NPHA)
OK = ZEROPHA (1, NPHA)
ELSEIF ((NTYPPHA (NPHA).EQ.TYPORE).OR.
(NTYPPHA (NPHA).EQ.TYPSOL)) THEN
NCG = NBCLASSCRIT (NPHA, CRITSIZE)
IF (NCG.LE.0) NCG = 1
IF (NCG.GT.NCGMAX) NCGMAX = NCG
NTY = NBCLASSCRIT (NPHA, CRITCOMP)
IF (NTY.LE.0) NTY = 1
IF (NTY.GT.NTYMAX) NTYMAX = NTY
NBPHASOL = NBPHASOL + 1
ENDIF
END DO
IF (NBPHASOL.LE.0) THEN
FLOG = 1
RETURN
ENDIF
The function NBPHA () returns the number of phases in the phase model.
The function NTYPPHA (NPHA) returns the type of the phase of number NPHA. It may
be TYPORE, TYPSOL, TYPLIQ, or TYPGAZ.
The function NBCLASSCRIT (NPHA, CRITERIA) returns the number of classes of the
criterion CRITERIA of the phase NPHA. It is an INTEGER variable. The criteria can be
CRITSIZE (size classes), CRITCOMP (components), CRITFLOT (flotation subpopulations), CRITFIXEDSP1, CRITFIXEDSP2 or CRITFIXEDSP3 (user-defined subpopulations).
The gas phases are supposed to go with the concentrate (output 2).
The function COPYPHA (OUTPUT, NPHA) copies the phase NPHA in the output of
index OUTPUT as is.
The function ZEROPHA (OUTPUT, NPHA) initializes the phase NPHA in the output of
index OUTPUT with a null flowrate.
Allocating arrays
ALLOCATE
ALLOCATE
ALLOCATE
ALLOCATE
USIM PAC
BRGM Software
40
INCORPORATION OF MODELS
ALLOCATE
ALLOCATE
ALLOCATE
ALLOCATE
The dimensions of arrays when allocated must not be 0. Each ALLOCATEd array has
to be DEALLOCATEd (see later).
Declaration: REAL*8 (or INTEGER) ARRAY [ALLOCATABLE] (:,:) . The number of ":"
represents the number of dimensions of the array.
Getting duplicated parameters:
C
&
The function BCLASSGRA (NPHA, BSUP) gives the upper bounds of the size classes
in meters. REAL*8 array BSUP has to be allocated.
Getting the mean size of each class
DO I = 1, NCG
BSUP (I) = BSUP (I) * 1.D06
END DO
DO I = 1, NCG - 1
BSUP (I) = DSQRT (BSUP (I) * BSUP (I+1))
END DO
IF (BSUP (NCG).LT.1.D0) THEN
BSUP (NCG) = BSUP (NCG) / 2.D0
ELSE
BSUP (NCG) = DSQRT (BSUP (NCG))
ENDIF
USIM PAC
BRGM Software
INCORPORATION OF MODELS
41
The models generally use the geometric mean of the size class limits, and the
arithmetic mean for the finest class (then assuming the lower limit is 0 m).
Calculation of the kinetic constant by component and size class
C
&
(BSUP)
(MAXDIM)
(FACEDIM)
(ALPHA)
The function GETCOMPDENSITY (NPHA, NTY, ARRAY) gives the density of the NTY
components of the phase NPHA into the ARRAY. If the density is not specified per
component in the phase model, and if there are several components, each of them has
the density of the phase. If the density of the phase is not specified in the phase model,
this function returns a negative value.
Getting information per phase on streams
USIM PAC
DO I = 1, NTY
ALIM (I, NPHASOL) = 0.D0
REC (I, NPHASOL) = 0.D0
1 = no floating, 2 = slow, 3 = fast
DEBIFLO (I, 1, NPHASOL) = 0.D0
DEBIFLO (I, 2, NPHASOL) = 0.D0
DEBIFLO (I, 3, NPHASOL) = 0.D0
DO J = 1, NCG
FLOR (J, I, NPHASOL) = 0.D0
FLOL (J, I, NPHASOL) = 0.D0
SORR (J, I, NPHASOL) = 0.D0
SORL (J, I, NPHASOL) = 0.D0
END DO
END DO
BRGM Software
42
INCORPORATION OF MODELS
USIM PAC
DO I = 1, NTY
DO J = 1, NCG
Division by the number of banks
ENTR (J, I) = ENTR (J, I) / DBLE (NOMB)
BRGM Software
INCORPORATION OF MODELS
43
&
NPHASOL)
&
NPHASOL)
&
END DO
DEBIFLO (I, 1, NPHASOL) = ALIM (I, NPHASOL)
- DEBIFLO (I, 2, NPHASOL) - DEBIFLO (I, 3, NPHASOL)
END DO
DEALLOCATE (ENTR)
DEALLOCATE (NOFLO)
DEALLOCATE (SLOWFLO)
DEALLOCATE (FASTFLO)
ENDIF
ENDIF
END DO
Calculation begins...
VOLFLO = (DSOLVOL + DLIQVOL) / DBLE (NOMB)
DSOL = DSOL / DBLE (NOMB)
DLIQ = DLIQ / DBLE (NOMB)
DLIQ2 = 0.D0
DSOL1 = DSOL
DLIQ1 = DLIQ
C Calculation for each cell of the bank of the mass flowrate of solids
and water in the froth
TS = 0.D0
DO CELL=1,NOCELL
IF (VOLFLO.GT.0.1D-06) THEN
IF (USEOPT.EQ.UP_MODEL_MESSAGE) THEN
ANSWER = '' C
CALL MESSMODELNEWLINE (ANSWER)
CALL MESSMODELINT (MODELNAME, 5, CELL, ANSWER)
CALL MESSTOCONV (ANSWER)
ENDIF
C
Cell residence time
TSC = CELVOL / VOLFLO
C
Cumulative residence time
TS = TS + TSC
&
DSOL2 = 0.D0
PVS = 0.D0
NPHASOL = 0
DO NPHA = 1, NBPHA ()
IF ((NTYPPHA (NPHA).EQ.TYPORE).OR.
(NTYPPHA (NPHA).EQ.TYPSOL)) THEN
NPHASOL = NPHASOL + 1
NCG = NBCLASSCRIT (NPHA, CRITSIZE)
IF (NCG.LE.0) NCG = 1
NTY = NBCLASSCRIT (NPHA, CRITCOMP)
IF (NTY.LE.0) NTY = 1
IF (USEOPT.EQ.UP_MODEL_MESSAGE) THEN
ANSWER = '' C
ANSWER1= '' C
ANSWER2= '' C
CALL MESSMODELNEWLINE (ANSWER)
NAME = '' C
OK = PHASENAME (NPHA, NAME)
CALL MESSMODELTEXT (MODELNAME, 6, NAME, ANSWER)
CALL MESSMODELNEWLINE (ANSWER1)
CALL MESSMODEL (MODELNAME, 7, ANSWER1)
USIM PAC
BRGM Software
44
INCORPORATION OF MODELS
Calculation continues...
DO J = 1, NTY
SUMDEBIT = 0.D0
SUMENTRE = 0.D0
DO I = 1, NCG
TMP = 1.D0
NPHASOL) * TSC)
C
1.D0
(1.D0
KC
(I,
J,
DEBITR
SORL (I, J, NPHASOL) = SORL (I, J, NPHASOL) +
DEBITL
PVS = PVS + (DEBITR + DEBITL) / DENS (J,
NPHASOL)
C
&
NPHASOL)
Recovery of component j
SUMDEBIT = SUMDEBIT + DEBITR + DEBITL
SUMENTRE = SUMENTRE + FLOR (I, J, NPHASOL)
+
FLOL
(I,
J,
DEBITR
FLOL (I, J, NPHASOL) = FLOL (I, J, NPHASOL) DEBITL
END DO
IF (USEOPT.EQ.UP_MODEL_MESSAGE) THEN
NAME = '' C
OK = COMPONENTNAME (NPHA, J, NAME)
CALL
MESSMODELTEXT
(MODELNAME,
9,
NAME,
ANSWER)
SUMENTRE = SUMENTRE + DEBIFLO (J, 1, NPHASOL)
IF (SUMENTRE.GT.0.D0) THEN
TMP = SUMDEBIT / SUMENTRE
ELSE
TMP = 0.D0
ENDIF
CALL
MESSMODELREAL
(MODELNAME,
10,
TMP,
ANSWER1)
IF (ALIM (J, NPHASOL).GT.0.D0) THEN
TMP = REC (J, NPHASOL) / ALIM (J, NPHASOL)
ELSE
TMP = 0.D0
ENDIF
CALL
MESSMODELREAL
(MODELNAME,
10,
TMP,
ANSWER2)
ENDIF
END DO
IF (USEOPT.EQ.UP_MODEL_MESSAGE) THEN
CALL MESSTOCONV (ANSWER)
CALL MESSTOCONV (ANSWER1)
CALL MESSTOCONV (ANSWER2)
ENDIF
ENDIF
END DO
IF (USEOPT.EQ.UP_MODEL_MESSAGE) THEN
ANSWER = '' C
CALL MESSMODELNEWLINE(ANSWER)
TMP = (DSOL - DSOL1)/DSOL
CALL MESSMODELREAL (MODELNAME,11,TMP,ANSWER)
USIM PAC
BRGM Software
INCORPORATION OF MODELS
45
CALL MESSTOCONV(ANSWER)
CALL MESSMODELREAL (MODELNAME,14,TS,ANSWER)
CALL MESSTOCONV(ANSWER)
ENDIF
...
C
Partition of water
DLIQCONC = DSOL2 * LIQPC / (1.D0 - LIQPC)
IF (DLIQCONC.GE.DLIQ1) THEN
DLIQCONC = DLIQ1
IF (USEOPT.EQ.UP_MODEL_MESSAGE) THEN
ANSWER = '' C
CALL MESSMODELNEWLINE (ANSWER)
CALL MESSMODEL (MODELNAME, 13, ANSWER)
CALL MESSTOCONV (ANSWER)
ENDIF
ENDIF
VOLFLO = VOLFLO - PVS - DLIQCONC
IF (VOLFLO.LE.0.D0) VOLFLO = 0.1D-06
DLIQ2 = DLIQ2 + DLIQCONC
IF (DLIQ2.GT.DLIQ) THEN
DLIQ2 = DLIQ
ENDIF
DLIQ1 = DLIQ - DLIQ2
ENDIF
END DO
&
SORL
NCG,
NTY,
NCG,
NTY,
(I,J,NPHASOL)
&
SOR1)
&
SOR2)
C
C
USIM PAC
Sub-population of floatability
OK = NUMHIERSYS (NPHA, NSCONFLOTFLOW)
IF (OK.GT.0) THEN
concentrate
ALLOCATE (NOFLO (NTY), SLOWFLO (NTY), FASTFLO (NTY))
ALLOCATE (INTER (NTY))
DO J = 1, NTY
TMP = 0.D0
TMPR = 0.D0
TMPL = 0.D0
DO I = 1, NCG
BRGM Software
46
INCORPORATION OF MODELS
USIM PAC
BRGM Software
INCORPORATION OF MODELS
47
(KC)
(FLOR)
(FLOL)
(SORR)
(SORL)
(DENS)
(REC)
(ALIM)
(DEBIFLO)
DLIQ1 = DLIQ1 *
OK = SETPHASLIQ
DLIQ2 = DLIQ2 *
OK = SETPHASLIQ
DBLE (NOMB)
(1, DLIQ1)
DBLE (NOMB)
(2, DLIQ2)
FLOG = 1
RETURN
The function SETPHASLIQ (NUMOUT, FLOWRATE) sets the FLOWRATE of all liquid
phases in the output NUMOUT, keeping the proportions of the feed.
The power consumption of a unit of equipment is calculated in this working mode and
displayed into the power consumption file POWER.INF (a text file).
Generally, the UP_POWER working mode is called after a UP_MODEL working mode.
Then, the power consumption is generally calculated with the values of the model
parameters (input or output parameters).
The sequence of actions is:
data receiving,
power computation,
text assembling,
USIM PAC
BRGM Software
48
INCORPORATION OF MODELS
The data receiving is carried out as in the UP_MODEL working mode. The function
GETPARAM calls the model parameters.
The text that displays the power consumption is made as in the UP_MODEL working
mode by the use of the MESSMODEL, MESSMODELINT, MESSMODELREAL
functions. The text is built in a string buffer (ANSWER in our example) before being
sent in the power consumption file using the function MESSTOPOWER.
The example taken to illustrate the power calculation is the rod mill model: BAR1. In
this example, the power consumption text recalls the number of mills in parallel and
gives the calculated rod load and power consumption:
CASE (UP_POWER)
OK1 = GETPARAM (1, PARAM)
IPARALL = HFIX (PARAM)
OK1 = GETPARAM (12, TR)
OK1 = GETPARAM (11, PWT)
ANSWER = '' C
CALL MESSMODELNEWLINE (ANSWER)
CALL MESSMODELINT (MODELNAME, 8, IPARALL, ANSWER)
CALL MESSMODELNEWLINE (ANSWER)
CALL MESSMODELREAL (MODELNAME, 31, TR, ANSWER)
CALL MESSTOPOWER (ANSWER)
CALL MESSMODELREAL (MODELNAME, 12, PWT, ANSWER)
CALL MESSTOPOWER (ANSWER)
RETURN
The cost estimation of a unit of equipment is called by the capital cost calculation.
The UP_COST working mode has one variant: UP_COST_CALC.
Generally, the UP_COST working mode is called after a UP_MODEL working mode.
Then, the cost estimation is generally calculated with the values of the model
parameters (input or output parameters).
The sequence of actions is:
data receiving,
cost computation,
USIM PAC
BRGM Software
INCORPORATION OF MODELS
49
The data receiving is carried out as in the UP_MODEL working mode. The function
GETPARAM retrieves the model parameters.
Some information required for the cost calculation may not be in the USIM PAC
standard set of data. This information is input by the user through a dialog box (see
part B). Three functions can be used:
GETINTFORCOST
The UP_HELP working mode has one variant: UP_HELP_INFO. It is used to declare
the user-defined help file that contains help about your model and the model topic
number.
The function SETINFOHELP sets the help file name and the topic number.
It is recommended to use the same number for the model number and the topic
number.
CASE (UP_HELP)
SELECT CASE (USEOPT)
CASE (UP_HELP_INFO)
MODELHELPFILE = 'MODELS.HLP' C
CALL SETINFOHELP (MODELHELPFILE, NUMMOD_PHYSEP+7)
FLOG = 1
END SELECT
RETURN
USIM PAC
BRGM Software
50
INCORPORATION OF MODELS
The user-defined help file has the Windows help format. It can be built with the
Microsoft help tools. These tools are not delivered with USIM PAC Development Kit.
alpha
delta
a
xi
=
=
=
=
adjustment constant
size of the easiest floating particle
size of the largest floating particle
size of class i (geometric mean of limits)
C
C
C
C
C
C
C
C
USIM PAC
Parameters
REAL*8 PARAM, CELVOL, LIQPC
INTEGER NOMB, NOCELL
Variables
SOR1(,)
= tailings
REAL*8 SOR1 [ALLOCATABLE] (:,:)
SOR2(,)
= concentrate
REAL*8 SOR2 [ALLOCATABLE] (:,:)
VOLFLO
= volumetric flowrate in each cell
PVS
= solids volumetric flowrate in each cell
DENS(,)
= density
REAL*8 DENS [ALLOCATABLE] (:,:)
MAXDIM()
= size of the largest floating particle (m)
REAL*8 MAXDIM [ALLOCATABLE] (:)
FACEDIM()
= size of the easiest floating particle (m)
REAL*8 FACEDIM [ALLOCATABLE] (:)
BRGM Software
INCORPORATION OF MODELS
C
C
C
C
C
C
51
ALPHA()
= adjustment parameter
REAL*8 ALPHA [ALLOCATABLE] (:)
KC(,,)
= kinetic constant
REAL*8 KC [ALLOCATABLE] (:,:,:)
FLOR(,,)
= feed mass flowrate (fast floating)
REAL*8 FLOR [ALLOCATABLE] (:,:,:)
FLOL(,,)
= feed mass flowrate (slow floating)
REAL*8 FLOL [ALLOCATABLE] (:,:,:)
SORR(,,)
= mass flowrate in froth (fast floating)
REAL*8 SORR [ALLOCATABLE] (:,:,:)
SORL(,,)
= mass flowrate in froth (slow floating)
REAL*8 SORL [ALLOCATABLE] (:,:,:)
INTEGER I, J, OK, CELL
INTEGER NCG, NTY, NPHA
INTEGER NCGMAX, NTYMAX, NBPHASOL, NPHASOL
REAL*8 DSOL, DSOL1, DSOL2
REAL*8 DLIQ, DLIQ1, DLIQ2, PVS, DLIQCONC
REAL*8 DSOLVOL, DLIQVOL, VOLFLO
REAL*8 TMP, TMP1, TMP2, TMP3, TS, TSC, TMPR, TMPL
REAL*8 DEBIT, DEBITR, DEBITL
REAL*8 SUMDEBIT, SUMENTRE
REAL*8 ENTR [ALLOCATABLE] (:,:)
REAL*8 BSUP [ALLOCATABLE] (:)
REAL*8 INTER [ALLOCATABLE] (:)
REAL*8 REC [ALLOCATABLE] (:,:)
REAL*8 ALIM [ALLOCATABLE] (:,:)
REAL*8 NOFLO [ALLOCATABLE] (:)
REAL*8 SLOWFLO [ALLOCATABLE] (:)
REAL*8 FASTFLO [ALLOCATABLE] (:)
REAL*8 DEBIFLO [ALLOCATABLE] (:,:,:)
CHARACTER*254 ANSWER1
CHARACTER*254 ANSWER2
REAL*8 COUT, EVP
MODELNAME='FLOG' C
ANSWER = '' C
SELECT CASE (USE)
CASE (UP_PRESENT)
SELECT CASE (USEOPT)
CASE (UP_PRESENT_TEST)
FLOG = 1
CASE (UP_PRESENT_INFO)
CALL SETINFOMODEL (NUMMOD_PHYSEP+7, 2, 8)
FLOG = 1
END SELECT
RETURN
C
C
C
C
C
C
USIM PAC
CASE (UP_PARAM)
SELECT CASE (USEOPT)
CASE (UP_PARAM_DIALOGTYPE)
CALL SETPARAMDIALOGTYPE (TP_DUPLIPARAM)
List of parameters:
1 : Number of banks in parallel
2 : Number of cells in a bank
3 : Pulp volume in one cell (m3)
4 : % water in the concentrate
Flotation parameters group
ANSWER = '' C
CALL MESSMODEL (MODELNAME, 20, ANSWER)
CALL SETGROUP (1, ANSWER)
5 : Size of the largest floating particle (m) per component
CALL SETPARAMDUPLI1CRIT (5, TYPORE, CRITCOMP)
CALL SETPARAMDUPLI1CRIT (5, TYPSOL, CRITCOMP)
CALL SETGROUPPARAM (1, 5)
6 : Size of the easiest floating particle (m) per component
CALL SETPARAMDUPLI1CRIT (6, TYPORE, CRITCOMP)
CALL SETPARAMDUPLI1CRIT (6, TYPSOL, CRITCOMP)
CALL SETGROUPPARAM (1, 6)
7 : Adjustment parameter per component
BRGM Software
52
INCORPORATION OF MODELS
C
C
C
C
USIM PAC
BRGM Software
INCORPORATION OF MODELS
&
&
53
&
USIM PAC
BRGM Software
54
INCORPORATION OF MODELS
(BSUP)
(MAXDIM)
(FACEDIM)
(ALPHA)
I)
&
NPHASOL)
&
NPHASOL)
&
USIM PAC
BRGM Software
INCORPORATION OF MODELS
55
DEALLOCATE (FASTFLO)
ENDIF
ENDIF
END DO
VOLFLO = (DSOLVOL + DLIQVOL) / DBLE (NOMB)
DSOL = DSOL / DBLE (NOMB)
DLIQ = DLIQ / DBLE (NOMB)
DLIQ2 = 0.D0
DSOL1 = DSOL
DLIQ1 = DLIQ
C Calculation for each cell of the bank of the mass flowrate of solids
C and water in the froth
TS = 0.D0
DO CELL=1,NOCELL
IF (VOLFLO.GT.0.1D-06) THEN
IF (USEOPT.EQ.UP_MODEL_MESSAGE) THEN
ANSWER = '' C
CALL MESSMODELNEWLINE (ANSWER)
CALL MESSMODELINT (MODELNAME, 5, CELL, ANSWER)
CALL MESSTOCONV (ANSWER)
ENDIF
C
Cell residence time
TSC = CELVOL / VOLFLO
C
Cumulative residence time
TS = TS + TSC
&
DSOL2 = 0.D0
PVS = 0.D0
NPHASOL = 0
DO NPHA = 1, NBPHA ()
IF ((NTYPPHA (NPHA).EQ.TYPORE).OR.
(NTYPPHA (NPHA).EQ.TYPSOL)) THEN
NPHASOL = NPHASOL + 1
NCG = NBCLASSCRIT (NPHA, CRITSIZE)
IF (NCG.LE.0) NCG = 1
NTY = NBCLASSCRIT (NPHA, CRITCOMP)
IF (NTY.LE.0) NTY = 1
IF (USEOPT.EQ.UP_MODEL_MESSAGE) THEN
ANSWER = '' C
ANSWER1= '' C
ANSWER2= '' C
CALL MESSMODELNEWLINE (ANSWER)
NAME = '' C
OK = PHASENAME (NPHA, NAME)
CALL MESSMODELTEXT (MODELNAME, 6, NAME, ANSWER)
CALL MESSMODELNEWLINE (ANSWER1)
CALL MESSMODEL (MODELNAME, 7, ANSWER1)
CALL MESSMODELNEWLINE (ANSWER2)
CALL MESSMODEL (MODELNAME, 8, ANSWER2)
ENDIF
DO J = 1, NTY
SUMDEBIT = 0.D0
SUMENTRE = 0.D0
DO I = 1, NCG
TMP
=
1.D0
KC(I,J,NPHASOL)*TSC)
C
1.D0
(1.D0
SORL
DEBITR
(I,J,NPHASOL)
SORL
(I,J,NPHASOL)
DEBITL
PVS = PVS + (DEBITR + DEBITL) / DENS (J,
NPHASOL)
C
USIM PAC
Recovery of component j
BRGM Software
56
INCORPORATION OF MODELS
&
NPHASOL)
REC
DEBITR+DEBITL
C
(J,NPHASOL)
REC
(J,NPHASOL)
J,
+
FLOL
DEBITR
(I,J,NPHASOL)
FLOL
(I,J,NPHASOL)
DEBITL
END DO
IF (USEOPT.EQ.UP_MODEL_MESSAGE) THEN
NAME = '' C
OK = COMPONENTNAME (NPHA, J, NAME)
CALL
MESSMODELTEXT
(MODELNAME,
9,
NAME,
ANSWER)
SUMENTRE = SUMENTRE + DEBIFLO (J, 1, NPHASOL)
IF (SUMENTRE.GT.0.D0) THEN
TMP = SUMDEBIT / SUMENTRE
ELSE
TMP = 0.D0
ENDIF
CALL
MESSMODELREAL
(MODELNAME,
10,
TMP,
ANSWER1)
IF (ALIM (J, NPHASOL).GT.0.D0) THEN
TMP = REC (J, NPHASOL) / ALIM (J, NPHASOL)
ELSE
TMP = 0.D0
ENDIF
CALL
MESSMODELREAL
(MODELNAME,
10,
TMP,
ANSWER2)
USIM PAC
ENDIF
END DO
IF (USEOPT.EQ.UP_MODEL_MESSAGE) THEN
CALL MESSTOCONV (ANSWER)
CALL MESSTOCONV (ANSWER1)
CALL MESSTOCONV (ANSWER2)
ENDIF
ENDIF
END DO
IF (USEOPT.EQ.UP_MODEL_MESSAGE) THEN
ANSWER = '' C
CALL MESSMODELNEWLINE(ANSWER)
TMP = (DSOL - DSOL1)/DSOL
CALL MESSMODELREAL (MODELNAME,11,TMP,ANSWER)
CALL MESSTOCONV(ANSWER)
CALL MESSMODELREAL (MODELNAME,14,TS,ANSWER)
CALL MESSTOCONV(ANSWER)
ENDIF
Partition of water
DLIQCONC = DSOL2 * LIQPC / (1.D0 - LIQPC)
IF (DLIQCONC.GE.DLIQ1) THEN
DLIQCONC = DLIQ1
IF (USEOPT.EQ.UP_MODEL_MESSAGE) THEN
ANSWER = '' C
CALL MESSMODELNEWLINE (ANSWER)
CALL MESSMODEL (MODELNAME, 13, ANSWER)
CALL MESSTOCONV (ANSWER)
ENDIF
ENDIF
VOLFLO = VOLFLO - PVS - DLIQCONC
IF (VOLFLO.LE.0.D0) VOLFLO = 0.1D-06
DLIQ2 = DLIQ2 + DLIQCONC
IF (DLIQ2.GT.DLIQ) THEN
DLIQ2 = DLIQ
ENDIF
DLIQ1 = DLIQ - DLIQ2
ENDIF
END DO
BRGM Software
INCORPORATION OF MODELS
&
57
SORL
NCG,
NTY,
NCG,
NTY,
(I,J,NPHASOL)
&
SOR1)
&
SOR2)
C
C
USIM PAC
Sub-population of floatability
OK = NUMHIERSYS (NPHA, NSCONFLOTFLOW)
IF (OK.GT.0) THEN
concentrate
ALLOCATE (NOFLO (NTY), SLOWFLO (NTY), FASTFLO (NTY))
ALLOCATE (INTER (NTY))
DO J = 1, NTY
TMP = 0.D0
TMPR = 0.D0
TMPL = 0.D0
DO I = 1, NCG
TMP = TMP + SOR2 (I, J)
TMPR = TMPR + SORR (I, J, NPHASOL)
TMPL = TMPL + SORL (I, J, NPHASOL)
END DO
INTER (J) = TMP
TMP = TMPR + TMPL
IF (TMP.GT.0.D0) THEN
FASTFLO (J) = TMPR / TMP
SLOWFLO (J) = TMPL / TMP
ELSE
FASTFLO (J) = 0.D0
SLOWFLO (J) = 0.D0
ENDIF
NOFLO (J) = 0.D0
END DO
OK=SETFLOATPROP(2,NPHA,NTY,INTER,NOFLO,SLOWFLO,FASTFLO)
tailings
DO J = 1, NTY
TMP = 0.D0
TMPR = 0.D0
TMPL = 0.D0
DO I = 1, NCG
TMP = TMP + SOR1 (I, J)
TMPR = TMPR + SORR (I, J, NPHASOL)
TMPL = TMPL + SORL (I, J, NPHASOL)
END DO
INTER (J) = TMP
TMP = TMP / DBLE (NOMB)
IF (TMP.GT.0.D0) THEN
FASTFLO (J) = (DEBIFLO (J,3,NPHASOL) - TMPR) / TMP
BRGM Software
58
INCORPORATION OF MODELS
(KC)
(FLOR)
(FLOL)
(SORR)
(SORL)
(DENS)
(REC)
(ALIM)
(DEBIFLO)
DLIQ1 = DLIQ1 *
OK = SETPHASLIQ
DLIQ2 = DLIQ2 *
OK = SETPHASLIQ
DBLE (NOMB)
(1, DLIQ1)
DBLE (NOMB)
(2, DLIQ2)
FLOG = 1
RETURN
CASE (UP_COST)
SELECT CASE (USEOPT)
CASE (UP_COST_CALC)
OK = GETPARAM (1, PARAM)
NOMB = IIDINT (PARAM)
OK = GETPARAM (2, PARAM)
NOCELL = IIDINT (PARAM)
OK = GETPARAM (3, CELVOL)
OK = GETPARAM (8, EVP)
OK = CICF (NOCELL, CELVOL, EVP, COUT)
IF (COUT.EQ.0.D0) THEN
CALL SETCOST (0, NOMB, COUT)
ELSE
CALL SETCOST (1, NOMB, COUT)
ENDIF
FLOG = 1
END SELECT
RETURN
CASE (UP_HELP)
SELECT CASE (USEOPT)
CASE (UP_HELP_INFO)
MODELHELPFILE = 'MODELS.HLP' C
CALL SETINFOHELP (MODELHELPFILE, NUMMOD_PHYSEP+7)
FLOG = 1
END SELECT
RETURN
CASE DEFAULT
FLOG = 0
RETURN
USIM PAC
BRGM Software
INCORPORATION OF MODELS
59
END SELECT
END
Replace all
INTEGER*2
by
INTEGER.
Remove all
[FAR].
or
FAR,.
by
INCLUDE 'MODELS.FI'
USIM PAC
BRGM Software
60
FUNCTION LIST
C - FUNCTION LIST
USIM PAC
BRGM Software
FUNCTION LIST
USIM PAC
61
BRGM Software
62
FUNCTION LIST
C.1. - INTRODUCTION
This part of the manual is used to facilitate the icon or model function research. It can
be used in association with the following part that gives the detailed description of all
functions in alphabetical order.
The functions are divided into the icon functions and the model functions. For each set,
functions are displayed by use or by type.
A special section is devoted to the "symbolic constants" which are used to increase the
code understanding.
The variables, which are used in every icon and every model, are described in the last
sections.
This set of functions is used in the working mode UP_PARAM. These functions are:
NBSORTIE
SORTIE
SETNAME
SETTYPE
defines the icon type, the number of the generic icon of its
family.
ZONERECT
TRACE
RECTAN
CERCLE
ARC
draws a circle arc with a center, a radius and the starting and
ending angles.
USIM PAC
BRGM Software
FUNCTION LIST
63
ARCINF
ARCSUP
declaration,
data receiving,
data sending,
test,
treatment.
The declaration functions are essentially used in the UP_PRESENT, UP_PARAM and
UP_HELP working modes. The other functions are used in the UP_COMP,
UP_MODEL, UP_POWER and UP_COST working modes.
The data receiving and sending functions can be sub-classified into model parameter
functions, phase functions, stream functions, message functions and macro functions
(functions using a large set of elementary functions).
SETINFOMODEL recalls the model number and sets the number of outputs
and the number of parameters (a multiple parameter is
counted as one).
SETINFMODHIER asserts that a material description criterion is not kept for a
type of phase and a type of hierarchy.
SETCOMMINUTION asserts that the size distribution of the phases of type ore
and solid are not kept.
USIM PAC
BRGM Software
64
FUNCTION LIST
SETPARAMDIALOGTYPE
interface.
SETPARAMDUPLIPHASE
sets that a parameter is duplicated along the
phases of a particular type.
SETPARAMDUPLI1CRIT sets that a parameter is duplicated along a
particular criterion of phases of a particular type.
SETPARAMDUPLI2CRIT sets that a parameter is duplicated along two
particular criteria of phases of a particular type.
SETPARAMDUPLI2PHA sets that a parameter is duplicated along two
particular criteria of two phases of two particular types.
SETPARAMDUPLIPARAM sets that a parameter is duplicated along another
parameter. Defines also a parameter as a chemical reaction
number.
SETPARAMDUPLIPARAMPHASE sets that a parameter is duplicated along
another parameter and the phases of a particular type.
SETPARAMDUPLIPARAM1CRIT sets that a parameter is duplicated along
another parameter and a particular criterion of phases of a
particular type.
SETPARAMSTRING sets that a parameter is a character string.
SETPARAMFILENAME sets that a parameter is a character string containing a
file name.
SETPARAMDATABASENAME sets that a parameter is a character string
containing the file name of a database of a particular type
with another parameter referring to the entry.
SETGROUP
NTYPPHA
NBPHATYP
NUMPHATYPE
USIM PAC
BRGM Software
FUNCTION LIST
65
NBCRIT
NUMCRITYP
NBCLASSCRIT
NBHIER
NUMHIERSYS
GETPARAM
USIM PAC
BRGM Software
66
FUNCTION LIST
NBPHA
NTYPPHA
NBPHATYPE
NUMPHATYPE
NBCRIT
USIM PAC
BRGM Software
FUNCTION LIST
67
NUMCRITYP
NBCLASSCRIT
BCLASSGRA
NBHIER
NUMHIERSYS
NUMHIER0D
NBHIER1D
NUMHIER1D
NBHIER2D
NUMHIER2D
PHASENAME
CLASSNAME
USIM PAC
BRGM Software
68
FUNCTION LIST
GETNBFLUXIN
GET0DHIER
GET1DHIER
GET2DHIER
USIM PAC
BRGM Software
FUNCTION LIST
69
MESSMODEL
GDBLTOSTR
MESSTOCONV
USIM PAC
BRGM Software
70
FUNCTION LIST
MESSTOCOST
Macro functions
COPYPHA
ZEROPHA
SETPHA
SETPHASLIQ
REGD
DXLOGINTERP
USIM PAC
BRGM Software
FUNCTION LIST
71
CRUSHPOINF
SETCOST
CIAB
CIATTRITION
CIBA
CIBO
CICA
CICC
CICD
CICF
CICG
CICM
CICO
CICR
CICV
CICY
CIEP
CIFB
CIFT
CIGC
CIGP
USIM PAC
BRGM Software
72
FUNCTION LIST
CIGV
CIJ
CIRA
CISM
CISP
CITANKCONE
CITANKFLAT
CITS
GETPARAM
SETINFOHELP
SETINFOMODEL recalls the model number and sets the number of outputs
and the number of parameters (a multiple parameter is
counted as one).
SETINFMODHIER asserts that a material description criterion is not kept for a
type of phase and a type of hierarchy.
SETCOMMINUTION asserts that the size distribution of the phases of type ore
and solid are not kept.
SETINFOHELP
SETPARAMDIALOGTYPE
interface.
SETPARAMDUPLIPHASE
sets that a parameter is duplicated along the
phases of a particular type.
SETPARAMDUPLI1CRIT sets that a parameter is duplicated along a
particular criterion of phases of a particular type.
SETPARAMDUPLI2CRIT sets that a parameter is duplicated along two
particular criteria of phases of a particular type.
SETPARAMDUPLI2PHA sets that a parameter is duplicated along two
particular criteria of two phases of two particular types.
SETPARAMDUPLIPARAM sets that a parameter is duplicated along another
parameter. Defines also a parameter as a chemical reaction
number.
USIM PAC
BRGM Software
FUNCTION LIST
73
GETPARAM
USIM PAC
BRGM Software
74
FUNCTION LIST
NTYPPHA
NBPHATYPE
NUMPHATYPE
NBCRIT
NUMCRITYP
NBCLASSCRIT
BCLASSGRA
NBHIER
USIM PAC
BRGM Software
FUNCTION LIST
NUMHIERSYS
75
NUMHIER0D
NBHIER1D
NUMHIER1D
NBHIER2D
NUMHIER2D
PHASENAME
CLASSNAME
GET0DHIER
USIM PAC
BRGM Software
76
FUNCTION LIST
GET1DHIER
GET2DHIER
USIM PAC
BRGM Software
FUNCTION LIST
77
ZEROPHA
SETPHA
SETPHASLIQ
USIM PAC
BRGM Software
78
FUNCTION LIST
CIAB
CIATTRITION
CIBA
CIBO
CICA
CICC
CICD
CICF
CICG
CICM
CICO
CICR
CICV
CICY
CIEP
CIFB
CIFT
CIGC
CIGP
CIGV
CIJ
CIRA
CISM
CISP
CITANKCONE
CITANKFLAT
CITS
REGD
DXLOGINTERP
USIM PAC
BRGM Software
FUNCTION LIST
79
MESSMODEL
GDBLTOSTR
MESSTOCONV
MESSTOCOST
USIM PAC
BRGM Software
80
FUNCTION LIST
USER
MAXUSER
UP_PRESENT
UP_PRESENT_TEST
USIM PAC
BRGM Software
FUNCTION LIST
81
UP_COMP
UP_COMP_NECESSAIRE
UP_MODEL_MESSAGE
UP_POWER
UP_COST
TP_NOPARAM
type of the model parameter input dialog box when there are
no parameter.
TP_SIMPLEPARAM type of the model parameter input dialog box when there
are no multiple parameter.
TP_DUPLIPARAM type of the model parameter input dialog box when there
are multiple parameters.
TYPORE
TYPSOL
TYPLIQ
TYPGAZ
CRITSIZE
CRITCOMP
characterizes
description.
CRITFLOT
CRITFIXEDSP1
CRITFIXEDSP2
USIM PAC
the
component
criterion
of
the
phase
sub-population
BRGM Software
82
FUNCTION LIST
CRITFIXEDSP3
TYPEFLOW
TYPEDENS
TYPMOLMASS
TYPLHV
NSPHAFLOW
NSSIZFLOW
NSPHADENS
NSCONDENS
NSCONFLOTFLOW characterizes
hierarchy.
the
floating
component
proportion
NSCONFSP1
NSCONFSP2
NSCONFSP3
NSSIZFSP1
NSSIZFSP2
NSSIZFSP3
NSCONLHV
GRANULATS
characterizes the phase model used for the sand and gravel
industry.
UPVER1
USIM PAC
BRGM Software
FUNCTION LIST
83
CHARACTER*50
contains the model name. This string variable must be
initialized with the C compatibility:
MODELNAME = 'MYMODEL' C
ANSWER
CHARACTER*254
contains a formatted text to display messages on the screen
or in files (power, model trace). This string variable must be
initialized with the C compatibility.
NAME
CHARACTER*31
contains a text receiving the name of a phase, a component,
a size class or a floating ability sub-population. This string
variable must be initialized with the C compatibility.
FORME
CHARACTER*14
contains the format string used by the GDBLTOSTR
function. This string variable must be initialized with the C
compatibility.
PARANAME
CHARACTER*50
no specific use.
MODELHELPFILE
CHARACTER*50
contains the model help file name. This string is used by the
function SETINFOHELP. This string variable must be
initialized with the C compatibility.
CHARACTER*255
contains the icon name. This string variable must be
initialized with the C compatibility:
ICONNAME = 'MYICON' C
USIM PAC
BRGM Software
84
FUNCTION REFERENCES
D - FUNCTION REFERENCES
USIM PAC
BRGM Software
FUNCTION REFERENCES
USIM PAC
85
BRGM Software
86
FUNCTION REFERENCES
INTRODUCTION
This part describes all the functions which can be used by the user-defined icon or
model functions.
To find easily a function use part C.
ARC
Syntax
IARCE
IARCS
Parameters
Type/Description
XC
YC
IARCS
IARCE
Comments:
This subroutine is called by the UP_DRAW working mode
of the icon library functions.
ARC is a new function of the version 3.0.
ARCINF
Syntax
USIM PAC
Type/Description
INTEGER X-coordinate of the circle
arc center.
BRGM Software
FUNCTION REFERENCES
87
YC
IARC
Comments:
This subroutine is called by the UP_DRAW working mode
of the icon library functions.
ARCSUP
Syntax
Type/Description
XC
YC
IARC
Comments:
This subroutine is called by the UP_DRAW working mode
of the icon library functions.
BCLASSGRA
Syntax
Type/Description
NPHA
SIZE
Return value:
A negative value if there is no size class or if the phase
number is not valid else 0.
Comments:
USIM PAC
BRGM Software
88
FUNCTION REFERENCES
CERCLE
Syntax
Type/Description
XC
YC
Comments:
This subroutine is called by the UP_DRAW working mode
of the icon library functions.
CIAB
Syntax
Type/Description
PW
COST
Return value:
Returns 1.
Comments:
This function is called by an autogenous mill model. If the
cost parameter PW is not known, its value must be
initialized to 0. If the value of PW equals 0 or is not within
the range for cost calculation, the function asks for a new
parameter value. If the request is not cancelled, CIAB
calculates COST and transmits it to the model.
This function is called by the UP_COST working mode of
the model library functions.
CIATTRITION
Syntax
USIM PAC
BRGM Software
FUNCTION REFERENCES
Parameters
89
Type/Description
CAP
COST
Return value:
Returns 1.
Comments:
This function is called by an attrition model. If the cost
parameter CAP is not known, its value must be initialized to
0. If the value of CAP equals 0 or is not within the range for
cost calculation, the function asks for a new parameter
value. If the request is not cancelled, CIATTRITION
calculates COST and transmits it to the model.
This function is called by the UP_COST working mode of
the model library functions.
CIBA
Syntax
Type/Description
XLD
FILL
COST
Return value:
Returns 1.
Comments:
This function is called by a rod mill model. If one of the cost
parameters D, XLD or FILL is not known, its value must be
initialized to 0. If one of the values of these parameters
equals 0 or is not within the range for cost calculation, the
function asks for new parameter values. If the request is
not cancelled, CIBA calculates COST and transmits it to
the model.
This function is called by the UP_COST working mode of
the model library functions.
CIBO
Syntax
USIM PAC
BRGM Software
90
FUNCTION REFERENCES
Type/Description
XLD
FILL
COST
Return value:
Returns 1.
Comments:
This function is called by a ball mill model. If one of the cost
parameters D, XLD or FILL is not known, its value must be
initialized to 0. If one of the value of these parameters
equals 0 or is not within the range for cost calculation, the
function asks for new parameters values. If the request is
not cancelled, CIBO calculates COST and transmits it to
the model.
This function is called by the UP_COST working mode of
the model library functions.
CICA
Syntax
Type/Description
COST
Return value:
Returns 1.
Comments:
This function is called by an air cyclone model. If the cost
parameter D is not known, its value must be initialized to 0.
If the value of D equals 0 or is not within the range for cost
calculation, the function asks for a new parameter value. If
the request is not cancelled, CICA calculates COST and
transmits it to the model.
This function is called by the UP_COST working mode of
the model library functions.
USIM PAC
BRGM Software
FUNCTION REFERENCES
91
CICC
Syntax
Type/Description
CAP
COST
Return value:
Returns 1.
Comments:
This function is called by a cone crusher model. If the cost
parameter CAP is not known, its value must be initialized to
0. If the value of CAP equals 0 or is not within the range for
cost calculation, the function asks for a new parameter
value. If the request is not cancelled, CICC calculates
COST and transmits it to the model.
This function is called by the UP_COST working mode of
the model library functions.
CICD
Syntax
Type/Description
LINER
COST
Return value:
Returns 1.
Comments:
This function is called by a cyclone model. If the cost
parameters D or LINER are not known, their values must
be initialized to 0. If the values of these parameters equal 0
or are not within the range for cost calculation, the function
asks for new parameters values. If the request is not
cancelled, CICD calculates COST and transmits it to the
model.
USIM PAC
BRGM Software
92
FUNCTION REFERENCES
CICF
Syntax
Type/Description
NBCELLS
CEV
EVP
COST
Return value:
Returns 1.
Comments:
This function is called by a flotation model. If the cost
parameters NBCELLS, CEV and EVP are not known, their
values must be initialized to 0. If the values of these
parameters equal 0 or are not within the range for cost
calculation, the function asks for new parameters values. If
the request is not cancelled, CICF calculates COST and
transmits it to the model.
This function is called by the UP_COST working mode of
the model library functions.
CICG
Syntax
Type/Description
OSS
CRUSH
COST
Return value:
Returns 1.
Comments:
USIM PAC
BRGM Software
FUNCTION REFERENCES
93
CICM
Syntax
Type/Description
CSS
COST
Return value:
Returns 1.
Comments:
This function is called by a jaw crusher model. If the cost
parameter CSS is not known, its value must be initialized to
0. If the value of CSS equals 0 or is not within the range for
cost calculation, the function asks for a new parameter
value. If the request is not cancelled, CICM calculates
COST and transmits it to the model.
This function is called by the UP_COST working mode of
the model library functions.
CICO
Syntax
Type/Description
CAP
COST
Return value:
Returns 1.
Comments:
USIM PAC
BRGM Software
94
FUNCTION REFERENCES
CICR
Syntax
Type/Description
WI
XLD
SCREEN
RADIUS
STEEL
DECK
COST
Return value:
Returns 1.
Comments:
This function is called by a screen model. If the cost
parameters WI, XLD, SCREEN, RADIUS, STEEL and
DECK are not known, their values must be initialized to 0. If
the values of these parameters equal 0 or are not within the
range for cost calculation, the function asks for a new
parameter value. The function CICR calls the function
CIGC (calculation of the cost of a DSM screen) if SCREEN
equals 1, or the function CIGP (calculation of the cost of a
stationary screen) if SCREEN equals 2, or the function
CIGV (calculation of the cost of a vibrating screen) if
SCREEN equals 3, and transmits COST to the model.
USIM PAC
BRGM Software
FUNCTION REFERENCES
95
CICV
Syntax
Type/Description
SD
SPIRAL
COST
Return value:
Returns 1.
Comments:
This function is called by a spiral classifier model. If the
cost parameters SD and SPIRAL are not known, their
values must be initialized to 0. If the values of these
parameters equal 0 or are not within the range for cost
calculation, the function asks for new parameters values. If
the request is not cancelled, CICV calculates COST and
transmits it to the model.
This function is called by the UP_COST working mode of
the model library functions.
CICY
Syntax
Type/Description
COST
Return value:
Returns 1.
Comments:
This function is called by an hydrocyclone model. If the cost
parameter D is not known, its value must be initialized to 0.
If the value of this parameter equals 0 or is not within the
USIM PAC
BRGM Software
96
FUNCTION REFERENCES
CIEP
Syntax
Type/Description
TD
DRIVE
COST
Return value:
Returns 1.
Comments:
This function is called by a thickener model. If the cost
parameters TD and DRIVE are not known, their values
must be initialized to 0. If the values of these parameters
equal 0 or are not within the range for cost calculation, the
function asks for new parameters values. If the request is
not cancelled, CIEP calculates COST and transmits it to the
model.
This function is called by the UP_COST working mode of
the model library functions.
CIFB
Syntax
Type/Description
AREA
COST
Return value:
Returns 1.
Comments:
This function is called by a belt filter model. If the cost
parameter AREA is not known, its value must be initialized
USIM PAC
BRGM Software
FUNCTION REFERENCES
97
CIFT
Syntax
Type/Description
AREA
COST
Return value:
Returns 1.
Comments:
This function is called by a drum filter model. If the cost
parameter AREA is not known, its value must be initialized
to 0. If the value of AREA equals 0 or is not within the
range for cost calculation, the function asks for a new
parameter value. If the request is not cancelled, CIFT
calculates COST and transmits it to the model.
This function is called by the UP_COST working mode of
the model library functions.
CIGC
Syntax
Type/Description
WI
RADIUS
COST
Return value:
Returns 1.
Comments:
This function is called by the function CICR. If the cost
parameters WI and RADIUS are not known, their values
USIM PAC
BRGM Software
98
FUNCTION REFERENCES
CIGP
Syntax
Type/Description
WI
XLD
STEEL
COST
Return value:
Returns 1.
Comments:
This function is called by the function CICR. If the cost
parameters WI, XLD and STEEL are not known, their
values must be initialized to 0. If the values of these
parameters equal 0 or are not within the range for cost
calculation, the function asks for new parameter values. If
the request is not cancelled, CIGP calculates COST and
transmits it to CICR or the model.
This function is called by the UP_COST working mode of
the model library functions.
CIGV
Syntax
USIM PAC
Type/Description
WI
XLD
DECK
BRGM Software
FUNCTION REFERENCES
COST
99
Return value:
Returns 1.
Comments:
This function is called by the function CICR. If the cost
parameters WI, XLD and DECK are not known, their values
must be initialized to 0. If the values of these parameters
equal 0 or are not within the range for cost calculation, the
function asks for new parameter values. If the request is
not cancelled, CIGV calculates COST and transmits it to
CICR or the model.
This function is called by the UP_COST working mode of
the model library functions.
CIJ
Syntax
Type/Description
AREA
JIG
COST
Return value:
Returns 1.
Comments:
This function is called by a jig model. If the cost parameters
AREA and JIG are not known, their values must be
initialized to 0. If the values of these parameters equal 0 or
are not within the range for cost calculation, the function
asks for new parameter values. If the request is not
cancelled, CIJ calculates COST and transmits it to the
model.
This function is called by the UP_COST working mode of
the model library functions.
CIRA
Syntax
USIM PAC
Type/Description
BRGM Software
100
FUNCTION REFERENCES
LENGTH
WIDTH
COST
Return value:
Returns 1.
Comments:
This function is called by a rake classifier model. If the cost
parameters LENGTH and WIDTH are not known, their
values must be initialized to 0. If the values of these
parameters equal 0 or are not within the range for cost
calculation, the function asks for new parameter values. If
the request is not cancelled, CIRA calculates COST and
transmits it to the model.
This function is called by the UP_COST working mode of
the model library functions.
CISP
Syntax
Type/Description
FLOW
SPIRAL
COST
Return value:
Returns 1.
Comments:
This function is called by a spiral model. If the cost
parameters FLOW and SPIRAL are not known, their values
must be initialized to 0. If the values of these parameters
equal 0 or are not within the range for cost calculation, the
function asks for new parameter values. If the request is
not cancelled, CISP calculates COST and transmits it to the
model.
This function is called by the UP_COST working mode of
the model library functions.
CITANKCONE
Syntax
USIM PAC
BRGM Software
FUNCTION REFERENCES
101
Type/Description
CAP
OPEN
RUBBER
COST
Return value:
Returns 1.
Comments:
This function is called by a CIP or CIL tank model. If the
cost parameters CAP, OPEN and RUBBER are not known,
their values must be initialized to 0. If the values of these
parameters equal 0 or are not within the range for cost
calculation, the function asks for new parameter values. If
the request is not cancelled, CITANKCONE calculates
COST and transmits it to the model.
This function is called by the UP_COST working mode of
the model library functions.
CITANKCONE is a new function of the version 3.0.
CITANKFLAT
Syntax
Type/Description
CAP
OPEN
RUBBER
COST
Return value:
Returns 1.
Comments:
This function is called by a leaching tank model. If the cost
parameters CAP, OPEN and RUBBER are not known, their
USIM PAC
BRGM Software
102
FUNCTION REFERENCES
CITS
Syntax
Type/Description
AREA
DECKA
DECKB
COST
Return value:
Returns 1.
Comments:
This function is called by a shaking table model. If the cost
parameters AREA, DECKA or DECKB are not known, their
values must be initialized to 0. If the values of these
parameters equal 0 or are not within the range for cost
calculation, the function asks for new parameter values. If
the request is not cancelled, CITS calculates COST and
transmits it to the model.
This function is called by the UP_COST working mode of
the model library functions.
CISM
Syntax
USIM PAC
Type/Description
BRGM Software
FUNCTION REFERENCES
COST
103
Return value:
Returns 1.
Comments:
This function is called by a magnetic separator model. If the
cost parameters D or L are not known, their values must be
initialized to 0. If the values of these parameters equal 0 or
are not within the range for cost calculation, the function
asks for new parameter values. If the request is not
cancelled, CISM calculates COST and transmits it to the
model.
This function is called by the UP_COST working mode of
the model library functions.
CISM is a new function of the version 3.0.
CLASSNAME
Syntax
Type/Description
NPHA
NCRIT
NCLASS
NAME
Return value:
The number of characters of the class name if success else
a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
CLASSNAME is a new function of the version 3.0.
COMPONENTNAME
Syntax
USIM PAC
BRGM Software
104
FUNCTION REFERENCES
Type/Description
NPHA
NCOMP
NAME
Return value:
The number of characters of the component name if
success else a negative integer.
Comments:
If there is no composition criterion or if the component
index is not in the expected range, the return value is the
phase name.
This function is called by the UP_MODEL working mode of
the model library functions.
COMPONENTNAME is a new function of the version 3.0.
COPYPHA
Syntax
Type/Description
NOUTPUT
NPHA
Return value:
0 if success else a negative integer.
Comments:
This function copies all description hierarchies of type
flowrate from the input stream (sum of all the input streams)
to an output stream. The hierarchies of other types are not
copied.
This function is called by the UP_MODEL working mode of
the model library functions.
CRUSHPOINF
Syntax
USIM PAC
BRGM Software
FUNCTION REFERENCES
105
Type/Description
INTEGER Index of the first
parameter of the parameter list for
power consumption calculation (see
comments of CRUSHPOWER).
Comments:
This function is called by the UP_POWER working mode of
the model library functions.
CRUSHPOINF is a new function of the version 3.0.
CRUSHPOWER
Syntax
Type/Description
NUMPAR
F80
P80
USEOPT
Comments:
NUMPAR indicates the index of the first parameter of a
sub-list of 15 consecutive parameters into the model
parameter list:
USIM PAC
BRGM Software
106
FUNCTION REFERENCES
CUMFLOWPASSDX
Syntax
INTEGER
FUNCTION
CUMFLOWPASSDX
NBCOMP, NCOMP, SIZE, PARFLOW, DX, FLOW)
(NBCLASS,
USIM PAC
Type/Description
NBCLASS
NBCOMP
NCOMP
BRGM Software
FUNCTION REFERENCES
107
SIZE
PARFLOW
DX
FLOW
Return value:
0 if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
DXGAUDINTERP
Syntax
Type/Description
NBCLASS
NBCOMP
NCOMP
SIZE
PARFLOW
XPASS
DX
Return value:
0 if success else a negative integer.
USIM PAC
BRGM Software
108
FUNCTION REFERENCES
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
DXLOGINTERP
Syntax
Type/Description
NBCLASS
NBCOMP
NCOMP
SIZE
PARFLOW
XPASS
DX
Return value:
0 if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
FLOATINGNAME
Syntax
INTEGER
NAME)
FUNCTION
FLOATINGNAME
(NPHA,
NFLOAT,
USIM PAC
BRGM Software
FUNCTION REFERENCES
109
Parameters
Type/Description
NPHA
NFLOAT
NAME
Return value:
The number of characters of the floatability sub-population
name if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
FLOATINGNAME is a new function of the version 3.0.
GDBLTOSTR
Syntax
Type/Description
STR
FORM
Comments:
The C format for real conversion is:
%[flags] [width] [.precision] type
USIM PAC
BRGM Software
110
FUNCTION REFERENCES
blank (' ') Prefix the output value with a blank if the
output value is signed and positive; the blank is
ignored if both the blank and + flags appear.
#
width
Optional number that specifies the minimum
number of characters output
GET0DHIER
Syntax
INTEGER FUNCTION
HIERTYP, VALUE)
GET0DHIER
(NSTREAM,
NPHA,
USIM PAC
BRGM Software
FUNCTION REFERENCES
Parameters
111
Type/Description
NSTREAM
NPHA
HIERTYP
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GET1DHIER
Syntax
(NSTREAM,
NPHA,
Type/Description
NSTREAM
NPHA
HIERTYP
CRITYP
NBCLASS
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
USIM PAC
BRGM Software
112
FUNCTION REFERENCES
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GET2DHIER
Syntax
Type/Description
NSTREAM
NPHA
HIERTYP
CRITYP1
NBCLASS1
CRITYP2
NBCLASS2
VALUE
REAL*8 The value array of the 2dimensional hierarchy. This 2dimensional array must be declared
or allocated with the sufficient
number of elements (NBCLASS1
NBCLASS2).
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
USIM PAC
BRGM Software
FUNCTION REFERENCES
113
GETBOOLFORCOST
Syntax
This dialog box has a title ("My model") and a question ("Do
you want a pump?"). Both texts are registered in file
MESSAGES.TXT:
[MyModel]
1=My model
2=What is the pressure drop?
3=Do you want a pump?
4=How many pumps do you want?
The string STR contains the tag text "MyModel". The title is
always registered with key 1. The question is registered
with key NUM. The response RES is 1 if Yes button is
pressed and 0 otherwise.
If the No cost calculation button is pressed, the return
value is 0 else it is 1.
For the example above, the function call is:
STR = 'MyModel' C
OK = GETBOOLFORCOST (STR, 3, RES)
Parameters
Type/Description
STR
NUM
RES
Return value:
0 if the No cost calculation button is pressed else 1.
Comments:
USIM PAC
BRGM Software
114
FUNCTION REFERENCES
GETCOMPDENSITY
Syntax
Type/Description
NPHA
NBCOMP
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
If there is not density per component, the phase density is
duplicated for all components.
This function is called by the UP_MODEL working mode of
the model library functions.
GETCOMPLHV
Syntax
INTEGER
VALUE)
FUNCTION
GETCOMPLHV
(NPHA,
NBCOMP,
Type/Description
NPHA
NBCOMP
VALUE
Return value:
USIM PAC
BRGM Software
FUNCTION REFERENCES
115
GETDATACRUSH
Syntax
INTEGER
FUNCTION
GETDATACRUSH
(FILENAME,
NCRUSHER, NBSET, NBCLAS, NBSIZERANGE, SETTING,
PASSING, SIZECLASS, MIN, MAX, CAPACITY)
Receives the data set corresponding to the crusher
NCRUSHER from the crusher database (file FILENAME).
NBSET, NBCLAS and NBSIZERANGE are given by
GETNBCRUSH.
Parameters
USIM PAC
Type/Description
FILENAME
NCRUSHER
NBSET
NBCLAS
NBSIZERANGE
SETTING
PASSING
SIZECLASS
MIN
BRGM Software
116
FUNCTION REFERENCES
MAX
CAPACITY
Return value:
1 if the function is successful. Otherwise 0.
Comments:
See the part D for more information about the crusher
database.
This function is called by the UP_MODEL working mode of
the model library functions.
The parameter list of the function GETDATACRUSH has
been changed in the version 3.0 compared to the version
2.1.
GETDENSANDVOLFLOWPERCOMP
Syntax
INTEGER
FUNCTION
GETDENSANDVOLFLOWPERCOMP
(NSTREAM, NPHA, NBCOMP, DENS, VFLOW)
Receives the density array DENS and the volumetric
flowrate array VFLOW for components of the phase
number NPHA in the stream NSTREAM. The number of
components is NBCOMP.
Parameters
Type/Description
NSTREAM
NPHA
NBCOMP
DENS
VFLOW
Return value:
USIM PAC
BRGM Software
FUNCTION REFERENCES
117
GETFLOATPROP
Syntax
Type/Description
NSTREAM
NPHA
NBCOMP
NOFLO
SLOWFLO
FASTFLO
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
USIM PAC
BRGM Software
118
FUNCTION REFERENCES
GETFLOWPERCOMPFIXEDSP
Syntax
INTEGER
FUNCTION
GETFLOWPERCOMPFIXEDSP
(NSTREAM, NPHA, NCRIT, NBCOMP, NBSP, VALUE)
Receives the partial flowrate array VALUE of the userdefined sub-population per components from phase
number NPHAN of stream NSTREAM. The user-defined
sub-population choice is given by NCRIT. The number of
components is NBCOMP and the number of subpopulations is NBSP.
Parameters
Type/Description
NSTREAM
NPHA
NCRIT
NBCOMP
NBSP
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETFLOWPERCOMPFIXEDSP is a new function of the
version 3.0.
GETFLOWPERSIZECOMP
Syntax
USIM PAC
BRGM Software
FUNCTION REFERENCES
Parameters
119
Type/Description
NSTREAM
NPHA
NBCLASS
NBCOMP
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETFLOWRATE
Syntax
Type/Description
NSTREAM
NPHA
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETFLOWRATEPERCOMP
Syntax
USIM PAC
BRGM Software
120
FUNCTION REFERENCES
Type/Description
NSTREAM
NPHA
NBCOMP
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETFLOWRATEPERFIXEDSP
Syntax
INTEGER
FUNCTION
GETFLOWRATEPERFIXEDSP
(NSTREAM, NPHA, NCRIT, NBSP, VALUE)
Receives the partial flowrate array VALUE of the userdefined sub-populations from phase number NPHAN of
stream NSTREAM. The user-defined sub-population choice
is given by NCRIT. The number of sub-populations is
NBSP.
Parameters
USIM PAC
Type/Description
NSTREAM
NPHA
NCRIT
NBSP
VALUE
BRGM Software
FUNCTION REFERENCES
121
GETFLOWRATEPERSIZE
Syntax
Type/Description
NSTREAM
NPHA
NBCLASS
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETINTFORCOST
Syntax
USIM PAC
BRGM Software
122
FUNCTION REFERENCES
[MyModel]
1=My model
2=What is the pressure drop?
3=Do you want a pump?
4=How many pumps do you want?
The string STR contains the tag text "MyModel". The title is
always registered with key 1. The question is registered
with the NUM. The input integer NB is in the range NBMIN
to NBMAX.
If the No cost calculation button is pressed, the return
value is 0 else it is 1.
For the example above, the function call is:
STR = 'MyModel' C
OK = GETINTFORCOST (STR, 4, NB, 1, 5)
Parameters
Type/Description
STR
NUM
NB
NBMIN
NBMAX
Return value:
0 if the No cost calculation button was pressed else 1.
Comments:
USIM PAC
BRGM Software
FUNCTION REFERENCES
123
the
use
of
file
GETLIQFLOWRATE
Syntax
Type/Description
NSTREAM
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETLIQVOLFLOW
Syntax
Type/Description
NSTREAM
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
USIM PAC
BRGM Software
124
FUNCTION REFERENCES
GETMOLECULARMASS
Syntax
INTEGER
FUNCTION
NBCOMP, VALUE)
GETMOLECULARMASS
(NPHA,
Type/Description
NPHA
NBCOMP
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETMOLECULARMASS is a new function of the version
3.0.
GETNAMECRUSH
Syntax
INTEGER
FUNCTION
GETNAMECRUSH
NCRUSHER, CRUSHNAME)
(FILENAME,
Type/Description
FILENAME
NCRUSHER
CRUSHNAME
Return value:
1 if the function is successful. Otherwise 0.
Comments:
This function is called by the UP_MODEL working mode of
USIM PAC
BRGM Software
FUNCTION REFERENCES
125
GETNBCRUSH
Syntax
Type/Description
FILENAME
NCRUSHER
NBSET
NBCLAS
NBSIZERANGE
Return value:
1 if the function is successful. Otherwise 0.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
The parameter list of the function GETNBCRUSH has been
changed in the version 3.0 compared to the version 2.1.
GETNBFLUXIN
Syntax
Return value:
The number of input streams.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETNUMFLUX
Syntax
USIM PAC
BRGM Software
126
FUNCTION REFERENCES
Type/Description
NOUTPUT
Return value:
The stream number or a negative value if the stream output
number is not valid.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETNUMFLUXIN
Syntax
Type/Description
NINPUT
Return value:
The stream number or CE_NOFLUX if the order number of
the stream input is not valid.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETOREFLOWRATE
Syntax
INTEGER
VALUE)
FUNCTION
GETOREFLOWRATE
(NSTREAM,
Type/Description
NSTREAM
VALUE
Return value:
USIM PAC
BRGM Software
FUNCTION REFERENCES
127
GETORESOLFLOWRATE
Syntax
Type/Description
NSTREAM
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETORESOLVOLFLOW
Syntax
INTEGER
VALUE)
FUNCTION
GETORESOLVOLFLOW
(NSTREAM,
Type/Description
NSTREAM
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
USIM PAC
BRGM Software
128
FUNCTION REFERENCES
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETPARAM
Syntax
Type/Description
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETPARAMDUPLI1CRIT
Syntax
Type/Description
NPHA
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
USIM PAC
BRGM Software
FUNCTION REFERENCES
129
GETPARAMDUPLI2CRIT
Syntax
Type/Description
NPHA
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETPARAMDUPLI2CRIT is a new function of the version
3.0 and replace the obsolete function GETPARAMDUPLI.
GETPARAMDUPLI2PHA
Syntax
USIM PAC
Type/Description
INTEGER First phase number.
BRGM Software
130
FUNCTION REFERENCES
NPHA2
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETPARAMDUPLIPARAM
Syntax
INTEGER
VALUE)
FUNCTION
GETPARAMDUPLIPARAM
(NPAR,
Type/Description
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETPARAMDUPLIPARAM is a new function of the version
3.0
USIM PAC
BRGM Software
FUNCTION REFERENCES
131
GETPARAMDUPLIPARAM1CRIT
Syntax
Type/Description
NPHA
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETPARAMDUPLIPARAM1CRIT is a new function of the
version 3.0
GETPARAMDUPLIPARAMPHASE
Syntax
USIM PAC
Type/Description
NPHA
NPAR
VALUE
BRGM Software
132
FUNCTION REFERENCES
GETPARAMDUPLIPHASE
Syntax
Type/Description
NPHA
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETPARAMDUPLIPHASE is a new function of the version
3.0 and replace the obsolete function GETPARAMDUPLI.
GETPARAMREAC
Syntax
USIM PAC
Type/Description
BRGM Software
FUNCTION REFERENCES
133
NBREAC
NBCOMP
NPN
NUMR
NPL
LEVEL
NPR
RATIO
CONS
PROD
USEOPT
Return value:
1.
Comments:
All component arrays are sized for the total number of
components and built by the component array of the
individual phase putted end to end.
This function is called by the UP_MODEL working mode of
the model library functions.
USIM PAC
BRGM Software
134
FUNCTION REFERENCES
GETPARAMSTRING
Syntax
Type/Description
NPAR
LENGTH
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETPARAMSTRING is a new function of the version 3.0
GETPHADENSANDVOLFLOW
Syntax
INTEGER
FUNCTION
GETPHADENSANDVOLFLOW
(NSTREAM, NPHA, DENS, VFLOW)
Receives the density DENS and the volumetric flowrate
VFLOW of the phase number NPHA in the stream
NSTREAM.
Parameters
USIM PAC
Type/Description
NSTREAM
NPHA
DENS
BRGM Software
FUNCTION REFERENCES
VFLOW
135
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETPHADENSANDVOLFLOW is a new function of the
version 3.0
GETPHASEDENSITY
Syntax
Type/Description
NSTREAM
NPHA
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETPHASEDENSITY is a new function of the version 3.0
GETPHASELHV
Syntax
USIM PAC
BRGM Software
136
FUNCTION REFERENCES
Type/Description
NPHA
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
If there is not global low heating value of the phase, the
function fails.
This function is called by the UP_MODEL working mode of
the model library functions.
GETPHASELHV is a new function of the version 3.0
GETREALFORCOST
Syntax
[MyModel]
1=My model
2=What is the pressure drop?
3=Do you want a pump?
4=How many pumps do you want?
The string STR contains the tag text "MyModel". The title is
always registered with key 1. The question is registered
USIM PAC
BRGM Software
FUNCTION REFERENCES
137
Type/Description
STR
NUM
NB
NBMIN
NBMAX
Return value:
0 if the No cost calculation button was pressed else 1.
Comments:
For more information about
MESSAGES.TXT, see part B.
the
use
of
file
GETROSINRAMMLER
Syntax
USIM PAC
Type/Description
NBCLASS
NBCOMP
BRGM Software
138
FUNCTION REFERENCES
NCOMP
SIZE
PARFLOW
D63
SLOPE
Return value:
0 if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETSIZEFRACTIONS
Syntax
Type/Description
NSTREAM
NPHA
NBCLASS
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
USIM PAC
BRGM Software
FUNCTION REFERENCES
139
GETSTOECHIOMOL
Syntax
Type/Description
NS
NBCOMP
CONS
PROD
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETSTOECHIOMOL is a new function of the version 3.0.
GETSTOECHIOMAS
Syntax
USIM PAC
Type/Description
INTEGER Chemical reaction number
given in the phase model.
BRGM Software
140
FUNCTION REFERENCES
NBCOMP
CONS
PROD
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETSTOECHIOMAS is a new function of the version 3.0.
GETSTREAMPHASEDENSITY
Syntax
INTEGER
FUNCTION
GETSTREAMPHASEDENSITY
(NSTREAM, NPHA, TYPE, VALUE)
Receives the stream phase density VALUE of the phase
number NPHA in the stream NSTREAM. Depending of
TYPE, the value is the experimental or the calculated one.
Parameters
Type/Description
NSTREAM
NPHA
TYPE
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETSTREAMPHASEDENSITY is a new function of the
version 3.0.
USIM PAC
BRGM Software
FUNCTION REFERENCES
141
GETUNITPARAM
Syntax
Type/Description
NUNIT
NMODEL
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is used when a model needs the value of a
parameter in another unit of equipment.
This function is called by the UP_MODEL working mode of
the model library functions.
GETUNITPARAM is a new function of the version 3.0.
GETUNITPARAMDUPLI1CRIT
Syntax
USIM PAC
Type/Description
NUNIT
NMODEL
BRGM Software
142
FUNCTION REFERENCES
NPHA
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is used when a model needs the value of a
parameter in another unit of equipment.
This function is called by the UP_MODEL working mode of
the model library functions.
GETUNITPARAMDUPLI1CRIT is a new function of the
version 3.0.
GETUNITPARAMDUPLI2CRIT
Syntax
USIM PAC
Type/Description
NUNIT
NMODEL
NPHA
NPAR
VALUE
BRGM Software
FUNCTION REFERENCES
143
GETUNITPARAMDUPLI2PHA
Syntax
Type/Description
NUNIT
NMODEL
NPHA1
NPHA2
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
USIM PAC
BRGM Software
144
FUNCTION REFERENCES
GETUNITPARAMDUPLIPARAM
Syntax
Type/Description
NUNIT
NMODEL
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is used when a model needs the value of a
parameter in another unit of equipment.
This function is called by the UP_MODEL working mode of
the model library functions.
GETUNITPARAMDUPLIPARAM is a new function of the
version 3.0.
GETUNITPARAMDUPLIPARAM1CRIT
Syntax
USIM PAC
BRGM Software
FUNCTION REFERENCES
145
Type/Description
NUNIT
NMODEL
NPHA
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is used when a model needs the value of a
parameter in another unit of equipment.
This function is called by the UP_MODEL working mode of
the model library functions.
GETUNITPARAMDUPLIPARAM1CRIT is a new function of
the version 3.0.
GETUNITPARAMDUPLIPARAMPHASE
Syntax
USIM PAC
Type/Description
BRGM Software
146
FUNCTION REFERENCES
NUNIT
NMODEL
NPHA
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is used when a model needs the value of a
parameter in another unit of equipment.
This function is called by the UP_MODEL working mode of
the model library functions.
GETUNITPARAMDUPLIPARAMPHASE is a new function
of the version 3.0.
GETUNITPARAMDUPLIPHASE
Syntax
USIM PAC
Type/Description
NUNIT
NMODEL
NPHA
NPAR
BRGM Software
FUNCTION REFERENCES
VALUE
147
Return value:
0 if success else a negative integer.
Comments:
This function is used when a model needs the value of a
parameter in another unit of equipment.
This function is called by the UP_MODEL working mode of
the model library functions.
GETUNITPARAMDUPLIPHASE is a new function of the
version 3.0.
GETUNITPARAMSTRING
Syntax
INTEGER
FUNCTION
GETUNITPARAMSTRING
NMODEL, NPAR, LENGTH, VALUE)
(NUNIT,
Type/Description
NUNIT
NMODEL
NPAR
LENGTH
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is used when a model needs the value of a
parameter in another unit of equipment.
This function is called by the UP_MODEL working mode of
the model library functions.
GETUNITPARAMSTRING is a new function of the version
3.0.
USIM PAC
BRGM Software
148
FUNCTION REFERENCES
GETVOLFLOWPERCOMP
Syntax
Type/Description
NSTREAM
NPHA
NBCOMP
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
GETVOLFLOWRATE
Syntax
Type/Description
NSTREAM
NPHA
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
USIM PAC
BRGM Software
FUNCTION REFERENCES
149
MESSCONCAT
Syntax
Type/Description
ANSWER
MORE
Comments:
This subroutine is called by the UP_MODEL or
UP_POWER working mode of the model library functions.
MESSCONCAT is a new function of the version 3.0.
MESSMODEL
Syntax
%s
USIM PAC
BRGM Software
150
FUNCTION REFERENCES
Type/Description
MODELNAME
KEY
ANSWER
Comments:
This subroutine is called by the UP_MODEL or
UP_POWER working mode of the model library functions.
MESSMODELINT
Syntax
SUBROUTINE
ANSWER)
MESSMODELINT
(MODELNAME,
KEY,
I,
%s
USIM PAC
BRGM Software
FUNCTION REFERENCES
151
Type/Description
MODELNAME
KEY
ANSWER
Comments:
Formatted text follows the C rules to format integer.
This subroutine is called by the UP_MODEL or
UP_POWER working mode of the model library functions.
MESSMODELNEWLINE
Syntax
Type/Description
ANSWER
Comments:
This subroutine is called by the UP_MODEL or
UP_POWER working mode of the model library functions.
MESSMODELREAL
Syntax
USIM PAC
BRGM Software
152
FUNCTION REFERENCES
8= Cumulated recovery
9= component %i;
10= ;
%s
Type/Description
MODELNAME
KEY
ANSWER
Comments:
See comments of the function GDBLTOSTR for C
formatting of real value.
This subroutine is called by the UP_MODEL or
UP_POWER working mode of the model library functions.
MESSMODELTAB
Syntax
Type/Description
CHARACTER*255 String receiving
the tabulation to its end.
Comments:
This subroutine is called by the UP_MODEL or
UP_POWER working mode of the model library functions.
MESSMODELTAB is a new function of the version 3.0.
USIM PAC
BRGM Software
FUNCTION REFERENCES
153
MESSMODELTEXT
Syntax
%s
Type/Description
MODELNAME
KEY
TEXT
ANSWER
Comments:
This subroutine is called by the UP_MODEL or
UP_POWER working mode of the model library functions.
USIM PAC
BRGM Software
154
FUNCTION REFERENCES
MESSTOCONV
Syntax
Type/Description
CHARACTER*255 String containing
the formatted text.
Comments:
The text is formatted by means of functions MESSMODEL,
MESSMODELINT,
MESSMODELREAL,
MESSMODELTEXT,
MESSMODELNEWLINE,
MESSMODELTAB and MESSCONCAT.
This subroutine is called by the UP_MODEL working mode
of the model library functions.
MESSTOCOST
Syntax
Type/Description
CHARACTER*255 String containing
the formatted text.
Comments:
The text is formatted by means of functions MESSMODEL,
MESSMODELINT,
MESSMODELREAL,
MESSMODELTEXT,
MESSMODELNEWLINE,
MESSMODELTAB and MESSCONCAT.
This subroutine is called by the UP_MODEL working mode
of the model library functions.
MESSTOPOWER
Syntax
USIM PAC
Type/Description
CHARACTER*255 String containing
the formatted text.
BRGM Software
FUNCTION REFERENCES
155
Comments:
The text is formatted by means of functions MESSMODEL,
MESSMODELINT,
MESSMODELREAL,
MESSMODELTEXT,
MESSMODELNEWLINE,
MESSMODELTAB and MESSCONCAT.
This subroutine is called by the UP_POWER working mode
of the model library functions.
MESSTOSCREEN
Syntax
Type/Description
CHARACTER*255 String containing
the formatted text.
Comments:
The text is formatted by means of functions MESSMODEL,
MESSMODELINT,
MESSMODELREAL,
MESSMODELTEXT,
MESSMODELNEWLINE,
MESSMODELTAB and MESSCONCAT.
This subroutine is called by the UP_MODEL working mode
of the model library functions.
NBCLASSCRIT
Syntax
Type/Description
NPHA
CRITYP
Return value:
The number of classes in the criterion. The return value is 0
if there is no criterion of this type or if the phase number is
not valid.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
USIM PAC
BRGM Software
156
FUNCTION REFERENCES
NBCRIT
Syntax
Type/Description
INTEGER Phase number.
Return value:
The number of criteria or 0 if the phase number is not valid.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
NBHIER
Syntax
Type/Description
INTEGER Phase number.
Return value:
The number of hierarchies or 0 if the phase number is not
valid.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
NBHIER1D
Syntax
USIM PAC
Type/Description
NPHA
HIERTYP
CRITYP
BRGM Software
FUNCTION REFERENCES
157
Return value:
The number of hierarchies or 0 if there is no hierarchy with
the specifications or if the phase number is not valid.
Comments:
For a hierarchy of type TYPDENS, only the 1-dimensional
hierarchy with the criterion is numbered.
This function is called by the UP_MODEL working mode of
the model library functions.
NBHIER2D
Syntax
Type/Description
NPHA
HIERTYP
CRITYP1
CRITYP2
Return value:
The number of hierarchies or 0 if there is no hierarchy with
the specifications or if the phase number is not valid.
Comments:
For a hierarchy of type TYPDENS, only the 2-dimensional
hierarchy with the criteria is numbered.
This function is called by the UP_MODEL working mode of
the model library functions.
NBPHA
Syntax
Return value:
The number of phases.
USIM PAC
BRGM Software
158
FUNCTION REFERENCES
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
NBPHATYP
Syntax
Type/Description
INTEGER Phase type: TYPORE,
TYPSOL, TYPLIQ or TYPGAZ.
Return value:
The number of phases with the specified type.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
NBSORTIE
Syntax
Type/Description
NUMICO
NS
Comments:
This subroutine is called by the UP_PARAM working mode
of the icon library functions.
NTYPPHA
Syntax
Type/Description
INTEGER Phase number.
Return value:
TYPORE, TYPSOL, TYPLIQ or TYPGAZ for ore, solid,
liquid or gas phase respectively. The return value is
negative if the phase number is not valid.
USIM PAC
BRGM Software
FUNCTION REFERENCES
159
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
NUMCRITYP
Syntax
Type/Description
NPHA
CRITYP
Return value:
The criterion number. The return value is 0 if there is no
criterion of this type in the phase or if the phase number is
not valid.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
NUMHIER0D
Syntax
Type/Description
NPHA
HIERTYP
Return value:
The hierarchy number or a negative value if there is no
hierarchy with the specified type or if the phase number is
not valid.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
NUMHIER1D
Syntax
USIM PAC
BRGM Software
160
FUNCTION REFERENCES
Type/Description
NPHA
HIERTYP
CRITYP
ORDER
Return value:
The hierarchy number or 0 if there is no hierarchy with the
specified type or if the phase number is not valid.
Comments:
For a hierarchy of type TYPDENS, only the 1-dimensional
hierarchies with the criteria are numbered.
This function is called by the UP_MODEL working mode of
the model library functions.
NUMHIER2D
Syntax
USIM PAC
Type/Description
NPHA
HIERTYP
CRITYP1
CRITYP2
BRGM Software
FUNCTION REFERENCES
161
CRITFIXEDSP1, CRITFIXEDSP2 or
CRITFIXEDSP3.
ORDER
Return value:
The hierarchy number or 0 if there is no hierarchy with the
specified type or if the phase number is not valid.
Comments:
For a hierarchy of type TYPDENS, only the 2-dimensional
hierarchies with the criteria are numbered.
This function is called by the UP_MODEL working mode of
the model library functions.
NUMHIERSYS
Syntax
Type/Description
NPHA
HIERSYS
Return value:
The description hierarchy number. The return value is 0 if
there is no hierarchy with this system number in the phase
or if the phase number is not valid.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
NUMSHAREDHIERSYS
Syntax
INTEGER
HIERSYS)
FUNCTION
NUMSHAREDHIERSYS
(NPHA,
USIM PAC
BRGM Software
162
FUNCTION REFERENCES
Parameters
Type/Description
NPHA
HIERSYS
Return value:
The shared description hierarchy number. The return value
is 0 if there is no hierarchy with this system number in the
phase or if the phase number is not valid.
Comments:
A shared description hierarchy is a description initialized in
the phase model and not depending of the stream.
This function is called by the UP_MODEL working mode of
the model library functions.
NUMSHAREDHIERSYS is a new function of the version
3.0.
NUMPHATYP
Syntax
Type/Description
PHATYP
INTEGER
Phase type: TYPORE,
TYPSOL, TYPLIQ or TYPGAZ.
ORDER
INTEGER
Order of the phase in
the same type phase set.
Return value:
The phase number. The return value is 0 if there is no
phase of this type or if the order is not in the legal range.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
PHASENAME
Syntax
USIM PAC
BRGM Software
FUNCTION REFERENCES
Parameters
163
Type/Description
NPHA
NAME
Return value:
The number of characters of the phase name if success
else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
PHASENAME is a new function of the version 3.0.
PHAUTE
Syntax
Type/Description
Comments:
This subroutine is called by the UP_DRAW working mode
of the icon library functions.
PERFPARREAC
Syntax
USIM PAC
Type/Description
NBCOMP
NBREAC
NPN
NPL
BRGM Software
164
FUNCTION REFERENCES
NPR
FLOWIN
TARGET
NPHA
NPI
NPC
FLOWOUT
USEOPT
Return value:
1.
Comments:
This function works as the GETPARAMREAC and
PERFREACTION functions in one step.
This function is called by the UP_MODEL working mode of
the model library functions.
PERFPARREAC is a new function of the version 3.0.
PERFPARREAC0
Syntax
USIM PAC
Type/Description
NBCOMP
NBREAC
BRGM Software
FUNCTION REFERENCES
165
NPN
NPL
NPR
FLOWIN
FLOWOUT
USEOPT
Return value:
1.
Comments:
This function works as the GETPARAMREAC and
PERFREACTION0 functions in one step.
This function is called by the UP_MODEL working mode of
the model library functions.
PERFPARREAC0 is a new function of the version 3.0.
PERFREAC0
Syntax
USIM PAC
Type/Description
NBCOMP
NBREAC
FLOWIN
LEVEL
CONS
BRGM Software
166
FUNCTION REFERENCES
RATIO
FLOWOUT
TARGET
Return value:
1.
Comments:
All component arrays are sized for the total number of
components and built by the component array of the
individual phase putted end to end.
This function is called by the UP_MODEL working mode of
the model library functions. It is also called by the
PERFREACTION0 and PERFREACTION functions.
PERFREAC0 is a new function of the version 3.0.
PERFREACTION
Syntax
USIM PAC
Type/Description
NBCOMP
NBREAC
FLOWIN
TARGET
BRGM Software
FUNCTION REFERENCES
167
NPHA
LEVEL
CONS
PROD
RATIO
NBITER
CC
FLOWOUT
USEOPT
Return value:
1.
Comments:
All component arrays are sized for the total number of
components and built by the component array of the
individual phase putted end to end.
This function is called by the UP_MODEL working mode of
the model library functions.
PERFREACTION is a new function of the version 3.0.
PERFREACTION0
Syntax
USIM PAC
BRGM Software
168
FUNCTION REFERENCES
Type/Description
NBCOMP
NBREAC
FLOWIN
LEVEL
CONS
PROD
RATIO
FLOWOUT
Return value:
1.
Comments:
All component arrays are sized for the total number of
components and built by the component array of the
individual phase putted end to end.
This function is called by the UP_MODEL working mode of
the model library functions.
PERFREACTION0 is a new function of the version 3.0.
RECTAN
Syntax
USIM PAC
Type/Description
INTEGER Length of the rectangle.
BRGM Software
FUNCTION REFERENCES
169
Comments:
This subroutine is called by the UP_DRAW working mode
of the icon library functions.
REGD
Syntax
Type/Description
Return value:
0 if success else a negative integer.
Comments:
This function is used in the GETROSINRAMMLER
function.
This function is called by the UP_MODEL working mode of
the model library functions.
SEND0DTOSTREAMS
Syntax
USIM PAC
Type/Description
BRGM Software
170
FUNCTION REFERENCES
NOUTPUT
NPHA
HIERTYP
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
SEND1DTOSTREAMS
Syntax
Type/Description
NOUTPUT
NPHA
HIERTYP
CRITYP
NBCLASS
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
USIM PAC
BRGM Software
FUNCTION REFERENCES
171
SEND2DTOSTREAMS
Syntax
Type/Description
NOUTPUT
NPHA
HIERTYP
CRITYP1
CRITYP2
NBCLASS1
NBCLASS2
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
SENDPHASEDENSITYTOSTREAMS
Syntax
INTEGER
FUNCTION
SENDPHASEDENSITYTOSTREAMS
(NOUTPUT, NPHA, VALUE)
Sends the calculated stream phase density VALUE of the
phase number NPHA to the output NOUTPUT.
USIM PAC
BRGM Software
172
FUNCTION REFERENCES
Parameters
Type/Description
NOUTPUT
NPHA
VALUE
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
SENDPHASEDENSITYTOSTREAMS is a new function of
the version 3.0.
SENDTOPARAM
Syntax
Type/Description
NPAR
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
SENDTOPARAMDUPLIPARAM
Syntax
USIM PAC
Type/Description
INTEGER Multiple model parameter
number.
BRGM Software
FUNCTION REFERENCES
173
NBELEM
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
SENDTOPARAMDUPLIPARAM is a new function of the
version 3.0.
SENDTOPARAMNEXTAPP
Syntax
(NPAR,
Type/Description
NPAR
NMOD
NOUTPUT
VALUE
Return value:
0 if success else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
SETCOMMINUTION
Syntax
SUBROUTINE SETCOMMINUTION ()
Asserts that the size distribution of the phases of ore and
solid types are not kept.
USIM PAC
BRGM Software
174
FUNCTION REFERENCES
Comments:
This subroutine is used by comminution models such as
mills or crushers. It is equivalent of the call of subroutines:
SETINFMODHIER
CRITSIZE)
(TYPORE,
TYPFLOW,
SETINFMODHIER
CRITSIZE)
(TYPSOL,
TYPFLOW,
SETCOST
Syntax
Type/Description
NOCOST
NBUNIT
COST
Comments:
This subroutine is called by the UP_COST_CALC variant of
the UP_COST working mode of the model library functions.
SETFLOATPROP
Syntax
USIM PAC
Type/Description
NOUTPUT
NPHA
NBCOMP
BRGM Software
FUNCTION REFERENCES
175
GLOFLOW
NOFLO
SLOWFLO
FASTFLO
Return value:
A positive or null value if the function is successful.
Otherwise negative value.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
SETGROUP
Syntax
Type/Description
NGROUP
NAME
Comments:
NAME must be a C-compatible string variable and can be
initialized using the MESSMODEL function. The group
name is then stored in the MESSAGES.TXT file.
A group generates an individual interface (dialog box) for
the associated parameters.
This
subroutine
is
called
by
the
UP_PARAM_DIALOGTYPE variant of the UP_PARAM
working mode of the model library functions.
SETGROUP is a new function of the version 3.0.
USIM PAC
BRGM Software
176
FUNCTION REFERENCES
SETGROUPPARAM
Syntax
Type/Description
NGROUP
NPAR
Comments:
This subroutine is called for each parameter associated to
the group. A parameter cannot be associated with more
than 1 group.
All parameters associated to a group are displayed in a
separate list box. A line containing the group name and an
edit button appears at the place of the parameters in the
main list box.
If a parameter is not associated to a group, it is directly
displayed in the main parameter list box.
If all the parameters associated to a group are duplicated
exactly following the same rules, a specific sheet box
appears.
This
subroutine
is
called
by
the
UP_PARAM_DIALOGTYPE variant of the UP_PARAM
working mode of the model library functions.
SETGROUPPARAM is a new function of the version 3.0.
SETINFMODHIER
Syntax
USIM PAC
Type/Description
PHATYP
HIERTYP
CRITYP
BRGM Software
FUNCTION REFERENCES
177
Comments:
This subroutine is called for each criterion that is not kept in
each phase.
This subroutine is called by the UP_PRESENT_INFO
variant of the UP_PRESENT working mode of the model
library functions.
SETINFOHELP
Syntax
Type/Description
HELPFILE
CHARACTER*256 User-defined
help file name.
TOPIC
Comments:
It is recommended to use the model number as topic
number.
This subroutine is called by the UP_HELP_INFO variant of
the UP_HELP working mode of the model library functions.
SETINFOMODEL
Syntax
Type/Description
NMOD
NBO
NBP
Comments:
This subroutine is called by the UP_PRESENT_INFO
variant of the UP_PRESENT working mode of the model
library functions.
SETNAME
Syntax
USIM PAC
BRGM Software
178
FUNCTION REFERENCES
Parameters
ICONNAME
Type/Description
CHARACTER*255 Name of the
icon.
Comments:
This subroutine is called by the UP_PARAM working mode
of the icon library functions.
The name must be in a C-compatible string variable.
SETPARAMDATABASENAME
Syntax
SUBROUTINE SETPARAMDATABASENAME
TYPE, NPARENTRY)
(NPAR,
EXT,
Type/Description
NPAR
EXT
TYPE
NPARENTRY
Comments:
EXT must be a C-compatible string variable.
The standard "Open" interface is proposed for the choice of
the file name.
A C++ class is proposed for automatic editing of the
database.
This
subroutine
is
called
by
the
UP_PARAM_DIALOGTYPE variant of the UP_PARAM
working mode of the model library functions.
SETPARAMDATABASENAME is a new function of the
version 3.0.
SETPARAMDIALOGTYPE
Syntax
USIM PAC
BRGM Software
FUNCTION REFERENCES
179
Type/Description
INTEGER Dialog box type:
TP_NOPARAM, TP_SIMPLEPARAM
and TP_DUPLIPARAM.
Comments:
This subroutine must be called but the value of TYPE has
no effect. It is kept for compatibility. USIM PAC is able to
recognize automatically the type of the dialog box.
This
subroutine
is
called
by
the
UP_PARAM_DIALOGTYPE variant of the UP_PARAM
working mode of the model library functions.
SETPARAMDUPLI1CRIT
Syntax
SUBROUTINE
CRITYP)
SETPARAMDUPLI1CRIT
(NPAR,
PHATYP,
Type/Description
NPAR
PHATYP
CRITYP
Comments:
This subroutine is called for each multiple parameter and
each phase type containing the criterion along which the
parameter is duplicated.
Values of the parameter duplications are registered in a
1-dimensional array.
This
subroutine
is
called
by
the
UP_PARAM_DIALOGTYPE variant of the UP_PARAM
working mode of the model library functions.
USIM PAC
BRGM Software
180
FUNCTION REFERENCES
SETPARAMDUPLI2CRIT
Syntax
SUBROUTINE SETPARAMDUPLI2CRIT
CRITYP1, CRITYP2)
(NPAR,
PHATYP,
Type/Description
NPAR
PHATYP
CRITYP1
CRITYP2
Comments:
This subroutine is called for each multiple parameter and
each phase type containing the criteria along which the
parameter is duplicated.
Values of the parameter duplications are registered in a
2-dimensional array.
This
subroutine
is
called
by
the
UP_PARAM_DIALOGTYPE variant of the UP_PARAM
working mode of the model library functions.
SETPARAMDUPLI2PHA
Syntax
SUBROUTINE SETPARAMDUPLI2PHA
CRITYP1, PHATYP2, CRITYP2)
(NPAR,
PHATYP1,
USIM PAC
Type/Description
BRGM Software
FUNCTION REFERENCES
181
NPAR
PHATYP1
CRITYP1
PHATYP2
CRITYP2
Comments:
This subroutine is called for each multiple parameter and
each phase type containing the criteria along which the
parameter is duplicated.
Values of the parameter duplications are registered in a
2-dimensional array.
This
subroutine
is
called
by
the
UP_PARAM_DIALOGTYPE variant of the UP_PARAM
working mode of the model library functions.
SETPARAMDUPLIPARAM
Syntax
USIM PAC
Type/Description
NPAR
NPARNB
BRGM Software
182
FUNCTION REFERENCES
ISREAC
Comments:
Values of the parameter duplications are registered in a
1-dimensional array.
This
subroutine
is
called
by
the
UP_PARAM_DIALOGTYPE variant of the UP_PARAM
working mode of the model library functions.
SETPARAMDUPLIPARAM is a new function of the version
3.0.
SETPARAMDUPLIPARAMPHASE
Syntax
SUBROUTINE
SETPARAMDUPLIPARAMPHASE
NPARNB, PHATYP)
(NPAR,
Type/Description
NPAR
NPARNB
PHATYP
Comments:
This subroutine is called for each multiple parameter and
each phase type along which the parameter is duplicated.
Values of the parameter duplications are registered in a
2-dimensional array.
This
subroutine
is
called
by
the
UP_PARAM_DIALOGTYPE variant of the UP_PARAM
working mode of the model library functions.
SETPARAMDUPLIPARAMPHASE is a new function of the
version 3.0.
SETPARAMDUPLIPARAM1CRIT
Syntax
USIM PAC
SUBROUTINE
SETPARAMDUPLIPARAM1CRIT
NPARNB, PHATYP, CRITYP)
(NPAR,
BRGM Software
FUNCTION REFERENCES
183
Type/Description
NPAR
NPARNB
PHATYP
CRITYP
Comments:
This subroutine is called for each multiple parameter and
each phase type containing the criterion along which the
parameter is duplicated.
Values of the parameter duplications are registered in a
2-dimensional array.
This
subroutine
is
called
by
the
UP_PARAM_DIALOGTYPE variant of the UP_PARAM
working mode of the model library functions.
SETPARAMDUPLIPARAM1CRIT is a new function of the
version 3.0.
SETPARAMDUPLIPHASE
Syntax
USIM PAC
Type/Description
NPAR
PHATYP
BRGM Software
184
FUNCTION REFERENCES
Comments:
This subroutine is called for each multiple parameter and
each phase along which the parameter is duplicated.
Values of the parameter duplications are registered in a
1-dimensional array.
This
subroutine
is
called
by
the
UP_PARAM_DIALOGTYPE variant of the UP_PARAM
working mode of the model library functions.
SETPARAMDUPLIPHASE is a new function of the version
3.0.
SETPARAMFILENAME
Syntax
Type/Description
NPAR
EXT
Comments:
EXT must be a C-compatible string variable.
The standard "Open" interface is proposed for the choice of
the file name.
This
subroutine
is
called
by
the
UP_PARAM_DIALOGTYPE variant of the UP_PARAM
working mode of the model library functions.
SETPARAMFILENAME is a new function of the version
3.0.
SETPARAMSTRING
Syntax
Type/Description
INTEGER Parameter number of the
string parameter.
Comments:
USIM PAC
BRGM Software
FUNCTION REFERENCES
185
SETPHA
Syntax
Type/Description
NOUTPUT
NPHA
FLOW
Return value:
0 if success else a negative integer.
Comments:
This function copies all description hierarchies of type
flowrate from the input stream (sum of all the input stream)
to an output stream. The hierarchies of other types are not
copied. Only the global flowrate is changed. All ratio
between partial flowrates and global flowrate are
conserved.
This function is called by the UP_MODEL working mode of
the model library functions.
SETPHASLIQ
Syntax
Type/Description
NOUTPUT
FLOW
Return value:
USIM PAC
BRGM Software
186
FUNCTION REFERENCES
SETROSINRAMMLER
Syntax
INTEGER
FUNCTION
SETROSINRAMMLER
NBCOMP, NCOMP, SIZE, FRAC, D63, SLOPE)
(NBCLASS,
Type/Description
NBCLASS
NBCOMP
NCOMP
SIZE
FRAC
D63
SLOPE
Return value:
0 if success else a negative integer.
USIM PAC
BRGM Software
FUNCTION REFERENCES
187
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
SETTYPE
Syntax
Type/Description
TYPE
Comments:
This subroutine is called by the UP_PARAM working mode
of the icon library functions.
SHOWERROR
Syntax
Linear
regression
fitness
coefficient
not
Log
interpolation
results
obtained
by
linear
Gaudin-Schuhmann
results
obtained
by
linear
Cumulative
passing
calculation
wrong
component
USIM PAC
BRGM Software
188
FUNCTION REFERENCES
Type/Description
INTEGER Key number of the
predefined text.
Comments:
This subroutine is called by the UP_MODEL working mode
of the model library functions and some utility functions.
SIZECLASSNAME
Syntax
Type/Description
NPHA
NCLASS
NAME
Return value:
The number of characters of the size class name if success
else a negative integer.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
SIZECLASSNAME is a new function of the version 3.0.
SORTIE
Syntax
USIM PAC
Type/Description
INTEGER Number of the output
location.
BRGM Software
FUNCTION REFERENCES
189
NOUT
XC
YC
Comments:
This subroutine must be called for each output location.
The number of output location is defined by the subroutine
NBSORTIE.
This subroutine is called by the UP_PARAM working mode
of the icon library functions.
TESTHIERTYP
Syntax
Type/Description
NPHA
NHIER
HIERTYP
Return value:
1 if the hierarchy has the type else 0. The return value is 0
if the phase number or the hierarchy number are not valid.
Comments:
This function is called by the UP_MODEL working mode of
the model library functions.
TESTPHAORE
Syntax
Return value:
1 if there is at least one ore phase else 0.
Comments:
This function is called by the UP_COMP working mode of
the model library functions.
TESTPHASMOD
Syntax
USIM PAC
BRGM Software
190
FUNCTION REFERENCES
Type/Description
DOMAIN
Return value:
1 if the phase model is coherent with the industrial domain
else 0.
Comments:
The industrial domains are:
GRANULATS
UPVER1
1.x.
TESTSIZECOMPFLOW
Syntax
Return value:
1 if there is a component grade per size class in an ore
phase else 0.
Comments:
This function is called by the UP_COMP working mode of
the model library functions.
TESTSIZEFLOW
Syntax
Return value:
1 if there is a size distribution in an ore phase else 0.
Comments:
This function is called by the UP_COMP working mode of
the model library functions.
TRACE
Syntax
USIM PAC
BRGM Software
FUNCTION REFERENCES
Parameters
191
Type/Description
Comments:
This subroutine is called by the UP_DRAW working mode
of the icon library functions.
ZEROPHA
Syntax
Type/Description
NOUTPUT
NPHA
Return value:
0 if success else a negative integer.
Comments:
This function initializes all description hierarchies of type
flowrate with a null global flowrate and copies it to an
output stream. The hierarchies of other types are not
initialized.
This function is called by the UP_MODEL working mode of
the model library functions.
ZONERECT
Syntax
USIM PAC
Type/Description
LEFT
RIGHT
TOP
BOTTOM
BRGM Software
192
FUNCTION REFERENCES
Comments:
This subroutine is called by the UP_PARAM working mode
of the icon library functions.
USIM PAC
BRGM Software