aboutsummaryrefslogtreecommitdiff
path: root/src/EOS_Omni_MultiVarCalls.F90
diff options
context:
space:
mode:
Diffstat (limited to 'src/EOS_Omni_MultiVarCalls.F90')
-rw-r--r--src/EOS_Omni_MultiVarCalls.F90149
1 files changed, 92 insertions, 57 deletions
diff --git a/src/EOS_Omni_MultiVarCalls.F90 b/src/EOS_Omni_MultiVarCalls.F90
index 6c18831..a0042b7 100644
--- a/src/EOS_Omni_MultiVarCalls.F90
+++ b/src/EOS_Omni_MultiVarCalls.F90
@@ -41,48 +41,98 @@ subroutine EOS_Omni_EOS_short(eoskey,keytemp,rf_precision,npoints,&
real*8 :: xdedt,xdpderho,xdpdrhoe
if(eoskey.ne.4) then
+ write(warnstring,"(A8,i5)") "eoskey: ", eoskey
+ !$OMP CRITICAL
+ call CCTK_WARN(1,warnstring)
call CCTK_WARN(0,"EOS_Omni_EOS_short currently does not work for this eoskey")
+ !$OMP END CRITICAL
endif
anyerr = 0
keyerr(:) = 0
- do i=1,npoints
-
- xrho = rho(i) * inv_rho_gf
- xtemp = temp(i)
- xye = ye(i)
- xenr = eps(i) * inv_eps_gf
- xent = entropy(i)
- call nuc_eos_short(xrho,xtemp,xye,xenr,xprs,&
- xent,xcs2,xdedt,xdpderho,xdpdrhoe,xmunu,&
- keytemp,keyerr(i),rf_precision)
-
- if(keyerr(i).ne.0) then
- anyerr = 1
- endif
-
- if(keytemp.eq.1) then
- eps(i) = xenr * eps_gf
- else if(keytemp.eq.2) then
- eps(i) = xenr * eps_gf
- temp(i) = xtemp
- else
- temp(i) = xtemp
- endif
-
- press(i) = xprs * press_gf
- entropy(i) = xent
- cs2(i) = xcs2
- dedt(i) = xdedt * eps_gf
- dpderho(i) = xdpderho * press_gf * inv_eps_gf
- dpdrhoe(i) = xdpdrhoe * press_gf * inv_rho_gf
- munu(i) = xmunu
-
- enddo
+ if(keytemp.eq.1) then
+ call nuc_eos_m_kt1_short(npoints,rho,temp,ye,eps,press,&
+ entropy,cs2,dedt,dpderho,dpdrhoe,munu,keyerr,anyerr)
+ else if(keytemp.eq.0) then
+ call nuc_eos_m_kt0_short(npoints,rho,temp,ye,eps,press,&
+ entropy,cs2,dedt,dpderho,dpdrhoe,munu,rf_precision,&
+ keyerr,anyerr)
+ else if (keytemp.eq.2) then
+ call nuc_eos_m_kt2_short(npoints,rho,temp,ye,eps,press,&
+ entropy,cs2,dedt,dpderho,dpdrhoe,munu,rf_precision,&
+ keyerr,anyerr)
+ else
+ !$OMP CRITICAL
+ call CCTK_WARN(0,"This keytemp is not supported")
+ !$OMP END CRITICAL
+ endif
end subroutine EOS_Omni_EOS_short
+subroutine EOS_Omni_EOS_full(eoskey,keytemp,rf_precision,npoints,&
+ rho,eps,temp,ye,press,entropy,cs2,dedt,dpderho,dpdrhoe,&
+ xa,xh,xn,xp,abar,zbar,mue,mun,mup,muhat,keyerr,anyerr)
+
+ use EOS_Omni_Module
+ implicit none
+ DECLARE_CCTK_PARAMETERS
+
+ CCTK_INT, intent(in) :: eoskey,keytemp,npoints
+ CCTK_INT, intent(out) :: keyerr(npoints)
+ CCTK_INT, intent(out) :: anyerr
+ CCTK_REAL, intent(in) :: rf_precision
+ CCTK_REAL, intent(in) :: rho(npoints),ye(npoints)
+ CCTK_REAL, intent(inout) :: eps(npoints), temp(npoints)
+ CCTK_REAL, intent(out) :: press(npoints)
+ CCTK_REAL, intent(inout) :: entropy(npoints)
+ CCTK_REAL, intent(out) :: cs2(npoints)
+ CCTK_REAL, intent(out) :: dedt(npoints)
+ CCTK_REAL, intent(out) :: dpderho(npoints)
+ CCTK_REAL, intent(out) :: dpdrhoe(npoints)
+ CCTK_REAL, intent(out) :: xa(npoints)
+ CCTK_REAL, intent(out) :: xh(npoints)
+ CCTK_REAL, intent(out) :: xn(npoints)
+ CCTK_REAL, intent(out) :: xp(npoints)
+ CCTK_REAL, intent(out) :: abar(npoints)
+ CCTK_REAL, intent(out) :: zbar(npoints)
+ CCTK_REAL, intent(out) :: mue(npoints)
+ CCTK_REAL, intent(out) :: mun(npoints)
+ CCTK_REAL, intent(out) :: mup(npoints)
+ CCTK_REAL, intent(out) :: muhat(npoints)
+
+ ! local vars
+ integer :: i
+ character(256) :: warnstring
+
+ if(eoskey.ne.4) then
+ write(warnstring,"(A8,i5)") "eoskey: ", eoskey
+ !$OMP CRITICAL
+ call CCTK_WARN(1,warnstring)
+ call CCTK_WARN(0,"EOS_Omni_EOS_full currently does not work for this eoskey")
+ !$OMP END CRITICAL
+ endif
+
+ anyerr = 0
+ keyerr(:) = 0
+
+ if(keytemp.eq.1) then
+ call nuc_eos_m_kt1_full(npoints,rho,temp,ye,eps,press,&
+ entropy,cs2,dedt,dpderho,dpdrhoe,xa,xh,xn,xp,abar,zbar,&
+ mue,mun,mup,muhat,keyerr,anyerr)
+ else if(keytemp.eq.0) then
+ call nuc_eos_m_kt0_full(npoints,rho,temp,ye,eps,press,&
+ entropy,cs2,dedt,dpderho,dpdrhoe,xa,xh,xn,xp,abar,zbar,&
+ mue,mun,mup,muhat,rf_precision,&
+ keyerr,anyerr)
+ else
+ !$OMP CRITICAL
+ call CCTK_WARN(0,"This keytemp is not supported")
+ !$OMP END CRITICAL
+ endif
+
+end subroutine EOS_Omni_EOS_full
+
subroutine EOS_Omni_EOS_dpderho_dpdrhoe(eoskey,keytemp,rf_precision,npoints,&
rho,eps,temp,ye,dpderho,dpdrhoe,keyerr,anyerr)
@@ -173,28 +223,13 @@ subroutine EOS_Omni_EOS_dpderho_dpdrhoe(eoskey,keytemp,rf_precision,npoints,&
dpderho(i) = (hybrid_gamma_th - 1.0d0) * rho(i)
enddo
case (4)
- do i=1,npoints
- xrho = rho(i) * inv_rho_gf
- xtemp = temp(i)
- xye = ye(i)
- xenr = eps(i) * inv_eps_gf
- call nuc_eos_dpdr_dpde(xrho,xtemp,xye,xenr, &
- xdpderho, xdpdrhoe,&
- keytemp,keyerr(i),rf_precision)
-
- if(keyerr(i).ne.0) then
- anyerr = 1
- endif
-
- if(keytemp.eq.1) then
- eps(i) = xenr * eps_gf
- else
- temp(i) = xtemp
- endif
-
- dpdrhoe(i) = xdpdrhoe * press_gf * inv_rho_gf
- dpderho(i) = xdpderho * press_gf * inv_eps_gf
- enddo
+ if(keytemp.eq.1) then
+ call CCTK_WARN(0,"keytemp=1 not supported for dpdrhoe, dpderho")
+ else
+ call nuc_eos_m_kt0_dpdrhoe_dpderho(npoints,&
+ rho,temp,ye,eps,dpdrhoe,dpderho,rf_precision,&
+ keyerr,anyerr)
+ endif
case DEFAULT
write(warnstring,*) "eoskey ",eoskey," not implemented!"
call CCTK_WARN(0,warnstring)
@@ -203,8 +238,8 @@ subroutine EOS_Omni_EOS_dpderho_dpdrhoe(eoskey,keytemp,rf_precision,npoints,&
end subroutine EOS_Omni_EOS_dpderho_dpdrhoe
- subroutine EOS_Omni_EOS_DEpsByDRho_DEpsByDPress(eoskey,keytemp,rf_precision,npoints,&
- rho,eps,temp,ye,depsdrho,depsdpress,keyerr,anyerr)
+ subroutine EOS_Omni_EOS_DEpsByDRho_DEpsByDPress(eoskey,keytemp,rf_precision,&
+ npoints,rho,eps,temp,ye,depsdrho,depsdpress,keyerr,anyerr)
use EOS_Omni_Module
implicit none