calc_nsites_star Function

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

Type Bound

star

Arguments

Type IntentOptional Attributes Name
class(star) :: 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_star(this, length_x, length_y, length_z) result(n_sites)
        ! the maximum of the input is used as the n_sites parameter!
        ! this is the same function as the one for "chain" below..
        ! but i cannot use it somehow..
        class(star) :: this
        integer, intent(in) :: length_x, length_y
        integer, intent(in), optional :: length_z
        integer :: n_sites
        character(*), parameter :: this_routine = "calc_nsites_star"
        unused_var(this)
        if (present(length_z)) then
            unused_var(length_z)
        end if

        unused_var(this)
        unused_var(length_z)

        if (max(length_x, length_y) < 1 .or. min(length_x, length_y) > 1 .or. &
            min(length_x, length_y) < 0) then
            n_sites = -1
            call stop_all(this_routine, "something went wrong in length input!")

        else
            n_sites = max(length_x, length_y)

        end if

    end function calc_nsites_star