Skip to content

Instantly share code, notes, and snippets.

View bhourahine's full-sized avatar

Ben Hourahine bhourahine

View GitHub Profile
@bhourahine
bhourahine / repeatGen.pl
Created March 24, 2021 21:26
Old script for repeating gen format including helical structures
#!/usr/bin/env perl
use Math::Trig;
# DFTB+ supercell and helical gen format repeat tool
# repeat a periodic .gen structure a specified number of times along
# lattice vectors. Input consists of gen file with an
# additional last line consisting of the number of additional repeats
# in each lattice vector direction, for example:
# 2 F
Geometry = GenFormat {
4 C
Fe
1 1 0.01020789 -.02020770 0.00020773
2 1 1.66468182 1.66468190 0.00020778
3 1 1.66468183 0.00020777 1.66468190
4 1 0.00020785 1.66468187 1.66468187
}
Driver = lBFGS {}
program test
use mpi
implicit none
integer, parameter :: requiredThreading = MPI_THREAD_FUNNELED
integer, parameter :: lead_id = 0
integer :: providedThreading, ierr
integer :: ii
logical :: jj
call mpi_init_thread(requiredThreading, providedThreading, ierr)
!> Module to allow read only array (1D integer as example)
module wrappedPointers
implicit none
type TPayload
private
integer :: updates = 0
integer, allocatable :: content(:)
contains