W3cubDocs

/GNU Fortran 7

8.2.1 _gfortran_caf_init — Initialiation function

Description:

This function is called at startup of the program before the Fortran main program, if the latter has been compiled with -fcoarray=lib. It takes as arguments the command-line arguments of the program. It is permitted to pass two NULL pointers as argument; if non-NULL, the library is permitted to modify the arguments.

Syntax:

void _gfortran_caf_init (int *argc, char ***argv)

Arguments:
argc intent(inout) An integer pointer with the number of arguments passed to the program or NULL.
argv intent(inout) A pointer to an array of strings with the command-line arguments or NULL.
NOTES

The function is modelled after the initialization function of the Message Passing Interface (MPI) specification. Due to the way coarray registration works, it might not be the first call to the library. If the main program is not written in Fortran and only a library uses coarrays, it can happen that this function is never called. Therefore, it is recommended that the library does not rely on the passed arguments and whether the call has been done.

© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gfortran/_005fgfortran_005fcaf_005finit.html