Skip to content

Commit

Permalink
refactor: Remove reorders in favor of reorder_stripe
Browse files Browse the repository at this point in the history
  • Loading branch information
edeustua committed Oct 27, 2024
1 parent 7d0cd2a commit 975e762
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 2,275 deletions.
211 changes: 0 additions & 211 deletions ccpy/lib/fortran/ccp3_adaptive_loops.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1376,217 +1376,6 @@ subroutine ccp3d_ijk_with_selection_opt(deltaA,deltaB,deltaC,deltaD,&
end do; end do; end do;
end subroutine ccp3d_ijk_with_selection_opt

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! REORDER ROUTINES !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

subroutine reorder3412(x_in,x_out)

real(kind=8), intent(in) :: x_in(:,:,:,:)
real(kind=8), intent(out) :: x_out(:,:,:,:)

integer :: i1, i2, i3, i4

do i1 = 1,size(x_in,1)
do i2 = 1,size(x_in,2)
do i3 = 1,size(x_in,3)
do i4= 1,size(x_in,4)
x_out(i3,i4,i1,i2) = x_in(i1,i2,i3,i4)
end do
end do
end do
end do

end subroutine reorder3412

subroutine reorder1342(x_in,x_out)

real(kind=8), intent(in) :: x_in(:,:,:,:)
real(kind=8), intent(out) :: x_out(:,:,:,:)

integer :: i1, i2, i3, i4

do i1 = 1,size(x_in,1)
do i2 = 1,size(x_in,2)
do i3 = 1,size(x_in,3)
do i4= 1,size(x_in,4)
x_out(i1,i3,i4,i2) = x_in(i1,i2,i3,i4)
end do
end do
end do
end do

end subroutine reorder1342

subroutine reorder3421(x_in,x_out)

real(kind=8), intent(in) :: x_in(:,:,:,:)
real(kind=8), intent(out) :: x_out(:,:,:,:)

integer :: i1, i2, i3, i4

do i1 = 1,size(x_in,1)
do i2 = 1,size(x_in,2)
do i3 = 1,size(x_in,3)
do i4= 1,size(x_in,4)
x_out(i3,i4,i2,i1) = x_in(i1,i2,i3,i4)
end do
end do
end do
end do

end subroutine reorder3421

subroutine reorder2134(x_in,x_out)

real(kind=8), intent(in) :: x_in(:,:,:,:)
real(kind=8), intent(out) :: x_out(:,:,:,:)

integer :: i1, i2, i3, i4

do i1 = 1,size(x_in,1)
do i2 = 1,size(x_in,2)
do i3 = 1,size(x_in,3)
do i4= 1,size(x_in,4)
x_out(i2,i1,i3,i4) = x_in(i1,i2,i3,i4)
end do
end do
end do
end do

end subroutine reorder2134

subroutine reorder1243(x_in,x_out)

real(kind=8), intent(in) :: x_in(:,:,:,:)
real(kind=8), intent(out) :: x_out(:,:,:,:)

integer :: i1, i2, i3, i4

do i1 = 1,size(x_in,1)
do i2 = 1,size(x_in,2)
do i3 = 1,size(x_in,3)
do i4= 1,size(x_in,4)
x_out(i1,i2,i4,i3) = x_in(i1,i2,i3,i4)
end do
end do
end do
end do

end subroutine reorder1243

subroutine reorder4213(x_in,x_out)

real(kind=8), intent(in) :: x_in(:,:,:,:)
real(kind=8), intent(out) :: x_out(:,:,:,:)

integer :: i1, i2, i3, i4

do i1 = 1,size(x_in,1)
do i2 = 1,size(x_in,2)
do i3 = 1,size(x_in,3)
do i4= 1,size(x_in,4)
x_out(i4,i2,i1,i3) = x_in(i1,i2,i3,i4)
end do
end do
end do
end do

end subroutine reorder4213

subroutine reorder4312(x_in,x_out)

real(kind=8), intent(in) :: x_in(:,:,:,:)
real(kind=8), intent(out) :: x_out(:,:,:,:)

integer :: i1, i2, i3, i4

do i1 = 1,size(x_in,1)
do i2 = 1,size(x_in,2)
do i3 = 1,size(x_in,3)
do i4= 1,size(x_in,4)
x_out(i4,i3,i1,i2) = x_in(i1,i2,i3,i4)
end do
end do
end do
end do

end subroutine reorder4312

subroutine reorder2341(x_in,x_out)

real(kind=8), intent(in) :: x_in(:,:,:,:)
real(kind=8), intent(out) :: x_out(:,:,:,:)

integer :: i1, i2, i3, i4

do i1 = 1,size(x_in,1)
do i2 = 1,size(x_in,2)
do i3 = 1,size(x_in,3)
do i4= 1,size(x_in,4)
x_out(i2,i3,i4,i1) = x_in(i1,i2,i3,i4)
end do
end do
end do
end do

end subroutine reorder2341

subroutine reorder2143(x_in,x_out)

real(kind=8), intent(in) :: x_in(:,:,:,:)
real(kind=8), intent(out) :: x_out(:,:,:,:)

integer :: i1, i2, i3, i4

do i1 = 1,size(x_in,1)
do i2 = 1,size(x_in,2)
do i3 = 1,size(x_in,3)
do i4= 1,size(x_in,4)
x_out(i2,i1,i4,i3) = x_in(i1,i2,i3,i4)
end do
end do
end do
end do

end subroutine reorder2143

subroutine reorder4123(x_in,x_out)

real(kind=8), intent(in) :: x_in(:,:,:,:)
real(kind=8), intent(out) :: x_out(:,:,:,:)

integer :: i1, i2, i3, i4

do i1 = 1,size(x_in,1)
do i2 = 1,size(x_in,2)
do i3 = 1,size(x_in,3)
do i4= 1,size(x_in,4)
x_out(i4,i1,i2,i3) = x_in(i1,i2,i3,i4)
end do
end do
end do
end do

end subroutine reorder4123

subroutine reorder3214(x_in,x_out)

real(kind=8), intent(in) :: x_in(:,:,:,:)
real(kind=8), intent(out) :: x_out(:,:,:,:)

integer :: i1, i2, i3, i4

do i1 = 1,size(x_in,1)
do i2 = 1,size(x_in,2)
do i3 = 1,size(x_in,3)
do i4= 1,size(x_in,4)
x_out(i3,i2,i1,i4) = x_in(i1,i2,i3,i4)
end do
end do
end do
end do

end subroutine reorder3214

subroutine get_index_table(idx_table, rng1, rng2, rng3, n1, n2, n3)

integer, intent(in) :: n1, n2, n3
Expand Down
Loading

0 comments on commit 975e762

Please sign in to comment.