<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Britton,<div><br></div><div>I need to implement Grackle into ART-NMSU, so I would need:</div><div><br></div><div>+fortran support</div><div>+simpler data structure</div><div>&nbsp;</div><div>I mostly agree with Romain that the current data structure is too heavy:</div><div><br></div><div><br></div><div><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; "><blockquote type="cite">int solve_chemistry(chemistry_data &amp;my_chemistry, &nbsp;???<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;code_units &amp;my_units, OK set to 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gr_float a_value, gr_float dt_value, why a ?<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gr_int grid_rank, gr_int *grid_dimension, ????<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gr_int *grid_start, gr_int *grid_end, ????<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gr_float *density, gr_float *internal_energy, OK<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gr_float *x_velocity, gr_float *y_velocity, gr_float *z_velocity, ???<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gr_float *HI_density, gr_float *HII_density, gr_float *HM_density, too much<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gr_float *HeI_density, gr_float *HeII_density, gr_float *HeIII_density, too much<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gr_float *H2I_density, gr_float *H2II_density, too much<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gr_float *DI_density, gr_float *DII_density, gr_float *HDI_density, too much<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gr_float *e_density, gr_float *metal_density); OK</blockquote></div></blockquote><div><br></div>For equilibrium cooling, many of these grids are not necessary. If we agree that solve_chemistry is called once per each resolution element, I think we need to simply it and get rid of the 3D grids.</div><div>This function is going to be called many times, so I would suggest a minimalistic approach that does the job.&nbsp;</div><div>We can add more layers of complexity later, like the sobolev aprox, which needs the velocity gradients, right?, but first we need to agree on a minimum API.</div><div>&nbsp;</div><div>best</div><div><br></div><div>Daniel</div><div><br><div><div>On Mar 21, 2014, at 6:00 PM, Britton Smith wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Sam, that is great news that no alterations need to be made for Grackle to work with ART. &nbsp;Thanks for your hard work on this!<div><br></div><div>Other groups, what are your experiences/needs?</div><div><br></div>
<div>Britton</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Mar 21, 2014 at 4:30 PM, Sam Leitner <span dir="ltr">&lt;<a href="mailto:sam.leitner@gmail.com" target="_blank">sam.leitner@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Nick, that is not correct, my ART implementation uses the grackle solver. We can discuss it in the PR that I issued.</div>
<div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Mar 21, 2014 at 12:23 PM, Nick Gnedin <span dir="ltr">&lt;<a href="mailto:gnedin@fnal.gov" target="_blank">gnedin@fnal.gov</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
At least with ART, the implementation is not what it is supposed to be.<br>
It actually uses ART sub-cycling solver, and only extracts the cooling<br>
rate from Grackle. I thought the plan was for everyone to use<br>
solve_chemistry.<br>
<br>
That's why it is important to converge on the API first.<br>
<div><br>
<br>
On 03/21/2014 11:14 AM, Britton Smith wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; This discussion seems to have ground to a halt, so I'll see if I can get<br>
&gt; it going again.<br>
&gt;<br>
&gt; It looks like the proposed API is pretty similar to what already exists,<br>
&gt; with mostly cosmetic changes related to what data the user is required<br>
&gt; to carry around. &nbsp;Since we have heard from so few regarding a new API,<br>
&gt; it doesn't seem that many people really want it. &nbsp;Perhaps we should<br>
&gt; establish what groups have completed the Grackle implementation, and<br>
&gt; then we can focus on what the remaining groups need in order to catch<br>
&gt; up. &nbsp;I heard a wise man once say, "You can't always get what you want,<br>
&gt; but if you try sometimes, well you might find you get what you need."<br>
&gt;<br>
&gt; We've heard from Ken Nagamine and Junhwan Choi on behalf of the Gadget<br>
&gt; group. &nbsp;I have done Enzo, and to be clear, the Grackle is slightly<br>
&gt; different from what is built in to Enzo, so Enzo now explicitly supports<br>
&gt; Grackle. &nbsp;Sam Leitner has told me that ART is now finished. &nbsp;Are there<br>
&gt; any other groups out there that can report in?<br>
&gt;<br>
</div>&gt; So, it sounds to me that one thing that is /needed/ is a clear path to<br>
<div>&gt; implementing the Grackle into a purely fortran code, like Ramses. &nbsp;Is<br>
&gt; that correct? &nbsp;If so, let's talk about how best that can be achieved.<br>
&gt;<br>
&gt; To the other groups out there that have not yet finished the<br>
&gt; implementation process, what are the things that you need to get this done?<br>
&gt;<br>
&gt; Britton<br>
&gt;<br>
&gt; On Thu, Mar 20, 2014 at 3:07 PM, Junhwan Choi (최준환)<br>
</div><div><div>&gt; &lt;<a href="mailto:choi.junhwan@gmail.com" target="_blank">choi.junhwan@gmail.com</a> &lt;mailto:<a href="mailto:choi.junhwan@gmail.com" target="_blank">choi.junhwan@gmail.com</a>&gt;&gt; wrote:<br>

&gt;<br>
&gt; &nbsp; &nbsp; Hi Romain,<br>
&gt;<br>
&gt; &nbsp; &nbsp; For me, it took about two weeks to make it works.<br>
&gt; &nbsp; &nbsp; But, I spend considerable time to find a way to pass the system unit<br>
&gt; &nbsp; &nbsp; to grackle properly.<br>
&gt; &nbsp; &nbsp; There are a few outstanding issues on this adjustment.<br>
&gt;<br>
&gt; &nbsp; &nbsp; 1. &nbsp;Grackle use C++ and wrap the FORTRAN cooling routine. It is not<br>
&gt; &nbsp; &nbsp; trivial to call this C++ wrapped the FORTRAN but there is example in<br>
&gt; &nbsp; &nbsp; the grackle example directory.<br>
&gt;<br>
&gt; &nbsp; &nbsp; 2. In the gadget case, I pass one particle by one particle to the<br>
&gt; &nbsp; &nbsp; grackle in order to calculate the cooling. The reason is that the<br>
&gt; &nbsp; &nbsp; gadget cooling and star formation routine is based on particle by<br>
&gt; &nbsp; &nbsp; particle. Indeed, it is least efficient way but so far I have not<br>
&gt; &nbsp; &nbsp; experienced significant slow down.<br>
&gt; &nbsp; &nbsp; [If I use tabulated H and He cooling rates from grackle, it takes<br>
&gt; &nbsp; &nbsp; almost the same time with the original gadget cooling.]<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; 3. For unit adjustment, we can set as follow:<br>
&gt; &nbsp; &nbsp; my_units.comoving_coordinates = 0;<br>
&gt; &nbsp; &nbsp; my_units.density_units = udensity;<br>
&gt; &nbsp; &nbsp; my_units.length_units = ulength;<br>
&gt; &nbsp; &nbsp; my_units.time_units = utime;<br>
&gt; &nbsp; &nbsp; my_units.a_units = 1.0;<br>
&gt; &nbsp; &nbsp; [udensity, ulength, and utime is the conversion factor from system<br>
&gt; &nbsp; &nbsp; physical units to cgs.]<br>
&gt; &nbsp; &nbsp; In this case, you can pass the density, internal energy, and chemistry<br>
&gt; &nbsp; &nbsp; value in system physical unit.<br>
&gt;<br>
&gt; &nbsp; &nbsp; Besides these issues, the incorporating Grackle should not be very<br>
&gt; &nbsp; &nbsp; difficult.<br>
&gt;<br>
&gt; &nbsp; &nbsp; Best,<br>
&gt; &nbsp; &nbsp; Junhwan<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; On Thu, Mar 20, 2014 at 2:35 AM, Romain Teyssier<br>
</div></div><div>&gt; &nbsp; &nbsp; &lt;<a href="mailto:romain.teyssier@gmail.com" target="_blank">romain.teyssier@gmail.com</a> &lt;mailto:<a href="mailto:romain.teyssier@gmail.com" target="_blank">romain.teyssier@gmail.com</a>&gt;&gt; wrote:<br>

&gt; &nbsp; &nbsp; &nbsp;&gt; That's great.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; A very important question: how long did it take him to succeed ?<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; Since in my opinion, many "adjustments" need to be done, I would<br>
&gt; &nbsp; &nbsp; be curious to<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; have an estimate on the time required that have this working.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; Cheers,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; Romain<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; On 20 Mar 2014, at 00:33, Ken Nagamine &lt;<a href="mailto:kn@physics.unlv.edu" target="_blank">kn@physics.unlv.edu</a><br>
</div><div>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:kn@physics.unlv.edu" target="_blank">kn@physics.unlv.edu</a>&gt;&gt; wrote:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt; Dear all,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt; Let me just mention that, on the SPH side, Junhwan Choi has<br>
&gt; &nbsp; &nbsp; already succeeded in<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt; implementing the Grackle package into Gadget3-UNLV version.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt; We still need to do more checks, but at least the phase diagram<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt; looks reasonable compared to the previous TREECOOL table<br>
&gt; &nbsp; &nbsp; implementation of original Gadget.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt; Junhwan can explain the details of his implementation method if<br>
&gt; &nbsp; &nbsp; it can be of help for this discussion.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt; cheers,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt; Ken<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt; On Mar 20, 2014, at 6:44 AM, Romain Teyssier wrote:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; On 19 Mar 2014, at 22:35, Matthew Turk &lt;<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a><br>
</div><div>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>&gt;&gt; wrote:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; On Wed, Mar 19, 2014 at 5:26 PM, Romain Teyssier<br>
</div>&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; &lt;<a href="mailto:romain.teyssier@gmail.com" target="_blank">romain.teyssier@gmail.com</a> &lt;mailto:<a href="mailto:romain.teyssier@gmail.com" target="_blank">romain.teyssier@gmail.com</a>&gt;&gt;<br>

<div><div>&gt; &nbsp; &nbsp; wrote:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; Hi Matt,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; For example:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; int solve_chemistry(chemistry_data &amp;my_chemistry, &nbsp;???<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; code_units &amp;my_units, OK set to 1<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gr_float a_value, gr_float dt_value, why a ?<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gr_int grid_rank, gr_int *grid_dimension, ????<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gr_int *grid_start, gr_int *grid_end, ????<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gr_float *density, gr_float<br>
&gt; &nbsp; &nbsp; *internal_energy, OK<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gr_float *x_velocity, gr_float *y_velocity,<br>
&gt; &nbsp; &nbsp; gr_float *z_velocity, ???<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gr_float *HI_density, gr_float<br>
&gt; &nbsp; &nbsp; *HII_density, gr_float *HM_density, too much<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gr_float *HeI_density, gr_float<br>
&gt; &nbsp; &nbsp; *HeII_density, gr_float *HeIII_density, too much<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gr_float *H2I_density, gr_float<br>
&gt; &nbsp; &nbsp; *H2II_density, too much<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gr_float *DI_density, gr_float<br>
&gt; &nbsp; &nbsp; *DII_density, gr_float *HDI_density, too much<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gr_float *e_density, gr_float<br>
&gt; &nbsp; &nbsp; *metal_density); OK<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; What are the *grid related variables ?<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; Good question! &nbsp;These, like the code units variables, are<br>
&gt; &nbsp; &nbsp; designed to<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; minimize the overhead of any simulation that wants to put its code<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; into it. &nbsp;For instance, if one had a patch/block-based code (like<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; Enzo, FLASH, Nyx, etc) or an Octree code where the 2x2x2 zones<br>
&gt; &nbsp; &nbsp; were<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; included in (2+2*NGZ, 2+2*NGZ, 2+2*NGZ) blocks and one didn't<br>
&gt; &nbsp; &nbsp; want to<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; spend time solving the ghost zones, they can be masked out.<br>
&gt; &nbsp; &nbsp; &nbsp; These are<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; the variables:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; grid_start =&gt; array of size (grid_rank) indicating the indices to<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; start at in each rank of dimensionality<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; grid_end =&gt; array of size (grid_rank) indicating the indices<br>
&gt; &nbsp; &nbsp; to *end*<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; at in each rank of dimensionality<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; grid_dimension =&gt; size of the block of data in each dimension<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; grid_rank =&gt; dimensionality; if you're supplying a pencil<br>
&gt; &nbsp; &nbsp; beam, this would be 1.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; While these typically are better for block or patch based<br>
&gt; &nbsp; &nbsp; solvers, I<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; think that the primary goal -- *minimizing* the overhead to<br>
&gt; &nbsp; &nbsp; using a<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; new code -- is met with them.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; Well I clearly disagree.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; It is brain damaging to say the least.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; As I mentioned in our previous email, the velocities are<br>
&gt; &nbsp; &nbsp; supplied for<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; the Sobolev approximation. &nbsp;You can see the full discussion on the<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; public Grackle mailing list here:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; <a href="https://groups.google.com/forum/#!searchin/grackle-cooling-users/velocity/grackle-cooling-users/Dr77TM2te9g/225RNzoZADEJ" target="_blank">https://groups.google.com/forum/#!searchin/grackle-cooling-users/velocity/grackle-cooling-users/Dr77TM2te9g/225RNzoZADEJ</a><br>



&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; If chemistry_data is an external variable, this is a pain<br>
&gt; &nbsp; &nbsp; because this variable need to be declared in the main code.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; Same thing for code_units.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; The alternative is that it be a global defined in a different<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; namespace, loading in by the dlloader at runtime. &nbsp;Not sure that's<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; substantially different.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; Well I think this should be completely hidden to the user.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; This is a very substantial difference.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; Code units, if you want to convert to CGS, will just be 1.0<br>
&gt; &nbsp; &nbsp; for all of<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; them, which can be constant.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; Yes but you still have to create a code_unit type, and set the<br>
&gt; &nbsp; &nbsp; variable to 1.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; Unless you change the calling sequence.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; This is all too ENZO specifics.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; I'm not sure I believe that argument. &nbsp;Perhaps the names of the<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; variables share too much with Enzo naming schemes, but I think<br>
&gt; &nbsp; &nbsp; it's<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; rather intuitive to think of the 3D dataset as a base starting<br>
&gt; &nbsp; &nbsp; point<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; and then reducing overhead by supplying 1-dimensional arrays.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; For a purely local process like cooling and chemistry, the<br>
&gt; &nbsp; &nbsp; natural data type is 1D.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; Cells, particles and what not, could then be sent as a 1D array<br>
&gt; &nbsp; &nbsp; to the chemistry solver.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; 3D structures are relevant only for patch based codes.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt; -Matt<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; Romain<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt; On 19 Mar 2014, at 22:08, Matthew Turk &lt;<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a><br>
</div></div><div>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>&gt;&gt; wrote:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; Hi all,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; On Wed, Mar 19, 2014 at 4:58 PM, Romain Teyssier<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; &lt;<a href="mailto:romain.teyssier@gmail.com" target="_blank">romain.teyssier@gmail.com</a><br>
</div><div><div>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:romain.teyssier@gmail.com" target="_blank">romain.teyssier@gmail.com</a>&gt;&gt; wrote:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I totally agree with the 3 routines that need to be used.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Nothing else should be required on the code's side, except<br>
&gt; &nbsp; &nbsp; passing the required variables.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; grackle_init_run()<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;called once per simulation<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; The parameters that should be passed here are<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; - some cosmological model parameters<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; - UV background model (spectrum, reionization redshift...)<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; - starting redshift to compute the initial temperature and<br>
&gt; &nbsp; &nbsp; ionisation state<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; grackle_init_step(aexp,...)<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;called once per each time-step, uses the value of the scale<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;factor and other parameters as needed<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; In principle at this stage, only aexp is required for cosmo<br>
&gt; &nbsp; &nbsp; runs.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; For non cosmo runs, the cooling tables do not need to be<br>
&gt; &nbsp; &nbsp; modified.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; grackle_solve_chemistry(dt,den,tem,...)<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;called for each resolution element one or more times per one<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;global time-step, uses gas properties to update internal<br>
&gt; &nbsp; &nbsp; energy.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;Input gas properties may be required to have specific<br>
&gt; &nbsp; &nbsp; units and<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;be of specific data type. It should internally sense if it<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;runs within an OpenMP construct and support OpenMP<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;parallelization.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I would rather give the possibility of passing an array of<br>
&gt; &nbsp; &nbsp; cell.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Users could also set the array size to 1 to deal with cells<br>
&gt; &nbsp; &nbsp; one by one.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; The required information could be<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; nH, T or Tovermu or specific energy, metallicity in some<br>
&gt; &nbsp; &nbsp; units, dt_hydro, ncell<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; On output, Delta T or Delta Tovermu or Delta specific energy<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; I suggest we use fixed units (cgs or mks) for all input and<br>
&gt; &nbsp; &nbsp; output variables.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; These 3 routines are the only one that the user should care<br>
&gt; &nbsp; &nbsp; about.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; This is awfully similar to the existing API:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; <a href="https://bitbucket.org/brittonsmith/grackle/src/642cd133535a2dd3c57626b768c7c8c107096ac7/src/clib/grackle.h?at=default" target="_blank">https://bitbucket.org/brittonsmith/grackle/src/642cd133535a2dd3c57626b768c7c8c107096ac7/src/clib/grackle.h?at=default</a><br>



&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; The only necessary functions, according to<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; <a href="http://grackle.readthedocs.org/en/latest/Integration.html" target="_blank">http://grackle.readthedocs.org/en/latest/Integration.html</a> , are:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; initialize_chemistry_data<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; solve_chemistry or solve_chemistry for tabular data<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; Looking at the example (non-equilibrium) executable:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; <a href="https://bitbucket.org/brittonsmith/grackle/src/642cd133535a2dd3c57626b768c7c8c107096ac7/src/example/example.C?at=default" target="_blank">https://bitbucket.org/brittonsmith/grackle/src/642cd133535a2dd3c57626b768c7c8c107096ac7/src/example/example.C?at=default</a><br>



&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; those are the only *functional* routines. &nbsp;Everything else is to<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; provide additional information, *not* to actually do any<br>
&gt; &nbsp; &nbsp; computation.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; I think that we have actually met these standards. &nbsp;All of<br>
&gt; &nbsp; &nbsp; the units<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; are provided so as the *avoid* any boilerplate -- but if you<br>
&gt; &nbsp; &nbsp; want to<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; supply in CGS, you can set the input unit conversions to 1.0.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; To compute the equilibrium tables:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; <a href="https://bitbucket.org/brittonsmith/grackle/src/642cd133535a2dd3c57626b768c7c8c107096ac7/src/example/table_example.C?at=default" target="_blank">https://bitbucket.org/brittonsmith/grackle/src/642cd133535a2dd3c57626b768c7c8c107096ac7/src/example/table_example.C?at=default</a><br>



&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; it's even simpler. &nbsp;The only *active* routine is called on<br>
&gt; &nbsp; &nbsp; line 120,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; "solve_chemistry". &nbsp;I am genuinely being earnest when I ask,<br>
&gt; &nbsp; &nbsp; from the<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; .h file linked above, which arguments to the functions would<br>
&gt; &nbsp; &nbsp; you like<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; to see removed? &nbsp;I've included the full function signatures<br>
&gt; &nbsp; &nbsp; below. &nbsp;If<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; you want to get *out* various things, you can utilize the other<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; functions -- like the cooling time function and so on.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; -Matt<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; int initialize_chemistry_data(chemistry_data &amp;my_chemistry,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;code_units &amp;my_units, gr_float<br>
&gt; &nbsp; &nbsp; a_value);<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; int solve_chemistry(chemistry_data &amp;my_chemistry,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; code_units &amp;my_units,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; gr_float a_value, gr_float dt_value,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; gr_int grid_rank, gr_int *grid_dimension,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; gr_int *grid_start, gr_int *grid_end,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; gr_float *density, gr_float *internal_energy,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; gr_float *x_velocity, gr_float *y_velocity, gr_float<br>
&gt; &nbsp; &nbsp; *z_velocity,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; gr_float *HI_density, gr_float *HII_density, gr_float<br>
&gt; &nbsp; &nbsp; *HM_density,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; gr_float *HeI_density, gr_float *HeII_density, gr_float<br>
&gt; &nbsp; &nbsp; *HeIII_density,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; gr_float *H2I_density, gr_float *H2II_density,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; gr_float *DI_density, gr_float *DII_density, gr_float<br>
&gt; &nbsp; &nbsp; *HDI_density,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; gr_float *e_density, gr_float *metal_density);<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; int solve_chemistry(chemistry_data &amp;my_chemistry,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;code_units &amp;my_units,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gr_float a_value, gr_float dt_value,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gr_int grid_rank, gr_int *grid_dimension,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gr_int *grid_start, gr_int *grid_end,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gr_float *density, gr_float *internal_energy,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gr_float *x_velocity, gr_float *y_velocity,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; gr_float *z_velocity,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gr_float *metal_density);<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Cheers,<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Romain<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; The API can also define its own data types with natutal<br>
&gt; &nbsp; &nbsp; conversion from<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; standard types, for example the following code should be<br>
&gt; &nbsp; &nbsp; valid:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; float f;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; double d;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; gr_float gr_f;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; gr_f = f;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; gr_f = d;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; An analogous API should be provided for F77.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Then in a code the API will be implemented as follows:<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Begin_code<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;grackle_init_run()<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;Loop_over_timesteps(aexp)<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;grackle_init_step(aexp,...)<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; #pragma omp parallel loop<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;Loop_over_resolution_elements(elem)<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;{<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gr_float dt = code_time_step*time_unit;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gr_float den = code_density(elem)*den_unit;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; gr_float tem = code_temperature(elem)*tem_unit;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; grackle_solve_chemistry(dt,den,tem,...)<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp; &nbsp; &nbsp;}<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; &nbsp;End_loop<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; End_code<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Let's converge on the API, and then the Grackle team will<br>
&gt; &nbsp; &nbsp; be able to<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; write a couple of wrappers that will suit everyone.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Given the wrappers, if Grackle is installed as an external<br>
&gt; &nbsp; &nbsp; library and<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; provides a proper Linus-style installer (that will handle<br>
&gt; &nbsp; &nbsp; all HDF5 and<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; other dependencies), then it should be trivial to<br>
&gt; &nbsp; &nbsp; integrate it in any code.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Nick<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; To unsubscribe from this group and stop receiving emails<br>
&gt; &nbsp; &nbsp; from it, send an email to <a href="mailto:santacruzgalaxy-list%2Bunsubscribe@ucsc.edu" target="_blank">santacruzgalaxy-list+unsubscribe@ucsc.edu</a><br>
</div></div>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:santacruzgalaxy-list%252Bunsubscribe@ucsc.edu" target="_blank">santacruzgalaxy-list%2Bunsubscribe@ucsc.edu</a>&gt;.<br>
<div>&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; santacruzgalaxy-list mailing list<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:santacruzgalaxy-list@ucsc.edu" target="_blank">santacruzgalaxy-list@ucsc.edu</a><br>
</div>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:santacruzgalaxy-list@ucsc.edu" target="_blank">santacruzgalaxy-list@ucsc.edu</a>&gt;<br>
<div>&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="https://lists.ucsc.edu/mailman/listinfo/santacruzgalaxy-list" target="_blank">https://lists.ucsc.edu/mailman/listinfo/santacruzgalaxy-list</a><br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; --<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; You received this message because you are subscribed to the<br>
&gt; &nbsp; &nbsp; Google Groups "Grackle Cooling Library Users" group.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; To unsubscribe from this group and stop receiving emails<br>
&gt; &nbsp; &nbsp; from it, send an email to<br>
&gt; &nbsp; &nbsp; <a href="mailto:grackle-cooling-users%2Bunsubscribe@googlegroups.com" target="_blank">grackle-cooling-users+unsubscribe@googlegroups.com</a><br>
</div>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:grackle-cooling-users%252Bunsubscribe@googlegroups.com" target="_blank">grackle-cooling-users%2Bunsubscribe@googlegroups.com</a>&gt;.<br>
<div>&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;&gt;&gt;&gt;&gt; For more options, visit <a href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/optout</a>.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; To unsubscribe from this group and stop receiving emails from<br>
&gt; &nbsp; &nbsp; it, send an email to <a href="mailto:santacruzgalaxy-list%2Bunsubscribe@ucsc.edu" target="_blank">santacruzgalaxy-list+unsubscribe@ucsc.edu</a><br>
</div>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:santacruzgalaxy-list%252Bunsubscribe@ucsc.edu" target="_blank">santacruzgalaxy-list%2Bunsubscribe@ucsc.edu</a>&gt;.<br>
<div>&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; _______________________________________________<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; santacruzgalaxy-list mailing list<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; <a href="mailto:santacruzgalaxy-list@ucsc.edu" target="_blank">santacruzgalaxy-list@ucsc.edu</a><br>
</div>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:santacruzgalaxy-list@ucsc.edu" target="_blank">santacruzgalaxy-list@ucsc.edu</a>&gt;<br>
<div>&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;&gt; <a href="https://lists.ucsc.edu/mailman/listinfo/santacruzgalaxy-list" target="_blank">https://lists.ucsc.edu/mailman/listinfo/santacruzgalaxy-list</a><br>
&gt; &nbsp; &nbsp; &nbsp;&gt;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt;<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; --<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; You received this message because you are subscribed to the<br>
&gt; &nbsp; &nbsp; Google Groups "Grackle Cooling Library Users" group.<br>
&gt; &nbsp; &nbsp; &nbsp;&gt; To unsubscribe from this group and stop receiving emails from it,<br>
&gt; &nbsp; &nbsp; send an email to <a href="mailto:grackle-cooling-users%2Bunsubscribe@googlegroups.com" target="_blank">grackle-cooling-users+unsubscribe@googlegroups.com</a><br>
</div>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:grackle-cooling-users%252Bunsubscribe@googlegroups.com" target="_blank">grackle-cooling-users%2Bunsubscribe@googlegroups.com</a>&gt;.<br>
<div>&gt; &nbsp; &nbsp; &nbsp;&gt; For more options, visit <a href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/optout</a>.<br>
&gt;<br>
&gt; &nbsp; &nbsp; --<br>
&gt; &nbsp; &nbsp; You received this message because you are subscribed to the Google<br>
&gt; &nbsp; &nbsp; Groups "Grackle Cooling Library Users" group.<br>
&gt; &nbsp; &nbsp; To unsubscribe from this group and stop receiving emails from it,<br>
&gt; &nbsp; &nbsp; send an email to <a href="mailto:grackle-cooling-users%2Bunsubscribe@googlegroups.com" target="_blank">grackle-cooling-users+unsubscribe@googlegroups.com</a><br>
</div>&gt; &nbsp; &nbsp; &lt;mailto:<a href="mailto:grackle-cooling-users%252Bunsubscribe@googlegroups.com" target="_blank">grackle-cooling-users%2Bunsubscribe@googlegroups.com</a>&gt;.<br>
<div>&gt; &nbsp; &nbsp; For more options, visit <a href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/optout</a>.<br>
&gt;<br>
&gt;<br>
&gt; To unsubscribe from this group and stop receiving emails from it, send<br>
&gt; an email to <a href="mailto:santacruzgalaxy-list%2Bunsubscribe@ucsc.edu" target="_blank">santacruzgalaxy-list+unsubscribe@ucsc.edu</a><br>
</div>&gt; &lt;mailto:<a href="mailto:santacruzgalaxy-list%2Bunsubscribe@ucsc.edu" target="_blank">santacruzgalaxy-list+unsubscribe@ucsc.edu</a>&gt;.<br>
<div><div>_______________________________________________<br>
santacruzgalaxy-list mailing list<br>
<a href="mailto:santacruzgalaxy-list@ucsc.edu" target="_blank">santacruzgalaxy-list@ucsc.edu</a><br>
<a href="https://lists.ucsc.edu/mailman/listinfo/santacruzgalaxy-list" target="_blank">https://lists.ucsc.edu/mailman/listinfo/santacruzgalaxy-list</a><br>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
santacruzgalaxy-list mailing list<br>
<a href="mailto:santacruzgalaxy-list@ucsc.edu">santacruzgalaxy-list@ucsc.edu</a><br>
<a href="https://lists.ucsc.edu/mailman/listinfo/santacruzgalaxy-list" target="_blank">https://lists.ucsc.edu/mailman/listinfo/santacruzgalaxy-list</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>santacruzgalaxy-list mailing list<br><a href="mailto:santacruzgalaxy-list@ucsc.edu">santacruzgalaxy-list@ucsc.edu</a><br>https://lists.ucsc.edu/mailman/listinfo/santacruzgalaxy-list<br></blockquote></div><br></div></body></html>