Fixed index generation in pargen.

CGS2
Salvatore Filippone 7 years ago
parent 96d224c912
commit f2741e3f5c

@ -401,7 +401,7 @@ contains
if (ix == 1) then if (ix == 1) then
zt(k) = g(dzero,y)*(-val(icoeff)) + zt(k) zt(k) = g(dzero,y)*(-val(icoeff)) + zt(k)
else else
icol(icoeff) = (ix-2)*idim+iy call ijk2idx(icol(icoeff),ix-1,iy,idim,idim)
irow(icoeff) = glob_row irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -410,14 +410,14 @@ contains
if (iy == 1) then if (iy == 1) then
zt(k) = g(x,dzero)*(-val(icoeff)) + zt(k) zt(k) = g(x,dzero)*(-val(icoeff)) + zt(k)
else else
icol(icoeff) = (ix-1)*idim+(iy-1) call ijk2idx(icol(icoeff),ix,iy-1,idim,idim)
irow(icoeff) = glob_row irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
! term depending on (x,y) ! term depending on (x,y)
val(icoeff)=(2*done)*(a1(x,y) + a2(x,y))/sqdeltah + c(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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
! term depending on (x,y+1) ! term depending on (x,y+1)
@ -425,7 +425,7 @@ contains
if (iy == idim) then if (iy == idim) then
zt(k) = g(x,done)*(-val(icoeff)) + zt(k) zt(k) = g(x,done)*(-val(icoeff)) + zt(k)
else else
icol(icoeff) = (ix-1)*idim+(iy+1) call ijk2idx(icol(icoeff),ix,iy+1,idim,idim)
irow(icoeff) = glob_row irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -434,7 +434,7 @@ contains
if (ix==idim) then if (ix==idim) then
zt(k) = g(done,y)*(-val(icoeff)) + zt(k) zt(k) = g(done,y)*(-val(icoeff)) + zt(k)
else else
icol(icoeff) = (ix)*idim+(iy) call ijk2idx(icol(icoeff),ix+1,iy,idim,idim)
irow(icoeff) = glob_row irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif

@ -421,7 +421,7 @@ contains
if (ix == 1) then if (ix == 1) then
zt(k) = g(dzero,y,z)*(-val(icoeff)) + zt(k) zt(k) = g(dzero,y,z)*(-val(icoeff)) + zt(k)
else 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -430,7 +430,7 @@ contains
if (iy == 1) then if (iy == 1) then
zt(k) = g(x,dzero,z)*(-val(icoeff)) + zt(k) zt(k) = g(x,dzero,z)*(-val(icoeff)) + zt(k)
else 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -439,7 +439,7 @@ contains
if (iz == 1) then if (iz == 1) then
zt(k) = g(x,y,dzero)*(-val(icoeff)) + zt(k) zt(k) = g(x,y,dzero)*(-val(icoeff)) + zt(k)
else 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -447,7 +447,7 @@ contains
! term depending on (x,y,z) ! term depending on (x,y,z)
val(icoeff)=(2*done)*(a1(x,y,z)+a2(x,y,z)+a3(x,y,z))/sqdeltah & val(icoeff)=(2*done)*(a1(x,y,z)+a2(x,y,z)+a3(x,y,z))/sqdeltah &
& + c(x,y,z) & + 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
! term depending on (x,y,z+1) ! term depending on (x,y,z+1)
@ -455,7 +455,7 @@ contains
if (iz == idim) then if (iz == idim) then
zt(k) = g(x,y,done)*(-val(icoeff)) + zt(k) zt(k) = g(x,y,done)*(-val(icoeff)) + zt(k)
else 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -464,7 +464,7 @@ contains
if (iy == idim) then if (iy == idim) then
zt(k) = g(x,done,z)*(-val(icoeff)) + zt(k) zt(k) = g(x,done,z)*(-val(icoeff)) + zt(k)
else 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -473,7 +473,7 @@ contains
if (ix==idim) then if (ix==idim) then
zt(k) = g(done,y,z)*(-val(icoeff)) + zt(k) zt(k) = g(done,y,z)*(-val(icoeff)) + zt(k)
else 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif

@ -401,7 +401,7 @@ contains
if (ix == 1) then if (ix == 1) then
zt(k) = g(szero,y)*(-val(icoeff)) + zt(k) zt(k) = g(szero,y)*(-val(icoeff)) + zt(k)
else else
icol(icoeff) = (ix-2)*idim+iy call ijk2idx(icol(icoeff),ix-1,iy,idim,idim)
irow(icoeff) = glob_row irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -410,14 +410,14 @@ contains
if (iy == 1) then if (iy == 1) then
zt(k) = g(x,szero)*(-val(icoeff)) + zt(k) zt(k) = g(x,szero)*(-val(icoeff)) + zt(k)
else else
icol(icoeff) = (ix-1)*idim+(iy-1) call ijk2idx(icol(icoeff),ix,iy-1,idim,idim)
irow(icoeff) = glob_row irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
! term depending on (x,y) ! term depending on (x,y)
val(icoeff)=(2*sone)*(a1(x,y) + a2(x,y))/sqdeltah + c(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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
! term depending on (x,y+1) ! term depending on (x,y+1)
@ -425,7 +425,7 @@ contains
if (iy == idim) then if (iy == idim) then
zt(k) = g(x,sone)*(-val(icoeff)) + zt(k) zt(k) = g(x,sone)*(-val(icoeff)) + zt(k)
else else
icol(icoeff) = (ix-1)*idim+(iy+1) call ijk2idx(icol(icoeff),ix,iy+1,idim,idim)
irow(icoeff) = glob_row irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -434,7 +434,7 @@ contains
if (ix==idim) then if (ix==idim) then
zt(k) = g(sone,y)*(-val(icoeff)) + zt(k) zt(k) = g(sone,y)*(-val(icoeff)) + zt(k)
else else
icol(icoeff) = (ix)*idim+(iy) call ijk2idx(icol(icoeff),ix+1,iy,idim,idim)
irow(icoeff) = glob_row irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif

@ -421,7 +421,7 @@ contains
if (ix == 1) then if (ix == 1) then
zt(k) = g(szero,y,z)*(-val(icoeff)) + zt(k) zt(k) = g(szero,y,z)*(-val(icoeff)) + zt(k)
else 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -430,7 +430,7 @@ contains
if (iy == 1) then if (iy == 1) then
zt(k) = g(x,szero,z)*(-val(icoeff)) + zt(k) zt(k) = g(x,szero,z)*(-val(icoeff)) + zt(k)
else 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -439,7 +439,7 @@ contains
if (iz == 1) then if (iz == 1) then
zt(k) = g(x,y,szero)*(-val(icoeff)) + zt(k) zt(k) = g(x,y,szero)*(-val(icoeff)) + zt(k)
else 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -447,7 +447,7 @@ contains
! term depending on (x,y,z) ! term depending on (x,y,z)
val(icoeff)=(2*sone)*(a1(x,y,z)+a2(x,y,z)+a3(x,y,z))/sqdeltah & val(icoeff)=(2*sone)*(a1(x,y,z)+a2(x,y,z)+a3(x,y,z))/sqdeltah &
& + c(x,y,z) & + 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
! term depending on (x,y,z+1) ! term depending on (x,y,z+1)
@ -455,7 +455,7 @@ contains
if (iz == idim) then if (iz == idim) then
zt(k) = g(x,y,sone)*(-val(icoeff)) + zt(k) zt(k) = g(x,y,sone)*(-val(icoeff)) + zt(k)
else 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -464,7 +464,7 @@ contains
if (iy == idim) then if (iy == idim) then
zt(k) = g(x,sone,z)*(-val(icoeff)) + zt(k) zt(k) = g(x,sone,z)*(-val(icoeff)) + zt(k)
else 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif
@ -473,7 +473,7 @@ contains
if (ix==idim) then if (ix==idim) then
zt(k) = g(sone,y,z)*(-val(icoeff)) + zt(k) zt(k) = g(sone,y,z)*(-val(icoeff)) + zt(k)
else 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 irow(icoeff) = glob_row
icoeff = icoeff+1 icoeff = icoeff+1
endif endif

Loading…
Cancel
Save