TABLE OF CONTENTS


::pwtk::sumpdos

SYNOPSIS

proc ::pwtk::sumpdos {args} {

USAGE

   ::pwtk::sumpdos ?-f PATTERN?  ?-n PATTERN?  ?-s PATTERN?  ?-w PATTERN?  ?-l PATTERN?  FILEOUT

DESCRIPTION

Sum PDOSes for projwfc.x filpdos pdos_atm files that matches the supplied glob patterns.

BEWARE that PDOSes are summed separately for each component, hence only compatible pdos_atm files can be summed, i.e., s with s, p with p, and d with d, where s,p,d are angular momenta. Otherwise, an error occurs.

OPTIONS

For description of options, see ::pwtk::pdos_atm_files

ARGUMENTS

RETURN VALUE

The value of the "fileout" argument.

SOURCE

    # the number of arguments must be odd when implcit options (-?,
    # -help, --) are stripped from $args    
    
    if { ! ([llength [trimImplicitOpts_ $args]] % 2) } {
        ::pwtk::error "wrong number of arguments, must be:\n 
[procName] ?-f PATTERN?  ?-n PATTERN?  ?-s PATTERN?  ?-w PATTERN?  ?-l PATTERN?  fileout" 1
    }
    
    ::pwtk::print PDOS "Summing PDOSes..."

    set pdosFiles [::pwtk::pdos_atm_files {*}$args]
    set fileout   [lindex $args end]    
    return [::pwtk::sumpdosFiles $pdosFiles $fileout]
}