3 ! Test the fix for PR91077 - both the original test and that in comment #4 of the PR.
5 ! Contribute by Ygal Klein <ygalklein@gmail.com>
13 integer, parameter :: length
= 9
14 real(8), dimension(2) :: a
, b
21 type(point
), dimension(:), allocatable
:: np
23 type(stored
), dimension(:), pointer :: std
=>null()
25 allocate(std(1)%np(length
))
26 std(1)%np(1)%x
= 0.3d0
27 std(1)%np(2)%x
= 0.3555d0
28 std(1)%np(3)%x
= 0.26782d0
30 std(1)%np(5)%x
= 1.555d0
31 std(1)%np(6)%x
= 7.3d0
32 std(1)%np(7)%x
= 7.8d0
33 std(1)%np(8)%x
= 6.3d0
34 std(1)%np(9)%x
= 5.5d0
36 ! write(*, "('std(1)%np(',i1,')%x = ',1e22.14)") i, std(1)%np(i)%x
39 ! write(*, "('std(1)%np(1:',i1,') = ',9e22.14)") i, std(1)%np(1:i)%x
42 b
= [std(1)%np(1)%x
, std(1)%np(2)%x
]
45 if (allocated (std(1)%np
)) deallocate (std(1)%np
)
46 if (associated (std
)) deallocate (std
)
47 if (norm2(a
- b
) .gt
. 1d-3) stop 1
51 integer, parameter :: length
= 2
52 real(8), dimension(length
) :: a
, b
60 type(point
), dimension(:), pointer :: np
=>null()
65 type(points
), pointer :: nfpoint
=>null()
68 type(stored
), dimension(:), pointer :: std
=>null()
72 allocate(std(1)%nfpoint
)
73 allocate(std(1)%nfpoint
%np(length
))
74 std(1)%nfpoint
%np(1)%x
= 0.3d0
75 std(1)%nfpoint
%np(2)%x
= 0.3555d0
78 ! write(*, "('std(1)%nfpoint%np(',i1,')%x = ',1e22.14)") i, std(1)%nfpoint%np(i)%x
81 ! write(*, "('std(1)%nfpoint%np(1:',i1,')%x = ',2e22.14)") i, std(1)%nfpoint%np(1:i)%x
83 a
= std(1)%nfpoint
%np(1:2)%x
84 b
= [std(1)%nfpoint
%np(1)%x
, std(1)%nfpoint
%np(2)%x
]
85 if (associated (std(1)%nfpoint
%np
)) deallocate (std(1)%nfpoint
%np
)
86 if (associated (std(1)%nfpoint
)) deallocate (std(1)%nfpoint
)
87 if (associated (std
)) deallocate (std
)
88 if (norm2(a
- b
) .gt
. 1d-3) stop 2