mirror of
https://github.com/LCPQ/quantum_package
synced 2024-10-19 22:41:48 +02:00
commit
9ab0c91b32
2
TODO
2
TODO
@ -65,4 +65,6 @@ qp_stop : pour forcer a terminer proprement le programme (kill clean)
|
|||||||
Virer EMSL
|
Virer EMSL
|
||||||
|
|
||||||
|
|
||||||
|
qp_create... -> qp_create_ezfio
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
# Configuration of all the paths to executables and libraries
|
# Configuration of all the paths to executables and libraries
|
||||||
|
|
||||||
if [[ -z $QP_PYTHON ]]
|
QP_PYTHON=
|
||||||
then
|
|
||||||
|
|
||||||
# Load dependencies
|
# Load dependencies
|
||||||
for i in ezfio.rc irpf90.rc ninja.rc ocaml.rc
|
for i in ezfio.rc irpf90.rc ninja.rc ocaml.rc
|
||||||
@ -39,5 +38,4 @@ then
|
|||||||
|
|
||||||
export C_INCLUDE_PATH=$(qp_prepend_export "C_INCLUDE_PATH" "${QP_ROOT}"/include)
|
export C_INCLUDE_PATH=$(qp_prepend_export "C_INCLUDE_PATH" "${QP_ROOT}"/include)
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
13
etc/qp.rc
13
etc/qp.rc
@ -37,6 +37,18 @@ Usage:
|
|||||||
|
|
||||||
function qp()
|
function qp()
|
||||||
{
|
{
|
||||||
|
function clean_ezfio() {
|
||||||
|
RESULT=""
|
||||||
|
while [[ -n $1 ]] ; do
|
||||||
|
case "$1" in
|
||||||
|
None) RESULT+='"None" ' ;;
|
||||||
|
*) RESULT+="$1 " ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
eval set -- "$RESULT"
|
||||||
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
"set_file")
|
"set_file")
|
||||||
if [[ -d ${2} ]] ; then
|
if [[ -d ${2} ]] ; then
|
||||||
@ -46,6 +58,7 @@ function qp()
|
|||||||
fi;;
|
fi;;
|
||||||
|
|
||||||
"has"|"set"|"get"|"unset_file")
|
"has"|"set"|"get"|"unset_file")
|
||||||
|
clean_ezfio
|
||||||
ezfio "$@"
|
ezfio "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
118
scripts/qp_reset
Executable file
118
scripts/qp_reset
Executable file
@ -0,0 +1,118 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Resets parts of the EZFIO directory.
|
||||||
|
#
|
||||||
|
# Wed Jan 16 16:50:36 CET 2019
|
||||||
|
#
|
||||||
|
|
||||||
|
# Check the QP_ROOT directory
|
||||||
|
if [[ -z ${QP_ROOT} ]] ; then
|
||||||
|
echo "The QP_ROOT environment variable is not set."
|
||||||
|
echo "Please reload the quantum_package.rc file."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
source ${QP_ROOT}/quantum_package.rc
|
||||||
|
|
||||||
|
TEMP=$(getopt -o adhm -l all,dets,help,mos -n $0 -- "$@") || exit 1
|
||||||
|
eval set -- "$TEMP"
|
||||||
|
|
||||||
|
function help() {
|
||||||
|
cat << EOF
|
||||||
|
This command resets parts of the EZFIO directory.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
$(basename $0) [OPTIONS] EZFIO_DIR
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
EZFIO_DIR EZFIO directory
|
||||||
|
|
||||||
|
Options:
|
||||||
|
|
||||||
|
-a --all Reset to the state after qp_create
|
||||||
|
-d --dets Deletes the determinants and CI coefficients
|
||||||
|
-h --help Prints the help message
|
||||||
|
-m --mos Deletes the MOs
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
To delete the complete set of determinants and CI coefficients:
|
||||||
|
|
||||||
|
$(basename $0) --dets h2o.ezfio
|
||||||
|
|
||||||
|
To delete the molecular orbitals (implies -dets):
|
||||||
|
|
||||||
|
$(basename $0) --mos h2o.ezfio
|
||||||
|
|
||||||
|
EOF
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function error() {
|
||||||
|
>&2 echo "$(basename $0): $@"
|
||||||
|
exit 2
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
dets=0
|
||||||
|
mos=0
|
||||||
|
while true ; do
|
||||||
|
case "$1" in
|
||||||
|
-a|--all)
|
||||||
|
dets=1
|
||||||
|
mos=1
|
||||||
|
;;
|
||||||
|
-d|--dets)
|
||||||
|
dets=1
|
||||||
|
;;
|
||||||
|
-m|--mos)
|
||||||
|
mos=1
|
||||||
|
;;
|
||||||
|
-h|-help|--help)
|
||||||
|
help
|
||||||
|
exit 0;;
|
||||||
|
--) shift ; break ;;
|
||||||
|
*)
|
||||||
|
error $(basename $0)": unknown option $1, try --help"
|
||||||
|
exit 2;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -z $1 ]] ; then
|
||||||
|
help
|
||||||
|
error "EZFIO directory not specified"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -d $1 ]] ; then
|
||||||
|
error "EZFIO directory not found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
ezfio=$1
|
||||||
|
qp set_file $ezfio
|
||||||
|
|
||||||
|
if [[ $dets -eq 1 ]] ; then
|
||||||
|
rm -- ${ezfio}/determinants/psi_{det,coef}.gz
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -x
|
||||||
|
if [[ $mos -eq 1 ]] ; then
|
||||||
|
if [[ -f ${ezfio}/mo_basis/mo_class.gz ]] && [[ $(qp get mo_basis mo_num) -ne \
|
||||||
|
$(zcat ${ezfio}/mo_basis/mo_class.gz |grep Active | wc -l) ]] ; then
|
||||||
|
echo "Warning: You will need to re-define the MO classes"
|
||||||
|
fi
|
||||||
|
rm --recursive --force -- ${ezfio}/mo_basis
|
||||||
|
rm --recursive --force -- ${ezfio}/work/mo_ints_*
|
||||||
|
fi
|
||||||
|
|
||||||
|
qp_edit --check ${ezfio}
|
||||||
|
|
||||||
|
if [[ $mos -eq 1 ]] ; then
|
||||||
|
qp set mo_two_e_ints io_mo_two_e_integrals None
|
||||||
|
qp set mo_one_e_ints io_mo_integrals_e_n None
|
||||||
|
qp set mo_one_e_ints io_mo_integrals_kinetic None
|
||||||
|
qp set mo_one_e_ints io_mo_integrals_pseudo None
|
||||||
|
qp set mo_one_e_ints io_mo_one_e_integrals None
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user