Skip to content

Instantly share code, notes, and snippets.

@goerz
Created August 19, 2009 15:01
Show Gist options
  • Save goerz/170393 to your computer and use it in GitHub Desktop.
Save goerz/170393 to your computer and use it in GitHub Desktop.
Fortran90 Pointers: is foo reliably 1?
module a_mod
use b_mod
implicit none
public
private :: a, b
integer, target :: a
integer, pointer :: b
contains
subroutine run_test()
a = 1
b => a
call print_value(b)
end subroutine run_test
end module a_mod
module b_mod
implicit none
contains
subroutine print_value(foo)
integer, pointer :: foo
write (*,*) " value is ", foo
end subroutine print_value
end module b_mod
program test
use a_mod
implicit none
call run_test()
end program test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment