# Eq 3 then if dir eq 1 then u n1 n2 n3 kk u n1

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: r(i1-1,i2-1,i3 ) + r(i1-1,i2+1,i3 ) + r(i1-1,i2, i3-1) + r(i1-1,i2, i3+1) y1(i1-1) = r(i1-1,i2-1,i3-1) + r(i1-1,i2-1,i3+1) + r(i1-1,i2+1,i3-1) + r(i1-1,i2+1,i3+1) enddo do j1=2,m1j-1 i1 = 2*j1-d1 y2 = r(i1, i2-1,i3-1) + r(i1, i2-1,i3+1) + r(i1, i2+1,i3-1) + r(i1, i2+1,i3+1) x2 = r(i1, i2-1,i3 ) + r(i1, i2+1,i3 ) + r(i1, i2, i3-1) + r(i1, i2, i3+1) s(j1,j2,j3) = 0.5D0 * r(i1,i2,i3) + 0.25D0 * (r(i1-1,i2,i3) + r(i1+1,i2,i3) + x2) + 0.125D0 * ( x1(i1-1) + x1(i1+1) + y2) + 0.0625D0 * ( y1(i1-1) + y1(i1+1) ) enddo enddo enddo j = k-1 call comm3(s,m1j,m2j,m3j,j) return end Fortran+MPI NAS MG rprj3 stencil subroutine comm3(u,n1,n2,n3,kk) use caf_intrinsics else if( dir .eq. +1 ) then if( axis .eq. 3 )then do i2=1,n2 do i1=1,n1 buff_len = buff_len + 1 buff(buff_len, buff_id ) = u( i1,i2,n3-1) enddo enddo endif if( axis .eq. 2 )then do i3=2,n3-1 do i1=1,n1 indx = indx + 1 u(i1,1,i3) = buff(indx, buff_id ) enddo enddo endif endif endif dir = -1 if( axis .eq. 3 )then if( dir .eq. -1 )then buff_id = 2 + dir buff_len = 0 if( axis .eq. 3 )then do i2=1,n2 do i1=1,n1 indx = i...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online