Hello<div><br></div><div>I use following code to compute total kinetic energy in the domain inside userchk</div><div><br></div><div><div><font class="Apple-style-span" face="'courier new', monospace" color="#3333ff">c Compute total kinetic energy</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" color="#3333ff"> if(mod(istep,10).eq.0)then</font></div><div><font class="Apple-style-span" face="'courier new', monospace" color="#3333ff"> n = nx1*ny1*nz1*nelv</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" color="#3333ff"> xke = glsc3(vx, vx, bm1, n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace" color="#3333ff"> yke = glsc3(vy, vy, bm1, n)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" color="#3333ff"> zke = glsc3(vz, vz, bm1, n)</font></div><div><font class="Apple-style-span" face="'courier new', monospace" color="#3333ff"> total_ke = 0.5*(xke + yke + zke)</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" color="#3333ff"> if(nid.eq.0) write(6,1) istep, time, total_ke</font></div><div><font class="Apple-style-span" face="'courier new', monospace" color="#3333ff"> 1 format(i6,1p2e14.6,' Totalke')</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace" color="#3333ff"> endif</font></div></div><div><font class="Apple-style-span" face="'courier new', monospace" color="#3333ff"><br></font></div>
Is this correct ? Does this account for the parallel computation or do I need to do something extra to gather from other processes ?<br><br>Thanks<br>praveen