TABLE OF CONTENTS


::pwtk::pdos_run

SYNOPSIS

proc ::pwtk::pdos_run {args} {

USAGE

   ::pwtk::pdos_run  ?SPECIFIC-OPTIONS?  ?OPTIONS?  HEAD

   where SPECIFIC-OPTIONS are:

       -scf
       -nscf KGRID
       -e    EFERMI
       -emin EMIN
       -emax EMAX

SPECIFIC OPTIONS

OPTIONS

See ::pwtk::pdos_multiplot

ARGUMENTS

DESCRIPTION

Run a workflow of calculations to calculate and plot the projected DOS. The sequence of jobs is:

      pw.x SCF (optional, requested by -scf)
       |
       |
      pw.x NSCF (optional, requested by -nscf)
       |
       |
      projwfc.x
       |
       |
      PLOTTING

BEWARE

If the -scf option is omitted, an SCF (or *RELAX) calculation must be performed prior to using this workflow. Optionally, the PROJWFC namelist could also be predefined.

EXAMPLE

   load_fromPWI scf.$head.in

   PROJWFC { ngauss  = 0 degauss = 0.01 DeltaE = 0.05 }
   pdos_run -scf -nscf {8 8 8} -emin -10 -emax 4 -t png  $head

RETURN VALUE

Filenames of the created LDOS and PDOS plots (for file terminals) or the empty string (for window terminals).

SOURCE

    printTitle PDOS_RUN "Running the PDOS workflow"
    print "Workflow options & arguments :  $args"

    addOpts_ options usage {
        {scf          "perform SCF calculation"}
        {nscf.arg {}  "perform NSCF calculation using provided KGRID"}
        {e.arg    {}  "Fermi energy (either a floating-point number or a pw.x output file from where the Fermi energy is taken)"}
        {emin.arg {}  "Emin for projwfc.x with respect to Fermi energy (in eV)"}
        {emax.arg {}  "Emax for projwfc.x with respect to Fermi energy (in eV)"}
    } {
        -scf {-nscf KGRID} {-e EFERMI} {-emin EMIN} {-emin EMAX}
    }

    set nargmin 1
    set nargmax -1
    set usage "[fmtUsage_ $usage]  ?SPECIFIC-OPTIONS?  ?OPTIONS?  HEAD"
    deprecatedOpts_ { {-k -nscf} } args; # N.B. -k was replace by -nscf
    parseKnownOpt_
    
    checkOType_ -nscf $opt(nscf) {numberlist nonnegint}  "list of non-negative integer numbers (i.e. automatic k-point grid specs)"
    checkOType_ -emin $opt(emin) double number
    checkOType_ -emin $opt(emax) double number

    set head [lindex $args end]
    
    print "Rootname for files:  $head\n"
    
    input_pushpop {
        input_clear IONS CELL

        # SCF + NSCF calcs & fetch Efermi
        SCF_NSCF_
        Efermi_

        # projwfc.x
        print PROJWFC "Performing projwfc.x calculation\n"
        PROJWFC " filpdos = '$head' "
        EminEmax_ $opt(emin) $opt(emax) $Efermi PROJWFC
        runPROJWFC projwfc.$head
    }

    print PLOTTING "Plotting all LDOSes and PDOSes ...\n"

    set ldos_ [ldos_fullplot -e $pwo -o landscape {*}$args]
    set pdos_ [pdos_fullplot -e $pwo -o landscape {*}$args]

    if { $ldos_ ne {} } {
        print PDOS_RUN "All LDOSes were plotted to :  $ldos_
All PDOSes were plotted to :  $pdos_\n"
    }

    return [concat $ldos_ $pdos_]
}