TABLE OF CONTENTS


::pwtk::environ::load_environ.in

SYNOPSIS

proc ::pwtk::environ::load_environ.in {environFile {clear_existing 1}} {

PURPOSE

Load the input data from existing ENVIRON input file (aka environ.in).

If clear_existing == 1, then the current input are cleared, otherwise the read data from $environFile are simply added to the existing input data.

ARGUMENTS

SOURCE

    ::pwtk::fileMustExist $environFile "ENVIRON input"

    if { [::pwtk::is_true $clear_existing] } {
        # clear the current projwfc.x input data ...
        ::pwtk::environ::clear
    }

    # read the namelists

    set output [::pwtk::readNamelists $environFile $::pwtk::environ::input_flow_list]
    append output [::pwtk::readCards  $environFile $::pwtk::environ::card_flow_list]
    
    # ENVIRON input file must contain an ENVIRON namelist
    if { $output == "" } {
        ::pwtk::error "input file \"$environFile\" does not appear to be an ENVIRON input file" 1
    }

    eval $output
}