Skip to content

Commit 3fdba72

Browse files
committed
fix: specify dim=1 in cshift
1 parent 615de11 commit 3fdba72

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/forcolormap.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ pure subroutine shift(self, sh)
10381038
class(Colormap), intent(inout) :: self
10391039
integer, intent(in) :: sh !! The shift
10401040

1041-
self%map = cshift(self%map, sh)
1041+
self%map = cshift(self%map, sh, dim=1)
10421042
end subroutine
10431043

10441044
!> Extracts colors from the colormap based on specified number of levels (extractedLevels).

test/check.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ subroutine test_044(id, nfail)
978978

979979
call cm%create("custom", 0.0_wp, 2.0_wp, map)
980980

981-
ref = cshift(map, 1)
981+
ref = cshift(map, 1, dim=1)
982982
call cm%shift(1)
983983

984984
ok = .true.
@@ -1104,7 +1104,7 @@ subroutine test_049(id, nfail)
11041104

11051105
call cm%create("custom", 0.0_wp, 2.0_wp, map)
11061106

1107-
ref = cshift(map, -1)
1107+
ref = cshift(map, -1, dim=1)
11081108
call cm%shift(-1)
11091109

11101110
ok = .true.
@@ -1260,22 +1260,22 @@ subroutine test_054(id, nfail)
12601260

12611261
call cmap%create("discrete", 0.0_wp, 2.0_wp, test_colormap)
12621262

1263-
ref = cshift(test_colormap, 2)
1263+
ref = cshift(test_colormap, 2, dim=1)
12641264
call cmap%shift(2)
12651265
ok = .true.
12661266
do i = 0, 6
12671267
call cmap%get_RGB(i, r, g, b)
12681268
ok = ok .and. (r == ref(i,1)) .and. (g == ref(i,2)) .and. (b == ref(i,3))
12691269
end do
12701270

1271-
ref = cshift(ref, -1)
1271+
ref = cshift(ref, -1, dim=1)
12721272
call cmap%shift(-1)
12731273
do i = 0, 6
12741274
call cmap%get_RGB(i, r, g, b)
12751275
ok = ok .and. (r == ref(i,1)) .and. (g == ref(i,2)) .and. (b == ref(i,3))
12761276
end do
12771277

1278-
ref = cshift(ref, -1)
1278+
ref = cshift(ref, -1, dim=1)
12791279
call cmap%shift(-1)
12801280
do i = 0, 6
12811281
call cmap%get_RGB(i, r, g, b)
@@ -1576,7 +1576,7 @@ subroutine test_067(id, nfail)
15761576

15771577
sh = 100
15781578
shmod = modulo(sh, cm%get_levels())
1579-
ref = cshift(test_colormap, shmod)
1579+
ref = cshift(test_colormap, shmod, dim=1)
15801580

15811581
call cm%shift(sh)
15821582

0 commit comments

Comments
 (0)