I'm working with an older Fortran code using subroutine calls like this:
call sub(A,,C)
With the corresponding subroutine of the form:
subroutine sub(A,B,C)
So in practice the argument B is optionally omitted here.
However, I am now creating explicit interfaces via the compiler options /warn:interface /gen-interface. I do this to debug interface errors in the code. This results in the following error (from Intel Visual Fortran compiler 19.1.0057.16):
error #8127: A null argument is not permitted when calling a Fortran routine which has an explicit interface defined. [sub]
I could make the argument B optional and move it to the end of the argument list. This would involve updating a lot of function calls. Also, I am not sure if it works in general, as e.g. several arguments may be omitted in this way in different combinations for different function calls.
What is the correct way to modernise the above code to work correctly with explicit interfaces?
Edit: The use of two consecutive commas (,,) is also a deprecated (?) language feature denoting a null data item. From the Oracle Fortran 77 language reference:
A null data item is denoted by two consecutive commas, and it means the corresponding array element or complex variable value is not to be changed. Null data item can be used with array elements or complex variables only. One null data item represents an entire complex constant; you cannot use it for either part of a complex constant.
In the comments below it was noted that this relates to the data input process, and does not apply to my problem.
Boptional, but you don't need to move it to the end of the argument list: use keywords (call sub(A,C=C)).,,for null data items is, however, part of the data input process. Take care when reading documentation that these two distinct aspects are not conflated.