Skip to content

Instantly share code, notes, and snippets.

@fuulish
fuulish / qs_mom_methods.patch
Created December 5, 2017 08:11
patch to ignore check for moving eletron to already occupied orbital with MOM in CP2K (for commit: 1a45a2b91906b661dd358495a61fe899814abce0)
--- qs_mom_methods.F 2017-11-27 22:08:09.279085183 +0100
+++ qs_mom_methods.F 2017-11-27 22:07:29.046000027 +0100
@@ -193,12 +193,14 @@
TRIM(str_iorb)//" is not occupied thus it cannot be deoccupied.")
ENDIF
- IF (occ_nums(occ_orb_set(iorb)) > 0.0_dp) THEN
- CALL integer_to_string(occ_orb_set(iorb), str_iorb)
+!FUX|
+ !IF (occ_nums(occ_orb_set(iorb)) > 0.0_dp) THEN
@fuulish
fuulish / qs_scf.patch
Created December 5, 2017 08:09
patch to allow running CP2K with 0 SCF iterations, but still doing some analysis and writing out wavefunction restart (for commit: 1a45a2b91906b661dd358495a61fe899814abce0)
--- qs_scf.F 2017-12-04 22:26:29.458437269 +0100
+++ qs_scf.F 2017-12-04 22:26:32.514518321 +0100
@@ -198,13 +198,16 @@
TYPE(qs_scf_env_type), POINTER :: scf_env
TYPE(scf_control_type), POINTER :: scf_control
TYPE(section_vals_type), POINTER :: dft_section, input, scf_section
+ TYPE(mo_set_p_type), DIMENSION(:), POINTER :: mos
+ TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
+ TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
@fuulish
fuulish / libxc40.sh
Created November 16, 2017 21:13
short script to build libxc 4.0.2 from git
#/bin/bash
mkdir -p extra_libs && cd extra_libs
git clone https://gitlab.com/libxc/libxc.git
cd libxc
git checkout release-4.0.2
#sed -i s/'include <xc.h>'/'include "xc.h"'/g src/references.c
mkdir cmbuild
@fuulish
fuulish / install.sh
Last active May 24, 2018 11:15
quick install script for cp2k.sopt including libint, openblas, libxc
#!/bin/bash
git clone https://github.com/cp2k/cp2k
cd cp2k
wget goo.gl/yFSoc4 -O libint.sh && chmod +x ./libint.sh
./libint.sh
wget goo.gl/ViUsZt -O openblas.sh && chmod +x ./openblas.sh
./openblas.sh
@fuulish
fuulish / libxc.sh
Last active May 24, 2018 08:00
install libXC
#/bin/bash
XC_VER=2.2.2
XC_VER=3.0.0
XC_VER=4.0.3
XC_VER=4.1.1
#assumes we are in the cp2k head directory
mkdir -p extra_libs && cd extra_libs
LIBINT_DIR = LOCAL_LIBINT/build/libint-src
LIBDER_DIR = LOCAL_LIBINT/build/libderiv-src
OPENBLAS_DIR = LOCAL_OPENBLAS
LIBXC_DIR = LOCAL_LIBXC
CC = gcc
CPP =
FC = gfortran
LD = gfortran
AR = ar -r
#!/bin/bash
mkdir -p extra_libs && cd extra_libs
wget http://github.com/xianyi/OpenBLAS/archive/v0.2.19.tar.gz
tar xfv v0.2.19.tar.gz
ln -s OpenBLAS-0.2.19 openblas
cd openblas
make USE_THREAD=0 INTERFACE64=0 BINARY=64
@fuulish
fuulish / install-libint.sh
Last active May 24, 2018 07:58
just a simple bash script to facilitate libint install for students in conjunction with CP2K
#/bin/bash
#assumes we are in the cp2k head directory
mkdir -p extra_libs && cd extra_libs
git clone https://github.com/evaleev/libint
cd libint
git checkout v1
LIBINT_DIR = LOCAL_LIBINT
CC = gcc
CPP =
FC = gfortran
LD = gfortran
AR = ar -r
DFLAGS = -D__GFORTRAN -D__FFTSG -D__LIBINT
CPPFLAGS =
FCFLAGS = $(DFLAGS) -O2 -ffast-math -ffree-form -ffree-line-length-none\
@fuulish
fuulish / myCP2K.sopt
Created May 26, 2017 08:32
simple arch-file for SMP machines without MPI, using gfortran and basic LAPACK and BLAS
CC = gcc
CPP =
FC = gfortran
LD = gfortran
AR = ar -r
DFLAGS = -D__GFORTRAN -D__FFTSG
CPPFLAGS =
FCFLAGS = $(DFLAGS) -O2 -ffast-math -ffree-form -ffree-line-length-none\
-ftree-vectorize -funroll-loops\
-mtune=native -fopenmp