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
WRAGH (and triggers a consistency check on the EOS parameters) sees the correct values.