diff options
Diffstat (limited to 'src/nuc_eos/eosmodule.F90')
-rw-r--r-- | src/nuc_eos/eosmodule.F90 | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/src/nuc_eos/eosmodule.F90 b/src/nuc_eos/eosmodule.F90 index 4a3e156..7ac049c 100644 --- a/src/nuc_eos/eosmodule.F90 +++ b/src/nuc_eos/eosmodule.F90 @@ -24,7 +24,7 @@ ! basics integer, parameter :: nvars = 19 - real*8,allocatable :: alltables(:,:,:,:) + real*8,pointer :: alltables(:,:,:,:) ! index variable mapping: ! 1 -> logpress ! 2 -> logenergy @@ -46,9 +46,9 @@ ! 18 -> zbar ! 19 -> gamma - real*8,allocatable,save :: logrho(:) - real*8,allocatable,save :: logtemp(:) - real*8,allocatable,save :: ye(:) + real*8,pointer :: logrho(:) + real*8,pointer :: logtemp(:) + real*8,pointer :: ye(:) ! constants real*8,save :: mev_to_erg = 1.60217733d-6 @@ -65,33 +65,27 @@ 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_) +! It creates pointers to the arrays given as parameters into arrays +! of the eos module. +subroutine setup_eosmodule(nrho_, ntemp_, nye_, alltables_, logrho_, logtemp_, ye_, energy_shift_) use eosmodule DECLARE_CCTK_PARAMETERS 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, TARGET :: alltables_(nrho_, ntemp_, nye_, 19) + CCTK_REAL, TARGET :: logrho_(nrho_) + CCTK_REAL, TARGET :: logtemp_(ntemp_) + CCTK_REAL, TARGET :: 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_ + alltables => alltables_ + logrho => logrho_ + logtemp => logtemp_ + ye => ye_ energy_shift = energy_shift_ @@ -109,5 +103,5 @@ subroutine allocate_eosmodule(nrho_, ntemp_, nye_, alltables_, logrho_, logtemp_ eos_tempmin = 10.0d0**logtemp(1) eos_tempmax = 10.0d0**logtemp(ntemp) -end subroutine allocate_eosmodule +end subroutine setup_eosmodule |