- changed status to open
EOS_Omni's hybrid EOS fallback is setting parameters incorrectly
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 (5)
-
reporter -
reporter Please review.
-
reporter Unless objected I will push this after 2020-08-28.
-
reporter Applied as git hash 5991e40 "EOS_Omni: make error message a bit more intuitive" of einsteineos
-
reporter - changed status to resolved
- Log in to comment