|
|
|
|
@ -257,10 +257,17 @@ contains
|
|
|
|
|
! j = mod(idx_/nz,ny) + base_
|
|
|
|
|
! i = mod(idx_/(nx*ny),nx) + base_
|
|
|
|
|
!
|
|
|
|
|
do i=size(dims),1,-1
|
|
|
|
|
coords(i) = mod(idx_,dims(i)) + base_
|
|
|
|
|
idx_ = idx_ / dims(i)
|
|
|
|
|
end do
|
|
|
|
|
if (col_major) then
|
|
|
|
|
do i=1,size(dims)
|
|
|
|
|
coords(i) = mod(idx_,dims(i)) + base_
|
|
|
|
|
idx_ = idx_ / dims(i)
|
|
|
|
|
end do
|
|
|
|
|
else
|
|
|
|
|
do i=size(dims),1,-1
|
|
|
|
|
coords(i) = mod(idx_,dims(i)) + base_
|
|
|
|
|
idx_ = idx_ / dims(i)
|
|
|
|
|
end do
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
end subroutine lidx2ijkv
|
|
|
|
|
|
|
|
|
|
@ -341,10 +348,17 @@ contains
|
|
|
|
|
! j = mod(idx_/nz,ny) + base_
|
|
|
|
|
! i = mod(idx_/(nx*ny),nx) + base_
|
|
|
|
|
!
|
|
|
|
|
do i=size(dims),1,-1
|
|
|
|
|
coords(i) = mod(idx_,dims(i)) + base_
|
|
|
|
|
idx_ = idx_ / dims(i)
|
|
|
|
|
end do
|
|
|
|
|
if (col_major) then
|
|
|
|
|
do i=1,size(dims)
|
|
|
|
|
coords(i) = mod(idx_,dims(i)) + base_
|
|
|
|
|
idx_ = idx_ / dims(i)
|
|
|
|
|
end do
|
|
|
|
|
else
|
|
|
|
|
do i=size(dims),1,-1
|
|
|
|
|
coords(i) = mod(idx_,dims(i)) + base_
|
|
|
|
|
idx_ = idx_ / dims(i)
|
|
|
|
|
end do
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
end subroutine lidx2lijkv
|
|
|
|
|
!
|
|
|
|
|
@ -447,11 +461,19 @@ contains
|
|
|
|
|
return
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
idx = coords(1) - base_
|
|
|
|
|
do i=2, sz
|
|
|
|
|
idx = (idx * dims(i)) + coords(i) - base_
|
|
|
|
|
end do
|
|
|
|
|
idx = idx + base_
|
|
|
|
|
if (col_major) then
|
|
|
|
|
idx = coords(sz) - base_
|
|
|
|
|
do i=sz-1,1,-1
|
|
|
|
|
idx = (idx * dims(i)) + coords(i) - base_
|
|
|
|
|
end do
|
|
|
|
|
idx = idx + base_
|
|
|
|
|
else
|
|
|
|
|
idx = coords(1) - base_
|
|
|
|
|
do i=2,sz
|
|
|
|
|
idx = (idx * dims(i)) + coords(i) - base_
|
|
|
|
|
end do
|
|
|
|
|
idx = idx + base_
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
end subroutine ijk2lidxv
|
|
|
|
|
!
|
|
|
|
|
@ -509,11 +531,19 @@ contains
|
|
|
|
|
return
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
idx = coords(1) - base_
|
|
|
|
|
do i=2, sz
|
|
|
|
|
idx = (idx * dims(i)) + coords(i) - base_
|
|
|
|
|
end do
|
|
|
|
|
idx = idx + base_
|
|
|
|
|
if (col_major) then
|
|
|
|
|
idx = coords(sz) - base_
|
|
|
|
|
do i=sz-1,1,-1
|
|
|
|
|
idx = (idx * dims(i)) + coords(i) - base_
|
|
|
|
|
end do
|
|
|
|
|
idx = idx + base_
|
|
|
|
|
else
|
|
|
|
|
idx = coords(1) - base_
|
|
|
|
|
do i=2,sz
|
|
|
|
|
idx = (idx * dims(i)) + coords(i) - base_
|
|
|
|
|
end do
|
|
|
|
|
idx = idx + base_
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
end subroutine lijk2lidxv
|
|
|
|
|
!
|
|
|
|
|
|