subroutine print_lat(this)
class(lattice) :: this
! depending on the type print specific lattice information
select type (this)
class is (lattice)
call stop_all("lattice%print()", &
"lattice type should never be directly instantiated!")
class is (chain)
print *, "Lattice type is: 'chain' "
print *, " number of dimensions: ", this%get_ndim()
print *, " max-number of neighbors: ", this%get_nconnect_max()
print *, " number of sites of chain: ", this%get_nsites()
print *, " is the chain periodic: ", this%is_periodic()
class is (rectangle)
if (trim(this%get_name()) == 'tilted') then
print *, "Lattice type is 'tilted' "
else
print *, "Lattice type is 'rectangle' "
end if
print *, " number of dimensions: ", this%get_ndim()
print *, " max-number of neighbors: ", this%get_nconnect_max()
print *, " number of sites in the lattice: ", this%get_nsites()
if (this%is_periodic()) then
print *, " is the lattice periodic: True"
end if
print *, "primitive lattice vectors: (", this%lat_vec(1:2, 1), "), (", this%lat_vec(1:2, 2), ")"
class is (ole)
print *, "Lattice type is 'Ole' ;) "
print *, "number of dimensions: ", this%get_ndim()
print *, "max-number of neigbors: ", this%get_nconnect_max()
print *, "number of sites: ", this%get_nsites()
print *, "primitive lattice vectors: (", this%lat_vec(1:2, 1), "), (", this%lat_vec(1:2, 2), ")"
print *, "TODO: more and better output! "
class is (ext_input)
print *, "Lattice read from lattice.file file "
print *, "Lattice type is :",this%get_name()
print *, "number of sites in the lattice: ", this%get_nsites()
print *, "max-number of neigbors: ", this%get_nconnect_max()
if (this%is_periodic()) then
print *, " is the lattice periodic: True"
end if
end select
end subroutine print_lat