calc_nsites_rect Function

private function calc_nsites_rect(this, length_x, length_y, length_z) result(n_sites)

Type Bound

rectangle

Arguments

Type IntentOptional Attributes Name
class(rectangle) :: this
integer, intent(in) :: length_x
integer, intent(in) :: length_y
integer, intent(in), optional :: length_z

Return Value integer


Contents

Source Code


Source Code

    function calc_nsites_rect(this, length_x, length_y, length_z) result(n_sites)
        class(rectangle) :: this
        integer, intent(in) :: length_x, length_y
        integer, intent(in), optional :: length_z
        integer :: n_sites
        character(*), parameter :: this_routine = "calc_nsites_rect"
        unused_var(this)
        if (present(length_z)) then
            unused_var(length_z)
        end if

        unused_var(this)
        unused_var(length_z)

        if (length_x < 2 .or. length_y < 2) then
            print *, "length_x: ", length_x
            print *, "length_y: ", length_y
            call stop_all(this_routine, "length input wrong for type rectangle!")

        else
            n_sites = length_x * length_y

        end if

    end function calc_nsites_rect