Page 1 of 1

Cosmomc/CAMB: omtau in equations.f90

Posted: November 04 2004
by Hans Kristian Eriksen
I just downloaded Cosmomc, and compiled it. It worked straight out of the box, but with one warning:

f90: Warning: equations.f90, line 1081: Variable OMTAU is used before its value has been defined
a = tau*adotrad*(1+omtau/4)

I guess it won't matter much, since it still is there in the code after a lot of people have used the program, but it would be nice to get a confirmation in any case.

Also, does anybody know if there is a performance cost for using implicit type conversions like the ones above, rather than doing something like the following:

a = tau*adotrad*(1.+omtau/4.) ?

Perhaps most compilers fix this at compile time?

Hans Kristian Eriksen

Re: Cosmomc/CAMB: omtau in equations.f90

Posted: November 05 2004
by Antony Lewis
Thanks for the bug in the vector mode initialization (there is also another vector mode bug in the Aug 2004 version - the spectral index is not set correctly). Obviously this doesn't affect any normal model.

I tend to use things like real/4 on the grounds that there may be more efficient ways to divide by four than use a general floating point division - however I've no idea if any compilers actually do it that way or whether they all convert to a real.