4. Operands#

The logical unit-file name association change (s) relate to the output and input files.

4.1. Operand ACTION#

◊ ACTION = 'ASSOCIER'

The logical unit number is associated, when allowed, with the name defined behind the keyword FICHIER if it is entered, with the name fort.xx otherwise.

It is not possible to redefine the associations of logical numbers 6 and 9.

◊ ACTION = 'LIBERER'

The logical unit number is released, it is no longer legal to use this unit number, the associated file, when it is of type ASCII, is subject to a closure order using the Fortran CLOSE instruction. It then becomes possible to reuse the logical unit number with an action of the type “LIBERER”. This mechanism is essential if one wants to be able to immediately re-use the content of the associated file in the current command file, in fact the buffers must have been completely emptied and the file must be accessible, possibly when calling a software program from a python command such as os.system.

◊ ACTION = 'RESERVER'

This type of action is used in command macros and helps avoid logical unit number conflicts between Fortran and Python.

The logical unit number is associated, when allowed, with the name defined behind the keyword FICHIER if it is entered, with the name fort.xx otherwise. There is no OPEN instruction executed, it is up to the macro command to perform the various actions required.

4.2. Operand FICHIER#

◊ FICHIER = nomfic

Physical name of the file (< 255 characters) that you want to associate with a logical unit. This file will be created under the code execution directory, but you can directly specify a file name (respecting conventions UNIX) in the user directory. Under the execution directory, it is possible to use an additional level of tree structure with a conventional name REPE_IN (data files) or REPE_OUT (result files) recognized by the astk code access interface. This name must be enclosed in quotes. Although they are not associated with a logical unit by a Fortran OPEN order, binary files (for example MED) can be processed with this mechanism, it is nevertheless necessary to specify the type of access NEW or OLD to activate the copying (by a system call from the code) from the data directory or to the result directory.

When the operand is absent, it is by default the file name fort.ul where ul is the unit number that is associated with the logical unit defined behind UNITE.

For files of type ASCII, a OPEN Fortran instruction is executed on the name associated with the logical unit.

4.3. Operand UNITE#

◊ UNITE = numul

An associated logical unit number, its value for ASCII files opened by instructions is between 1 and 99 inclusive.

It is possible to reuse a number already assigned but in this case it is necessary to take the precaution of releasing it previously. Some logical unit numbers cannot be redefined from the Aster commands, these are numbers 6 and 9 that are respectively allocated to files MESSAGE and ERREUR.

This number can then be used in all Aster commands that have the UNITE operand (IMPR_RESU, IMPR_TABLE, IMPR_FONCTION, etc).

The operand UNITE can sometimes be omitted, it is then the code that will choose to assign a number, depending on availability, it is then imperative to specify the operand FICHIER, the code is then responsible internally for associating the logical unit number and the associated file. It is then possible to retrieve an integer value as output from the operator.

4.4. Operand TYPE#

◊ TYPE = 'ASCII'

The file associated with the logical unit is of type ASCII.

◊ TYPE = 'LIBRE'

The file associated with the logical unit is of an undetermined type in the sense of Fortran, this makes it possible to manage access to the file more flexibly, this type is essentially used for access to files MED. The logical unit is not really used in this case, but it makes it possible to have the fort.ul name convention on the file and to be able to easily transmit it through the code access interface.

◊ TYPE = 'BINARY'

The file associated with the logical unit is of type BINARY.

4.5. Operand ACCES#

◊ ACCES = 'NEW'

The file of type « ASCII » is opened and we are positioned at the top, a Fortan instruction of type REWIND is executed. If it exists, the file is overwritten. To be used for a result file.

◊ ACCES = 'OLD'

The « ASCII » file is open and we position ourselves as it is, that is to say possibly at the position in which we were at the time of the last access.

To be used for a data file.

◊ ACCES = 'APPEND'

The file is open and we position ourselves at the end of the file. Only used in the case of ASCII files.

To be used for a data file that you want to complete (which will therefore be in principle the result).

4.6. Operand INFO#

◊ INFO = under

Allows you to print in file MESSAGE the list of logical units opened with the DEFI_FICHIER command as well as the associated parameters. If INFO = 1, there is no printing.