polyProfile_antiderivative Function

public function polyProfile_antiderivative(sf) result(antideriv)

get the exact polynomial antiderivative, with respect to rho2

Type Bound

t_rProfile_poly

Arguments

Type IntentOptional Attributes Name
class(t_rProfile_poly), intent(in) :: sf

self

Return Value class(c_rProfile), ALLOCATABLE


Source Code

  FUNCTION polyProfile_antiderivative(sf) RESULT(antideriv)
  ! MODULES
  !-----------------------------------------------------------------------------------------------------------------------------------
  ! INPUT VARIABLES
    CLASS(t_rProfile_poly), INTENT(IN)  :: sf !! self
  !-----------------------------------------------------------------------------------------------------------------------------------
  ! OUTPUT VARIABLES
    CLASS(c_rProfile),ALLOCATABLE :: antideriv
  !-----------------------------------------------------------------------------------------------------------------------------------
  ! LOCAL VARIABLES
    REAL(wp) :: coefs(sf%n_coefs+1)
    INTEGER :: i
  !===================================================================================================================================
    coefs = 0.0_wp
    DO i=1,sf%n_coefs
      coefs(i+1) = sf%coefs(i)/REAL(i,wp)
    END DO
    antideriv = t_rProfile_poly(coefs)
  END FUNCTION polyProfile_antiderivative