Programming Languages

You can program your TQ-library with the FORTRAN or C programming languages.

FORTRAN

No special consideration is needed when interfacing the TQ-library with a program written in FORTRAN; the main core of the TQ-library is written in FORTRAN. By default all parameters are passed to routines by reference, except for strings, which are passed by descriptor.

C-Interface

The C-interface acts as a translation layer in between the calling C-program and the underlying FORTRAN TQ-library.

For a C-interface, the default parameter passing mechanism is by value and not by reference. Some decisions must be made as to how parameters, which are updated in the TQ-Interface, are then passed into the library. For example:

  • The C procedures are defined in the file tqroot.h which should be included in the procedures using the library calls in C.
  • The tqroot.h file also includes the file tc_data_defs.h where the datatypes are defined.

The definition of some of these data types vary depending on what platform and compiler is used. It is important to define these and for the definitions to be correctly set.