Code_Aster
®
Version
8.2
Titrate:
Procedure
DEFI_FICHIER
Date:
31/01/06
Author (S):
J-P. LEFEBVRE
Key
:
U4.12.03-B1
Page:
1/6
Instruction manual
U4.1- booklet: Management
HT-62/06/004/A
Organization (S):
EDF-R & D/AMA
Instruction manual
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.
Code_Aster
®
Version
8.2
Titrate:
Procedure
DEFI_FICHIER
Date:
31/01/06
Author (S):
J-P. LEFEBVRE
Key
:
U4.12.03-B1
Page:
2/6
Instruction manual
U4.1- booklet: Management
HT-62/06/004/A
2 Syntax
[nfic [whole] =] DEFI_FICHIER
(
ACTION
=
/
“TO ASSOCIATE”
,
[DEFECT]
/“TO RELEASE”,
/“TO RESERVE”,
FILE = nomfic,
[K255]
UNIT = numul,
[I]
TYPE =
/
“ASCII”,
[DEFECT]
/
“BINARY”
,
/
“FREE”,
ACCESS
=
/
“NEW”
,
[DEFECT]
/
“OLD”
,
/
“SUSPENDS”
,
INFORMATION =/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 control while providing
a result of the whole type reusable behind a key word of a further order, is like one
procedure.
Code_Aster
®
Version
8.2
Titrate:
Procedure
DEFI_FICHIER
Date:
31/01/06
Author (S):
J-P. LEFEBVRE
Key
:
U4.12.03-B1
Page:
3/6
Instruction manual
U4.1- booklet: Management
HT-62/06/004/A
3 Operation
of
DEFI_FICHIER
The inputs/outputs on the ASCII files since Code_Aster are carried out for the majority, with aid
instructions FORTRAN using the concept of unit logical, it is a variable entirety from 1 to 99 associated
the aid 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 exit and input files.
In the command file Aster various operators carrying out of the readings or the writings
admit the key word UNIT 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:
RESULT
· 9:
ERROR
· 80: MED
The key word
IMPRESSION
procedure
BEGINNING
[U4.11.01] or of the procedure CONTINUATION [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 ASCII type 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 index (./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 index
(repe type in astk). OPEN named FORTRAN is then carried out on the files of the ASCII type.
control 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 amendments 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
FILE 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 ASCII type, 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.
Code_Aster
®
Version
8.2
Titrate:
Procedure
DEFI_FICHIER
Date:
31/01/06
Author (S):
J-P. LEFEBVRE
Key
:
U4.12.03-B1
Page:
4/6
Instruction manual
U4.1- booklet: Management
HT-62/06/004/A
ACTION = “TO RESERVE”
This type of action is used in the macros controls 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
FILE if it is indicated, with the name fort.xx if not. There is no instruction of the OPEN type
carried out, with load for the macro control to carry out the various actions necessary.
4.2 Operand
FILE
FILE = nomfic
Physical name of the file (
255 characters) which one wishes to associate a logical unit. This file
will be created under the index of execution of the code, but one can indicate a name directly of
file (respecting UNIX conventions) in the index of the user. Under the index
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 an OPEN command FORTRAN, binary files (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 index 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 UNIT.
For the file of the ASCII type, an OPEN instruction FORTRAN is carried out on the name associated with
the logical unit.
4.3 Operand
UNIT
UNIT = numul
Number of logical unit associated, its value for the ASCII file 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 controls Aster, they are the numbers 6 and 9 which are respectively allocated with
files MESSAGE, and ERROR.
This number can be used then in all the Aster controls which have the operand
UNIT (IMPR_RESU, IMPR_TABLE, IMPR_COURBE, etc).
The operand UNIT 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 the operand FILE, 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 exit of the operator.
4.4 Operand
TYPE
TYPE = “ASCII”
The file associated with the logical unit is of ASCII type.
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.
Code_Aster
®
Version
8.2
Titrate:
Procedure
DEFI_FICHIER
Date:
31/01/06
Author (S):
J-P. LEFEBVRE
Key
:
U4.12.03-B1
Page:
5/6
Instruction manual
U4.1- booklet: Management
HT-62/06/004/A
4.5 Operand
ACCESS
Is used only in the case of the files of the ASCII type.
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
INFORMATION
INFORMATION = inf
Allows to print in the file MESSAGE the list of the open logical units with
order DEFI_FICHIER as well as the associated parameters. If INFORMATION = 1, it does not have there
of impression.
5
Statement 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 pitches or moments of evolution of calculation.
The user must declare the names physical of the files and the associated logical units. This
statement 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 index of nonroom REPE_IN, them
files in result are transmitted in the index of local name REPE_OUT.
In order DEFI_FICHIER, the name placed behind FILE is form:
./REPE_IN/mon_fichier.
Code_Aster
®
Version
8.2
Titrate:
Procedure
DEFI_FICHIER
Date:
31/01/06
Author (S):
J-P. LEFEBVRE
Key
:
U4.12.03-B1
Page:
6/6
Instruction manual
U4.1- booklet: Management
HT-62/06/004/A
Intentionally white left page.