Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rectangle), | intent(in) | :: | this | |||
integer, | intent(in), | optional | :: | dimen |
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