| 1 |
!{ dg-do run } |
| 2 |
|
| 3 |
! PR fortran/120637 |
| 4 |
|
| 5 |
! Contributed by Antony Lewis <[email protected]> |
| 6 |
! The unused module is needed to trigger the issue of not freeing the |
| 7 |
! memory of second module. |
| 8 |
|
| 9 |
module MiscUtils |
| 10 |
implicit none |
| 11 |
|
| 12 |
contains |
| 13 |
|
| 14 |
logical function isFloat0(R) |
| 15 |
class(*), intent(in) :: R |
| 16 |
|
| 17 |
select type(R) |
| 18 |
type is (real) |
| 19 |
isFloat0 = .true. |
| 20 |
end select |
| 21 |
end function isFloat0 |
| 22 |
|
| 23 |
end module MiscUtils |
| 24 |
|
| 25 |
module results3 |
| 26 |
implicit none |
| 27 |
public |
| 28 |
|
| 29 |
Type ClTransferData2 |
| 30 |
real, dimension(:,:,:), allocatable :: Delta_p_l_k |
| 31 |
end type ClTransferData2 |
| 32 |
|
| 33 |
type TCLdata2 |
| 34 |
Type(ClTransferData2) :: CTransScal, CTransTens, CTransVec |
| 35 |
end type TCLdata2 |
| 36 |
|
| 37 |
type :: CAMBdata2 |
| 38 |
Type(TClData2) :: CLdata2 |
| 39 |
end type |
| 40 |
|
| 41 |
end module results3 |
| 42 |
|
| 43 |
program driver |
| 44 |
use results3 |
| 45 |
integer i |
| 46 |
do i=1, 2 |
| 47 |
call test() |
| 48 |
end do |
| 49 |
|
| 50 |
contains |
| 51 |
|
| 52 |
subroutine test |
| 53 |
implicit none |
| 54 |
class(CAMBdata2), pointer :: Data |
| 55 |
|
| 56 |
allocate(CAMBdata2::Data) |
| 57 |
|
| 58 |
allocate(Data%ClData2%CTransScal%Delta_p_l_k(3, 1000, 1000)) |
| 59 |
allocate(Data%ClData2%CTransVec%Delta_p_l_k(3, 1000, 1000)) |
| 60 |
deallocate(Data) |
| 61 |
|
| 62 |
end subroutine test |
| 63 |
|
| 64 |
end program driver |
| 65 |
|
| 66 |
!{ dg-final { cleanup-modules "miscutils results3" } } |
| 67 |
|