Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.atnf.csiro.au/computing/software/miriad/progguide/node53.html
Дата изменения: Unknown
Дата индексирования: Tue Feb 5 09:25:28 2013
Кодировка:

Поисковые слова: релятивистское движение
Interface Definition Libraries

Interface Definition Libraries

It is a common (normal) situation in program development to have a library of standard functions and routines. Though Flint knows the interface definitions (i.e. number, type and intent of each argument) of standard FORTRAN functions, it is desirable for users to build and use a file (or files) describing the interfaces to their own library. This section describes the features in Flint to achieve this.

Flint can output a text file, in a pseudo-FORTRAN, which contains interface descriptions of all the routines that it has encountered in this run. The format is:

     flint -o file ....
Each routine in the output file will probably contain many `INTENT' statements (part of the FORTRAN-8X standard). INTENT is used to indicate whether a subroutine argument is input to or output from a routine (or both), or whether this is unknown. Typically a routine description would look like:
      subroutine example(arg1,arg2,arg3,arg4)
      real arg1,arg2
      integer arg3,arg4
      intent(in) arg1,arg3
      intent(out) arg3,arg4
      intent(unknown) arg2
      end
Here Flint believes arg1 is input, arg4 is output, and arg3 is both input and output. Flint could not determine whether arg2 was input or output.

The user can edit an interface file created by Flint, or create an entire interface description by hand.

Such an interface description file appears as normal FORTRAN to Flint, so it can be input to Flint (to teach Flint about a users standard routine interfaces) on subsequent uses of Flint. While these interface definitions could be input along with normal source files, preceding the interface file with the -l (library) switch has the advantage that the source of this file does not appear in the listing file. Warning messages generated by analyzing this file are also suppressed.

The following example generates a interface description file, library.dat, from source files routine1.for, routine2.for and routine3.for. The interface definition is then used in a subsequent Flint run on program.for.

     flint -o library.dat routine1.for routine2.for routine3.for
     flint -l library.dat program.for

Miriad manager
2011-08-19