set_periodic Subroutine

private subroutine set_periodic(this, t_periodic_x, t_periodic_y, t_periodic_z)

Type Bound

lattice

Arguments

Type IntentOptional Attributes Name
class(lattice) :: this
logical, intent(in) :: t_periodic_x
logical, intent(in) :: t_periodic_y
logical, intent(in), optional :: t_periodic_z

Contents

Source Code


Source Code

    subroutine set_periodic(this, t_periodic_x, t_periodic_y, t_periodic_z)
        class(lattice) :: this
        logical, intent(in) :: t_periodic_x, t_periodic_y
        logical, intent(in), optional :: t_periodic_z

        ! how do we decide which periodic flag to take?
        ! well we just set it like that! the user has to be specific!
        ! well.. but we do not want to ask if this x or y is periodic in
        ! the 1dim case or?
        ! periodic is the default.. and we want to turn off periodic by
        ! inputting open-bc.. and in the case of the cain + open-bc this
        ! means immediately that it is NOT periodic.. so only if both inputs
        ! are true (which is the default case) the chain is set to be
        ! periodic! (or in the is_periodic procedure, we check if
        ! both are true!
        this%t_periodic_x = t_periodic_x
        this%t_periodic_y = t_periodic_y

        this%t_periodic(1) = t_periodic_x
        this%t_periodic(2) = t_periodic_y
        if (present(t_periodic_z)) then
            this%t_periodic(3) = t_periodic_z
        end if

    end subroutine set_periodic