F2003+ standard question regarding passing a scalar character to an array



Hello all,

I have problems with the following quote from the standard; I can read it in two ways: Either being a character is enough or such that a non-array-element scalar character is differently treated than one which is an array element. (The wording in F2003 is the same except for "noncoindexed" and "polymorphic".)

F2008, "12.5.2.4 Ordinary dummy variables":

"If the actual argument is a noncoindexed scalar, the corresponding dummy argument shall be scalar unless the actual argument is default character, of type character with the C character kind (15.2.2), or is an element or substring of an element of an array that is not an assumed-shape, pointer, or polymorphic array."


Thus, is the following program valid or not? Would there be a difference if one had a substring ["x(1)(1:1)"] or not?

subroutine t(x)
character, pointer :: x(:)
call f(x(1))
contains
subroutine f(a)
character :: a(*)
end subroutine f
end subroutine


I assume a character actual argument which is a scalar pointer (and not an array element) is always valid - substring or not, isn't it?

Tobias

PS: My feeling is that it requires an interpretation request though maybe I simply cannot read. In any case, as the next J3 meeting is already tomorrow, one has plenty of time to decide whether one should write an IR for the next meeting ...
.