Class pfcoef_class
In: PartialFractionClass/pfcoef_class.F90
pfcoef_param_class pfcoef_inv_sqrt_class pfcoef_inv_qdrt_class pfcoef_sqrt_class pfcoef_qdrt_class pfcoef_class dot/f_148.png

Methods

Included Modules

pfcoef_param_class pfcoef_inv_sqrt_class pfcoef_inv_qdrt_class pfcoef_sqrt_class pfcoef_qdrt_class

Public Instance methods

Subroutine :
this :type(partial_fraction_coef), intent(inout)

[Source]

subroutine delete_pf_coef(this)
  implicit none
  type(partial_fraction_coef), intent(inout) :: this
  this%itype = 1
  this%n = 0
  this%npow = 0
  this%minimaxerror = 0.0_DP
  this%a = 0.0_DP
  this%b = 0.0_DP
  if (allocated(this%alp)) deallocate(this%alp)
  if (allocated(this%bet)) deallocate(this%bet)
  return
end subroutine
Function :
f :real(DP)
this :class(partial_fraction_coef), intent(inout)
x :real(DP), intent(in)

[Source]

function get_value(this,x) result(f)
  implicit none
  class(partial_fraction_coef), intent(inout) :: this
  real(DP), intent(in) :: x
  real(DP) :: f,gg
  integer :: i
  f = 0.0_DP
  do i=1,this%n
    f = f + this%alp(i)/(x-this%bet(i))
  enddo
  f = f + this%alp(0)
  return
end function
Subroutine :
this :type(partial_fraction_coef), intent(inout)
itype :integer, intent(in)
n :integer, intent(in)
a :real(DP), intent(in)
b :real(DP), intent(in)

[Source]

subroutine new_pf_coef(this,itype,n,a,b)
  implicit none
  type(partial_fraction_coef), intent(inout) :: this
  integer, intent(in) :: itype
  integer, intent(in) :: n
  integer :: npow
  integer :: i
  real(DP), intent(in) :: a,b

  if (allocated(this%alp)) deallocate(this%alp)
  if (allocated(this%bet)) deallocate(this%bet)

  if ( a > b ) then
    write(*,'("#STOP: pf coef range [a,b] should be a < b: [a,b]=",2E12.4)')a,b
    stop
  endif

  npow = CEILING(LOG10(b/a))
!  write(*,'("#NPOW=",I3)')npow

  select case(itype)
  case(+1)
    call get_pfcoef_sqrt(this,n,npow)
  case(-1)
    call get_pfcoef_inv_sqrt(this,n,npow)
  case(+2)
    call get_pfcoef_qdrt(this,n,npow)
  case(-2)
    call get_pfcoef_inv_qdrt(this,n,npow)
  end select

  this%a = a
  this%b = b

  select case(itype)
  case(+1)
    this%alp(0) = this%alp(0)*sqrt(b)
    do i = 1,n
      this%alp(i) = this%alp(i)*sqrt(b)*b
      this%bet(i) = this%bet(i)*b
    enddo
  case(-1)
    this%alp(0) = this%alp(0)/sqrt(b)
    do i = 1,n
      this%alp(i) = this%alp(i)*sqrt(b)
      this%bet(i) = this%bet(i)*b
    enddo
  case(+2)
    this%alp(0) = this%alp(0)*(b**(+0.25e0_DP))
    do i = 1,n
      this%alp(i) = this%alp(i)*(b**(+1.25e0_DP))
      this%bet(i) = this%bet(i)*b
    enddo
  case(-2)
    this%alp(0) = this%alp(0)*(b**(-0.25e0_DP))
    do i = 1,n
      this%alp(i) = this%alp(i)*(b**(+0.75e0_DP))
      this%bet(i) = this%bet(i)*b
    enddo
  end select

  return
end subroutine
partial_fraction_coef
Derived Type :
itype :integer
n :integer
npow :integer
a :real(DP)
b :real(DP)
minimaxerror :real(DP)
alp(:) :real(DP), allocatable
bet(:) :real(DP), allocatable

Original external subprogram is pfcoef_param_class#partial_fraction_coef