subroutine test_1d() type (LocalMemReference) :: a integer (kind=INT32),allocatable :: i(:) integer (kind=INT64),allocatable :: j(:) real (kind=REAL32), allocatable :: r(:) real (kind=REAL64), allocatable :: d(:) integer ( kind=INT32), pointer :: iPtr(:) integer ( kind=INT64), pointer :: jPtr(:) real ( kind=REAL32), pointer :: rPtr(:) real ( kind=REAL64), pointer :: dPtr(:) allocate(i(10)) i = 100 a = LocalMemReference(i) call c_f_pointer(a%base_address, iptr,shape(i)) @assertTrue(all(iptr == i)) call a%deallocate() @assertTrue(.not. associated(a%i_ptr)) allocate(j(10)) j = 10000 a = LocalMemReference(j) call c_f_pointer(a%base_address, jptr,shape(j)) @assertTrue(all(jptr == j)) call a%deallocate() @assertTrue(.not. associated(a%i_ptr)) allocate(r(10)) r = 100.0 a = LocalMemReference(r) call c_f_pointer(a%base_address, rptr,shape(r)) @assertTrue(nearlyEqual(rptr, r)) call a%deallocate() @assertTrue(.not. associated(a%i_ptr)) allocate(d(10)) d = 100.0d0 a = LocalMemReference(d) call c_f_pointer(a%base_address, dptr,shape(d)) @assertTrue(nearlyEqual(dptr, d)) call a%deallocate() @assertTrue(.not. associated(a%i_ptr)) deallocate(i) allocate(i(0)) a = LocalMemReference(i) call c_f_pointer(a%base_address, iptr,a%shape) !@assertFalse(associated(iptr)) @assertTrue( size(a%i_ptr) ==0) call a%deallocate() @assertTrue(.not. associated(a%i_ptr)) end subroutine test_1d