6 character(len
=10) :: digit_string
= '123456789', str
7 character :: digit_arr(10)
8 call copy(digit_string
, digit_arr
)
9 call copy(digit_arr
,str
)
10 if(str
/= '123456789') STOP 1
11 digit_string
= 'qwertasdf'
12 call copy2(digit_string
, digit_arr
)
13 call copy2(digit_arr
,str
)
14 if(str
/= 'qwertasdf') STOP 2
15 digit_string
= '1qayxsw23e'
16 call copy3("1qayxsw23e", digit_arr
)
17 call copy3(digit_arr
,str
)
18 if(str
/= '1qayxsw23e') STOP 3
20 subroutine copy(in
, out
)
21 character, dimension(*) :: in
22 character, dimension(10) :: out
25 subroutine copy2(in
, out
)
26 character, dimension(2,*) :: in
27 character, dimension(2,5) :: out
28 out(1:2,1:5) = in(1:2,1:5)
30 subroutine copy3(in
, out
)
31 character(len
=2), dimension(5) :: in
32 character(len
=2), dimension(5) :: out