Fixed from testing on delta. Now HASH and GEN_BLOCK maps should work

with long integers.
ILmat
Salvatore Filippone 8 years ago
parent 12840050ac
commit 55a451d2de

@ -91,7 +91,7 @@ UTIL_MODS = auxil/psb_string_mod.o desc/psb_desc_const_mod.o desc/psb_indx_map_m
auxil/psb_d_hsort_x_mod.o \
auxil/psb_c_hsort_x_mod.o \
auxil/psb_z_hsort_x_mod.o \
psb_check_mod.o auxil/psb_hash_mod.o\
psb_check_mod.o desc/psb_hash_mod.o\
serial/psb_base_mat_mod.o serial/psb_mat_mod.o\
serial/psb_s_base_mat_mod.o serial/psb_s_csr_mat_mod.o serial/psb_s_csc_mat_mod.o serial/psb_s_mat_mod.o \
serial/psb_d_base_mat_mod.o serial/psb_d_csr_mat_mod.o serial/psb_d_csc_mat_mod.o serial/psb_d_mat_mod.o \
@ -154,7 +154,7 @@ penv/psi_e_collective_mod.o penv/psi_m_collective_mod.o penv/psi_s_collective_m
penv/psi_d_collective_mod.o penv/psi_c_collective_mod.o penv/psi_z_collective_mod.o: penv/psi_penv_mod.o
auxil/psb_string_mod.o desc/psb_desc_const_mod.o psi_comm_buffers_mod.o: psb_const_mod.o
auxil/psb_hash_mod.o: psb_realloc_mod.o psb_const_mod.o
desc/psb_hash_mod.o: psb_realloc_mod.o psb_const_mod.o desc/psb_desc_const_mod.o
auxil/psb_i_sort_mod.o auxil/psb_s_sort_mod.o auxil/psb_d_sort_mod.o auxil/psb_c_sort_mod.o auxil/psb_z_sort_mod.o \
auxil/psb_ip_reord_mod.o auxil/psi_serial_mod.o auxil/psb_sort_mod.o: $(BASIC_MODS)
auxil/psb_sort_mod.o: auxil/psb_m_hsort_mod.o auxil/psb_m_isort_mod.o \
@ -226,7 +226,7 @@ psb_error_impl.o: psb_penv_mod.o
psb_spmat_type.o: auxil/psb_string_mod.o auxil/psb_sort_mod.o
desc/psb_desc_mod.o: psb_penv_mod.o psb_realloc_mod.o\
auxil/psb_hash_mod.o desc/psb_hash_map_mod.o desc/psb_list_map_mod.o \
desc/psb_hash_mod.o desc/psb_hash_map_mod.o desc/psb_list_map_mod.o \
desc/psb_repl_map_mod.o desc/psb_gen_block_map_mod.o desc/psb_desc_const_mod.o\
desc/psb_indx_map_mod.o serial/psb_i_vect_mod.o
@ -250,8 +250,8 @@ desc/psb_hash_map_mod.o desc/psb_list_map_mod.o desc/psb_repl_map_mod.o desc/psb
desc/psb_indx_map_mod.o desc/psb_desc_const_mod.o \
auxil/psb_sort_mod.o psb_penv_mod.o
desc/psb_glist_map_mod.o: desc/psb_list_map_mod.o
desc/psb_hash_map_mod.o: auxil/psb_hash_mod.o auxil/psb_sort_mod.o
desc/psb_gen_block_map_mod.o: auxil/psb_hash_mod.o
desc/psb_hash_map_mod.o: desc/psb_hash_mod.o auxil/psb_sort_mod.o
desc/psb_gen_block_map_mod.o: desc/psb_hash_mod.o
psb_check_mod.o: desc/psb_desc_mod.o

@ -101,11 +101,11 @@ module psb_desc_const_mod
!
! Constants for hashing into desc%hashv(:) and desc%glb_lc(:,:)
!
integer(psb_ipk_), parameter :: psb_hash_bits=16
integer(psb_ipk_), parameter :: psb_max_hash_bits=22
integer(psb_ipk_), parameter :: psb_hash_size=2**psb_hash_bits, psb_hash_mask=psb_hash_size-1
integer(psb_ipk_), parameter :: psb_hash_bits = 16
integer(psb_ipk_), parameter :: psb_max_hash_bits = 22
integer(psb_ipk_), parameter :: psb_hash_size = 2**psb_hash_bits, psb_hash_mask=psb_hash_size-1
integer(psb_ipk_), parameter :: psb_default_large_threshold=1*1024*1024
integer(psb_ipk_), parameter :: psb_hpnt_nentries_=7
integer(psb_ipk_), parameter :: psb_hpnt_nentries_ = 7
!
! Constants for desc_a handling

@ -1949,7 +1949,8 @@ contains
integer(psb_ipk_), intent(out) :: info
! To be implemented
integer(psb_mpk_) :: iam, np
integer(psb_ipk_) :: i, ntot
integer(psb_ipk_) :: i
integer(psb_lpk_) :: ntot
integer(psb_lpk_), allocatable :: vnl(:)
info = 0

@ -60,7 +60,7 @@ module psb_hash_map_mod
type, extends(psb_indx_map) :: psb_hash_map
integer(psb_ipk_) :: hashvsize, hashvmask
integer(psb_lpk_) :: hashvsize, hashvmask
integer(psb_ipk_), allocatable :: hashv(:)
integer(psb_lpk_), allocatable :: glb_lc(:,:), loc_to_glob(:)
type(psb_hash_type) :: hash
@ -105,14 +105,14 @@ module psb_hash_map_mod
& hash_l2gv1, hash_l2gv2, hash_g2ls1, hash_g2ls2, &
& hash_g2lv1, hash_g2lv2, hash_g2ls1_ins, hash_g2ls2_ins, &
& hash_g2lv1_ins, hash_g2lv2_ins, hash_init_vlu, &
& hash_bld_g2l_map, hash_inner_cnvs1, hash_inner_cnvs2,&
& hash_inner_cnv1, hash_inner_cnv2, hash_row_extendable
& hash_bld_g2l_map, hash_inner_cnvs2, hash_inner_cnvs1, &
& hash_inner_cnv2, hash_inner_cnv1, hash_row_extendable
integer(psb_ipk_), private :: laddsz=500
interface hash_inner_cnv
module procedure hash_inner_cnvs1, hash_inner_cnvs2,&
& hash_inner_cnv1, hash_inner_cnv2
module procedure hash_inner_cnvs2, hash_inner_cnv2,&
& hash_inner_cnvs1, hash_inner_cnv1
end interface hash_inner_cnv
private :: hash_inner_cnv
@ -134,9 +134,9 @@ contains
if (allocated(idxmap%hashv)) &
& val = val + size(idxmap%hashv)*psb_sizeof_ip
if (allocated(idxmap%glb_lc)) &
& val = val + size(idxmap%glb_lc)*psb_sizeof_ip
& val = val + size(idxmap%glb_lc)*psb_sizeof_lp
if (allocated(idxmap%loc_to_glob)) &
& val = val + size(idxmap%loc_to_glob)*psb_sizeof_ip
& val = val + size(idxmap%loc_to_glob)*psb_sizeof_lp
val = val + psb_sizeof(idxmap%hash)
end function hash_sizeof
@ -327,8 +327,8 @@ contains
integer(psb_ipk_), intent(out) :: info
logical, intent(in), optional :: mask(:)
logical, intent(in), optional :: owned
integer(psb_ipk_) :: i, is, mglob, lip, nrow, nrm
integer(psb_lpk_) :: ncol, ip, tlip
integer(psb_ipk_) :: i, lip, nrow, nrm, is
integer(psb_lpk_) :: ncol, ip, tlip, mglob
integer(psb_mpk_) :: ictxt, iam, np
logical :: owned_
@ -374,7 +374,8 @@ contains
idx(i) = -1
cycle
endif
call hash_inner_cnv(ip,lip,idxmap%hashvmask,idxmap%hashv,idxmap%glb_lc,nrm)
call hash_inner_cnv(ip,lip,idxmap%hashvmask,idxmap%hashv,&
& idxmap%glb_lc,nrm)
if (lip < 0) then
call psb_hash_searchkey(ip,tlip,idxmap%hash,info)
lip = tlip
@ -412,7 +413,8 @@ contains
idx(i) = -1
cycle
endif
call hash_inner_cnv(ip,lip,idxmap%hashvmask,idxmap%hashv,idxmap%glb_lc,nrm)
call hash_inner_cnv(ip,lip,idxmap%hashvmask,&
& idxmap%hashv,idxmap%glb_lc,nrm)
if (lip < 0) then
call psb_hash_searchkey(ip,tlip,idxmap%hash,info)
lip = tlip
@ -592,12 +594,11 @@ contains
if (info >=0) then
if (nxt == tlip) then
ncol = max(ncol,nxt)
call psb_ensure_size(ncol,idxmap%loc_to_glob,info,pad=-1_psb_lpk_,addsz=laddsz)
call psb_ensure_size(ncol,idxmap%loc_to_glob,info,&
& pad=-1_psb_lpk_,addsz=laddsz)
if (info /= psb_success_) then
info=1
ch_err='psb_ensure_size'
call psb_errpush(psb_err_from_subroutine_ai_,name,&
&a_err=ch_err,i_err=(/info,izero,izero,izero,izero/))
&a_err='psb_ensure_size',i_err=(/info/))
goto 9999
end if
idxmap%loc_to_glob(nxt) = ip
@ -605,9 +606,8 @@ contains
endif
info = psb_success_
else
ch_err='SearchInsKeyVal'
call psb_errpush(psb_err_from_subroutine_ai_,name,&
& a_err=ch_err,i_err=(/info,izero,izero,izero,izero/))
& a_err='SearchInsKeyVal',i_err=(/info/))
goto 9999
end if
end if
@ -627,7 +627,8 @@ contains
idx(i) = -1
cycle
endif
call hash_inner_cnv(ip,lip,idxmap%hashvmask,idxmap%hashv,idxmap%glb_lc,ncol)
call hash_inner_cnv(ip,lip,idxmap%hashvmask,idxmap%hashv,&
& idxmap%glb_lc,ncol)
if (lip < 0) then
nxt = lidx(i)
if (nxt <= nrow) then
@ -643,9 +644,8 @@ contains
call psb_ensure_size(ncol,idxmap%loc_to_glob,info,pad=-1_psb_lpk_,addsz=laddsz)
if (info /= psb_success_) then
info=1
ch_err='psb_ensure_size'
call psb_errpush(psb_err_from_subroutine_ai_,name,&
&a_err=ch_err,i_err=(/info,izero,izero,izero,izero/))
&a_err='psb_ensure_size',i_err=(/info/))
goto 9999
end if
idxmap%loc_to_glob(nxt) = ip
@ -653,9 +653,8 @@ contains
endif
info = psb_success_
else
ch_err='SearchInsKeyVal'
call psb_errpush(psb_err_from_subroutine_ai_,name,&
& a_err=ch_err,i_err=(/info,izero,izero,izero,izero/))
& a_err='SearchInsKeyVal',i_err=(/info/))
goto 9999
end if
end if
@ -677,7 +676,8 @@ contains
cycle
endif
nxt = ncol + 1
call hash_inner_cnv(ip,lip,idxmap%hashvmask,idxmap%hashv,idxmap%glb_lc,ncol)
call hash_inner_cnv(ip,lip,idxmap%hashvmask,idxmap%hashv,&
& idxmap%glb_lc,ncol)
if (lip < 0) then
call psb_hash_searchinskey(ip,tlip,nxt,idxmap%hash,info)
lip = tlip
@ -686,12 +686,12 @@ contains
if (info >=0) then
if (nxt == lip) then
ncol = nxt
call psb_ensure_size(ncol,idxmap%loc_to_glob,info,pad=-1_psb_lpk_,addsz=laddsz)
call psb_ensure_size(ncol,idxmap%loc_to_glob,info,&
& pad=-1_psb_lpk_,addsz=laddsz)
if (info /= psb_success_) then
info=1
ch_err='psb_ensure_size'
call psb_errpush(psb_err_from_subroutine_ai_,name,&
&a_err=ch_err,i_err=(/info,izero,izero,izero,izero/))
& a_err='psb_ensure_size',i_err=(/info/))
goto 9999
end if
idxmap%loc_to_glob(nxt) = ip
@ -699,9 +699,8 @@ contains
endif
info = psb_success_
else
ch_err='SearchInsKeyVal'
call psb_errpush(psb_err_from_subroutine_ai_,name,&
& a_err=ch_err,i_err=(/info,izero,izero,izero,izero/))
& a_err='SearchInsKeyVal',i_err=(/info/))
goto 9999
end if
idx(i) = lip
@ -721,7 +720,8 @@ contains
cycle
endif
nxt = ncol + 1
call hash_inner_cnv(ip,lip,idxmap%hashvmask,idxmap%hashv,idxmap%glb_lc,ncol)
call hash_inner_cnv(ip,lip,idxmap%hashvmask,idxmap%hashv,&
& idxmap%glb_lc,ncol)
if (lip < 0) then
call psb_hash_searchinskey(ip,tlip,nxt,idxmap%hash,info)
lip = tlip
@ -730,7 +730,8 @@ contains
if (info >=0) then
if (nxt == lip) then
ncol = nxt
call psb_ensure_size(ncol,idxmap%loc_to_glob,info,pad=-1_psb_lpk_,addsz=laddsz)
call psb_ensure_size(ncol,idxmap%loc_to_glob,info,&
& pad=-1_psb_lpk_,addsz=laddsz)
if (info /= psb_success_) then
info=1
ch_err='psb_ensure_size'
@ -997,7 +998,8 @@ contains
! To be implemented
integer(psb_mpk_) :: ictxt, iam, np
integer(psb_ipk_) :: i, j, m, nl
integer(psb_ipk_) :: key, ih, nh, idx, nbits, hsize, hmask
integer(psb_ipk_) :: ih, nh, idx, nbits
integer(psb_lpk_) :: key, hsize, hmask
character(len=20), parameter :: name='hash_map_init_vlu'
info = 0
@ -1036,7 +1038,7 @@ contains
idxmap%hashvmask = hmask
if (info == psb_success_) &
& call psb_realloc(hsize+1,idxmap%hashv,info,lb=0_psb_ipk_)
& call psb_realloc(hsize+1,idxmap%hashv,info,lb=0_psb_lpk_)
if (info /= psb_success_) then
! !$ ch_err='psb_realloc'
! !$ call psb_errpush(info,name,a_err=ch_err)
@ -1133,11 +1135,13 @@ contains
subroutine hash_inner_cnvs1(x,hashmask,hashv,glb_lc,nrm)
integer(psb_ipk_), intent(in) :: hashmask,hashv(0:),glb_lc(:,:)
integer(psb_ipk_), intent(inout) :: x
implicit none
integer(psb_lpk_), intent(in) :: hashmask,glb_lc(:,:)
integer(psb_ipk_), intent(in) :: hashv(0:)
integer(psb_lpk_), intent(inout) :: x
integer(psb_ipk_), intent(in) :: nrm
integer(psb_ipk_) :: ih, key, idx,nh,tmp,lb,ub,lm
integer(psb_ipk_) :: idx,nh,tmp,lb,ub,lm
integer(psb_lpk_) :: key, ih
!
! When a large descriptor is assembled the indices
! are kept in a (hashed) list of ordered lists.
@ -1180,11 +1184,13 @@ contains
end subroutine hash_inner_cnvs1
subroutine hash_inner_cnvs2(x,y,hashmask,hashv,glb_lc,nrm)
integer(psb_ipk_), intent(in) :: hashmask,hashv(0:)
integer(psb_lpk_), intent(in) :: x, glb_lc(:,:)
implicit none
integer(psb_ipk_), intent(in) :: hashv(0:)
integer(psb_lpk_), intent(in) :: hashmask, x, glb_lc(:,:)
integer(psb_ipk_), intent(out) :: y
integer(psb_ipk_), intent(in) :: nrm
integer(psb_ipk_) :: ih, key, idx,nh,tmp,lb,ub,lm
integer(psb_ipk_) :: idx,nh,tmp,lb,ub,lm
integer(psb_lpk_) :: ih, key
!
! When a large descriptor is assembled the indices
! are kept in a (hashed) list of ordered lists.
@ -1228,13 +1234,15 @@ contains
subroutine hash_inner_cnv1(n,x,hashmask,hashv,glb_lc,mask,nrm)
integer(psb_ipk_), intent(in) :: n,hashmask,hashv(0:)
integer(psb_lpk_), intent(in) :: glb_lc(:,:)
implicit none
integer(psb_ipk_), intent(in) :: n, hashv(0:)
integer(psb_lpk_), intent(in) :: glb_lc(:,:),hashmask
logical, intent(in), optional :: mask(:)
integer(psb_ipk_), intent(in), optional :: nrm
integer(psb_lpk_), intent(inout) :: x(:)
integer(psb_ipk_) :: i, ih, key, idx,nh,tmp,lb,ub,lm
integer(psb_ipk_) :: i, nh,tmp,lb,ub,lm
integer(psb_lpk_) :: ih, key, idx
!
! When a large descriptor is assembled the indices
! are kept in a (hashed) list of ordered lists.
@ -1320,13 +1328,16 @@ contains
end subroutine hash_inner_cnv1
subroutine hash_inner_cnv2(n,x,y,hashmask,hashv,glb_lc,mask,nrm)
integer(psb_ipk_), intent(in) :: n, hashmask,hashv(0:),glb_lc(:,:)
implicit none
integer(psb_ipk_), intent(in) :: n, hashv(0:)
integer(psb_lpk_), intent(in) :: hashmask,glb_lc(:,:)
logical, intent(in), optional :: mask(:)
integer(psb_ipk_), intent(in), optional :: nrm
integer(psb_ipk_), intent(in) :: x(:)
integer(psb_lpk_), intent(in) :: x(:)
integer(psb_ipk_), intent(out) :: y(:)
integer(psb_ipk_) :: i, ih, key, idx,nh,tmp,lb,ub,lm
integer(psb_ipk_) :: i, idx,nh,tmp,lb,ub,lm
integer(psb_lpk_) :: ih, key
!
! When a large descriptor is assembled the indices
! are kept in a (hashed) list of ordered lists.
@ -1487,6 +1498,7 @@ contains
use psb_penv_mod
use psb_error_mod
use psb_realloc_mod
implicit none
class(psb_hash_map), intent(in) :: idxmap
type(psb_hash_map), intent(out) :: outmap
integer(psb_ipk_) :: info

@ -33,7 +33,7 @@
!
module psb_hash_mod
use psb_const_mod
use psb_desc_const_mod
!> \class psb_hash_mod
!! \brief Simple hash module for storing integer keys.
!!
@ -295,7 +295,7 @@ contains
integer(psb_ipk_) :: hsize,nbits
info = psb_success_
nbits = 14
nbits = psb_hash_bits
hsize = 2**nbits
!
! Figure out the smallest power of 2 bigger than NV
@ -335,7 +335,7 @@ contains
integer(psb_ipk_) :: hsize,nbits
info = psb_success_
nbits = 12
nbits = psb_hash_bits
hsize = 2**nbits
!
! Figure out the smallest power of 2 bigger than NV

@ -405,7 +405,7 @@ contains
if (ix == 1) then
zt(k) = g(dzero,y)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-2)*idim+iy
call ijk2idx(icol(icoeff),ix-1,iy,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -414,14 +414,14 @@ contains
if (iy == 1) then
zt(k) = g(x,dzero)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-1)*idim+(iy-1)
call ijk2idx(icol(icoeff),ix,iy-1,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
! term depending on (x,y)
val(icoeff)=(2*done)*(a1(x,y) + a2(x,y))/sqdeltah + c(x,y)
icol(icoeff) = (ix-1)*idim+iy
call ijk2idx(icol(icoeff),ix,iy,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
! term depending on (x,y+1)
@ -429,7 +429,7 @@ contains
if (iy == idim) then
zt(k) = g(x,done)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-1)*idim+(iy+1)
call ijk2idx(icol(icoeff),ix,iy+1,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -438,7 +438,7 @@ contains
if (ix==idim) then
zt(k) = g(done,y)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix)*idim+(iy)
call ijk2idx(icol(icoeff),ix+1,iy,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif

@ -426,7 +426,7 @@ contains
if (ix == 1) then
zt(k) = g(dzero,y,z)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-2)*idim*idim+(iy-1)*idim+(iz)
call ijk2idx(icol(icoeff),ix-1,iy,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -435,7 +435,7 @@ contains
if (iy == 1) then
zt(k) = g(x,dzero,z)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-1)*idim*idim+(iy-2)*idim+(iz)
call ijk2idx(icol(icoeff),ix,iy-1,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -444,7 +444,7 @@ contains
if (iz == 1) then
zt(k) = g(x,y,dzero)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-1)*idim*idim+(iy-1)*idim+(iz-1)
call ijk2idx(icol(icoeff),ix,iy,iz-1,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -452,7 +452,7 @@ contains
! term depending on (x,y,z)
val(icoeff)=(2*done)*(a1(x,y,z)+a2(x,y,z)+a3(x,y,z))/sqdeltah &
& + c(x,y,z)
icol(icoeff) = (ix-1)*idim*idim+(iy-1)*idim+(iz)
call ijk2idx(icol(icoeff),ix,iy,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
! term depending on (x,y,z+1)
@ -460,7 +460,7 @@ contains
if (iz == idim) then
zt(k) = g(x,y,done)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-1)*idim*idim+(iy-1)*idim+(iz+1)
call ijk2idx(icol(icoeff),ix,iy,iz+1,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -469,7 +469,7 @@ contains
if (iy == idim) then
zt(k) = g(x,done,z)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-1)*idim*idim+(iy)*idim+(iz)
call ijk2idx(icol(icoeff),ix,iy+1,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -478,7 +478,7 @@ contains
if (ix==idim) then
zt(k) = g(done,y,z)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix)*idim*idim+(iy-1)*idim+(iz)
call ijk2idx(icol(icoeff),ix+1,iy,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif

@ -405,7 +405,7 @@ contains
if (ix == 1) then
zt(k) = g(szero,y)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-2)*idim+iy
call ijk2idx(icol(icoeff),ix-1,iy,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -414,14 +414,14 @@ contains
if (iy == 1) then
zt(k) = g(x,szero)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-1)*idim+(iy-1)
call ijk2idx(icol(icoeff),ix,iy-1,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
! term depending on (x,y)
val(icoeff)=(2*sone)*(a1(x,y) + a2(x,y))/sqdeltah + c(x,y)
icol(icoeff) = (ix-1)*idim+iy
call ijk2idx(icol(icoeff),ix,iy,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
! term depending on (x,y+1)
@ -429,7 +429,7 @@ contains
if (iy == idim) then
zt(k) = g(x,sone)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-1)*idim+(iy+1)
call ijk2idx(icol(icoeff),ix,iy+1,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -438,7 +438,7 @@ contains
if (ix==idim) then
zt(k) = g(sone,y)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix)*idim+(iy)
call ijk2idx(icol(icoeff),ix+1,iy,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif

@ -426,7 +426,7 @@ contains
if (ix == 1) then
zt(k) = g(szero,y,z)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-2)*idim*idim+(iy-1)*idim+(iz)
call ijk2idx(icol(icoeff),ix-1,iy,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -435,7 +435,7 @@ contains
if (iy == 1) then
zt(k) = g(x,szero,z)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-1)*idim*idim+(iy-2)*idim+(iz)
call ijk2idx(icol(icoeff),ix,iy-1,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -444,7 +444,7 @@ contains
if (iz == 1) then
zt(k) = g(x,y,szero)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-1)*idim*idim+(iy-1)*idim+(iz-1)
call ijk2idx(icol(icoeff),ix,iy,iz-1,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -452,7 +452,7 @@ contains
! term depending on (x,y,z)
val(icoeff)=(2*sone)*(a1(x,y,z)+a2(x,y,z)+a3(x,y,z))/sqdeltah &
& + c(x,y,z)
icol(icoeff) = (ix-1)*idim*idim+(iy-1)*idim+(iz)
call ijk2idx(icol(icoeff),ix,iy,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
! term depending on (x,y,z+1)
@ -460,7 +460,7 @@ contains
if (iz == idim) then
zt(k) = g(x,y,sone)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-1)*idim*idim+(iy-1)*idim+(iz+1)
call ijk2idx(icol(icoeff),ix,iy,iz+1,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -469,7 +469,7 @@ contains
if (iy == idim) then
zt(k) = g(x,sone,z)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix-1)*idim*idim+(iy)*idim+(iz)
call ijk2idx(icol(icoeff),ix,iy+1,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif
@ -478,7 +478,7 @@ contains
if (ix==idim) then
zt(k) = g(sone,y,z)*(-val(icoeff)) + zt(k)
else
icol(icoeff) = (ix)*idim*idim+(iy-1)*idim+(iz)
call ijk2idx(icol(icoeff),ix+1,iy,iz,idim,idim,idim)
irow(icoeff) = glob_row
icoeff = icoeff+1
endif

Loading…
Cancel
Save