TABLE OF CONTENTS
::pwtk::restartPW_fromPWIandPWO
SYNOPSIS
proc ::pwtk::restartPW_fromPWIandPWO {args} {
USAGE
restartPW_fromPWIandPWO ?options? head ?pwi? ?pwo?
DESCRIPTION
Load the input data from the specified pw.x input and output files and restart the pw.x calculation. From the output file only the latest atomic-positions and cell-paramaters (if exist) will be used.
OPTIONS
- -true_restart 0|1 -- perform true restart with restart_mode = 'restart' (allowed values: 0|1, default = 1). If "-true_restart 0" then only the latest cell-parameters and atomic positions from the output file are re-used.
- -clear 0|1 -- clear the previously defined pw.x input variables, i.e., just use the input variables from the specified input file (allowed values: 0|1, default = 1)
ARGUMENTS
- head -- headname to which the I/O files will be stored. The .in (.out) suffix is added to input (output) filename, i.e., new I/O files are $head.in & $head.out
- pwi -- [optional] name of pw.x input file to load the data from (default = $head.in)
- pwo -- [optional] name of pw.x output file to load the data from (default = $head.out)
SOURCE
# parse options set options { {true_restart.arg 1 "perform true restart with restart_mode = 'restart'"} {clear.arg 1 "use the input variables from the specified input file"} } array set opt [::cmdline::getoptions args $options [list [lindex [info level 0] 0] options:]] foreach op {true_restart clear} { # e.g., .true. --> true set opt($op) [string trim $opt($op) .] if { ! [string is boolean $opt($op)] } { ::pwtk::error "wrong value for option -$opt, expected boolean but got: $opt($op)" 1 } } if { [llength $args] < 1 } { ::pwtk::error "Usage: restartPW_fromPWIandPWO ?options? head ?pwi? ?pwo?" 1 } # assign head, pwi, pwo set head [lindex $args 0] set pwi [lindex $args 1] set pwo [lindex $args 2] if { $pwi == {} } { set pwi $head.in } if { $pwo == {} } { set pwo $head.out } # do the job input_pushpop { ::pwtk::pwi::load_fromPWI $pwi $opt(clear) ::pwtk::pwi::CELL_PARAMETERS_and_ATOMIC_POSITIONS_fromPWO $pwo if { $opt(true_restart) } { rerunPW $head } else { CONTROL " restart_mode = " runPW -append $head } } }