ispline Function

public function ispline(u_, N_, x_, y_, b_, c_, d_) result(spl_result)

returns interpolated value at guven u_ point number of points and ascending order of x is not checked since ispline is called after "spline" where these checks are done

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: u_

point at which the tabulated value is interpolated

integer(kind=int32), intent(in) :: N_

number of grid points

real(kind=dp), intent(in) :: x_(N_)

grid points

real(kind=dp), intent(in) :: y_(N_)

tabulated values

real(kind=dp), intent(in) :: b_(N_)

arrays with coefficients of the spline function

real(kind=dp), intent(in) :: c_(N_)

arrays with coefficients of the spline function

real(kind=dp), intent(in) :: d_(N_)

arrays with coefficients of the spline function

Return Value real(kind=dp)

interpolated value at u_


Calls

proc~~ispline~~CallsGraph proc~ispline ispline proc~float_to_character float_to_character proc~ispline->proc~float_to_character proc~write_warning write_warning proc~ispline->proc~write_warning proc~write_message write_message proc~write_warning->proc~write_message

Called by

proc~~ispline~~CalledByGraph proc~ispline ispline proc~get_radial_coupling_term_value get_radial_coupling_term_value proc~get_radial_coupling_term_value->proc~ispline proc~calculate_single_pes_matrix_element calculate_single_pes_matrix_element proc~calculate_single_pes_matrix_element->proc~get_radial_coupling_term_value proc~calculate_pes_matrix calculate_pes_matrix proc~calculate_pes_matrix->proc~calculate_single_pes_matrix_element proc~initial_setup initial_setup proc~initial_setup->proc~calculate_pes_matrix proc~general_propagation_step general_propagation_step proc~general_propagation_step->proc~calculate_pes_matrix proc~numerov numerov proc~numerov->proc~initial_setup proc~numerov->proc~general_propagation_step proc~handle_final_propagation_steps handle_final_propagation_steps proc~handle_final_propagation_steps->proc~general_propagation_step

Contents

Source Code


Variables

Type Visibility Attributes Name Initial
real(kind=dp), public :: dx_
integer(kind=int32), public :: k_
integer(kind=int32), public :: l_
integer(kind=int32), public :: mid_

Source Code

      function ispline(u_, N_, x_, y_, b_, c_, d_) result(spl_result)
         !! returns interpolated value at guven u_ point
         !! number of points and ascending order of x is not checked since
         !! ispline is called after "spline" where these checks are done
         !---------------------------------------------------------------------!
         real(dp), intent(in) :: u_
            !! point at which the tabulated value is interpolated
         integer(int32), intent(in) :: N_
            !! number of grid points
         real(dp), intent(in) :: x_(N_)
            !! grid points
         real(dp), intent(in) :: y_(N_)
            !! tabulated values
         real(dp), intent(in) :: b_(N_), c_(N_), d_(N_)
            !! arrays with coefficients of the spline function
         real(dp) :: spl_result
            !! interpolated value at u_
         !---------------------------------------------------------------------!
         integer(int32) :: k_, l_, mid_
         real(dp) :: dx_
         !---------------------------------------------------------------------!
         if (u_ > x_(N_)) then
            call write_warning("ispline: point u_ = " //                       &
               trim(adjustl(float_to_character(u_))) //                        &
               " exceeds the original " // "grid: x(N) = " //                  &
               trim(adjustl(float_to_character(x_(N_)))))
            spl_result = y_(N_)
         else if (u_ < x_(1) ) then
            call write_warning("ispline: point u_ = " //                       &
               trim(adjustl(float_to_character(u_))) //                        &
               " exceeds the original " // "grid: x(1) = " //                  &
               trim(adjustl(float_to_character(x_(1)))))
            spl_result = y_(1)
         else
            !------------------------------------------------------------------!
            l_ = 1
            k_ = N_+1
            do while (k_ > l_+1)

               mid_ = nint( (l_ + k_) / 2.0_dp )

               if (x_(mid_) > u_) then
                   k_ = mid_
               else
                   l_ = mid_
               endif

            end do

            dx_ = u_ - x_(l_)
            spl_result = y_(l_) + dx_ * (b_(l_) + dx_ * (c_(l_) + d_(l_) * dx_))
            !------------------------------------------------------------------!
         endif
         !---------------------------------------------------------------------!
      end function ispline