TABLE OF CONTENTS


::pwtk::pdos_fullplot

SYNOPSIS

proc ::pwtk::pdos_fullplot {args} {

USAGE

    ::pwtk::pdos_fullplot  ?-out ROOTNAME?  ?OPTIONS?  FILPLOT

PURPOSE

Plot the PDOS(es) of each pdos_atm file into a separate plot of a multiplot.

OPTIONS

For other options, see ::pwtk::pdos_multiplot

ARGUMENT

SOURCE

    addOpts_ options usage [subst {
        {out.arg  {}   "rootname for the Gnuplot-script and image file"}
        {t.arg    $::pwtk::gp::gp(workflow.terminal)   "terminal for the plot"}
    }] {
        {-out ROOTNAME} {-t TERMINAL}
    }
    set nargmin 1
    set nargmax -1
    set usage "[fmtUsage_ $usage]  ?OPTIONS?  FILPLOT"
    parseKnownOpt_

    set filplot [lindex $args end]
    set args [lrange $args 0 end-1]

    if { $opt(out) eq {} } {
        set plotname $filplot
    } else {
        set plotname [headname $opt(out) .$opt(t)]
    }
    set plotname $plotname.fullPDOS

    print "PDOS_FULLPLOT:\nrootname for plotting files:                $plotname"
    
    # construct a list of lists of LDOS plots
    
    set nat 0
    foreach f [pdos_atm_files -f $filplot] {
        # extract atom.# (iat) and angular momentum (l) from the filename
        regexp {pdos_atm#(\d+)\(\w+\)_wfc#\d+\((\w)\)} $f matchVar iat l
        lappend l1($iat,$l) $f
        if { $iat > $nat} { set nat $iat }
    }
    for {set iat 1} {$iat <= $nat} {incr iat} {
        foreach l {s p d f g h} {
            ifnotempty l1($iat,$l) {
                foreach x $l1($iat,$l) {
                    switch -exact $l {
                        s {
                            lappend ll [list $x s]
                        }
                        p {
                            lappend ll [list $x pz  $x px  $x py]
                        }
                        d {
                            lappend ll [list $x dz2  $x dzx  $x dzy  $x dx2y2  $x dzy]
                        }
                        default {
                            ::pwtk::warning "angular momentum beyond d not supported"
                        }
                    }
                }
            }
        }
    }
    
    pdos_multiplot {*}$args -t $opt(t) $ll $plotname
}