﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
425	Bug in ropp_fm_interpol.f90	Ian Culverwell	Ian Culverwell	"Extrapolation below the least input point in '''ropp_fm_interpol.f90''' is incorrect.

{{{
  DO k = 1, SIZE(newx)
     j = 1
     DO WHILE (j < SIZE(x) .AND. x(j) < newx(k))
        j = j + 1
     ENDDO
     i = j - 1

     interp(k) = array(j) + &
          ( (newx(k) - x(j)) / (x(i) - x(j)) * (array(i) - array(j)) )
 if (k == 1) print*,'LIN: i, j, array(i), array(j), newx(k), x(i), x(j), array(i), array(j), interp(k) = ', &
                          i, j, array(i), array(j), newx(k), x(i), x(j), array(i), array(j), interp(k)
  ENDDO

}}}

generates

{{{
 LIN: i, j, array(i), array(j), newx(k), x(i), x(j), array(i), array(j), interp(
 k) =            0           1  4.940656458412465E-324   224.465585702694     
   663.892771230079       0.000000000000000E+000   3684.59747913574     
  4.940656458412465E-324   224.465585702694        40.4443309158695     
}}}

Note x(0) = 0.000000000000000E+000 and y(0) = 4.940656458412465E-324.  Very dodgy!

It should say, as '''ropp_fm_interpol_log.f90''' does,

{{{
  DO k = 1, SIZE(newx)
     j = 2
     DO WHILE (j < SIZE(x) .AND. x(j) < newx(k))
        j = j + 1
     ENDDO
     i = j - 1

     interp(k) = array(j) + &
          ( (newx(k) - x(j)) / (x(i) - x(j)) * (array(i) - array(j)) )
 if (k == 1) print*,'LIN: i, j, array(i), array(j), newx(k), x(i), x(j), array(i), array(j), interp(k) = ', &
                          i, j, array(i), array(j), newx(k), x(i), x(j), array(i), array(j), interp(k)
  ENDDO
}}}

This correctly generates
{{{
 LIN: i, j, array(i), array(j), newx(k), x(i), x(j), array(i), array(j), interp(
 k) =            1           2   224.465585702694        213.429474246952     
   663.892771230079        3684.59747913574        3702.16006527328     
   224.465585702694        213.429474246952        2122.63898512385     
}}}
in this case.

(This has not caused a problem before because only {{{ropp_fm_interpol_log}}} is  called in practice.)
"	defect	closed	normal	9.0	ropp_fm	8.0	fixed		
