SPEDAT is a PIL command which is used for transmitting SPEcial DATa from the Q1 file to GROUND, such data being the ones for which no PIL variables or functions already exist.
It thus enables limitations of PIL to be easily circumvented; but its use requires the provision in EARTH or GROUND of the appropriate data-using coding.
1. Using SPEDAT for setting data
The full syntax of the PIL command, when used for SETting data, is:
SPEDAT(SET, CONTEXT, VARNAME, TYPE, VALUE)
For example, inclusion in the Q1 file of the line:
SPEDAT(SET, new_idea, new_variable, r, 11.e3)
will cause the following to be written into the EARDAT file:
NEW_IDEA NEW_VARIABLE R 1.10000E+04
This line is subsequently read by EARTH; and its content is used in the subsequent flow-simulating calculation.
NOTE !! It is permitted (since PHOENICS-3.1) to replace SET by S, or even to omit it (and the comma which follows it) altogether.
2. The GROUND-coding Fortran statements for getting the data
The reading and interpretation of the EARDAT line in EARTH requires the presence, usually in a GROUND subroutine, of the following line, or its equivalent:
CALL GETSPD('NEW_IDEA','NEW_VARIABLE',1, RVAL, IVAL, LVAL, CVAL, IERR)
Warning: Here the quotes are essential !
Then the real variable RVAL will be set equal to 1.1E4 .
The third argument indicates which of the four following arguments is to be taken, as follows:
Because the GETSPD command has rather many arguments, it is sometimes preferable to use whichever is appropriate of the following four subroutines in the GROUND Fortran file:
At the time of creating the EARDAT file, the PHOENICS Satellite module writes the SPEDAT data as indicated in the following examples, in which the first integer indicates how many following lines are to be read by EARTH.
10 PRINT NUMBER I 5 PRINT COMMAND1 CTOTAL_TEMP PRINT COMMAND2 CPOW_TEMP_C1 PRINT POWER R 5.00000E-01 PRINT COMMAND3 CMINMAX_U1 PRINT COMMAND4 CAVE_C1 PRINT COMMAND5 CVALUE_V1 PRINT IXLOC I 5 PRINT IYLOC I 5 PRINT IZLOC I 1
16 GRIDS CASE CBOX GRIDS XCMIN R 0.00000E+00 GRIDS XCMAX R 1.00000E+00 GRIDS YCMIN R 0.00000E+00 GRIDS YCMAX R 2.00000E+00 GRIDS ZCMIN R 0.00000E+00 GRIDS ZCMAX R 3.00000E+00 GRIDS TFCXMX R 1.10000E+00 GRIDS TFCXMN R 1.00000E+00 GRIDS TFCYMX R 1.10000E+00 GRIDS TFCYMN R 1.00000E+00 GRIDS TFCZMX R 1.10000E+00 GRIDS TFCZMN R 1.00000E+00 GRIDS DXCDZC R 0.00000E+00 GRIDS DYCDXC R 0.00000E+00 GRIDS DYCDZC R 0.00000E+00
98 OBJNAM ^SOIN1 CSOIN1 IGESTYPE ^SOIN1 CUSER_DEFINED OBJNAM ^SOIN2 CSOIN2 IGESTYPE ^SOIN2 CUSER_DEFINED OBJNAM ^DILUIN CDILUIN IGESTYPE ^DILUIN CUSER_DEFINED OBJNAM ^IZ4 CIZ4 IGESTYPE ^IZ4 CUSER_DEFINED OBJNAM ^XSECIN1 CXSECIN1 IGESTYPE ^XSECIN1 CUSER_DEFINED OBJNAM ^XSECIN2 CXSECIN2 IGESTYPE ^XSECIN2 CUSER_DEFINED OBJNAM ^OB1 CX1 IGESTYPE ^OB1 CNULL OBJNAM ^OB2 CY1 IGESTYPE ^OB2 CNULL OBJNAM ^OB3 CY3 IGESTYPE ^OB3 CNULL OBJNAM ^OB4 CZ4 IGESTYPE ^OB4 CNULL OBJNAM ^OB5 CZ5 IGESTYPE ^OB5 CNULL OBJNAM ^OB6 CCMP2 IGESTYPE ^OB6 CBLOCKAGE
4. Examples of the use of SPEDAT, GETSPD, GETSDR, etc can be found in the Encyclopaedia, in the input-file libraries and in the corresponding open-source Fortran files, as follows:
5. Other arguments of the PIL command
SET is not the only possible first argument of the SPEDAT command. Others are:
They are not often used, because SPEDAT statements are usually introduced by hand-editing, which allows more direct methods of de-activating previously-made settings; but they have their uses in complex multi-purpose Q1s, controlled by PIL-logic constructs.