optional_sources Function

public pure function optional_sources(opt, dof, scale) result(s)

The sources of optional opt's x, y, (z) (zero beyond dof, default 3), each times scale (default 1): e.g. a thrust vector stored per point, for set_end_data with relative ends.

Arguments

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

the optional (1 to num_optionals)

integer, intent(in), optional :: dof

degrees of freedom (default 3)

real(kind=wp), intent(in), optional :: scale

factor (default 1)

Return Value type(DataSource), (3)


Source Code

    pure function optional_sources(opt, dof, scale) result(s)
        integer, intent(in) :: opt      !! the optional (1 to num_optionals)
        integer, intent(in), optional :: dof !! degrees of freedom (default 3)
        real(wp), intent(in), optional :: scale !! factor (default 1)
        type(DataSource) :: s(3)
        integer :: k, d
        d = 3
        if (present(dof)) d = dof
        do k = 1, min(3, d)
            s(k) = DataSource(SOURCE_POSOPT, element=k, opt=opt, scale=scale)
        end do
    end function optional_sources