<div dir="ltr"><div>Hi Maksim! <br></div><div>Maybe the more appropriate and easier place to sum over all cells is in the Simulation_adjustEvolution routine. <br></div><div>This is a stub routine (see the user manal sec. 4.2.1) called by default every cycle (you will be able to sum over <br></div><div>cells in each time step). There you will find the number of blocks blkcnt. So you should have a copy of this <br></div><div>routine in your problem directory with a piece of code of the type:<br></div><div><br></div><div>do n=1,blkcnt<br> blockId = blockList(n)<br> call Grid_getBlkPtr(blockId,S,CENTER)<br> call Grid_getBlkIndexLimits(blockID,blk,blkGC)<br> <br> call Grid_getCellCoords(IAXIS,blockId,CENTER,.false.,xCoord,sizeX)<br> call Grid_getCellCoords(JAXIS,blockId,CENTER,.false.,yCoord,sizeY)<br> <br> do k=kb,ke<br> do j=jb,je<br> do i=ib,ie<br></div><div> ...<br></div><div> ...</div><div> ... <br> enddo i<br> enddo j<br> enddo k<br> <br>enddo<br></div><div><br></div><div>Best! <br></div><div>Ernesto. <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El dom, 6 jun 2021 a las 11:51, Maksim Kozlov (<<a href="mailto:maksim.kozlov@nu.edu.kz">maksim.kozlov@nu.edu.kz</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Dear Flash users,</div><div>How can I sum variable across all blocks , not just blocks calculated by one processor?</div><div>I am trying to do the following<br></div><div>I need to sum some variable calculated inside Simulation_initBlock over several blocks. So in "gr_expandDomain" I added</div><div> srce_volume=0</div><div> do i = 1, count</div><div> ...</div><div> call Simulation_initBlock (blkList(i),tvolume)</div><div> srce_volume=srce_volume+tvolume<br> end do</div><div>to use srce_volume in different subroutines I added <br></div><div>real, save :: srce_volume</div><div>to Simulation_data</div><div>and <br></div><div>use Simulation_data, ONLY : srce_volume</div><div>in all subroutines where I need it <br></div><div>but what happens is that all blocks are divided between different processors so srce_volume is summed only over blocks of one processor instead of adding it for all blocks. </div><div>Thank you very much!</div><div>Maksim Kozlov<br></div></div>
</blockquote></div>