Skip to content

Commit

Permalink
TestArrayGroup: avoid use of non-standard RANK function
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaas80 committed Jan 10, 2025
1 parent 612dd81 commit 29c4da5
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions TestArrayGroup/src/TestDynamicData.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,21 @@ subroutine TestArrayGroup_DynamicDataF(CCTK_ARGUMENTS)
DECLARE_CCTK_PARAMETERS
DECLARE_CCTK_ARGUMENTS

integer, dimension(3) :: dim3

! RANK() is not supported by all compilers, so we fail to complile here instead
! Validate grid array dynamic data
if(RANK(test1) /= 3) then ! note rank 3 b/c of vector of rank=2 arrays
call CCTK_ERROR("incorrect dimension in test1 array dynamic data")
endif
dim3 = SHAPE(test1)
if(SIZE(test1, 1) /= 5 .or. SIZE(test1, 2) /= 6 .or. SIZE(test1, 3) /= 4) then
call CCTK_ERROR("incorrect size in test1 array dynamic data")
endif

if(RANK(test2) /= 3) then ! note rank 3 b/c of vector of rank=2 arrays
call CCTK_ERROR("incorrect dimension in test2 array dynamic data")
endif
dim3 = SHAPE(test2)
if(SIZE(test2, 1) /= 5 .or. SIZE(test2, 2) /= 6 .or. SIZE(test2, 3) /= 4) then
call CCTK_ERROR("incorrect size in test2 array dynamic data")
endif

if(RANK(test3) /= 3) then ! note rank 3 b/c of vector of rank=2 arrays
call CCTK_ERROR("incorrect dimension in test3 array dynamic data")
endif
dim3 = SHAPE(test3)
if(SIZE(test3, 1) /= 5 .or. SIZE(test3, 2) /= 6 .or. SIZE(test3, 3) /= 4) then
call CCTK_ERROR("incorrect size in test3 array dynamic data")
endif
Expand Down

0 comments on commit 29c4da5

Please sign in to comment.