Created
April 25, 2017 14:05
-
-
Save cglosser/0294f4e84fdc51e10a74f806668c1490 to your computer and use it in GitHub Desktop.
Demonstration of the "invalid" way to pass array bounds in Fortran
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program test | |
implicit none | |
integer :: a(10) | |
a = [1,2,3,4,5,6,7,8,9,10] | |
call print_int_array(a) | |
end program test | |
subroutine print_int_array(x) | |
implicit none | |
integer, intent(in) :: x(3:5) ! This doesn't error out given 'a' above. | |
write(*,*) x | |
end subroutine print_int_array |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment