3.17: TQGNLC

TOCGroup 2TQINLCTQNOSLGroup 3A-ZGroup 2

GET-NAME-OF-SUBLATTICE-CONSTITUENT

Use TQGNLC to get the name for a specified sublattice constituent.

Added for ChemApp version 3.3.1

Synopsis

FORTRAN: CALL TQGNLC(INDEXP,INDEXL,INDEXC,NAME,NOERR)

C: tqgnlc(indexp,indexl,&indexc,name,&noerr);

Pascal: tqgnlc(indexp,indexl,indexc,name,noerr);

Basic: Call tqgnlc(indexp,indexl,indexc,name,noerr)


Name Type Value set on call or returned
INDEXP INTEGER Set to the index number for a phase
INDEXL INTEGER Set to the index number for a sublattice
INDEXC INTEGER Set to the index number for a sublattice constituent
NAME CHARACTER Returns the sublattice constituent name
NOERR INTEGER Returns an error number

INDEXP, INDEXL, and INDEXC are all integer input and have to be set to the index numbers of a phase, a sublattice in that phase, and a sublattice constituent on that sublattice. The output variable NAME cannot exceed 25 characters in length. All solution phases are considered to be modelled with one or several sublattices. For phases with one sublattice, the subroutines TQGNLC and TQGNPC are equivalent.

If the variable NAME contains a name for the sublattice constituent like Comp 1, 1 this usually means that the thermochemical data-file used has been converted from ChemSage version 3.x to 4.x format using ChemFile. Sublattice constituent names were not part of the ChemSage V3.x data-file format, thus ChemFile can only use generic names for them if a data-file is converted that contains a sublattice phase. If the data-file in use is in ASCII format, these generic names can be manually edited in the file using a text editor. In case binary files are used, please contact GTT-Technologies.

See also

TQINLC, TQNOSL, TQNOLC, TQGTLC

Examples

FORTRAN:View plain source code



C Handling sublattice constituents
PROGRAM CAF26 IMPLICIT NONE
INTEGER NOERR, NPHASE, NSL, NSLCON, INDEXP, INDEXL, INDEXC, I CHARACTER PNAME*24, CNAME*24
C Initialise ChemApp CALL TQINI(NOERR)
C Open the thermochemical data-file subl-ex.dat for reading. It contains C an extract of the system Co-Cr-Fe: the phase SIGMA:30, which is C modelled according to the sublattice formalism, and the BCC phase, C described by a Redlich-Kister polynomial. Both phases are each C included twice, to account for miscibility gaps. CALL TQOPNA('subl-ex.dat', 10, NOERR)
C Read data-file CALL TQRFIL(NOERR)
C Close data-file CALL TQCLOS(10, NOERR)
C The first of the two identical copies of the SIGMA:30 phase, which C ChemApp calls SIGMA:30#1, will be investigated with respect to the C number of sublattices, the number of sublattice constituents on each C sublattice, and the names of the sublattice constituents.
C Get the index number for the phase SIGMA:30#1 PNAME = 'SIGMA:30#1' CALL TQINP(PNAME, INDEXP, NOERR)
C Get the number of sublattices CALL TQNOSL(INDEXP, NSL, NOERR) WRITE(*,*) PNAME, ' has ', NSL, ' sublattices'

Output:
 SIGMA:30#1               has  3 sublattices

C Loop over all sublattices DO INDEXL=1, NSL
C Get the number of sublattice constituents CALL TQNOLC(INDEXP, INDEXL, NSLCON, NOERR) WRITE(*,*) 'Sublattice ', INDEXL, ' has ', NSLCON, * ' constituents with the following names:'
C Get the name of each sublattice constituent DO INDEXC=1, NSLCON CALL TQGNLC(INDEXP, INDEXL ,INDEXC, CNAME, NOERR)
C The reverse (getting the index number for the name of the sublattice C constituent just retrieved), is rather superfluous here, and only used C to demonstrate the call to TQINLC: CALL TQINLC(CNAME, INDEXP, INDEXL, I, NOERR) WRITE(*,*) ' ',I,':', CNAME ENDDO ENDDO

Output:
 Sublattice  1 has  2 constituents with the following names:
    1:Co                      
    2:Fe                      
 Sublattice  2 has  1 constituents with the following names:
    1:Cr                      
 Sublattice  3 has  3 constituents with the following names:
    1:Co                      
    2:Cr                      
    3:Fe

END




C:View plain source code




/* Program cac26 */ /* Handling sublattice constituents */
#include "cacint.h"
int main() {

LI noerr, nphase, nsl, nslcon, indexp, indexl, indexc, i; char pname[TQSTRLEN], cname[TQSTRLEN];
/* Initialise ChemApp */ tqini(&noerr);
/* Open the thermochemical data-file subl-ex.dat for reading. It contains an extract of the system Co-Cr-Fe: the phase SIGMA:30, which is modelled according to the sublattice formalism, and the BCC phase, described by a Redlich-Kister polynomial. Both phases are each included twice, to account for miscibility gaps. */ tqopna("subl-ex.dat",10,&noerr);
/* Read data-file */ tqrfil(&noerr);
/* Close data-file */ tqclos(10, &noerr);
/* The first of the two identical copies of the SIGMA:30 phase, which ChemApp calls SIGMA:30#1, will be investigated with respect to the number of sublattices, the number of sublattice constituents on each sublattice, and the names of the sublattice constituents. */
/* Get the index number for the phase SIGMA:30#1 */ strcpy(pname, "SIGMA:30#1"); tqinp(pname, &indexp, &noerr);
/* Get the number of sublattices */ tqnosl(indexp, &nsl, &noerr); printf("%s has %li sublattices\n",pname, nsl);

Output:
SIGMA:30#1 has 3 sublattices

/* Loop over all sublattices */ for (indexl = 1; indexl<=nsl; indexl++) {
/* Get the number of sublattice constituents */ tqnolc(indexp, indexl, &nslcon, &noerr); printf("Sublattice %li has %li constituents with the following names:\n", indexl, nslcon);
/* Get the name of each sublattice constituent */ for (indexc = 1; indexc<=nslcon; indexc++) { tqgnlc(indexp, indexl ,indexc, cname, &noerr);
/* The reverse (getting the index number for the name of the sublattice constituent just retrieved), is rather superfluous here, and only used to demonstrate the call to tqinlc: */ tqinlc(cname, indexp, indexl, &i, &noerr); printf(" %li: %s\n", i, cname); } }

Output:
Sublattice 1 has 2 constituents with the following names:
   1: Co
   2: Fe
Sublattice 2 has 1 constituents with the following names:
   1: Cr
Sublattice 3 has 3 constituents with the following names:
   1: Co
   2: Cr
   3: Fe

return 0;
}

For more examples, see also TQGTLC


ChemApp Programmer's Manual, Edition 3.6© GTT-Technologies, 2003