<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="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&#39;s why it is important to converge on the API first.<br>
<div class=""><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&#39;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.  Since we have heard from so few regarding a new API,<br>
&gt; it doesn&#39;t seem that many people really want it.  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.  I heard a wise man once say, &quot;You can&#39;t always get what you want,<br>
&gt; but if you try sometimes, well you might find you get what you need.&quot;<br>
&gt;<br>
&gt; We&#39;ve heard from Ken Nagamine and Junhwan Choi on behalf of the Gadget<br>
&gt; group.  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.  Sam Leitner has told me that ART is now finished.  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 class="">&gt; implementing the Grackle into a purely fortran code, like Ramses.  Is<br>
&gt; that correct?  If so, let&#39;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 class="h5">&gt; &lt;<a href="mailto:choi.junhwan@gmail.com">choi.junhwan@gmail.com</a> &lt;mailto:<a href="mailto:choi.junhwan@gmail.com">choi.junhwan@gmail.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Hi Romain,<br>
&gt;<br>
&gt;     For me, it took about two weeks to make it works.<br>
&gt;     But, I spend considerable time to find a way to pass the system unit<br>
&gt;     to grackle properly.<br>
&gt;     There are a few outstanding issues on this adjustment.<br>
&gt;<br>
&gt;     1.  Grackle use C++ and wrap the FORTRAN cooling routine. It is not<br>
&gt;     trivial to call this C++ wrapped the FORTRAN but there is example in<br>
&gt;     the grackle example directory.<br>
&gt;<br>
&gt;     2. In the gadget case, I pass one particle by one particle to the<br>
&gt;     grackle in order to calculate the cooling. The reason is that the<br>
&gt;     gadget cooling and star formation routine is based on particle by<br>
&gt;     particle. Indeed, it is least efficient way but so far I have not<br>
&gt;     experienced significant slow down.<br>
&gt;     [If I use tabulated H and He cooling rates from grackle, it takes<br>
&gt;     almost the same time with the original gadget cooling.]<br>
&gt;<br>
&gt;<br>
&gt;     3. For unit adjustment, we can set as follow:<br>
&gt;     my_units.comoving_coordinates = 0;<br>
&gt;     my_units.density_units = udensity;<br>
&gt;     my_units.length_units = ulength;<br>
&gt;     my_units.time_units = utime;<br>
&gt;     my_units.a_units = 1.0;<br>
&gt;     [udensity, ulength, and utime is the conversion factor from system<br>
&gt;     physical units to cgs.]<br>
&gt;     In this case, you can pass the density, internal energy, and chemistry<br>
&gt;     value in system physical unit.<br>
&gt;<br>
&gt;     Besides these issues, the incorporating Grackle should not be very<br>
&gt;     difficult.<br>
&gt;<br>
&gt;     Best,<br>
&gt;     Junhwan<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;     On Thu, Mar 20, 2014 at 2:35 AM, Romain Teyssier<br>
</div></div><div class="">&gt;     &lt;<a href="mailto:romain.teyssier@gmail.com">romain.teyssier@gmail.com</a> &lt;mailto:<a href="mailto:romain.teyssier@gmail.com">romain.teyssier@gmail.com</a>&gt;&gt; wrote:<br>
&gt;      &gt; That&#39;s great.<br>
&gt;      &gt; A very important question: how long did it take him to succeed ?<br>
&gt;      &gt; Since in my opinion, many &quot;adjustments&quot; need to be done, I would<br>
&gt;     be curious to<br>
&gt;      &gt; have an estimate on the time required that have this working.<br>
&gt;      &gt;<br>
&gt;      &gt; Cheers,<br>
&gt;      &gt; Romain<br>
&gt;      &gt;<br>
&gt;      &gt; On 20 Mar 2014, at 00:33, Ken Nagamine &lt;<a href="mailto:kn@physics.unlv.edu">kn@physics.unlv.edu</a><br>
</div><div class="">&gt;     &lt;mailto:<a href="mailto:kn@physics.unlv.edu">kn@physics.unlv.edu</a>&gt;&gt; wrote:<br>
&gt;      &gt;<br>
&gt;      &gt;&gt; Dear all,<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; Let me just mention that, on the SPH side, Junhwan Choi has<br>
&gt;     already succeeded in<br>
&gt;      &gt;&gt; implementing the Grackle package into Gadget3-UNLV version.<br>
&gt;      &gt;&gt; We still need to do more checks, but at least the phase diagram<br>
&gt;      &gt;&gt; looks reasonable compared to the previous TREECOOL table<br>
&gt;     implementation of original Gadget.<br>
&gt;      &gt;&gt; Junhwan can explain the details of his implementation method if<br>
&gt;     it can be of help for this discussion.<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; cheers,<br>
&gt;      &gt;&gt; Ken<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt; On Mar 20, 2014, at 6:44 AM, Romain Teyssier wrote:<br>
&gt;      &gt;&gt;<br>
&gt;      &gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt; On 19 Mar 2014, at 22:35, Matthew Turk &lt;<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a><br>
</div><div class="">&gt;     &lt;mailto:<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>&gt;&gt; wrote:<br>
&gt;      &gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt; On Wed, Mar 19, 2014 at 5:26 PM, Romain Teyssier<br>
</div>&gt;      &gt;&gt;&gt;&gt; &lt;<a href="mailto:romain.teyssier@gmail.com">romain.teyssier@gmail.com</a> &lt;mailto:<a href="mailto:romain.teyssier@gmail.com">romain.teyssier@gmail.com</a>&gt;&gt;<br>
<div><div class="h5">&gt;     wrote:<br>
&gt;      &gt;&gt;&gt;&gt;&gt; Hi Matt,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt; For example:<br>
&gt;      &gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt; int solve_chemistry(chemistry_data &amp;my_chemistry,  ???<br>
&gt;      &gt;&gt;&gt;&gt;&gt;                   code_units &amp;my_units, OK set to 1<br>
&gt;      &gt;&gt;&gt;&gt;&gt;                   gr_float a_value, gr_float dt_value, why a ?<br>
&gt;      &gt;&gt;&gt;&gt;&gt;                   gr_int grid_rank, gr_int *grid_dimension, ????<br>
&gt;      &gt;&gt;&gt;&gt;&gt;                   gr_int *grid_start, gr_int *grid_end, ????<br>
&gt;      &gt;&gt;&gt;&gt;&gt;                   gr_float *density, gr_float<br>
&gt;     *internal_energy, OK<br>
&gt;      &gt;&gt;&gt;&gt;&gt;                   gr_float *x_velocity, gr_float *y_velocity,<br>
&gt;     gr_float *z_velocity, ???<br>
&gt;      &gt;&gt;&gt;&gt;&gt;                   gr_float *HI_density, gr_float<br>
&gt;     *HII_density, gr_float *HM_density, too much<br>
&gt;      &gt;&gt;&gt;&gt;&gt;                   gr_float *HeI_density, gr_float<br>
&gt;     *HeII_density, gr_float *HeIII_density, too much<br>
&gt;      &gt;&gt;&gt;&gt;&gt;                   gr_float *H2I_density, gr_float<br>
&gt;     *H2II_density, too much<br>
&gt;      &gt;&gt;&gt;&gt;&gt;                   gr_float *DI_density, gr_float<br>
&gt;     *DII_density, gr_float *HDI_density, too much<br>
&gt;      &gt;&gt;&gt;&gt;&gt;                   gr_float *e_density, gr_float<br>
&gt;     *metal_density); OK<br>
&gt;      &gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt; What are the *grid related variables ?<br>
&gt;      &gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt; Good question!  These, like the code units variables, are<br>
&gt;     designed to<br>
&gt;      &gt;&gt;&gt;&gt; minimize the overhead of any simulation that wants to put its code<br>
&gt;      &gt;&gt;&gt;&gt; into it.  For instance, if one had a patch/block-based code (like<br>
&gt;      &gt;&gt;&gt;&gt; Enzo, FLASH, Nyx, etc) or an Octree code where the 2x2x2 zones<br>
&gt;     were<br>
&gt;      &gt;&gt;&gt;&gt; included in (2+2*NGZ, 2+2*NGZ, 2+2*NGZ) blocks and one didn&#39;t<br>
&gt;     want to<br>
&gt;      &gt;&gt;&gt;&gt; spend time solving the ghost zones, they can be masked out.<br>
&gt;       These are<br>
&gt;      &gt;&gt;&gt;&gt; the variables:<br>
&gt;      &gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt; grid_start =&gt; array of size (grid_rank) indicating the indices to<br>
&gt;      &gt;&gt;&gt;&gt; start at in each rank of dimensionality<br>
&gt;      &gt;&gt;&gt;&gt; grid_end =&gt; array of size (grid_rank) indicating the indices<br>
&gt;     to *end*<br>
&gt;      &gt;&gt;&gt;&gt; at in each rank of dimensionality<br>
&gt;      &gt;&gt;&gt;&gt; grid_dimension =&gt; size of the block of data in each dimension<br>
&gt;      &gt;&gt;&gt;&gt; grid_rank =&gt; dimensionality; if you&#39;re supplying a pencil<br>
&gt;     beam, this would be 1.<br>
&gt;      &gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt; While these typically are better for block or patch based<br>
&gt;     solvers, I<br>
&gt;      &gt;&gt;&gt;&gt; think that the primary goal -- *minimizing* the overhead to<br>
&gt;     using a<br>
&gt;      &gt;&gt;&gt;&gt; new code -- is met with them.<br>
&gt;      &gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt; Well I clearly disagree.<br>
&gt;      &gt;&gt;&gt; It is brain damaging to say the least.<br>
&gt;      &gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt; As I mentioned in our previous email, the velocities are<br>
&gt;     supplied for<br>
&gt;      &gt;&gt;&gt;&gt; the Sobolev approximation.  You can see the full discussion on the<br>
&gt;      &gt;&gt;&gt;&gt; public Grackle mailing list here:<br>
&gt;      &gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;<br>
&gt;     <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;      &gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt; If chemistry_data is an external variable, this is a pain<br>
&gt;     because this variable need to be declared in the main code.<br>
&gt;      &gt;&gt;&gt;&gt;&gt; Same thing for code_units.<br>
&gt;      &gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt; The alternative is that it be a global defined in a different<br>
&gt;      &gt;&gt;&gt;&gt; namespace, loading in by the dlloader at runtime.  Not sure that&#39;s<br>
&gt;      &gt;&gt;&gt;&gt; substantially different.<br>
&gt;      &gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt; Well I think this should be completely hidden to the user.<br>
&gt;      &gt;&gt;&gt; This is a very substantial difference.<br>
&gt;      &gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt; Code units, if you want to convert to CGS, will just be 1.0<br>
&gt;     for all of<br>
&gt;      &gt;&gt;&gt;&gt; them, which can be constant.<br>
&gt;      &gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt; Yes but you still have to create a code_unit type, and set the<br>
&gt;     variable to 1.<br>
&gt;      &gt;&gt;&gt; Unless you change the calling sequence.<br>
&gt;      &gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt; This is all too ENZO specifics.<br>
&gt;      &gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt; I&#39;m not sure I believe that argument.  Perhaps the names of the<br>
&gt;      &gt;&gt;&gt;&gt; variables share too much with Enzo naming schemes, but I think<br>
&gt;     it&#39;s<br>
&gt;      &gt;&gt;&gt;&gt; rather intuitive to think of the 3D dataset as a base starting<br>
&gt;     point<br>
&gt;      &gt;&gt;&gt;&gt; and then reducing overhead by supplying 1-dimensional arrays.<br>
&gt;      &gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt; For a purely local process like cooling and chemistry, the<br>
&gt;     natural data type is 1D.<br>
&gt;      &gt;&gt;&gt; Cells, particles and what not, could then be sent as a 1D array<br>
&gt;     to the chemistry solver.<br>
&gt;      &gt;&gt;&gt; 3D structures are relevant only for patch based codes.<br>
&gt;      &gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt; -Matt<br>
&gt;      &gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt; Romain<br>
&gt;      &gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt; On 19 Mar 2014, at 22:08, Matthew Turk &lt;<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a><br>
</div></div><div class="">&gt;     &lt;mailto:<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>&gt;&gt; wrote:<br>
&gt;      &gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; Hi all,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; On Wed, Mar 19, 2014 at 4:58 PM, Romain Teyssier<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; &lt;<a href="mailto:romain.teyssier@gmail.com">romain.teyssier@gmail.com</a><br>
</div><div><div class="h5">&gt;     &lt;mailto:<a href="mailto:romain.teyssier@gmail.com">romain.teyssier@gmail.com</a>&gt;&gt; wrote:<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; I totally agree with the 3 routines that need to be used.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; Nothing else should be required on the code&#39;s side, except<br>
&gt;     passing the required variables.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; grackle_init_run()<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;  called once per simulation<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; The parameters that should be passed here are<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; - some cosmological model parameters<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; - UV background model (spectrum, reionization redshift...)<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; - starting redshift to compute the initial temperature and<br>
&gt;     ionisation state<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; grackle_init_step(aexp,...)<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;  called once per each time-step, uses the value of the scale<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;  factor and other parameters as needed<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; In principle at this stage, only aexp is required for cosmo<br>
&gt;     runs.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; For non cosmo runs, the cooling tables do not need to be<br>
&gt;     modified.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; grackle_solve_chemistry(dt,den,tem,...)<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;  called for each resolution element one or more times per one<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;  global time-step, uses gas properties to update internal<br>
&gt;     energy.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;  Input gas properties may be required to have specific<br>
&gt;     units and<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;  be of specific data type. It should internally sense if it<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;  runs within an OpenMP construct and support OpenMP<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;  parallelization.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; I would rather give the possibility of passing an array of<br>
&gt;     cell.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; Users could also set the array size to 1 to deal with cells<br>
&gt;     one by one.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; The required information could be<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; nH, T or Tovermu or specific energy, metallicity in some<br>
&gt;     units, dt_hydro, ncell<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; On output, Delta T or Delta Tovermu or Delta specific energy<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; I suggest we use fixed units (cgs or mks) for all input and<br>
&gt;     output variables.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; These 3 routines are the only one that the user should care<br>
&gt;     about.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; This is awfully similar to the existing API:<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;     <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;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; The only necessary functions, according to<br>
&gt;      &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;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; initialize_chemistry_data<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; solve_chemistry or solve_chemistry for tabular data<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; Looking at the example (non-equilibrium) executable:<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;     <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;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; those are the only *functional* routines.  Everything else is to<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; provide additional information, *not* to actually do any<br>
&gt;     computation.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; I think that we have actually met these standards.  All of<br>
&gt;     the units<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; are provided so as the *avoid* any boilerplate -- but if you<br>
&gt;     want to<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; supply in CGS, you can set the input unit conversions to 1.0.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; To compute the equilibrium tables:<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;     <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;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; it&#39;s even simpler.  The only *active* routine is called on<br>
&gt;     line 120,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; &quot;solve_chemistry&quot;.  I am genuinely being earnest when I ask,<br>
&gt;     from the<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; .h file linked above, which arguments to the functions would<br>
&gt;     you like<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; to see removed?  I&#39;ve included the full function signatures<br>
&gt;     below.  If<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; you want to get *out* various things, you can utilize the other<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; functions -- like the cooling time function and so on.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; -Matt<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; int initialize_chemistry_data(chemistry_data &amp;my_chemistry,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;                            code_units &amp;my_units, gr_float<br>
&gt;     a_value);<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; int solve_chemistry(chemistry_data &amp;my_chemistry,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; code_units &amp;my_units,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; gr_float a_value, gr_float dt_value,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; gr_int grid_rank, gr_int *grid_dimension,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; gr_int *grid_start, gr_int *grid_end,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; gr_float *density, gr_float *internal_energy,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; gr_float *x_velocity, gr_float *y_velocity, gr_float<br>
&gt;     *z_velocity,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; gr_float *HI_density, gr_float *HII_density, gr_float<br>
&gt;     *HM_density,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; gr_float *HeI_density, gr_float *HeII_density, gr_float<br>
&gt;     *HeIII_density,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; gr_float *H2I_density, gr_float *H2II_density,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; gr_float *DI_density, gr_float *DII_density, gr_float<br>
&gt;     *HDI_density,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; gr_float *e_density, gr_float *metal_density);<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; int solve_chemistry(chemistry_data &amp;my_chemistry,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;                  code_units &amp;my_units,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;                  gr_float a_value, gr_float dt_value,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;                  gr_int grid_rank, gr_int *grid_dimension,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;                  gr_int *grid_start, gr_int *grid_end,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;                  gr_float *density, gr_float *internal_energy,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;                  gr_float *x_velocity, gr_float *y_velocity,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt; gr_float *z_velocity,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;                  gr_float *metal_density);<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; Cheers,<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; Romain<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; The API can also define its own data types with natutal<br>
&gt;     conversion from<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; standard types, for example the following code should be<br>
&gt;     valid:<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; float f;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; double d;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; gr_float gr_f;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; gr_f = f;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; gr_f = d;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; An analogous API should be provided for F77.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Then in a code the API will be implemented as follows:<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Begin_code<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;  grackle_init_run()<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;  Loop_over_timesteps(aexp)<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;      grackle_init_step(aexp,...)<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; #pragma omp parallel loop<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;      Loop_over_resolution_elements(elem)<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;      {<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;           gr_float dt = code_time_step*time_unit;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;           gr_float den = code_density(elem)*den_unit;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;           gr_float tem = code_temperature(elem)*tem_unit;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;           grackle_solve_chemistry(dt,den,tem,...)<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;      }<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;  End_loop<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; End_code<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Let&#39;s converge on the API, and then the Grackle team will<br>
&gt;     be able to<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; write a couple of wrappers that will suit everyone.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Given the wrappers, if Grackle is installed as an external<br>
&gt;     library and<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; provides a proper Linus-style installer (that will handle<br>
&gt;     all HDF5 and<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; other dependencies), then it should be trivial to<br>
&gt;     integrate it in any code.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Nick<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; To unsubscribe from this group and stop receiving emails<br>
&gt;     from it, send an email to <a href="mailto:santacruzgalaxy-list%2Bunsubscribe@ucsc.edu">santacruzgalaxy-list+unsubscribe@ucsc.edu</a><br>
</div></div>&gt;     &lt;mailto:<a href="mailto:santacruzgalaxy-list%252Bunsubscribe@ucsc.edu">santacruzgalaxy-list%2Bunsubscribe@ucsc.edu</a>&gt;.<br>
<div class="">&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; santacruzgalaxy-list mailing list<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href="mailto:santacruzgalaxy-list@ucsc.edu">santacruzgalaxy-list@ucsc.edu</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:santacruzgalaxy-list@ucsc.edu">santacruzgalaxy-list@ucsc.edu</a>&gt;<br>
<div class="">&gt;      &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;      &gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; --<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; You received this message because you are subscribed to the<br>
&gt;     Google Groups &quot;Grackle Cooling Library Users&quot; group.<br>
&gt;      &gt;&gt;&gt;&gt;&gt;&gt;&gt; To unsubscribe from this group and stop receiving emails<br>
&gt;     from it, send an email to<br>
&gt;     <a href="mailto:grackle-cooling-users%2Bunsubscribe@googlegroups.com">grackle-cooling-users+unsubscribe@googlegroups.com</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:grackle-cooling-users%252Bunsubscribe@googlegroups.com">grackle-cooling-users%2Bunsubscribe@googlegroups.com</a>&gt;.<br>
<div class="">&gt;      &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;      &gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt;<br>
&gt;      &gt;&gt;&gt; To unsubscribe from this group and stop receiving emails from<br>
&gt;     it, send an email to <a href="mailto:santacruzgalaxy-list%2Bunsubscribe@ucsc.edu">santacruzgalaxy-list+unsubscribe@ucsc.edu</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:santacruzgalaxy-list%252Bunsubscribe@ucsc.edu">santacruzgalaxy-list%2Bunsubscribe@ucsc.edu</a>&gt;.<br>
<div class="">&gt;      &gt;&gt;&gt; _______________________________________________<br>
&gt;      &gt;&gt;&gt; santacruzgalaxy-list mailing list<br>
&gt;      &gt;&gt;&gt; <a href="mailto:santacruzgalaxy-list@ucsc.edu">santacruzgalaxy-list@ucsc.edu</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:santacruzgalaxy-list@ucsc.edu">santacruzgalaxy-list@ucsc.edu</a>&gt;<br>
<div class="">&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;      &gt;&gt;<br>
&gt;      &gt;<br>
&gt;      &gt; --<br>
&gt;      &gt; You received this message because you are subscribed to the<br>
&gt;     Google Groups &quot;Grackle Cooling Library Users&quot; group.<br>
&gt;      &gt; To unsubscribe from this group and stop receiving emails from it,<br>
&gt;     send an email to <a href="mailto:grackle-cooling-users%2Bunsubscribe@googlegroups.com">grackle-cooling-users+unsubscribe@googlegroups.com</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:grackle-cooling-users%252Bunsubscribe@googlegroups.com">grackle-cooling-users%2Bunsubscribe@googlegroups.com</a>&gt;.<br>
<div class="">&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;<br>
&gt;     --<br>
&gt;     You received this message because you are subscribed to the Google<br>
&gt;     Groups &quot;Grackle Cooling Library Users&quot; group.<br>
&gt;     To unsubscribe from this group and stop receiving emails from it,<br>
&gt;     send an email to <a href="mailto:grackle-cooling-users%2Bunsubscribe@googlegroups.com">grackle-cooling-users+unsubscribe@googlegroups.com</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:grackle-cooling-users%252Bunsubscribe@googlegroups.com">grackle-cooling-users%2Bunsubscribe@googlegroups.com</a>&gt;.<br>
<div class="">&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;<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">santacruzgalaxy-list+unsubscribe@ucsc.edu</a><br>
</div>&gt; &lt;mailto:<a href="mailto:santacruzgalaxy-list%2Bunsubscribe@ucsc.edu">santacruzgalaxy-list+unsubscribe@ucsc.edu</a>&gt;.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br></div>