Skip to content

Instantly share code, notes, and snippets.

@alanbriolat
Created April 4, 2014 11:59
Show Gist options
  • Save alanbriolat/9973099 to your computer and use it in GitHub Desktop.
Save alanbriolat/9973099 to your computer and use it in GitHub Desktop.
program pointer_remap
type :: real_pointer
real, pointer :: p => null()
end type real_pointer
real, target, dimension(1:3) :: vec
type(real_pointer), dimension(-1:1) :: pVec
integer :: i
vec = (/ 1.0, 2.0, 3.0 /)
pVec(-1)%p => vec(2)
pVec(0)%p => vec(3)
pVec(1)%p => vec(1)
end program pointer_remap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment