<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <font face="serif">So apparently you guys can't get the diffusion
      code to work using the 3D Jacobi update algorithm.  Since you are
      using a cube and the dx=dy=dz, you can do something like this...
      which is a simple extension of equation 3.7 in your text to 3D<br>
      <br>
    </font><tt>scalar = diffusion_coefficient * timestep /
      distance_between_blocks**2</tt><tt><br>
    </tt><tt><br>
    </tt><tt>   do i = 1, msize</tt><tt><br>
    </tt><tt>      do j = 1, msize</tt><tt><br>
    </tt><tt>          do k = 1, msize</tt><tt><br>
    </tt><tt>              tempbox(k,j,i) = box(k,j,i) + &amp;</tt><tt><br>
    </tt><tt>                           (  ( box(k,j,i-1) + box(k,j,i+1)
      - 2.0D0* box(k,j,i)) &amp;</tt><tt><br>
    </tt><tt>                                    * mask(k,j,i-1) *
      mask(k,j,i+1)  +  &amp;</tt><tt><br>
    </tt><tt>                              ( box(k,j-1,i) + box(k,j+1,i)
      - 2.0D0* box(k,j,i)) &amp;</tt><tt><br>
    </tt><tt>                                    * mask(k,j-1,i) *
      mask(k,j+1,i)  +  &amp;</tt><tt><br>
    </tt><tt>                              ( box(k-1,j,i) + box(k+1,j,i)
      - 2.0D0* box(k,j,i)) &amp;</tt><tt><br>
    </tt><tt>                                    * mask(k-1,j,i) *
      mask(k+1,j,i)  )  &amp;</tt><tt><br>
    </tt><tt>                            * scalar       </tt><tt><br>
    </tt><tt>          end do</tt><tt><br>
    </tt><tt>      end do</tt><tt><br>
    </tt><tt>   end do</tt><font face="serif"><br>
      <br>
          <br>
      Hope that helps...<br>
      <br>
      <br>
    </font>
    <pre class="moz-signature" cols="72">-- 
Andrew J. Pounds, Ph.D.  (<a class="moz-txt-link-abbreviated" href="mailto:pounds_aj@mercer.edu">pounds_aj@mercer.edu</a>)
Professor of Chemistry and Computer Science
Mercer University,  Macon, GA 31207   (478) 301-5627
<a class="moz-txt-link-freetext" href="http://faculty.mercer.edu/pounds_aj">http://faculty.mercer.edu/pounds_aj</a>
</pre>
  </body>
</html>