TABLE OF CONTENTS
::pwtk::load_from
SYNOPSIS
proc ::pwtk::load_from {program inputFile {clear_existing 1}} {
USAGE
load_from PROGRAM inputFile ?clear_existing?
PURPOSE
Load the input data for PROGRAM from the existing input file.
If clear_existing == 1, then the current input will be cleared, otherwise the data will be simply added to the existing data.
ARGUMENTS
- PROGRAM -- the QE executable (e.g. pw.x, cp.x, neb.x)
- pwi -- filename of the input file from which to extract the input data
- clear_existing -- (optional) should the current input data associated with the PROGRAM be cleared (boolean)
EXAMPLE
load_from pw.x scf.in
SOURCE
variable prog2inNN variable plugin if { ! [info exists prog2inNN($program)] && [lsearch -exact $plugin(list) [string tolower $program]] < 0} { ::pwtk::error "cannot load the $program input file because $program is neither a supported executable nor plugin" 1 } if { [info exists prog2inNN($program)] } { # executable set ns [namespace tail $prog2inNN($program)] namespace eval ::pwtk::${ns} load_from[string toupper $ns] $inputFile $clear_existing } else { # plugin set program [string tolower $program] namespace eval ::pwtk::${program} load_$program.in $inputFile $clear_existing } }