<html>#2438: EOS_Omni's hybrid EOS fallback is setting parameters incorrectly
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Roland Haas</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td></td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>major</td></tr>
<tr><td style='text-align:right'>Component:</td><td>EinsteinToolkit thorn</td></tr>
</table>

<p>In git hash <a data-is-external-link="true" href="https://bitbucket.org/einsteintoolkit/einsteineos/commits/b2c251c63f67a8bcfab7098eda3b6b5dedc93a74" rel="nofollow">b2c251c</a> "Merged in PARMA (pull request #2)" of <a data-is-external-link="true" href="https://bitbucket.org/einsteintoolkit/einsteineos" rel="nofollow">einsteineos</a> EOS_Omni gained the ability to handle piece-polytropic EOS with a thermal part.</p>
<p>However there are a number of issues with this:</p>
<ul>
<li>it directly modifies the parameter variables when attempting to implement a backwards compatible set of parameter choices for the original “hybrid” EOS. However these parameter variables are to be treated read-only (they are explicitly const in C but Fortran does not allow this) since (in Fortran) they refer to the actual COMMON section that holds the values. </li>
<li>the fallback logic is incorrect and will not correctly set the second “K” value since the first one is only set to the correct value until after the  the following Ks have been computed with an incorrect first K value</li>
</ul>
<p>Pull request <a data-is-external-link="true" href="https://bitbucket.org/einsteintoolkit/einsteineos/pull-requests/8/do-not-modify-parameter-variables" rel="nofollow">https://bitbucket.org/einsteintoolkit/einsteineos/pull-requests/8/do-not-modify-parameter-variables</a> fixes this by introducing Fortran module variables to hold the EOS parameters and moving the initialization to the correct location. It also initializes the module in <code>CCTK_STARTUP</code> rather than <code>WRAGH</code> so that the module is set up early and code that calls <code>EOS_Omni_GetHandle</code> before <code>WRAGH</code> (and triggers a consistency check on the EOS parameters) sees the correct values.</p>
<p>‌</p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2438/eos_omnis-hybrid-eos-fallback-is-setting'>https://bitbucket.org/einsteintoolkit/tickets/issues/2438/eos_omnis-hybrid-eos-fallback-is-setting</a></p>
</html>