rms_func Function

public pure function rms_func(x) result(xmag)

Use the root mean square, , for computing the vector norm. This is the norm used in Hairer's DOPRI5 and DOP853 codes.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in), dimension(:) :: x

Return Value real(kind=wp)


Source Code

    pure function rms_func(x) result(xmag)

    implicit none

    real(wp),dimension(:),intent(in) :: x
    real(wp) :: xmag

    xmag = sqrt(sum(x**2)/size(x))

    end function rms_func