Commit 375fa7dc authored by Marco Govoni's avatar Marco Govoni
Browse files

bug fixes

parent 35baa9f2
......@@ -18,7 +18,6 @@ IFLAGS=
IO_KERNEL_OBJS = \
mpiio.o \
my_mkdir.o \
cubefile.o \
function3d.o \
pdep_io.o \
......
......@@ -99,7 +99,7 @@ MODULE function3d
IERR = kwargs%setitem("grid_function",charbase64)
IERR = kwargs%setitem("dtype","double")
!
IERR = call_py_noret(pymod, "base64_to_function3d", args, kwargs)
IERR = call_py_noret(pymod, "base64_to_function3D", args, kwargs)
!
CALL kwargs%destroy
CALL args%destroy
......@@ -162,7 +162,7 @@ MODULE function3d
IERR = args%setitem(0, TRIM(ADJUSTL(fname)) )
IERR = dict_create(kwargs)
!
IERR = call_py(return_obj,pymod, "function3d_to_base64", args, kwargs)
IERR = call_py(return_obj,pymod, "function3D_to_base64", args, kwargs)
!
IERR = cast(return_dict, return_obj)
!
......
......@@ -86,7 +86,7 @@ MODULE westin
CHARACTER(LEN=512) :: qe_prefix
CHARACTER(LEN=512) :: savedir ! outdir/west_prefix.code.save
CHARACTER(LEN=512) :: main_input_file ! input file
CHARACTER(LEN=:), ALLOCATABLE :: logfile ! savedir/logfile.xml
CHARACTER(LEN=512) :: logfile ! savedir/logfile.json
!
END MODULE
!
......@@ -148,8 +148,8 @@ MODULE wfreq_center
INTEGER :: n_secant_maxiter
REAL(DP) :: trev_secant
LOGICAL :: l_enable_lanczos
CHARACTER(LEN=1) :: macropol_calculation
LOGICAL :: l_enable_gwetot
CHARACTER(LEN=1) :: macropol_calculation
REAL(DP) :: exx_etot
REAL(DP) :: o_restart_time
REAL(DP) :: ecut_spectralf(2)
......
......@@ -67,6 +67,7 @@ class QboxServer(ClientServer) :
#
client_image = self.client_lockfile.split(".")[1]
self.server_inputfile = f"qb.{client_image}.in" # we assume that server_number = client_image
print(self.server_inputfile)
#
# List of perturbation files
#
......@@ -102,7 +103,7 @@ class QboxServer(ClientServer) :
# INTERFACE #
#############
def sleep_and_wait_for_lock_to_be_removed(*args, **kwargs):
def sleep_and_wait(*args, **kwargs):
#
client_lockfile = args[0] # name of client lockfile
maxsec = 12 * 60 * 60 # 12 hours, Max sleep time (in s)
......@@ -127,7 +128,7 @@ def sleep_and_wait_for_lock_to_be_removed(*args, **kwargs):
def test() :
with open("I.1.lock","w") as f :
f.write(" ")
sleep_and_wait_for_lock_to_be_removed("I.1.lock",maxsec=60,sleepsec=2)
sleep_and_wait("I.1.lock",maxsec=60,sleepsec=2)
if __name__ == "__main__":
# execute only if run as a script
......
......@@ -37,28 +37,29 @@ default["wstat_control"]["qlist"] = [ 1 ] # dynamically set to the actual number
default["wfreq_control"] = {}
default["wfreq_control"]["wfreq_calculation"] = "XWGQ"
default["wfreq_control"]["n_pdep_eigen_to_use"] = 1 # dynamically set to the number of electrons
default["wfreq_control"]["qp_bandrange"] = [1,2]
default["wfreq_control"]["qp_bandrange"] = [1, 2]
default["wfreq_control"]["macropol_calculation"] = 'N'
default["wfreq_control"]["n_lanczos"] = 30
default["wfreq_control"]["n_imfreq"] = 128
default["wfreq_control"]["n_refreq"] = 272 # dynamically set so that ecut_refreq / n_refreq = 0.1 eV
default["wfreq_control"]["n_refreq"] = 272
default["wfreq_control"]["ecut_imfreq"] = 25. # dynamically set to ecutrho
default["wfreq_control"]["ecut_refreq"] = 2. # dynamically set to contain eks + 0.5 Ry padding
default["wfreq_control"]["ecut_refreq"] = 2.
default["wfreq_control"]["wfreq_eta"] = 0.05 / rytoev
default["wfreq_control"]["n_secant_maxiter"] = 21
default["wfreq_control"]["trev_secant"] = 0.05 / rytoev
default["wfreq_control"]["l_enable_lanczos"] = True
default["wfreq_control"]["l_enable_gwetot"] = False
default["wfreq_control"]["o_restart_time"] = 0.
default["wfreq_control"]["ecut_spectralf"] = [-2.,1.]
default["wfreq_control"]["ecut_spectralf"] = [-2., 1.]
default["wfreq_control"]["n_spectralf"] = 204
# westpp_control
default["westpp_control"] = {}
default["westpp_control"]["westpp_calculation"] = "r"
default["westpp_control"]["westpp_range"] = [1,2]
default["westpp_control"]["westpp_range"] = [1, 2]
default["westpp_control"]["westpp_format"] = "C"
default["westpp_control"]["westpp_sign"] = False
default["westpp_control"]["westpp_n_pdep_eigen_to_use"] = 1
default["westpp_control"]["westpp_r0"] = [0.,0.,0.]
default["westpp_control"]["westpp_r0"] = [0., 0., 0.]
default["westpp_control"]["westpp_nr"] = 100
default["westpp_control"]["westpp_rmax"] = 1.
default["westpp_control"]["westpp_epsinfty"] = 1.
......@@ -78,22 +79,17 @@ def update_default_values(key,kwargs) :
#
assert("nelec") in kwargs.keys()
nelec = kwargs["nelec"]
default[key]["n_pdep_eigen"] = nelec
default[key]["n_pdep_eigen"] = int(nelec)
#
if key == "wfreq_control" :
#
assert("nelec") in kwargs.keys()
nelec = kwargs["nelec"]
default[key]["n_pdep_eigen_to_use"] = nelec
default[key]["n_pdep_eigen_to_use"] = int(nelec)
#
assert("ecutrho") in kwargs.keys()
ecutrho = kwargs["ecutrho"]
default[key]["ecut_imfreq"] = ecutrho
#
assert("eksmax") in kwargs.keys()
eksmax = kwargs["eksmax"]
default[key]["ecut_refreq"] = eksmax + 0.5
default[key]["n_refreq"] = int( default[key]["ecut_refreq"] * rytoev / 0.1 )
################
# OPEN & PARSE #
......@@ -206,6 +202,7 @@ def read_keyword_from_file(*args, **kwargs):
#
fileName = args[0]
keyword = args[1]
verbose = args[2]
#
# Assign static & dynamical defaults
#
......@@ -226,7 +223,8 @@ def read_keyword_from_file(*args, **kwargs):
#
# Print
#
print_dict(keyword, data)
if (verbose) :
print_dict(keyword, data)
#
return data
......@@ -249,10 +247,10 @@ wstat_control :
unknown_key : value # this line will be read but not passed
""")
#
read_keyword_from_file(fileName,"input_west")
read_keyword_from_file(fileName,"wstat_control",nq=20,nelec=10)
read_keyword_from_file(fileName,"wfreq_control",nelec=10,ecutrho=30.,eksmax=2.)
read_keyword_from_file(fileName,"westpp_control")
read_keyword_from_file(fileName,"input_west",True)
read_keyword_from_file(fileName,"wstat_control",True,nq=20,nelec=10)
read_keyword_from_file(fileName,"wfreq_control",True,nelec=10,ecutrho=30.)
read_keyword_from_file(fileName,"westpp_control",True)
#
remove(fileName)
......
#!/usr/bin/python3
from __future__ import print_function
from os import mkdir
import sys
#############
# INTERFACE #
#############
def my_mkdir(*args, **kwargs):
#
path = args[0]
#
try:
mkdir(path)
except OSError:
#print (f"Creation of the directory {path} failed")
pass
else:
#print (f"Successfully created the directory {path} ")
pass
sys.stdout.flush()
########
# TEST #
########
def test() :
#
dirname = "./wstat.save"
#
my_mkdir(dirname)
if __name__ == "__main__":
# execute only if run as a script
test()
......@@ -16,9 +16,9 @@ IFLAGS=
TOOLS_OBJS = \
conversions.o \
io_push.o \
logfile.o \
fetch_input.o \
my_mkdir.o \
set_dirs.o \
fetch_input.o \
west_print_clocks.o \
exx_go.o \
exx_ungo.o \
......
......@@ -11,501 +11,6 @@
! Marco Govoni
!
!-----------------------------------------------------------------------
SUBROUTINE fetch_input( num_drivers, driver, verbose )
!-----------------------------------------------------------------------
!
USE json_module, ONLY : json_file
USE westcom
USE io_files, ONLY : tmp_dir, prefix
USE io_global, ONLY : stdout
USE mp, ONLY : mp_bcast
USE mp_world, ONLY : mpime,root,world_comm
USE mp_global, ONLY : nimage
USE io_push, ONLY : io_push_title,io_push_value,io_push_bar,io_push_es0,io_push_c512
USE gvect, ONLY : ecutrho
USE start_k, ONLY : nk1, nk2, nk3
USE control_flags, ONLY : gamma_only
!
IMPLICIT NONE
!
! I/O
!
INTEGER, INTENT(IN) :: num_drivers
INTEGER, INTENT(IN) :: driver(num_drivers)
LOGICAL, INTENT(IN) :: verbose
!
! Workspace
!
TYPE(json_file) :: json
INTEGER :: i
INTEGER :: iiarg, nargs
INTEGER :: numsp
LOGICAL :: found
CHARACTER (LEN=512) :: input_file
CHARACTER(LEN=512), EXTERNAL :: trimcheck
CHARACTER(LEN=:),ALLOCATABLE :: cval
REAL(DP) :: rval
INTEGER :: ival
INTEGER,ALLOCATABLE :: ivec(:)
REAL(DP),ALLOCATABLE :: rvec(:)
LOGICAL :: lval
INTEGER :: iunit
!
CALL start_clock('fetch_input')
!
! PRESETS
!
! ** input_west **
IF ( ANY(driver(:)==1) ) THEN
qe_prefix = 'pwscf'
west_prefix = 'west'
CALL get_environment_variable( 'ESPRESSO_TMPDIR', outdir )
IF ( trim( outdir ) == ' ' ) outdir = './'
ENDIF
!
! ** wstat_control **
IF ( ANY(driver(:)==2) ) THEN
!
! ** WARNING ** : In order to properly initialize these variables, this driver
! can be called only after:
! - fetch_input( driver 1 )
! - read_pwout()
!
wstat_calculation = 'S'
n_pdep_eigen = 1
n_pdep_times = 4
n_pdep_maxiter = 100
n_dfpt_maxiter = 250
n_pdep_read_from_file = 0
trev_pdep = 1.d-3
trev_pdep_rel = 1.d-1
tr2_dfpt = 1.d-12
l_kinetic_only = .FALSE.
l_minimize_exx_if_active = .FALSE.
l_use_ecutrho = .FALSE.
IF( ALLOCATED(qlist) ) DEALLOCATE(qlist)
IF ( gamma_only ) THEN
ALLOCATE( qlist(1) )
qlist(1) = 1
ELSE
ALLOCATE(qlist(nk1*nk2*nk3))
qlist = (/ (i, i=1,nk1*nk2*nk3,1) /)
ENDIF
ENDIF
!
! ** wfreq_control **
IF ( ANY(driver(:)==3) ) THEN
!
! ** WARNING ** : In order to properly initialize these variables, this driver
! can be called only after:
! - fetch_input( driver 1 )
! - read_pwout()
!
wfreq_calculation = 'XWGQ'
n_pdep_eigen_to_use = 2
qp_bandrange = (/ 1, 2 /)
macropol_calculation = 'N'
n_lanczos = 30
n_imfreq = 128
n_refreq = 272
ecut_imfreq = ecutrho
ecut_refreq = 2._DP
wfreq_eta = 0.003675_DP
n_secant_maxiter = 21
trev_secant = 0.003675_DP
l_enable_lanczos = .TRUE.
l_enable_gwetot = .FALSE.
o_restart_time = 0._DP
ecut_spectralf = (/ -2._DP, 2._DP /)
n_spectralf = 10
ENDIF
!
! ** westpp_control **
IF ( ANY(driver(:)==4) ) THEN
westpp_calculation = 'r'
westpp_range = (/ 1, 2 /)
westpp_format = 'C'
westpp_sign = .FALSE.
westpp_n_pdep_eigen_to_use = 1
westpp_r0 = (/ 0.d0, 0.d0, 0.d0 /)
westpp_nr = 100
westpp_rmax = 1.d0
westpp_epsinfty = 1.d0
ENDIF
!
! READ the input
!
IF ( mpime==root ) THEN
!
!
CALL json%initialize()
CALL json%load_file( filename = main_input_file )
!
IF ( ANY(driver(:)==1) ) THEN
CALL json%get('input_west.qe_prefix', cval, found)
IF( found ) qe_prefix = cval
CALL json%get('input_west.west_prefix', cval, found)
IF( found ) west_prefix = cval
CALL json%get('input_west.outdir', cval, found)
IF( found ) outdir = cval
ENDIF
!
IF ( ANY(driver(:)==2) ) THEN
CALL json%get('wstat_control.wstat_calculation', cval, found)
IF( found ) wstat_calculation = cval
CALL json%get('wstat_control.n_pdep_eigen', ival, found)
IF( found ) n_pdep_eigen = ival
CALL json%get('wstat_control.n_pdep_times', ival, found)
IF( found ) n_pdep_times = ival
CALL json%get('wstat_control.n_pdep_maxiter', ival, found)
IF( found ) n_pdep_maxiter = ival
CALL json%get('wstat_control.n_dfpt_maxiter', ival, found)
IF( found ) n_dfpt_maxiter = ival
CALL json%get('wstat_control.n_pdep_read_from_file', ival, found)
IF( found ) n_pdep_read_from_file = ival
CALL json%get('wstat_control.trev_pdep', rval, found)
IF( found ) trev_pdep = rval
CALL json%get('wstat_control.trev_pdep_rel', rval, found)
IF( found ) trev_pdep_rel = rval
CALL json%get('wstat_control.tr2_dfpt', rval, found)
IF( found ) tr2_dfpt = rval
CALL json%get('wstat_control.l_kinetic_only', lval, found)
IF( found ) l_kinetic_only = lval
CALL json%get('wstat_control.l_minimize_exx_if_active', lval, found)
IF( found ) l_minimize_exx_if_active = lval
CALL json%get('wstat_control.l_use_ecutrho', lval, found)
IF( found ) l_use_ecutrho = lval
!CALL json%get('wstat_control.nq', ivec, found)
!IF( found ) nq(1:3) = ivec(:)
CALL json%get('wstat_control.qlist', ivec, found)
IF( found ) THEN
IF( ALLOCATED(qlist) ) DEALLOCATE(qlist)
ALLOCATE(qlist(SIZE(ivec)))
qlist(1:SIZE(ivec)) = ivec(1:SIZE(ivec))
ENDIF
ENDIF
!
IF ( ANY(driver(:)==3) ) THEN
CALL json%get('wfreq_control.wfreq_calculation', cval, found)
IF( found ) wfreq_calculation = cval
CALL json%get('wfreq_control.n_pdep_eigen_to_use', ival, found)
IF( found ) n_pdep_eigen_to_use = ival
CALL json%get('wfreq_control.qp_bandrange', ivec, found)
IF( found ) qp_bandrange(1:2) = ivec(:)
! CALL json%get('wfreq_control.qp_bandrange(2)', rval, found)
! IF( found ) qp_bandrange(2) = rval
CALL json%get('wfreq_control.macropol_calculation', cval, found)
IF( found ) macropol_calculation = cval
CALL json%get('wfreq_control.n_lanczos', ival, found)
IF( found ) n_lanczos = ival
CALL json%get('wfreq_control.n_imfreq', ival, found)
IF( found ) n_imfreq = ival
CALL json%get('wfreq_control.n_refreq', ival, found)
IF( found ) n_refreq = ival
CALL json%get('wfreq_control.ecut_imfreq', rval, found)
IF( found ) ecut_imfreq = rval
CALL json%get('wfreq_control.ecut_refreq', rval, found)
IF( found ) ecut_refreq = rval
CALL json%get('wfreq_control.wfreq_eta', rval, found)
IF( found ) wfreq_eta = rval
CALL json%get('wfreq_control.n_secant_maxiter', ival, found)
IF( found ) n_secant_maxiter = ival
CALL json%get('wfreq_control.trev_secant', rval, found)
IF( found ) trev_secant = rval
CALL json%get('wfreq_control.l_enable_lanczos', lval, found)
IF( found ) l_enable_lanczos = lval
CALL json%get('wfreq_control.l_enable_gwetot', lval, found)
IF( found ) l_enable_gwetot = lval
CALL json%get('wfreq_control.o_restart_time', rval, found)
IF( found ) o_restart_time = rval
CALL json%get('wfreq_control.ecut_spectralf', rvec, found)
IF( found ) ecut_spectralf(1:2) = rvec(1:2)
! CALL json%get('wfreq_control.ecut_spectralf(2)', rval, found)
! IF( found ) ecut_spectralf(2) = rval
CALL json%get('wfreq_control.n_spectralf', ival, found)
IF( found ) n_spectralf = ival
ENDIF
!
IF ( ANY(driver(:)==4) ) THEN
CALL json%get('westpp_control.westpp_calculation', cval, found)
IF( found ) westpp_calculation = cval
CALL json%get('westpp_control.westpp_range', rvec, found)
IF( found ) westpp_range(1:2) = rvec(1:2)
! CALL json%get('westpp_control.westpp_range(2)', rval, found)
! IF( found ) westpp_range(2) = rval
CALL json%get('westpp_control.westpp_format', cval, found)
IF( found ) westpp_format = cval
CALL json%get('westpp_control.westpp_sign', lval, found)
IF( found ) westpp_sign = lval
CALL json%get('westpp_control.westpp_n_pdep_eigen_to_use', ival, found)
IF( found ) westpp_n_pdep_eigen_to_use = ival
CALL json%get('westpp_control.westpp_r0', rvec, found)
IF( found ) westpp_r0(1:3) = rvec(1:3)
! CALL json%get('westpp_control.westpp_r0(2)', rval, found)
! IF( found ) westpp_r0(2) = rval
! CALL json%get('westpp_control.westpp_r0(3)', rval, found)
! IF( found ) westpp_r0(3) = rval
CALL json%get('westpp_control.westpp_nr', ival, found)
IF( found ) westpp_nr = ival
CALL json%get('westpp_control.westpp_rmax', rval, found)
IF( found ) westpp_rmax = rval
CALL json%get('westpp_control.westpp_epsinfty', rval, found)
IF( found ) westpp_epsinfty = rval
ENDIF
!
CALL json%destroy()
!
ENDIF
!
! BCAST & CHECKS
!
IF ( ANY(driver(:)==1) ) THEN
!
CALL mp_bcast(qe_prefix,root,world_comm)
prefix=qe_prefix
CALL mp_bcast(west_prefix,root,world_comm)
tmp_dir = trimcheck (TRIM(ADJUSTL(outdir)))
CALL mp_bcast(tmp_dir,root,world_comm)
!
ENDIF
!
IF ( ANY(driver(:)==2) ) THEN
!
CALL mp_bcast(wstat_calculation,root,world_comm)
CALL mp_bcast(n_pdep_eigen,root,world_comm)
CALL mp_bcast(n_pdep_times,root,world_comm)
CALL mp_bcast(n_pdep_maxiter,root,world_comm)
CALL mp_bcast(n_dfpt_maxiter,root,world_comm)
CALL mp_bcast(n_pdep_read_from_file,root,world_comm)
CALL mp_bcast(trev_pdep,root,world_comm)
CALL mp_bcast(trev_pdep_rel,root,world_comm)
CALL mp_bcast(tr2_dfpt,root,world_comm)
CALL mp_bcast(l_kinetic_only,root,world_comm)
CALL mp_bcast(l_minimize_exx_if_active,root,world_comm)
CALL mp_bcast(l_use_ecutrho,root,world_comm)
!CALL mp_bcast(nq,root,world_comm)
CALL mp_bcast(qlist,root,world_comm)
!
! CHECKS
!
SELECT CASE(wstat_calculation)
CASE('r','R','s','S')
CASE DEFAULT
CALL errore('fetch_input','Err: wstat_calculation /= S or R',1)
END SELECT
!
IF( n_pdep_times < 2 ) CALL errore('fetch_input','Err: n_pdep_times<2',1)
IF( n_pdep_eigen < 1 ) CALL errore('fetch_input','Err: n_pdep_eigen<1',1)
IF( n_pdep_eigen*n_pdep_times < nimage ) CALL errore('fetch_input','Err: n_pdep_eigen*n_pdep_times<nimage',1)
IF( n_pdep_maxiter < 1 ) CALL errore('fetch_input','Err: n_pdep_maxiter<1',1)
IF( n_dfpt_maxiter < 1 ) CALL errore('fetch_input','Err: n_dfpt_maxiter<1',1)
IF( n_pdep_read_from_file < 0 ) CALL errore('fetch_input','Err: n_pdep_read_from_file<0',1)
IF( n_pdep_read_from_file > n_pdep_eigen ) CALL errore('fetch_input','Err: n_pdep_read_from_file>n_pdep_eigen',1)
IF(tr2_dfpt<=0._DP) CALL errore('fetch_input','Err: tr2_dfpt<0.',1)
IF(trev_pdep<=0._DP) CALL errore('fetch_input','Err: trev_pdep<0.',1)
IF(trev_pdep_rel<=0._DP) CALL errore('fetch_input','Err: trev_pdep_rel<0.',1)
IF(gamma_only) THEN
IF (SIZE(qlist)/=1) CALL errore('fetch_input','Err: SIZE(qlist)/=1.',1)
ELSE
IF (SIZE(qlist)>nk1*nk2*nk3) CALL errore('fetch_input','Err: SIZE(qlist)>nk1*nk2*nk3.',1)
ENDIF
!
ENDIF
!
IF ( ANY(driver(:)==3) ) THEN
!
CALL mp_bcast(wfreq_calculation,root,world_comm)
CALL mp_bcast(n_pdep_eigen_to_use,root,world_comm)
CALL mp_bcast(qp_bandrange,root,world_comm)
CALL mp_bcast(macropol_calculation,root,world_comm)
CALL mp_bcast(n_lanczos,root,world_comm)
CALL mp_bcast(n_imfreq,root,world_comm)
CALL mp_bcast(n_refreq,root,world_comm)
CALL mp_bcast(ecut_imfreq,root,world_comm)
CALL mp_bcast(ecut_refreq,root,world_comm)
CALL mp_bcast(wfreq_eta,root,world_comm)
CALL mp_bcast(n_secant_maxiter,root,world_comm)
CALL mp_bcast(trev_secant,root,world_comm)
CALL mp_bcast(l_enable_lanczos,root,world_comm)
CALL mp_bcast(l_enable_gwetot,root,world_comm)
CALL mp_bcast(o_restart_time,root,world_comm)
CALL mp_bcast(ecut_spectralf,root,world_comm)
CALL mp_bcast(n_spectralf,root,world_comm)
!
! CHECKS
!
IF( n_lanczos < 2 ) CALL errore('fetch_input','Err: n_lanczos<2',1)
IF( n_pdep_eigen_to_use < 1 ) CALL errore('fetch_input','Err: n_pdep_eigen_to_use<1',1)
IF( n_pdep_eigen_to_use > n_pdep_eigen ) CALL errore('fetch_input','Err: n_pdep_eigen_to_use>n_pdep_eigen',1)
IF( n_imfreq < 1 ) CALL errore('fetch_input','Err: n_imfreq<1',1)
IF( n_refreq < 1 ) CALL errore('fetch_input','Err: n_refreq<1',1)
IF( n_spectralf < 2 ) CALL errore('fetch_input','Err: n_spectralf<1',1)
IF( qp_bandrange(1) < 1 ) CALL errore('fetch_input','Err: qp_bandrange(1)<1',1)
IF( qp_bandrange(2) < 1 ) CALL errore('fetch_input','Err: qp_bandrange(2)<1',1)
IF( qp_bandrange(2) < qp_bandrange(1) ) CALL errore('fetch_input','Err: qp_bandrange(2)<qp_bandrange(1)',1)
IF( ecut_imfreq<=0._DP) CALL errore('fetch_input','Err: ecut_imfreq<0.',1)
IF( ecut_refreq<=0._DP) CALL errore('fetch_input','Err: ecut_imfreq<0.',1)
IF( ecut_spectralf(2)<ecut_spectralf(1)) CALL errore('fetch_input','Err: ecut_spectralf(2)<ecut_spectralf(1)',1)
IF( wfreq_eta<=0._DP) CALL errore('fetch_input','Err: wfreq_eta<0.',1)
IF( n_secant_maxiter < 0 ) CALL errore('fetch_input','Err: n_secant_maxiter<0',1)
IF( trev_secant<=0._DP) CALL errore('fetch_input','Err: trev_secant<0.',1)
SELECT CASE(macropol_calculation)
CASE('N','n','C','c')
CASE DEFAULT
CALL errore('fetch_input','Err: macropol_calculation /= (N,C)',1)
END SELECT
!
ENDIF
!
IF ( ANY(driver(:)==4) ) THEN
!
CALL mp_bcast(westpp_calculation,root,world_comm)
CALL mp_bcast(westpp_range,root,world_comm)
CALL mp_bcast(westpp_format,root,world_comm)
CALL mp_bcast(westpp_sign,root,world_comm)
CALL mp_bcast(westpp_n_pdep_eigen_to_use,root,world_comm)
CALL mp_bcast(westpp_r0,root,world_comm)
CALL mp_bcast(westpp_nr,root,world_comm)
CALL mp_bcast(westpp_rmax,root,world_comm)
CALL mp_bcast(westpp_epsinfty,root,world_comm)
!
! CHECKS
!
IF( westpp_range(1) < 1 ) CALL errore('fetch_input','Err: westpp_range(1)<1',1)