!======================================================================= ! FILE: INTENT6.F90 ! DATE: 21 July 2003 ! ! TEST: Correct code using Intent In and Intent Out, assumed ! size array. Check whether the code is run using compiler ! debug options rathar than incorrectly flagged with an ! error message. ! ! Author/contact: Arnaud Desitter !======================================================================= subroutine s1(a,b) double precision a(*), b(*) intent(out) :: a intent(in) :: b a(2) = b(2) end subroutine program main double precision w(10) w(1:5) = -1.D0 w(6:10) = -2.D0 ! correct call s1(w(1:5),w(6:10)) print *,'after s1, (correct) w(2)=',w(2) call s1(w(1),w(6)) print *,'after s1, (correct) w(2)=',w(2) end program