evaluate the 4th derivative of a radial profile with respect to rho ~sqrt(magnetic flux)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(c_rProfile) | :: | sf |
self |
|||
| real(kind=wp), | intent(in) | :: | rho |
rho position rho ~sqrt(magnetic flux) |
4th derivative of a radial profile with respect to rho ~sqrt(magnetic flux).
FUNCTION rProfile_drho4(sf, rho) RESULT(derivative) ! MODULES !----------------------------------------------------------------------------------------------------------------------------------- ! INPUT VARIABLES CLASS(c_rProfile) :: sf !! self REAL(wp), INTENT(IN) :: rho !! rho position rho ~sqrt(magnetic flux) !----------------------------------------------------------------------------------------------------------------------------------- ! OUTPUT VARIABLES REAL(wp) :: derivative !! 4th derivative of a radial profile with respect to rho ~sqrt(magnetic flux). !----------------------------------------------------------------------------------------------------------------------------------- ! LOCAL VARIABLES REAL(wp) :: rho2 !=================================================================================================================================== rho2 = rho2_derivative(rho,deriv=0) ! d^4/dx^4 f(g(x)) = f''''(g(x))g'(x)**4 ! + 6f'''(g(x))g''(x)g'(x)^2 ! + 3f''(g(x))g''(x)^2 ! + 4f''(g(x))g'''(x)g'(x) ! + f'(g(x))g''''(x) derivative = sf%eval_at_rho2(rho2, deriv=4)*rho2_derivative(rho,deriv=1)**4 & + 6*sf%eval_at_rho2(rho2, deriv=3)*rho2_derivative(rho,deriv=2)*rho2_derivative(rho,deriv=1)**2 & + 3*sf%eval_at_rho2(rho2, deriv=2)*rho2_derivative(rho,deriv=2)**2 & + 4*sf%eval_at_rho2(rho2, deriv=2)*rho2_derivative(rho,deriv=3)*rho2_derivative(rho,deriv=1) & + sf%eval_at_rho2(rho2, deriv=1)*rho2_derivative(rho,deriv=4) END FUNCTION rProfile_drho4