get_length_rect Function

private pure function get_length_rect(this, dimen)

Type Bound

rectangle

Arguments

Type IntentOptional Attributes Name
class(rectangle), intent(in) :: this
integer, intent(in), optional :: dimen

Return Value integer


Contents

Source Code


Source Code

    integer pure function get_length_rect(this, dimen)
        class(rectangle), intent(in) :: this
        integer, intent(in), optional :: dimen
        character(*), parameter :: this_routine = "get_length_rect"

        ASSERT(present(dimen))
        ASSERT(dimen > 0)

        if (dimen > 2) then
            get_length_rect = 1
        else
            get_length_rect = this%length(dimen)
        end if

    end function get_length_rect