TABLE OF CONTENTS


::pwtk::readNml

SYNOPSIS

proc ::pwtk::readNml {fileChannel nmlOrigName {nmlPWTKname {}} {must_exist 0} {match_first 0}} {

PURPOSE

Read the namelist from the fileChannel of e.g. opened QE input file, return its content in the PWTK syntax, and increment fileChannel to the point just after the namelist.

This routine is used internally by PWTK in load_from*** set of commands.

ARGUMENTS

SIDE EFFECTS

If namelist is not present an error will be raised.

RETURN VALUE

Namelist in the PWTK syntax, e.g.,: NAMELIST { ... }

SOURCE

    if { $nmlPWTKname eq {} } {
        set nmlName [string toupper $nmlOrigName]
    } else {
        set nmlName [string toupper $nmlPWTKname]
    }

    set nmlContent [::fnml::getContent $nmlOrigName $fileChannel $must_exist $match_first]
    if { $nmlContent ne {} } {
        return "$nmlName { [string trim $nmlContent] }\n"
    } else {
        return ""
    }
}