Skip to content

Instantly share code, notes, and snippets.

@cglosser
Created April 25, 2017 14:05
Show Gist options
  • Save cglosser/0294f4e84fdc51e10a74f806668c1490 to your computer and use it in GitHub Desktop.
Save cglosser/0294f4e84fdc51e10a74f806668c1490 to your computer and use it in GitHub Desktop.
Demonstration of the "invalid" way to pass array bounds in Fortran
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