module md_ptr

implicit none

public

type test_data
   real :: x, y(3), z(2) , dx, dy, dz
   integer :: ii , jj , kk 
   real :: res
end type

type(test_data), allocatable, target :: dat(:)
real, pointer :: res(:)


contains

subroutine alloc(n)
implicit none

integer, intent(in) :: n

allocate(dat(n))

res => dat(:)%res

res(1:2) = 112312.12



end subroutine


subroutine call_alloc(n)
implicit none

integer, intent(in) :: n
call alloc(n)
end subroutine 

end module
