TABLE OF CONTENTS


::pwtk::pwo::scferr

SYNOPSIS

proc ::pwtk::pwo::scferr {file {index end}} {

PURPOSE

Extract the index-th "estimated scf accuracy" from SCF's pw.x output (i.e., grep the "estimated scf accuracy" string). Index can be "end" or digital number (first energy has an index of 0).

ARGUMENTS

SOURCE

    pwtk::lineread line $file {
        if { [regexp {^ +estimated scf accuracy} $line] } {
            lappend errList [lindex $line 4]
        }
    }
    if { ! [info exists errList] } {
        ::pwtk::error "no \"estimated scf accuracy\" line found in output file: $file"
        set errList {}
    }
    return [::pwtk::f2c_number [lindex $errList $index]]
}