evaluate the n-th derivative of a power polynomial
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_rProfile_poly), | intent(in) | :: | sf |
self |
||
| real(kind=wp), | intent(in) | :: | rho2 |
evaluation point in the toroidal flux coordinate (rho2=phi/phi_edge= spos^2) |
||
| integer, | intent(in), | optional | :: | deriv |
FUNCTION polyProfile_eval_at_rho2(sf, rho2, deriv) RESULT(profile_prime_value) ! MODULES USE MODgvec_Globals, ONLY: Eval1DPoly,Eval1DPoly_deriv ! INPUT VARIABLES -------------------------! CLASS(t_rProfile_poly), INTENT(IN) :: sf !! self REAL(wp) , INTENT(IN) :: rho2 !! evaluation point in the toroidal flux coordinate (rho2=phi/phi_edge= spos^2) INTEGER , OPTIONAL , INTENT(IN) :: deriv ! OUTPUT VARIABLES -------------------------! REAL(wp) :: profile_prime_value ! LOCAL VARIABLES -------------------------! REAL(wp) :: prefactor INTEGER :: d INTEGER :: deriv_case ! CODE --------------------------------------------------------------------------------------------------------------------------! IF (PRESENT(deriv)) THEN deriv_case = deriv ELSE deriv_case = 0 END IF IF (deriv_case>sf%deg) THEN profile_prime_value = 0.0_wp ELSE IF (deriv_case==0) THEN profile_prime_value = EVAL1DPOLY(sf%n_coefs, sf%coefs, rho2) ELSE IF (deriv_case==1) THEN profile_prime_value = EVAL1DPOLY_deriv(sf%n_coefs, sf%coefs, rho2) ELSE profile_prime_value = 0.0_wp DO d=sf%deg+1, deriv_case+1,-1 prefactor=poly_derivative_prefactor(d-1,deriv_case) profile_prime_value = profile_prime_value*rho2+prefactor*sf%coefs(d) END DO END IF END FUNCTION polyProfile_eval_at_rho2