<div dir="ltr">Dear Neks, <div><br></div><div>In TurbInflow example there is a usr file for postprocessing where TKE is calculated.</div><div><br></div><div>It says:</div><div><br></div><div><br></div><div><br></div><div><div>ccc   avg all the avgturbInflow0.f0* files</div><div>      call auto_averager(fname1)</div><div><br></div><div>ccc   copy uk=vx**2, vk=vy**2, wk=vz**2</div><div>      call col3(uk,vx,vx,lt)</div><div>      call col3(vk,vy,vy,lt)</div><div>      call col3(wk,vz,vz,lt)</div><div><br></div><div>ccc   avg all the rmsturbInflow0.f0* files</div><div>      call auto_averager(fname2)</div><div><br></div><div>ccc   u'^2,v'^2,w'^2 = rms - avg**2</div><div>      call sub2(vx,uk,lt)</div><div>      call sub2(vy,vk,lt)</div><div>      call sub2(vz,wk,lt)</div><div><br></div><div>ccc   Average in thex direction</div><div>      call my_x_avg(uk,vx,gs_avg_hndl,nelx,nely,nelz,ifld,rcmask)</div><div>      call my_x_avg(vk,vy,gs_avg_hndl,nelx,nely,nelz,ifld,rcmask)</div><div>      call my_x_avg(wk,vz,gs_avg_hndl,nelx,nely,nelz,ifld,rcmask)</div><div><br></div><div>ccc   TKE = 0.5*(u'^2+v'^2+w'^2)</div><div>      call add4(tk,uk,vk,wk,lt)</div><div>      call cmult(tk,0.5,lt)</div><div><br></div><div>ccc   sqrt uk,vk,wk to get urms, vrms and wrms</div><div>      call vsqrt(uk,lt)</div><div>      call vsqrt(vk,lt)</div><div>      call vsqrt(wk,lt)</div><div><br></div><div>ccc   output urms,vrms and wrms along with the TKE </div><div>ccc   TKE is in temperature field</div><div>      ifto = .true.</div><div>      call outpost(uk,vk,wk,pr,tk,'avx')</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div>As far as I know, the sub2 subroutine works like</div><div><br></div><div>sub2(A,B,lt)</div><div>A=A+B</div><div><br></div><div>That means, it saves the sum in the first argument. </div><div><br></div><div>The code says:</div><div><br></div><div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">      call sub2(vx,uk,lt)</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">      call sub2(vy,vk,lt)</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">      call sub2(vz,wk,lt)</div><br></div><div>Meaning that <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">u'^2,v'^2,w'^2 is being stored in vx, vy, and vz. </span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">So should the code say:.. ?</span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><br></div><div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">      call add4(tk,vx,vy,vz,lt)</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">instead of </div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><div style="text-decoration-style:initial;text-decoration-color:initial">      call add4(tk,uk,vk,wk,lt)</div><div style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="text-decoration-style:initial;text-decoration-color:initial">Or there is something I'm missing?</div><div style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="text-decoration-style:initial;text-decoration-color:initial">Thank you all.</div><div style="text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="text-decoration-style:initial;text-decoration-color:initial">Juan Pablo.</div><br></div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><br></div></div>