get_finite_diff_formula Subroutine

public subroutine get_finite_diff_formula(id, formula, name)

Return a string with the finite difference formula. Input is the method id code.

See also:

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: id

the id code for the method

character(len=:), intent(out), allocatable :: formula

the formula string

character(len=:), intent(out), optional, allocatable :: name

Calls

proc~~get_finite_diff_formula~~CallsGraph proc~get_finite_diff_formula numerical_differentiation_module::get_finite_diff_formula proc~get_finite_difference_method numerical_differentiation_module::get_finite_difference_method proc~get_finite_diff_formula->proc~get_finite_difference_method proc~get_formula numerical_differentiation_module::finite_diff_method%get_formula proc~get_finite_diff_formula->proc~get_formula proc~integer_to_string numerical_differentiation_module::integer_to_string proc~get_formula->proc~integer_to_string

Source Code

    subroutine get_finite_diff_formula(id,formula,name)

    implicit none

    integer,intent(in) :: id  !! the id code for the method
    character(len=:),allocatable,intent(out) :: formula !! the formula string
    character(len=:),allocatable,intent(out),optional :: name

    type(finite_diff_method) :: fd
    logical :: found

    call get_finite_difference_method(id,fd,found)
    if (found .and. fd%id/=0) then
        call get_formula(fd,formula)
        if (present(name)) name = fd%name
    else
        formula = ''
        if (present(name)) name = ''
    end if

    end subroutine get_finite_diff_formula