next up previous 252
Next: F77_EXPORT_type - Export a C variable to a FORTRAN variable.
Up: Full Description of F77 Macros
Previous: F77_ASSOC_type_ARRAY - Associate a FORTRAN array with a C array.


F77_CREATE_type_ARRAY - Create an array of type.

Description:
These macros ensure that memory is available for arrays to be used as actual arguments for FORTRAN subroutines, assuming that space is already allocated for a corresponding C array. That is, they will only allocate additional memory for those types which require a non-null export or import. (type not CHARACTER or LOCATOR.)

Invocation:
F77_CREATE_type_ARRAY(farg,nels)

Arguments:

carg
A pointer to the C array
farg
A pointer to the FORTRAN array
nels
The number of elements required

Examples:

F77_CREATE_type_ARRAY(farg,n)
type LOGICAL will expand as follows:

All systems: {int f77dims[1];f77dims[0]=n;
  farg=cnfCrela(1,f77dims);}

type POINTER will expand as follows:

All systems: farg=
  (F77_POINTER_TYPE *)malloc(n*sizeof(F77_POINTER_TYPE))

All other types (except CHARACTER) will expand as follows:

All systems:


Associated macros:
F77_CREATE_CHARACTER_ARRAY, F77_ASSOC_type_ARRAY, F77_EXPORT_type_ARRAY,
F77_IMPORT_type_ARRAY



next up previous 252
Next: F77_EXPORT_type - Export a C variable to a FORTRAN variable.
Up: Full Description of F77 Macros
Previous: F77_ASSOC_type_ARRAY - Associate a FORTRAN array with a C array.

CNF and F77 Mixed Language Programming -- FORTRAN and C
Starlink User Note 209
P.M. Allan
A.J. Chipperfield
R.F. Warren-Smith
19 January 2000
E-mail:ussc@star.rl.ac.uk