F77_CREATE_CHARACTER_ARRAY_M

Create a FORTRAN CHARACTER array (n-D)

Description:

Create an n-D CHARACTER array that will be passed to a FORTRAN routine using the CHARACTER_ARRAY_ARG macro. Use this macro, in combination with the DECLARE_CHARACTER_ARRAY_DYN and F77_FREE_CHARACTER macros, where the size of the CHARACTER array is not known until run time. A pointer to the actual string of characters and an integer variable giving the length of the string are set.

Invocation

F77_CREATE_CHARACTER_ARRAY_M(arg,length,ndims,dims)

Arguments

arg
The variable being created.
length
The length of the character string. This will usually be a variable name or expression of type int.
ndims
The number of dimensions.
dims
A 1-D array holding the ndims dimensions.

Examples:

F77_CREATE_CHARACTER_ARRAY_M(fstring,strlen(cstring),ndims,dims)
will expand as follows:
All Unix: fstring=cnfCrefa(strlen(cstring),ndims,dims);
fstring_length=strlen(cstring)
VAX/VMS: fstring_arg = cnfCrefa(strlen(cstring),ndims,dims);
fstring = fstring_arg->pointer;
fstring_length = fstring_arg->length

Notes:

On VMS, the expansion of the macro is quite complex. A descriptor structure and a pointer to it are set up in addition to the pointer to the actual array of strings and the length of the strings. (The address of the descriptor is what is actually passed to the called FORTRAN routine.)