EOS_Omni's hybrid EOS fallback is setting parameters incorrectly

Create issue
Issue #2438 open
Roland Haas created an issue

In git hash b2c251c "Merged in PARMA (pull request #2)" of einsteineos EOS_Omni gained the ability to handle piece-polytropic EOS with a thermal part.

However there are a number of issues with this:

  • 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.
  • 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

Pull request https://bitbucket.org/einsteintoolkit/einsteineos/pull-requests/8/do-not-modify-parameter-variables 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 CCTK_STARTUP rather than WRAGH so that the module is set up early and code that calls EOS_Omni_GetHandle before WRAGH (and triggers a consistency check on the EOS parameters) sees the correct values.

Comments (2)

  1. Log in to comment