TYPE_DEFINITION
TYPE_DEFINITION [data-type code]*1 [secondary keyword with parameters] !
This keyword couples phases to an action performed by the DATA module when the DATA command GET_DATA is executed.

The secondary keywords and associated parameters in syntax are:
SEQ [filename]
RND# [filename]
GES [valid GIBBS command with parameters]
POLY3 [valid POLY command with parameters]
TDB [valid DATA command with parameters]
IF [conditional statement] THEN [keyword with parameters]
AFTER [valid GIBBS command with parameters]
The secondary keyword SEQ
specifies a sequential file that stores parameters belonging to the phases using the associated data type code (which is defined by this keyword). A special case where the filename is given as an asterisk (*
) implies that the database definition file also acts as a sequential data storage file. This case makes it possible to have a single file for a small database, which is especially suited for personal databases.
The secondary keyword RND
should be concatenated with a positive integer #
to indicate the type of the random file. Currently, there are these types of random files:
RND0
, the default, is used for complete Gibbs energy expressions (G0 parameters), where the search field is the unabbreviated parameter name.
RND1
is designated for functions, where the function name is used as the search field.
RND2
is reserved for binary interaction parameters, where its search field is also the unabbreviated parameter name without any interaction order notation.
Ternary and higher order interaction parameters must be specified on a sequential file. Moreover, the internal structures of these random files are subject to changes with different versions of DATA, and with implementations of DATA on various computer systems. For more information, see the FORTRAN program TDBSORT, which is available from Thermo‑Calc Software AB.
The secondary keywords GES
, POLY3
, or TDB
specifies a modification of, or addition to, phases having the associated data type code, such as magnetic contribution, another excess model, or any other valid GIBBS/POLY/DATA command that applies to a certain phase. By implementing this as a call to the interactive GIBBS/POLY/DATA module, flexibility is achieved. If a new type of addition is implemented in a GIBBS/POLY/DATA module, it can be immediately used in the database definition file without reprogramming the DATA module.
In several examples below, the use of the at (@
) sign indicates any phase to which the relevant type definition (e.g. A
, B
, 4
, or E
) applies.
The secondary keywords IF
and THEN
allow specification of a conditional statement structured with respect to the phase constitution that controls the execution of a following type-definition (keyword with parameters) string. See the last four examples.
The secondary keyword AFTER
is similar to the GES keyword except the defined GIBBS command is executed after all parameters are entered. The reason for this is that the command has no effect unless there is a parameter. Following the AFTER
keyword, a GIBBS command must be given and it is executed after entering the parameters of the phase.
The data-type code (always as one string) can be any normal or special character, e.g. 0
, 5
, A
, F
, M
, %
, &
, and so forth, and is referred in the definition keywords PHASE, COMPOUND_PHASE and ALLOTROPIC_PHASE for various phases.
A phase can have several ADDITIONAL parts of different types (that are enforced by certain TYPE_DEFINITIONS which call the GIBBS command AMEND_PHASE_DESCRIPTION for describing various contributions to Gibbs energy). However, the DATA/GIBBS module automatically deletes any early-defined ADDITIONAL part(s) of the same type.
The DATA module can selectively retrieve functions that are necessary for a defined system from a database that has functions stored in its setup
file or SEQ
sequential function file, while all other functions irrelevant for the defined system are ignored and are not saved in associated GIBBS and POLY workspaces.

TYPE_DEF % SEQ TCPATH\DATA\[DATABASE]\PARAMETERS.TDB !
TYPE_DEF I SEQ TCPATH\DATA\[DATABASE]\INTERACTION-PARAMS.TDB !
TYPE_DEF G RND0 TCPATH\DATA\[DATABASE]\GZERO-PARAMS.TDB !
TYPE_DEF F RND1 TCPATH\DATA\[DATABASE]\FUNCTIONS.TDB !
TYPE_DEF & RND2 TCPATH\DATA\[DATABASE]\BINARY-INTERACTIONS.TDB !
TYPE_DEF A GES AM_PH_DES @ MAGNETIC -1 0.40 !
TYPE_DEF B GES AM_PH_DES @ MAGNETIC -3 0.28 !
TYPE_DEF 4 GES AM_PH_DES @ EXCESS_MODEL REDLICH-KISTER_KOHLER !
TYPE_DEF 5 GES AM_PH_DES AQUEOUS EXCESS_MODEL HKF !
TYPE_DEF 6 GES AM_PH_DES AQUEOUS HKF_ELECTROSTATIC !
TYPE_DEF 7 GES AM_PH_DES AQUEOUS STATUS 02084000,,, !
TYPE_DEF 8 GES AM_PH_DES AQUEOUS MAJOR_CONST 1 H2O !
TYPE_DEF E AFTER AM_PH_DES LIQUID EXCESS MIXED-EXCESS
A B LEGENDRE C A POLYNOM ,,,, !
TYPE_DEF T AFTER AM_PH_DES LIQUID TERN-EXT TOOP-KOHLER B A C ,,,, !
TYPE_DEF Q AFTER AM_PH_DES LIQUID TERN-EXT KOHLER FE CR NI !
TYPE_DEF C IF (PD AND PT AND SN) THEN TDB RESTORE_PHASE BCT_A5 !
TYPE_DEF D IF (PD AND (PT OR SN)) THEN TDB REJECT_PHASE BCC_A2 !
TYPE_DEF E IF ((NB OR TI OR V) AND (C OR N)) THEN
GES AM_PH_DES @ COMP_SET ,, CR NB TI V: C N: !
TYPE_DEF F IF (ALO3/2 OR CRO3/2 OR FEO OR MNO OR SIO2) THEN
GES AM_PH_DES LIQUID COMP_SET ,, ALN%,ALO3/2%,CRO3/2%,
FEO%,FEO3/2,MNO3/2%,MNS%,SIO2%,TIO2% : !
TYPE_DEF R GES AM_PH_DES FE_LIQUID FRACTION_LIMITS Fe 0 0.6
Ag 0 0.01 Al 0 0.05 Ca 0 0.05 Co 0 0.01 Cr 0 0.01
Cu 0 0.02 Mg 0 0.05 Mn 0 0.05 Mo 0 0.05 Nb 0 0.05
Ni 0 0.05 Pb 0 0.05 Si 0 0.10 Sn 0 0.02 Ti 0 0.05
U 0 0.01 V 0 0.02 W 0 0.02 Zr 0 0.03
B 0 0.01 C 0 0.01 H 0 0.01 N 0 0.01 O 0 0.01
P 0 0.01 S 0 0.01 !

When an ordered phase with disordered contribution is restored, the disordered contribution is automatically restored as well. You can also restore the disordered phase without restoring the ordered phase.
However the DIS_PART TYPE_DEFINITION must always be set on the ordered phase. It is important that the disordered phase is declared before the ordered phase. Otherwise it causes an error when DIS_PART TYPE_DEFINITION is executed and then either the ordered or disordered phase is rejected.

TYPE_DEFINITION & GES A_P_D FCC_A1 MAGNETIC -3.0 2.80000E-01 !
PHASE FCC_A1 %& 2 1 1 !
CONSTITUENT FCC_A1 :CR,NI% : C%,VA : !
$ THIS PHASE HAS A DISORDERED CONTRIBUTION FROM FCC_A1
TYPE_DEFINITION ' GES AMEND_PHASE_DESCRIPTION FCC_L12 DIS_PART FCC_A1,,,!
TYPE_DEFINITION ( GES A_P_D FCC_L12 MAGNETIC -3.0 2.80000E-01 !
PHASE FCC_L12 %'( 3 .75 .25 1 !
CONSTITUENT FCC_L12 :CR,NI% : CR,NI% : C,VA% : !
For example a GES command such as the following only affects phases defined above or at the phase with this TYPE_DEFINITION in the TDB file:
TYPE_DEFINITION ( GES A_P_D FCC_L12 DIS_PART FCC_A1,,, !
For example a TDB command such as the following only affects phases defined below the phase with this TYPE_DEFINITION in the TDB file:
TYPE_DEFINITION ( TDB RESTORE_PHASE FCC_A1 !