next up previous 252
Next: DECLARE_CHARACTER_DYN - Declare a CHARACTER variable
Up: Full Description of F77 Macros
Previous: DECLARE_CHARACTER - Declare a CHARACTER variable


DECLARE_CHARACTER_ARRAY - Declare a CHARACTER array

Description:
Declare a CHARACTER array that will be passed to a FORTRAN routine. This array will be the actual argument of a call to a FORTRAN routine.

Invocation:
DECLARE_CHARACTER_ARRAY(arg,length,dims)

Arguments:

arg
The array being declared.
length
The length of the character string.
dims
The dimensions of the array.

Examples:

DECLARE_CHARACTER_ARRAY(C,50,10)
will expand as follows:

All Unix: char C[10][50]; const int C_length
VAX/VMS: char C[10][50]; const int C_length = 50;
  struct dsc$descriptor_s C_descr =
  {50, DSC$K_DTYPE_T, DSC$K_CLASS_S, C };
  struct dsc$descriptor_s *C_arg =&C_descr


Notes:
On VMS, the expansion of the macro is quite complex. A char array is declared as well as an int variable to store the length of the array. There is also a descriptor and a pointer to that descriptor. The address of the descriptor is what is actually passed to the called FORTRAN routine.



next up previous 252
Next: DECLARE_CHARACTER_DYN - Declare a CHARACTER variable
Up: Full Description of F77 Macros
Previous: DECLARE_CHARACTER - Declare a CHARACTER variable

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