Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
west-public
West
Commits
d2792373
Commit
d2792373
authored
May 20, 2017
by
Marco Govoni
Browse files
Added stuff to the json file.
parent
81cd36fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Tools/do_setup.f90
View file @
d2792373
...
...
@@ -14,6 +14,7 @@
SUBROUTINE
do_setup
!-----------------------------------------------------------------------
!
USE
json_module
,
ONLY
:
json_file
USE
pwcom
,
ONLY
:
npw
,
nbnd
,
nkstot
,
xk
,
wk
,
nspin
,
nelec
,
nelup
,
neldw
,
et
,
wg
,&
&
lspinorb
,
domag
,
lsda
,
isk
,
nks
,
two_fermi_energies
,
ngk
USE
fixed_occ
,
ONLY
:
tfixed_occ
,
f_inp
...
...
@@ -33,9 +34,13 @@ SUBROUTINE do_setup
USE
gvect
,
ONLY
:
ngm_g
,
ngm
USE
gvecw
,
ONLY
:
ecutwfc
USE
io_push
USE
westcom
,
ONLY
:
logfile
USE
mp_world
,
ONLY
:
mpime
,
root
!
IMPLICIT
NONE
!
TYPE
(
json_file
)
::
json
INTEGER
::
iunit
INTEGER
::
auxi
,
ib
INTEGER
::
ipol
,
ik
,
npwx_g
,
nkbl
,
nkl
,
nkr
,
iks
,
ike
,
spin
INTEGER
,
ALLOCATABLE
::
ngk_g
(:)
...
...
@@ -51,6 +56,11 @@ SUBROUTINE do_setup
!
CALL
set_dirs
()
!
IF
(
mpime
==
root
)
THEN
CALL
json
%
initialize
()
CALL
json
%
load_file
(
filename
=
TRIM
(
logfile
))
ENDIF
!
IF
(
lsda
)
THEN
IF
(
INT
(
nelup
)
==
0
.AND.
INT
(
neldw
)
==
0
)
THEN
!IF ( .NOT. two_fermi_energies ) THEN
...
...
@@ -75,12 +85,16 @@ SUBROUTINE do_setup
!
CALL
io_push_title
(
'System Overview'
)
CALL
io_push_value
(
'gamma_only'
,
gamma_only
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.gamma_only'
,
gamma_only
)
CALL
io_push_value
(
'ecutwfc [Ry]'
,
ecutwfc
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.ecutwfc'
,
ecutwfc
)
CALL
io_push_es0
(
'omega [au^3]'
,
omega
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.omega'
,
omega
)
IF
(
gamma_only
)
THEN
auxi
=
npw
CALL
mp_sum
(
auxi
,
intra_bgrp_comm
)
CALL
io_push_value
(
'glob. #G'
,
auxi
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.globg'
,
auxi
)
ELSE
ALLOCATE
(
ngk_g
(
nkstot
)
)
!npool = nproc_image / nproc_pool
...
...
@@ -98,21 +112,33 @@ SUBROUTINE do_setup
ngk_g
=
ngk_g
/
nbgrp
npwx_g
=
MAXVAL
(
ngk_g
(
1
:
nkstot
)
)
CALL
io_push_value
(
'glob. #PW'
,
npwx_g
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.globpw'
,
npwx_g
)
DEALLOCATE
(
ngk_g
)
ENDIF
CALL
io_push_value
(
'nbnd'
,
nbnd
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.nbnd'
,
nbnd
)
CALL
io_push_value
(
'nkstot'
,
nkstot
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.nkstot'
,
nkstot
)
CALL
io_push_value
(
'nspin'
,
nspin
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.nspin'
,
nspin
)
CALL
io_push_value
(
'nelec'
,
nelec
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.nelec'
,
nelec
)
IF
(
nspin
==
2
)
THEN
CALL
io_push_value
(
'nelup'
,
nelup
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.nelup'
,
nelup
)
CALL
io_push_value
(
'neldw'
,
neldw
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.neldw'
,
neldw
)
ENDIF
CALL
io_push_value
(
'npol'
,
npol
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.npol'
,
npol
)
CALL
io_push_value
(
'lsda'
,
lsda
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.lsda'
,
lsda
)
CALL
io_push_value
(
'noncolin'
,
noncolin
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.noncolin'
,
noncolin
)
CALL
io_push_value
(
'lspinorb'
,
lspinorb
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.lspinorb'
,
lspinorb
)
CALL
io_push_value
(
'domag'
,
domag
,
20
)
IF
(
mpime
==
root
)
CALL
json
%
add
(
'system.domag'
,
domag
)
CALL
io_push_bar
!
alat
=
celldm
(
1
)
...
...
@@ -166,6 +192,13 @@ SUBROUTINE do_setup
WRITE
(
stdout
,
*
)
END
IF
!
IF
(
mpime
==
root
)
THEN
OPEN
(
NEWUNIT
=
iunit
,
FILE
=
TRIM
(
logfile
)
)
CALL
json
%
print_file
(
iunit
)
CLOSE
(
iunit
)
CALL
json
%
destroy
()
ENDIF
!
CALL
stop_clock
(
'do_setup'
)
!
END
SUBROUTINE
Tools/fetch_input.f90
View file @
d2792373
...
...
@@ -350,9 +350,10 @@ SUBROUTINE fetch_input( num_drivers, driver, verbose )
!
IF
(
verbose
)
THEN
!
CALL
json
%
initialize
()
!
CALL
json
%
load_file
(
filename
=
TRIM
(
logfile
))
IF
(
mpime
==
root
)
THEN
CALL
json
%
initialize
()
CALL
json
%
load_file
(
filename
=
TRIM
(
logfile
))
ENDIF
!
IF
(
ANY
(
driver
(:)
==
1
)
)
THEN
!
...
...
@@ -367,9 +368,11 @@ SUBROUTINE fetch_input( num_drivers, driver, verbose )
!
CALL
io_push_bar
()
!
CALL
json
%
add
(
'input.input_west.qe_prefix'
,
TRIM
(
qe_prefix
))
CALL
json
%
add
(
'input.input_west.west_prefix'
,
TRIM
(
west_prefix
))
CALL
json
%
add
(
'input.input_west.outdir'
,
TRIM
(
outdir
))
IF
(
mpime
==
root
)
THEN
CALL
json
%
add
(
'input.input_west.qe_prefix'
,
TRIM
(
qe_prefix
))
CALL
json
%
add
(
'input.input_west.west_prefix'
,
TRIM
(
west_prefix
))
CALL
json
%
add
(
'input.input_west.outdir'
,
TRIM
(
outdir
))
ENDIF
!
ENDIF
!
...
...
@@ -395,18 +398,20 @@ SUBROUTINE fetch_input( num_drivers, driver, verbose )
!
CALL
io_push_bar
()
!
CALL
json
%
add
(
'input.wstat_control.wstat_calculation'
,
TRIM
(
wstat_calculation
))
CALL
json
%
add
(
'input.wstat_control.n_pdep_eigen'
,
n_pdep_eigen
)
CALL
json
%
add
(
'input.wstat_control.n_pdep_times'
,
n_pdep_times
)
CALL
json
%
add
(
'input.wstat_control.n_pdep_maxiter'
,
n_pdep_maxiter
)
CALL
json
%
add
(
'input.wstat_control.n_dfpt_maxiter'
,
n_dfpt_maxiter
)
CALL
json
%
add
(
'input.wstat_control.n_pdep_read_from_file'
,
n_pdep_read_from_file
)
CALL
json
%
add
(
'input.wstat_control.trev_pdep'
,
trev_pdep
)
CALL
json
%
add
(
'input.wstat_control.trev_pdep_rel'
,
trev_pdep_rel
)
CALL
json
%
add
(
'input.wstat_control.tr2_dfpt'
,
tr2_dfpt
)
CALL
json
%
add
(
'input.wstat_control.l_kinetic_only'
,
l_kinetic_only
)
CALL
json
%
add
(
'input.wstat_control.l_minimize_exx_if_active'
,
l_minimize_exx_if_active
)
CALL
json
%
add
(
'input.wstat_control.l_use_ecutrho'
,
l_use_ecutrho
)
IF
(
mpime
==
root
)
THEN
CALL
json
%
add
(
'input.wstat_control.wstat_calculation'
,
TRIM
(
wstat_calculation
))
CALL
json
%
add
(
'input.wstat_control.n_pdep_eigen'
,
n_pdep_eigen
)
CALL
json
%
add
(
'input.wstat_control.n_pdep_times'
,
n_pdep_times
)
CALL
json
%
add
(
'input.wstat_control.n_pdep_maxiter'
,
n_pdep_maxiter
)
CALL
json
%
add
(
'input.wstat_control.n_dfpt_maxiter'
,
n_dfpt_maxiter
)
CALL
json
%
add
(
'input.wstat_control.n_pdep_read_from_file'
,
n_pdep_read_from_file
)
CALL
json
%
add
(
'input.wstat_control.trev_pdep'
,
trev_pdep
)
CALL
json
%
add
(
'input.wstat_control.trev_pdep_rel'
,
trev_pdep_rel
)
CALL
json
%
add
(
'input.wstat_control.tr2_dfpt'
,
tr2_dfpt
)
CALL
json
%
add
(
'input.wstat_control.l_kinetic_only'
,
l_kinetic_only
)
CALL
json
%
add
(
'input.wstat_control.l_minimize_exx_if_active'
,
l_minimize_exx_if_active
)
CALL
json
%
add
(
'input.wstat_control.l_use_ecutrho'
,
l_use_ecutrho
)
ENDIF
!
ENDIF
!
...
...
@@ -440,24 +445,26 @@ SUBROUTINE fetch_input( num_drivers, driver, verbose )
!
CALL
io_push_bar
()
!
CALL
json
%
add
(
'input.wfreq_control.wfreq_calculation'
,
TRIM
(
wfreq_calculation
))
CALL
json
%
add
(
'input.wfreq_control.n_pdep_eigen_to_use'
,
n_pdep_eigen_to_use
)
CALL
json
%
add
(
'input.wfreq_control.qp_bandrange'
,
qp_bandrange
)
CALL
json
%
add
(
'input.wfreq_control.macropol_calculation'
,
macropol_calculation
)
CALL
json
%
add
(
'input.wfreq_control.n_lanczos'
,
n_lanczos
)
CALL
json
%
add
(
'input.wfreq_control.n_imfreq'
,
n_imfreq
)
CALL
json
%
add
(
'input.wfreq_control.n_refreq'
,
n_refreq
)
CALL
json
%
add
(
'input.wfreq_control.ecut_imfreq'
,
ecut_imfreq
)
CALL
json
%
add
(
'input.wfreq_control.ecut_refreq'
,
ecut_refreq
)
CALL
json
%
add
(
'input.wfreq_control.wfreq_eta'
,
wfreq_eta
)
CALL
json
%
add
(
'input.wfreq_control.n_secant_maxiter'
,
n_secant_maxiter
)
CALL
json
%
add
(
'input.wfreq_control.trev_secant'
,
trev_secant
)
CALL
json
%
add
(
'input.wfreq_control.l_enable_lanczos'
,
l_enable_lanczos
)
CALL
json
%
add
(
'input.wfreq_control.l_enable_gwetot'
,
l_enable_gwetot
)
CALL
json
%
add
(
'input.wfreq_control.div_kind_hf'
,
div_kind_hf
)
CALL
json
%
add
(
'input.wfreq_control.o_restart_time'
,
o_restart_time
)
CALL
json
%
add
(
'input.wfreq_control.ecut_spectralf'
,
ecut_spectralf
)
CALL
json
%
add
(
'input.wfreq_control.n_spectralf'
,
n_spectralf
)
IF
(
mpime
==
root
)
THEN
CALL
json
%
add
(
'input.wfreq_control.wfreq_calculation'
,
TRIM
(
wfreq_calculation
))
CALL
json
%
add
(
'input.wfreq_control.n_pdep_eigen_to_use'
,
n_pdep_eigen_to_use
)
CALL
json
%
add
(
'input.wfreq_control.qp_bandrange'
,
qp_bandrange
)
CALL
json
%
add
(
'input.wfreq_control.macropol_calculation'
,
macropol_calculation
)
CALL
json
%
add
(
'input.wfreq_control.n_lanczos'
,
n_lanczos
)
CALL
json
%
add
(
'input.wfreq_control.n_imfreq'
,
n_imfreq
)
CALL
json
%
add
(
'input.wfreq_control.n_refreq'
,
n_refreq
)
CALL
json
%
add
(
'input.wfreq_control.ecut_imfreq'
,
ecut_imfreq
)
CALL
json
%
add
(
'input.wfreq_control.ecut_refreq'
,
ecut_refreq
)
CALL
json
%
add
(
'input.wfreq_control.wfreq_eta'
,
wfreq_eta
)
CALL
json
%
add
(
'input.wfreq_control.n_secant_maxiter'
,
n_secant_maxiter
)
CALL
json
%
add
(
'input.wfreq_control.trev_secant'
,
trev_secant
)
CALL
json
%
add
(
'input.wfreq_control.l_enable_lanczos'
,
l_enable_lanczos
)
CALL
json
%
add
(
'input.wfreq_control.l_enable_gwetot'
,
l_enable_gwetot
)
CALL
json
%
add
(
'input.wfreq_control.div_kind_hf'
,
div_kind_hf
)
CALL
json
%
add
(
'input.wfreq_control.o_restart_time'
,
o_restart_time
)
CALL
json
%
add
(
'input.wfreq_control.ecut_spectralf'
,
ecut_spectralf
)
CALL
json
%
add
(
'input.wfreq_control.n_spectralf'
,
n_spectralf
)
ENDIF
!
ENDIF
!
...
...
@@ -483,23 +490,26 @@ SUBROUTINE fetch_input( num_drivers, driver, verbose )
!
CALL
io_push_bar
()
!
CALL
json
%
add
(
'input.westpp_control.westpp_calculation'
,
TRIM
(
westpp_calculation
))
CALL
json
%
add
(
'input.westpp_control.westpp_range'
,
westpp_range
)
CALL
json
%
add
(
'input.westpp_control.westpp_format'
,
TRIM
(
westpp_format
))
CALL
json
%
add
(
'input.westpp_control.westpp_sign'
,
westpp_sign
)
CALL
json
%
add
(
'input.westpp_control.westpp_n_pdep_eigen_to_use'
,
westpp_n_pdep_eigen_to_use
)
CALL
json
%
add
(
'input.westpp_control.westpp_r0'
,
westpp_r0
)
CALL
json
%
add
(
'input.westpp_control.westpp_nr'
,
westpp_nr
)
CALL
json
%
add
(
'input.westpp_control.westpp_rmax'
,
westpp_rmax
)
CALL
json
%
add
(
'input.westpp_control.westpp_epsinfty'
,
westpp_epsinfty
)
IF
(
mpime
==
root
)
THEN
CALL
json
%
add
(
'input.westpp_control.westpp_calculation'
,
TRIM
(
westpp_calculation
))
CALL
json
%
add
(
'input.westpp_control.westpp_range'
,
westpp_range
)
CALL
json
%
add
(
'input.westpp_control.westpp_format'
,
TRIM
(
westpp_format
))
CALL
json
%
add
(
'input.westpp_control.westpp_sign'
,
westpp_sign
)
CALL
json
%
add
(
'input.westpp_control.westpp_n_pdep_eigen_to_use'
,
westpp_n_pdep_eigen_to_use
)
CALL
json
%
add
(
'input.westpp_control.westpp_r0'
,
westpp_r0
)
CALL
json
%
add
(
'input.westpp_control.westpp_nr'
,
westpp_nr
)
CALL
json
%
add
(
'input.westpp_control.westpp_rmax'
,
westpp_rmax
)
CALL
json
%
add
(
'input.westpp_control.westpp_epsinfty'
,
westpp_epsinfty
)
ENDIF
!
ENDIF
!
OPEN
(
NEWUNIT
=
iunit
,
FILE
=
TRIM
(
logfile
)
)
CALL
json
%
print_file
(
iunit
)
CLOSE
(
iunit
)
!
CALL
json
%
destroy
()
IF
(
mpime
==
root
)
THEN
OPEN
(
NEWUNIT
=
iunit
,
FILE
=
TRIM
(
logfile
)
)
CALL
json
%
print_file
(
iunit
)
CLOSE
(
iunit
)
CALL
json
%
destroy
()
ENDIF
!
ENDIF
!
...
...
Tools/west_environment.f90
View file @
d2792373
...
...
@@ -121,24 +121,59 @@ CONTAINS
!
!
SUBROUTINE
west_environment_end
(
code
)
!
USE
json_module
,
ONLY
:
json_file
USE
mp_world
,
ONLY
:
mpime
,
root
USE
westcom
,
ONLY
:
logfile
!
IMPLICIT
NONE
!
CHARACTER
(
LEN
=*
),
INTENT
(
IN
)
::
code
INTEGER
::
iunit
TYPE
(
json_file
)
::
json
CHARACTER
(
LEN
=
9
)
::
cdate
,
ctime
CHARACTER
(
LEN
=
80
)
::
time_str
!
IF
(
meta_ionode
)
WRITE
(
stdout
,
*
)
!
CALL
stop_clock
(
TRIM
(
code
)
)
CALL
print_clock
(
TRIM
(
code
)
)
!
CALL
west_closing_message
(
)
CALL
date_and_tim
(
cdate
,
ctime
)
!
time_str
=
'This run was terminated on: '
//
ctime
//
' '
//
cdate
!
IF
(
meta_ionode
)
THEN
WRITE
(
stdout
,
*
)
WRITE
(
stdout
,
3334
)
time_str
WRITE
(
stdout
,
3335
)
END
IF
!
IF
(
meta_ionode
)
THEN
WRITE
(
stdout
,
'(A)'
)
' JOB DONE.'
WRITE
(
stdout
,
3335
)
END
IF
3334
FORMAT
(
3X
,
A60
,
/
)
3335
FORMAT
(
'='
,
78
(
'-'
),
'='
)
FLUSH
(
stdout
)
!
RETURN
IF
(
mpime
==
root
)
THEN
!
CALL
json
%
initialize
()
CALL
json
%
load_file
(
filename
=
TRIM
(
logfile
))
!
CALL
json
%
add
(
'run.completed'
,
.TRUE.
)
CALL
json
%
add
(
'run.endtime'
,
TRIM
(
ctime
)
)
CALL
json
%
add
(
'run.enddate'
,
TRIM
(
cdate
)
)
!
OPEN
(
NEWUNIT
=
iunit
,
FILE
=
TRIM
(
logfile
)
)
CALL
json
%
print_file
(
iunit
)
CLOSE
(
iunit
)
!
CALL
json
%
destroy
()
!
ENDIF
!
END
SUBROUTINE
!
!
...
...
@@ -188,15 +223,15 @@ CONTAINS
!
CALL
json
%
initialize
()
!
CALL
json
%
add
(
'
init.
date'
,
TRIM
(
cdate
)
)
CALL
json
%
add
(
'
init.
time'
,
TRIM
(
ctime
)
)
CALL
json
%
add
(
'
init
.program'
,
TRIM
(
code
)
)
CALL
json
%
add
(
'
init
.version'
,
TRIM
(
west_version_number
)
)
CALL
json
%
add
(
'
run.start
date'
,
TRIM
(
cdate
)
)
CALL
json
%
add
(
'
run.start
time'
,
TRIM
(
ctime
)
)
CALL
json
%
add
(
'
run.software
.program'
,
TRIM
(
code
)
)
CALL
json
%
add
(
'
run.software
.version'
,
TRIM
(
west_version_number
)
)
IF
(
TRIM
(
west_svn_revision
)
/
=
"unknown"
)
CALL
json
%
add
(
'init.svn'
,
TRIM
(
west_svn_revision
)
)
CALL
json
%
add
(
'
init
.website'
,
"http://www.west-code.org"
)
CALL
json
%
add
(
'
init
.citation'
,
"M. Govoni et al., J. Chem. Theory Comput. 11, 2680 (2015)."
)
CALL
json
%
add
(
'
init
.qeversion'
,
TRIM
(
version_number
)
)
IF
(
TRIM
(
svn_revision
)
/
=
"unknown"
)
CALL
json
%
add
(
'
init
.qesvn'
,
TRIM
(
svn_revision
)
)
CALL
json
%
add
(
'
run.software
.website'
,
"http://www.west-code.org"
)
CALL
json
%
add
(
'
run.software
.citation'
,
"M. Govoni et al., J. Chem. Theory Comput. 11, 2680 (2015)."
)
CALL
json
%
add
(
'
run.software
.qeversion'
,
TRIM
(
version_number
)
)
IF
(
TRIM
(
svn_revision
)
/
=
"unknown"
)
CALL
json
%
add
(
'
run.software
.qesvn'
,
TRIM
(
svn_revision
)
)
!
OPEN
(
NEWUNIT
=
iunit
,
FILE
=
TRIM
(
logfile
)
)
CALL
json
%
print_file
(
iunit
)
...
...
@@ -208,29 +243,6 @@ CONTAINS
!
END
SUBROUTINE
!
!
!
SUBROUTINE
west_closing_message
(
)
!
CHARACTER
(
LEN
=
9
)
::
cdate
,
ctime
CHARACTER
(
LEN
=
80
)
::
time_str
!
CALL
date_and_tim
(
cdate
,
ctime
)
!
time_str
=
'This run was terminated on: '
//
ctime
//
' '
//
cdate
!
IF
(
meta_ionode
)
THEN
WRITE
(
stdout
,
*
)
WRITE
(
stdout
,
3334
)
time_str
WRITE
(
stdout
,
3335
)
END
IF
!
3334
FORMAT
(
3X
,
A60
,
/
)
3335
FORMAT
(
'='
,
78
(
'-'
),
'='
)
!
RETURN
END
SUBROUTINE
!
!
!
SUBROUTINE
report_parallel_status
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment