2019-03-07 16:29:06 +01:00
|
|
|
BEGIN_PROVIDER [double precision, energy_x, (N_states)]
|
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
|
|
|
! correlation energies general providers.
|
|
|
|
END_DOC
|
|
|
|
|
|
|
|
BEGIN_SHELL [ /usr/bin/env python2 ]
|
|
|
|
import os
|
|
|
|
import glob
|
|
|
|
from qp_path import QP_SRC
|
|
|
|
funcdir=QP_SRC+'/functionals/'
|
|
|
|
os.chdir(funcdir)
|
|
|
|
functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f"))
|
|
|
|
prefix = ""
|
|
|
|
for f in functionals:
|
|
|
|
print """
|
|
|
|
%sif (trim(exchange_functional) == '%s') then
|
|
|
|
energy_x = energy_x_%s"""%(prefix, f, f)
|
|
|
|
prefix = "else "
|
|
|
|
print """
|
2019-01-25 11:39:31 +01:00
|
|
|
else
|
2019-03-07 16:29:06 +01:00
|
|
|
print *, 'exchange functional required does not exist ...'
|
|
|
|
print *, 'exchange_functional ',exchange_functional
|
|
|
|
stop"""
|
|
|
|
print "endif"
|
|
|
|
|
|
|
|
END_SHELL
|
|
|
|
|
|
|
|
|
|
|
|
END_PROVIDER
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_PROVIDER [double precision, energy_c, (N_states)]
|
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
|
|
|
! correlation and exchange energies general providers.
|
|
|
|
END_DOC
|
|
|
|
|
|
|
|
BEGIN_SHELL [ /usr/bin/env python2 ]
|
|
|
|
import os
|
|
|
|
import glob
|
|
|
|
from qp_path import QP_SRC
|
|
|
|
funcdir=QP_SRC+'/functionals/'
|
|
|
|
os.chdir(funcdir)
|
|
|
|
functionals = map(lambda x : x.replace(".irp.f",""), glob.glob("*.irp.f"))
|
|
|
|
prefix = ""
|
|
|
|
for f in functionals:
|
|
|
|
print """
|
|
|
|
%sif (trim(correlation_functional) == '%s') then
|
|
|
|
energy_c = energy_c_%s"""%(prefix, f, f)
|
|
|
|
prefix = "else "
|
2019-01-25 11:39:31 +01:00
|
|
|
|
2019-03-07 16:29:06 +01:00
|
|
|
print """
|
2019-01-25 11:39:31 +01:00
|
|
|
else
|
2019-03-07 16:29:06 +01:00
|
|
|
print*, 'Correlation functional required does not exist ...'
|
|
|
|
print*,'correlation_functional ',correlation_functional
|
|
|
|
stop"""
|
|
|
|
print "endif"
|
|
|
|
|
|
|
|
END_SHELL
|
|
|
|
|
|
|
|
END_PROVIDER
|
2019-01-25 11:39:31 +01:00
|
|
|
|