hpparvi / PyTransit

Fast and easy exoplanet transit light curve modelling.
GNU General Public License v2.0
99 stars 23 forks source link

double precision parameters #16

Closed lucaborsato closed 8 years ago

lucaborsato commented 8 years ago

Hi, I was looking at the source code and I found that some double precision parameters are declare without specify the precision at the end of the number, i.e. function ellc(k):

real(8), parameter :: &     
         & a1=0.443251414630, &
         & a2=0.062606012200, &     
         & a3=0.047573835460, &     
         & a4=0.017365064510, &     
         & b1=0.249983683100, &     
         & b2=0.092001800370, &     
         & b3=0.040696975260, &     
         & b4=0.005264496390     

You should add _dp at the end of all these values:

real(8), parameter :: &
         & a1=0.443251414630_dp, &
         & a2=0.062606012200_dp, &
         & a3=0.047573835460_dp, &
         & a4=0.017365064510_dp, &
         & b1=0.249983683100_dp, &
         & b2=0.092001800370_dp, &
         & b3=0.040696975260_dp, &
         & b4=0.005264496390_dp

otherwise the code will use a single precision value even if they have been declare real(8). I found the same issue in the orbits.f90 file, mainly in the do while conditions; in this case it would be better to add the _fd at the end of the value. Best, Luca

hpparvi commented 8 years ago

Thanks, this was a good thing to notice :)

Fixed now by merging the changes from your fork.