5 ! Contributed by Dominique d'Humieres and John Chludzinski,
6 ! using the code of John Reid
10 PURE
FUNCTION s_to_c(string
)
11 CHARACTER(LEN
=*),INTENT(IN
) :: string
12 CHARACTER(LEN
=:),ALLOCATABLE
:: s_to_c
15 CHARACTER(LEN
=:),ALLOCATABLE
:: str
16 if (s_to_c("ABCdef") /= "ABCdef" .or
. len(s_to_c("ABCdef")) /= 6) call abort()
17 str
= s_to_c("ABCdef")
18 if (str
/= "ABCdef" .or
. len(str
) /= 6) call abort()
19 str(1:3) = s_to_c("123")
20 if (str
/= "123def" .or
. len(str
) /= 6) call abort()
24 PURE
FUNCTION s_to_c(string
)
25 CHARACTER(LEN
=*),INTENT(IN
) :: string
26 CHARACTER(LEN
=:),ALLOCATABLE
:: s_to_c