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