cp2k/cmake/compiler-tests/f95-reshape-order-allocatable.f90
2022-10-27 18:00:54 +02:00

18 lines
1.1 KiB
Fortran

!--------------------------------------------------------------------------------------------------!
! Copyright (C) by the DBCSR developers group - All rights reserved !
! This file is part of the DBCSR library. !
! !
! For information on the license, see the LICENSE file. !
! For further information please visit https://dbcsr.cp2k.org !
! SPDX-License-Identifier: GPL-2.0+ !
!--------------------------------------------------------------------------------------------------!
program test_reshape
integer, dimension(4) :: x = [1, 2, 3, 4]
integer, dimension(:), allocatable :: order
allocate (order(2))
order(:) = [2, 1]
! PGI <= 19.10 does not accept allocatables for the order parameter
print *, reshape(x, shape=[2, 2], order=order)
end program