aboutsummaryrefslogtreecommitdiff
path: root/src/nuc_eos/eosmodule.F90
diff options
context:
space:
mode:
Diffstat (limited to 'src/nuc_eos/eosmodule.F90')
-rw-r--r--src/nuc_eos/eosmodule.F9046
1 files changed, 46 insertions, 0 deletions
diff --git a/src/nuc_eos/eosmodule.F90 b/src/nuc_eos/eosmodule.F90
index ed5e7c6..9290c99 100644
--- a/src/nuc_eos/eosmodule.F90
+++ b/src/nuc_eos/eosmodule.F90
@@ -1,3 +1,8 @@
+#include "cctk.h"
+#include "cctk_Parameters.h"
+#include "cctk_Arguments.h"
+#include "cctk_Functions.h"
+
module eosmodule
implicit none
@@ -58,3 +63,44 @@
end module eosmodule
+
+! This function is called from within readtable.c
+! It copies the values of the arrays given as parameters into arrays
+! of the eos module, until I can find out how I can use those arrays
+! directly.
+subroutine allocate_eosmodule(nrho_, ntemp_, nye_, alltables_, logrho_, logtemp_, ye_, energy_shift_)
+ use eosmodule
+ CCTK_INT :: nrho_, ntemp_, nye_
+ CCTK_REAL :: alltables_(nrho_, ntemp_, nye_, 19)
+ CCTK_REAL :: logrho_(nrho_)
+ CCTK_REAL :: logtemp_(ntemp_)
+ CCTK_REAL :: ye_(nye_)
+ CCTK_REAL :: energy_shift_
+
+ nrho = nrho_
+ ntemp = ntemp_
+ nye = nye_
+
+ allocate(alltables(nrho,ntemp,nye,nvars))
+ allocate(logrho(nrho))
+ allocate(logtemp(ntemp))
+ allocate(ye(nye))
+ alltables = alltables_
+ logrho = logrho_
+ logtemp = logtemp_
+ ye = ye_
+
+ energy_shift = energy_shift_
+
+ ! set min-max values:
+ eos_rhomin = 10.0d0**logrho(1)
+ eos_rhomax = 10.0d0**logrho(nrho)
+
+ eos_yemin = ye(1)
+ eos_yemax = ye(nye)
+
+ eos_tempmin = 10.0d0**logtemp(1)
+ eos_tempmax = 10.0d0**logtemp(ntemp)
+
+end subroutine allocate_eosmodule
+