Build a honeycomb supercell (parallelogram)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | rows | |||
integer, | intent(in) | :: | cols |
pure function hex_supercell(rows,cols) result(hexagons) !! Build a honeycomb supercell (parallelogram) integer,intent(in) :: rows,cols type(hex) :: hexagons(rows*cols) integer :: i,j,k k = 0 do i = 1,rows do j = 1,cols k = k + 1 hexagons(k) = hex(q=i,r=j) enddo enddo end function hex_supercell