!>
!> @file ex14.f90
!>
!> @brief Test getdims
!>
!> @copyright
!> Copyright (©) 2021 EPFL (Ecole Polytechnique Fédérale de Lausanne)
!> SPC (Swiss Plasma Center)
!>
!> futils is free software: you can redistribute it and/or modify it under
!> the terms of the GNU Lesser General Public License as published by the Free
!> Software Foundation, either version 3 of the License, or (at your option)
!> any later version.
!>
!> futils is distributed in the hope that it will be useful, but WITHOUT ANY
!> WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
!> FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
!>
!> You should have received a copy of the GNU Lesser General Public License
!> along with this program. If not, see .
!>
!> @authors
!> (in alphabetical order)
!> @author Trach-Minh Tran
!>
PROGRAM main
!
! Test getdims
!
USE futils
IMPLICIT NONE
DOUBLE PRECISION :: arr1(10), arr2(10,20)
DOUBLE COMPLEX :: zarr3(10,20,30)
CHARACTER(len=32) :: file='getdims.h5'
INTEGER :: fid
INTEGER :: rank, dims(7) ! Max rank is 7 in Fortran
!
CALL creatf(file, fid)
WRITE(*,'(a)') file(1:LEN_TRIM(file))//' created'
!
arr1=1.0
arr2=2.0
zarr3=(3.0, -3.0)
!
CALL putarr(fid, '/arr1', arr1)
CALL putarr(fid, '/arr2', arr2)
CALL putarr(fid, '/zarr3', zarr3)
!
CALL getdims(fid, '/arr1', rank, dims)
WRITE(*,'(a,7i6)') 'Dims of arr1 are ', dims(1:rank)
CALL getdims(fid, '/arr2', rank, dims)
WRITE(*,'(a,7i6)') 'Dims of arr2 are ', dims(1:rank)
CALL getdims(fid, '/zarr3', rank, dims)
WRITE(*,'(a,7i6)') 'Dims of zarr3 are', dims(1:rank)
!
CALL closef(fid)
END PROGRAM main