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 17, 2025
1 parent 45e7ade commit 017629a
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions TestArrayGroup/src/TestDynamicData.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,21 @@ subroutine TestArrayGroup_DynamicDataF(CCTK_ARGUMENTS)
DECLARE_CCTK_PARAMETERS
DECLARE_CCTK_ARGUMENTS

! 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
if(SIZE(test1, 1) /= 5 .or. SIZE(test1, 2) /= 6 .or. SIZE(test1, 3) /= 4) then
integer, dimension(3) :: sizes1, sizes2, sizes3

! check that grid variable is of rank 3. This fails to compiler otherwise.
sizes1 = SHAPE(test1)
if(sizes1(1) /= 5 .or. sizes1(2) /= 6 .or. sizes1(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
if(SIZE(test2, 1) /= 5 .or. SIZE(test2, 2) /= 6 .or. SIZE(test2, 3) /= 4) then
sizes2 = SHAPE(test2)
if(sizes2(1) /= 5 .or. sizes2(2) /= 6 .or. sizes2(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
if(SIZE(test3, 1) /= 5 .or. SIZE(test3, 2) /= 6 .or. SIZE(test3, 3) /= 4) then
sizes3 = SHAPE(test3)
if(sizes3(1) /= 5 .or. sizes3(2) /= 6 .or. sizes3(3) /= 4) then
call CCTK_ERROR("incorrect size in test3 array dynamic data")
endif

Expand Down

0 comments on commit 017629a

Please sign in to comment.