Specifying the compile-time option -CV causes checks to be carried out at runtime that actual arguments to subprograms correspond with the dummy arguments expected. Note the following:
Both caller and called Fortran code must be compiled with -CV (or -C). No argument checking will be performed unless this condition is satisfied.
The amount of checking performed depends upon whether the procedure call was made via an implicit interface or an explicit interface. Irrespective of the type of interface used, however, the following checks verify that:
- the correct number of arguments are passed.
- the type and type kinds of the actual and dummy arguments correspond.
- subroutines have been called as subroutines and that functions have been declared with the correct type and type kind.
- dummy arrays are associated with either an array or an element of an array and not a scalar variable or constant.
- the declared length of a dummy character argument is not greater than the declared length of associated actual argument.
- the declared length of a character scalar function result is the same length as that declared by the caller.
- the actual and dummy arguments of derived type correspond to the number and types of the derived type components.
- actual arguments were not passed using the intrinsic procedures %REF and %VAL.
If an implicit interface call was made, then yet another check is made whether an interface block should have been used.
If an explicit interface block was used, then further checks are made in addition to those described (in the second bullet) above, to validate the interface block. These checks verify that:
- the OPTIONAL attribute of each dummy argument has been correctly specified by the caller.
- the POINTER attribute of each dummy argument has been correctly specified by the caller.
- the declared length of a dummy pointer of type character is the same as the declared length of the associated actual pointer of type character.
- the rank of an assumed-shape array or dummy pointer matches the rank of the associated actual argument.
- the rank of an array-valued function or pointer-valued function has been correctly specified by the caller.
- the declared length of a character array-valued function or a character pointer-valued function is the same length as that declared by the caller.