I posted this in another thread regarding the PPF code, but it's from 2012 so it could be unnoticed, maybe more people are still having this issue:
Coming back to the PPF problem, while running with the option where you need to modify the equation of state in the function w_de(a) in equations_ppf.f90, this one seems to run fine with cosmomc, I am using April 2014 version. However, while trying to use the tabulated case, it gives the error that some of you describe "bad xa input splint ".
This error comes from the subroutine cubicsplint included in equations_ppf.f90. While trying to run the tabulated version in cosmomc, I added:
write((*,*) 'h, xa(khi), xa(klo)', h, xa(khi), xa(klo)
in cubicsplint, where the variables written are those involved with the crashing of the program. This in order to see if I seeing their values could help to understand what is going on.
Then, before cosmomc stops running it gives me that all these values are zero. That is, it seems like it's not even reading the file with the tabulated data.
Doing some tracing back, the clue seems to be in the function grho_de(a) in equations_ppf.f90. This function works for both cases, in the following way:
For the NOT tabulated case:
Code: Select all
if(.not. use_tabulated_w) then
grho_de=grhov*a**(1._dl-3.*w_lam-3.*wa_ppf)*exp(-3.*wa_ppf*(1._dl-a))
For the tabulated case:
Code: Select all
else
if(a.eq.0.d0)then
grho_de=0.d0 !assume rho_de*a^4-->0, when a-->0, OK if w_de always <0.
else
al=dlog(a)
if(al.lt.ade(1))then
fint=rde(1)*(a/amin)**(1.-3.*w_de(amin)) !if a<amin, assume here w=w_de(amin)
else !if amin is small enough, this extrapolation will be unnecessary.
call cubicsplint(ade,rde,ddrde,nde,al,fint)
endif
grho_de=grhov*fint
endif
endif
As you can see for the tabulated case it is calling cubicsplint, but cubicsplint is only required for the tabulated case, the not tabulated only needs to know the values w0, wa to do the calculation and that's why that case presents no trouble.
Also, the subroutine DarkEnergy_ReadParams(Ini) which reads the tabulated file is nowhere to be called inside equations_ppf.f90, however, it is called in inidriver.F90. Perhaps that's why in CAMB both versions run well but in CosmoMC only the non tabulated does?
I have been trying to do something similar to the quint module case, where the subroutine init_background is used to call the subroutine Quint_init_background and initialize quintessence, to be more specific, what I have tried to do is to add:
use IniFile
Type(TIniFile) :: Ini
call DarkEnergy_ReadParams(Ini)
to init_background in equations_ppf.f90. But it seems like that is not allowed, I get segmentation errors. I have tried to do the same directly into the function grho_de, in order for it to be read straightaway after compilation, but to no avail.
Any ideas would be appreciated,