TABLE OF CONTENTS


::pwtk::mopdos_run

SYNOPSIS

proc ::pwtk::mopdos_run {args} {

PURPOSE

A very configurable workflow for calculating and plotting DOS projected to molecular orbitals (aka MOPDOS).

The workflow requires minimal input data specs for moleculardos.x (see the example below). In particular, all i_atmwfc_* and i_bnd_* variables are automatically assigned by the workflow itself.

USAGE

   ::pwtk::mopdos_run  ?SPECIFIC-OPTIONS?  ?PLOTTING-OPTIONS?  HEAD  MOLECULE  MOLATOMS

   where SPECIFIC-OPTIONS are:

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

       -homo HOMO_INDEX 
       -mo   MO_INDICES 
       -molatoms   MOL_ATOMS 
       -otheratoms OTHER_ATOMS 
       -mollab     MOL_LABEL 
       -otherlab   OTHER_LABEL

  PLOTTING-OPTIONS:

       -top 
       -descend 
       -yrel  YREL 
       -rymax RYMAX 
       -ylp   Y_LABEL_PDOS 
       -lx    LABEL_X_POS 
       -ly    LABEL_Y_POS

       -out   ROOTNAME
       -w_dw  WITH 
       -w_mol WITH 
       -w_mol_dw WITH 
       -fc    FILLCOLOR 
       -fc_dw FILLCOLOR 
       -fc_mol FILLCOLOR 
       -fc_mol_dw FILLCOLOR


   For other PLOTTING-OPTIONS, see: ::pwtk::plot.
   Ignored PLOTTING-OPTIONS: -u

ARGUMENTS

SPECIFIC OPTIONS

PLOTTING OPTIONS

For other PLOTTING OPTIONS, see ::pwtk::plot

DESCRIPTION

The workflow's sequence of jobs is:

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

This workflow makes two plots:

DEFAULTS

EXAMPLE

   load_fromPWI scf.CO-Pt111.in

   set inp { ngauss = 0, degauss = 0.01, DeltaE  = 0.05 }
   PROJWFC $inp
   MOPDOS  $inp

   mopdos_run -scf -nscf {8 8 8} -t png  $head

RETURN VALUE

Filename of the created MOPDOS plots (for file terminals) or the empty string (for window terminals).

SOURCE

    printTitle MOPDOS_RUN "Running the MOPDOS workflow"
    print "Workflow options & arguments :  $args\n" 

    # parse command-line options & arguments
    
    mopdosParseOpts_

    print "Calculating projections onto selected molecular orbitals\nusing pw.x, projwfc.x, and molecularpdos.x codes"
    print $molInfo
    
    # calculate

    input_pushpop {        
        input_clear IONS CELL
        printTitle "Performing calculations of the whole structure"
        
        # SCF + NSCF & fetch Efermi
        SCF_NSCF_
        Efermi_

        # projwfc.x
        print PROJWFC "Performing projwfc.x calculation\n"
        set full_xml [PROJWFC_xml_ $head $opt(emin) $opt(emax) $Efermi]
        
        # calculate a molecule
        input_pushpop {
            printTitle "Performing calculations of the '$mol' fragment (aka molecule)"
            print SCF "Performing SCF pw.x calculation of the '$mol' fragment\n"
            
            CONTROL " calculation = 'scf', prefix = '$fragment' "
            ::pwtk::pwi::deleteAtoms $other_atoms
            runPW pw.$fragment.scf.in

            print PROJWFC "Performing projwfc.x calculation of the '$mol' fragment\n"
            # N.B. set prefix explicitly
            #      (otherwise the prefix of the whole structure would be used)
            PROJWFC " prefix = '$fragment' "
            set mol_xml [PROJWFC_xml_ $fragment]
        }
        
        # molecularpdos.x
        
        printTitle "Performing molecularpdos.x calculation"

        MOPDOS [subst {
            xmlfile_full = '$full_xml'
            xmlfile_part = '$mol_xml'
            fileout      = '$head.proj_to_$mol'
        }]
        if { $opt(emin) ne {} } { MOPDOS " Emin = $opt(emin)+$Efermi " }
        if { $opt(emax) ne {} } { MOPDOS " Emax = $opt(emax)+$Efermi " }
        
        # i_atmwfc_beg_full & i_atmwfc_end_full
        
        lassign [infoFromPRO_ $mol_atoms projwfc.$head.out] i_beg i_end
        
        print "Finding the first and last molecular states from projwfc.$head.out:
   * i_atmwfc_beg_full = $i_beg
   * i_atmwfc_end_full = $i_end\n"
        
        MOPDOS [subst {
            i_atmwfc_beg_full = $i_beg
            i_atmwfc_end_full = $i_end
        }]
        
        runMOLECULARPDOS molecularpdos.$head.in
    }
    printTitle "Projecting DOS"
    
    return [mopdosPlot_]
}