Code_Aster ®
Version
8.2
Titrate:
Procedure DEFI_FICHIER


Date:
31/01/06
Author (S):
Key J-P. LEFEBVRE
:
U4.12.03-B1 Page:
1/6

Organization (S): EDF-R & D/AMA
Handbook of Utilization
U4.1- booklet: Management
Document: U4.12.03

Procedure DEFI_FICHIER

1 Goal

To open or close a file associated with a number with logical unit. This number can be indicated in
procedure or obtained in return of the latter. This action can be carried out constantly
during work.
Handbook of Utilization
U4.1- booklet: Management
HT-62/06/004/A

Code_Aster ®
Version
8.2
Titrate:
Procedure DEFI_FICHIER


Date:
31/01/06
Author (S):
Key J-P. LEFEBVRE
:
U4.12.03-B1 Page:
2/6

2 Syntax
[nfic [whole] =] DEFI_FICHIER



(
ACTION
=
/
“ASSOCIER”
,
[DEFAUT]






/“LIBERER”,






/“RESERVER”,



FICHIER = nomfic,
[K255]




UNITE = numul,
[I]





TYPE =
/
“ASCII”,
[DEFAUT]
/
“BINARY”
,
/

“LIBRE”,




ACCES
=
/
“NEW”
,
[DEFAUT]
/
“OLD”
,
/
“APPEND”
,




INFO =/1,








/2

,

)

The obligatory or optional character of certain operands depends on the presence or the value
associated previously well informed key words.
This operator has the characteristic to function at the same time like a command while providing
a result of the whole type reusable behind a key word of a further order, is like one
procedure.

Handbook of Utilization
U4.1- booklet: Management
HT-62/06/004/A

Code_Aster ®
Version
8.2
Titrate:
Procedure DEFI_FICHIER


Date:
31/01/06
Author (S):
Key J-P. LEFEBVRE
:
U4.12.03-B1 Page:
3/6

3 Operation
of
DEFI_FICHIER

The inputs/outputs on files ASCII since Code_Aster are carried out for the majority, with the assistance
instructions FORTRAN using the concept of unit logical, it is a variable entirety from 1 to 99 associated
assistance of an instruction of the “open” type to a file. By defect this number xx is associated the name
fort.xx, but it is possible to associate it an unspecified file name. The logical number of unit is
used in the interface of access to the code astk to recopy the output and input files.
In the command file Aster various operators carrying out of the readings or the writings
admit key word UNITE like argument.
Several logical units are reserved by the code at the time of the phase of initialization, they are
associated the following files, it is in general not allowed to modify them.

· 6:
MESSAGE
· 8:
RESULTAT
· 9:
ERREUR
· 80: MED

Key word IMPRESSION of procedure DEBUT [U4.11.01] or procedure POURSUITE [U4.11.03]
at the head command file can define associations between imposed names of files and
their logical units FORTRAN.

The user can wish to add or modify associations using the procedure
DEFI_FICHIER to use for example new file names, to print some
results or to differently gather them in files. Procedure DEFI_FICHIER allows in
in addition to directly indicating the file of the type ASCII which will be associated the specified logical unit. It
can be specified either by a name in absolute (limited to 255 characters) if the file is localized on
machine, is by a relative name in an agreed repertory (./REPE_IN or./REPE_OUT) when
the interface takes care of the distant and total transfer of the whole of the files located under the repertory
(repe type in astk). A named OPEN FORTRAN is then carried out on the files of the type ASCII.
command makes it possible of more than position either file at the head, or at the end of the file.
The code manages in-house a structure of data gathering the unit of associations unit
logic ­ standard file name ­ of file - type of access.

4 Operands

The modifications of association unit logic-name of file relates to the output files and
of input.

4.1 Operand
ACTION

ACTION = “TO ASSOCIATE”

The logical number of unit is associated, when that is allowed, the name defined behind the key word
FICHIER if it is indicated, with the name fort.xx if not.
It is not possible to redefine associations of the logical numbers 6 and 9.

ACTION = “TO RELEASE”

The logical number of unit is released, it is not more possible to use this number of unit, the file
associated, when it is of type ASCII, is the subject of a command of closing using the instruction
FORTRAN CLOSED. It then becomes possible to re-use the logical number of unit. This mechanism is
essential if one wants to be able D-to immediately exploit the contents of the associated file in
command file in progress, indeed the buffers must be completely emptied and it
file must be able to be accessible, possibly at the time of a call to a software since one
order python of the os.system type.
Handbook of Utilization
U4.1- booklet: Management
HT-62/06/004/A

Code_Aster ®
Version
8.2
Titrate:
Procedure DEFI_FICHIER


Date:
31/01/06
Author (S):
Key J-P. LEFEBVRE
:
U4.12.03-B1 Page:
4/6

ACTION = “TO RESERVE”

This type of action is used in the macros commands and makes it possible to avoid the conflicts of number
of logical unit between FORTRAN and python.
The logical number of unit is associated, when that is allowed, the name defined behind the key word
FICHIER if it is indicated, with the name fort.xx if not. There is no instruction of the type OPEN
carried out, with load for the macro command to carry out the various actions necessary.

4.2 Operand
FICHIER

FICHIER = nomfic

Physical name of the file (255 characters) which one wishes to associate a logical unit. This file
will be created under the repertory of execution of the code, but one can indicate a name directly of
file (respecting UNIX conventions) in the repertory of the user. Under the repertory
of execution, it is possible to use an additional level of tree structure of name
conventional REPE_IN (data files) or REPE_OUT (files of results) recognized by
the interface of access to the code astk. This name must be placed between quotes. Although they are not
associated a logical unit by a command FORTRAN OPEN, files binary (for example MED)
can be treated with this mechanism, it is necessary nevertheless to specify the type of access NEW or OLD
to activate the recopy (by a call system since the code) since the data directory or
towards the repertory in result.
When the operand misses, it is by defect the file name fort.ul where ul is the number
of unit which is associated the logical unit definite behind UNITE.
For the file of the type ASCII, an instruction OPEN FORTRAN is carried out on the name associated with
the logical unit.

4.3 Operand
UNITE

UNITE = numul

Number of logical unit associated, its value for file ASCII opened by instructions is
ranging between 1 and 99 included.

It is possible to re-use an already affected number but in this case it is necessary to take the precaution
to release this last before. Certain numbers D `units logical cannot be redefined
since the Aster commands, they are the numbers 6 and 9 which are respectively allocated with
files MESSAGE, and ERREUR.
This number can be used then in all the Aster commands which have the operand
UNITE (IMPR_RESU, IMPR_TABLE, IMPR_COURBE, etc).

Operand UNITE can sometimes be omitted, it is then the code which will choose to affect a number,
according to the availabilities, it is then necessary imperatively to specify operand FICHIER, the code
then in-house load to associate the logical number of unit and the associated file. It is then
possible to recover a whole value at output of the operator.

4.4 Operand
TYPE

TYPE = “ASCII”

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

TYPE = “BINARY”

The file associated with the logical unit is of binary type (not still used in the code).

TYPE = “FREE”

The file associated with the logical unit is of unspecified type within the meaning of FORTRAN, that allows
to manage in a more flexible way the access to the file, this type is primarily used for the access to
files MED. The logical unit is not really used in this case, but that makes it possible to have
convention of name fort.ul on the file and being able to easily transmit it through the interface
access to the code.
Handbook of Utilization
U4.1- booklet: Management
HT-62/06/004/A

Code_Aster ®
Version
8.2
Titrate:
Procedure DEFI_FICHIER


Date:
31/01/06
Author (S):
Key J-P. LEFEBVRE
:
U4.12.03-B1 Page:
5/6

4.5 Operand
ACCES

Is used only in the case of the files of the type ASCII.

ACCESS = “NEW”

The file is opened and one positions at the head, a Fortan instruction of the type REWIND is
carried out.

ACCESS = “OLD”

The file is opened and one positions just as it is.

ACCESS = “SUSPENDS”

The file is opened and one positions at the end of the file.

4.6 Operand
INFO

INFO = inf

Allows to print in file MESSAGE the list of the open logical units with
order DEFI_FICHIER as well as the associated parameters. If INFO = 1, it does not have there
of impression.

5
Declaration in the interface of access to the code of the unit
logic implemented in DEFI_FICHIER

Generally the user will invite DEFI_FICHIER in order to carry out postprocessings when it
test the need to physically create several files of results according to the cases of
loads, of the sizes, the steps or moments of evolution of calculation.

The user must declare the names physical of the files and the associated logical units. This
declaration is carried out, in the interface astk before the launching of the completion of the work. It
is necessary to add the files in the profile of study by selecting the libr type and to associate the number to them
of logical unit selected.

The repe type is used in the interface astk to transmit or receive all the contents of one
file directory, with load for the user to make call in the command file with
DEFI_FICHIER to carry out association with the logical number of unit.
For convention the data files are transmitted in the repertory of nonroom REPE_IN, them
files in result are transmitted in the repertory of local name REPE_OUT.
In order DEFI_FICHIER, the name placed behind FICHIER is form:
./REPE_IN/mon_fichier.

Handbook of Utilization
U4.1- booklet: Management
HT-62/06/004/A

Code_Aster ®
Version
8.2
Titrate:
Procedure DEFI_FICHIER


Date:
31/01/06
Author (S):
Key J-P. LEFEBVRE
:
U4.12.03-B1 Page:
6/6

Intentionally white left page.
Handbook of Utilization
U4.1- booklet: Management
HT-62/06/004/A

Outline document