aim_lattice_constructor Function

private function aim_lattice_constructor(lat_type, length_x, length_y) result(this)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: lat_type
integer, intent(in) :: length_x
integer, intent(in) :: length_y

Return Value class(aim), pointer


Contents


Source Code

    function aim_lattice_constructor(lat_type, length_x, length_y) result(this)
        character(*), intent(in) :: lat_type
        integer, intent(in) :: length_x, length_y
        class(aim), pointer :: this
        character(*), parameter :: this_routine = "aim_lattice_constructor"

        select case (lat_type)
        case ('chain', 'aim-chain', 'chain-aim')

            allocate(aim_chain :: this)

        case ('star', 'aim-star', 'star-aim')

            allocate(aim_star :: this)

        case default
            ! stop here because a incorrect lattice type was given
            call stop_all(this_routine, &
                          'incorrect lattice type provided in lattice_constructor!')

        end select

        ! the initializer deals with the different types then..
        call this%initialize(length_x, length_y, 1, .false., .false., .false.)

    end function aim_lattice_constructor