Você está na página 1de 5

Code_Aster

Titre : Procdure DEFI_FICHIER Res o!sa"#e : $ea!%Pierre &EFE'(RE

Version default
Date : 30/09/2013 Page : 1/5 C# : )*+12+03 R,isio! : 11*55

Procdure DEFI_FICHIER

Drank
Ouvrir or to close a file associated with a number with logical unit. This number can be indicated in the procedure or obtained in return of the latter. This action can be carried out constantly during work. This procedure makes it possible to associate a logical number of unit with a file FORTRAN of the type AS !!" but this concept can also apply with certain restrictions on files of the binary type.

-ar!i!g : T.e tra!s#atio! rocess used o! t.is /e"site is a 01ac.i!e Tra!s#atio!0+ It 2a3 "e i2 recise a!d i!accurate i! /.o#e or i! art a!d is ro,ided as a co!,e!ie!ce+ &ice!sed u!der t.e ter2s o4 t.e 56) FD& 7.tt ://///+g!u+org/co 3#e4t/4d#+.t2#8

Code_Aster
Titre : Procdure DEFI_FICHIER Res o!sa"#e : $ea!%Pierre &EFE'(RE

Version default
Date : 30/09/2013 Page : 2/5 C# : )*+12+03 R,isio! : 11*55

Syntax
[nfic [whole] =] DEFI_FICHIER ( ACTION = / ASSOCIER / !I"ERER / RESER#ER [DEFECT]

FICHIER (NITE T*+E= ACCES=

= no$fic = n)$)l / ASCII / !I"RE / NE, / O!D / A++END / /&

[%&''] [I] [DEFECT] [DEFECT]

INFO= .

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

-ar!i!g : T.e tra!s#atio! rocess used o! t.is /e"site is a 01ac.i!e Tra!s#atio!0+ It 2a3 "e i2 recise a!d i!accurate i! /.o#e or i! art a!d is ro,ided as a co!,e!ie!ce+ &ice!sed u!der t.e ter2s o4 t.e 56) FD& 7.tt ://///+g!u+org/co 3#e4t/4d#+.t2#8

Code_Aster
Titre : Procdure DEFI_FICHIER Res o!sa"#e : $ea!%Pierre &EFE'(RE

Version default
Date : 30/09/2013 Page : 3/5 C# : )*+12+03 R,isio! : 11*55

Operation of DEFI_FICHIER
#es inputs$outputs on files AS !! since Code_9ster are carried out for the ma%ority" using instructions FORTRAN using the concept of unit logical, it is a variable integer from & to '' associate using an instruction of the (open) type to a file. *y default this number ++ is associated with the name fort.++" but it is possible to associate it with an unspecified file name. The logical number of unit is used in the application interface of access to the code astk to recopy the output and input files. !n the command file 9ster the various operators carrying out of the readings or the writings admit key word (NITE like argument. Several logical units are reserved by the code at the time of the phase of initiali,ation. !t is not authori,ed to modify the logical units - and ' which make it possible to trace the course of an e+ecution.

logical unit / 2 3

name of the file 0ESSA1E RES(!TAT ERRE(R

authorized amendment not yes not

the user can wish to add or modify associations using procedure DEFI_FICHIER to use for e+ample new file names" to print certain results or to differently gather them in files. .rocedure DEFI_FICHIER makes it possible moreover to directly indicate the file of the type AS !! which will be associated with the specified logical unit. !t can be specified either by a name in absolute /restricted with 011 characters2 if the file is localised on the machine" or by a relative name in an agreed directory /4 /RE+E_IN or 4/RE+E_O(T2 when the application interface is loaded of the remote and total rollout of all the files located under the directory /standard 5e6e in astk2. A n7$e8 O.3N FORTRAN is then carried out on the files of the type AS !!. The command makes it possible of more than position either at the top of file" or at the end of the file. The code manages in4house a data structure gathering all of associations logical unit 4 file name 4 file type 4 type of access.

4
4!1

Oprande
#e ou les amendments of association unit logic4name of file relates to the input and output files.

Operand ACTION
ACTION = ASSOCIER the logical number of unit is associated" when that is allowed" the name defined behind key word FICHIER if it is indicated" in the name fo594:: if not. !t is not possible to redefine associations of the logical numbers - and '. ACTION = !I"ERER

the logical number of unit is released" it is not more licit to use this number of unit" the associated file" when it is of type AS !!" is the sub%ect of an order of closing using instruction FORTRAN C!OSE. !t then becomes possible to re4use the logical number of unit with an action of the type (!I"ERER5. This mechanism is essential if one wants to be able 64to immediately e+ploit the file contents associated in the command file in progress" indeed the buffers must be completely emptied and the file must be able to be accessible" possibly at the time of a call to a software since a command python of the os.system 9;6e. ACTION = RESER#ER

-ar!i!g : T.e tra!s#atio! rocess used o! t.is /e"site is a 01ac.i!e Tra!s#atio!0+ It 2a3 "e i2 recise a!d i!accurate i! /.o#e or i! art a!d is ro,ided as a co!,e!ie!ce+ &ice!sed u!der t.e ter2s o4 t.e 56) FD& 7.tt ://///+g!u+org/co 3#e4t/4d#+.t2#8

Code_Aster
Titre : Procdure DEFI_FICHIER Res o!sa"#e : $ea!%Pierre &EFE'(RE

Version default
Date : 30/09/2013 Page : */5 C# : )*+12+03 R,isio! : 11*55

e type d5 action is used in the macro commands and makes it possible to avoid the conflicts of logical number of unit between FORTRAN and python. The logical number of unit is associated" when that is allowed" the name defined behind key word FICHIER if it is indicated" in the name fo594:: if not. There is no instruction of the e+ecuted type O.3N" with load for the macro command to carry out the various actions necessary.

4!2

Phy ical operand


FICHIER FICHIER = nomfic Nom of the file /7 011 characters2 which one wishes to associate with a logical unit. This file will be created under the directory of e+ecution of the code" but one can directly indicate a file name /respecting conventions 8N!92 in the directory of the user. 8nder the directory of e+ecution" it is possible to use an additional level of tree structure of conventional name RE+E_IN /data files2 or RE+E_O(T /results files2 recogni,ed by the application interface of access to the code astk. This name must be placed between :uotes. Although they are not associated with a logical unit by an order FORTRAN O.3N" the binary files /for e+ample ;362 can be treated with this mechanism" it is necessary nevertheless to specify the type of access N3< or O#6 to activate the recopy /by a call system since the code2 since the data directory or directory in result. <hen the operand is absent" it is by defect the file name fo594)l where )l is the number of unit which is associated with the logical unit definite behind (NITE. For the files of the type AS !!" an instruction O+EN FORTRAN is carried out on the name associated with the logical unit.

4!3

Operand UNITE
(NITE = n)$)l Num=ro of logical unit associated" its value for file AS !! opened by instructions lies between & and '' included. !t is possible to re4use an already affected number but in this case it is necessary to take the precaution to release this last before. ertain numbers 6 > units logical cannot be redefined since the Aster commands" they is the numbers - and ' which are respectively allocated with files 0ESSA1E and ERRE(R. This number can be used then in all the Aster commands which have operand (NITE /I0+R_RES(" I0+R_TA"!E" I0+R_FONCTION" etc2. Operand (NITE 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 is given the responsability then in4house to associate the logical number of unit and the associated file. !t is then possible to recover an integer value in output of the operator.

4!4

Operand TYPE
T*+E T*+E = ASCII = !I"RE the file associated with the logical unit is of type AS !!. the file associated with the logical unit is of undetermined type within the meaning of FORTRAN" that makes it possible to manage in a more fle+ible way the access to the file" this type is primarily used for the access to files ;36. The logical unit is not really used in this case" but that makes it possible to have the convention of name fort.ul on the file and being able to easily transmit it through the application interface of access to the code.

4!"
-ar!i!g : T.e tra!s#atio! rocess used o! t.is /e"site is a 01ac.i!e Tra!s#atio!0+ It 2a3 "e i2 recise a!d i!accurate i! /.o#e or i! art a!d is ro,ided as a co!,e!ie!ce+ &ice!sed u!der t.e ter2s o4 t.e 56) FD& 7.tt ://///+g!u+org/co 3#e4t/4d#+.t2#8

Code_Aster
Titre : Procdure DEFI_FICHIER Res o!sa"#e : $ea!%Pierre &EFE'(RE

Version default
Date : 30/09/2013 Page : 5/5 C# : )*+12+03 R,isio! : 11*55

4!#

Operand ACCES
ACCES = NE, the file of the type (AS !!) is opened and one positions in head" a Fortan instruction of the type RE,IND is carried out. !f there e+ists" the file is crushed. To use for a file in result. ACCES = O!D the file of the type (AS !!) is opened and one positions such as it is" i.e. possibly with the position at which one was located at the time of the last access. To use for a data file. ACCES = A++END the file is opened and one positions at the end of the file. !s used only in the case of the files of the type AS !!. To use for a data file which one wants to supplement /who will be thus a priori in result2.

4!$

Operand INFO
INFO = inf .ermet to print in file 0ESSA1E the list of the open logical units with command DEFI_FICHIER as well as the associated parameters. !f INFO = -" it does not have there printing.

"

Statement in the application interface of acce to the code of the logical unit %et in &ork in DEFI_FICHIER
?=n=ralement the user will invite DEFI_FICHIER in order to carry out postprocessings when it tests the need to create several results files according to the loading cases physically" of the :uantities" the pitches or times of evolution of computation. The user must declare the names physical of the files and the associated logical units. This statement is carried out" in the application interface 7<9= prior to launching of the completion of the work. !t is necessary to add the files in the profile of study by selecting the libr type and to associate the number of logical unit to them selected. The repe 9;6e is used in the application interface astk to transmit or receive all the contents of a file directory" with load for the user to make call in the command file to DEFI_FICHIER to carry out association with the number of logical unit. For convention the data files are transmitted in the directory of nonroom RE+E_IN" the files in result are transmitted in the directory of local name RE+E_O(T. !n the order DEFI_FICHIER" the name placed behind FICHIER is form@ 4/RE+E_IN/$on_fichie5. For a data file" one will make for e+ample@ DEFI_FICHIER (FICHIER=4 /RE+E_IN/file48797> ACCESS=>O!D> (NITE=--. !IRE_FONCTION ((NITE=-- ?. 'emar(ue INCLUDE ca!!ot "e used /it. a #ogica# u!it associated /it. a articu#ar 4i#e !a2e+

-ar!i!g : T.e tra!s#atio! rocess used o! t.is /e"site is a 01ac.i!e Tra!s#atio!0+ It 2a3 "e i2 recise a!d i!accurate i! /.o#e or i! art a!d is ro,ided as a co!,e!ie!ce+ &ice!sed u!der t.e ter2s o4 t.e 56) FD& 7.tt ://///+g!u+org/co 3#e4t/4d#+.t2#8

Você também pode gostar