Created
August 19, 2009 15:01
-
-
Save goerz/170393 to your computer and use it in GitHub Desktop.
Fortran90 Pointers: is foo reliably 1?
This file contains 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
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 |
This file contains 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
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 |
This file contains 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 | |
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