TABLE OF CONTENTS


::pwtk::cpi::load_fromCPI

SYNOPSIS

proc ::pwtk::cpi::load_fromCPI {cpi {clear_existing 1}} {

PURPOSE

Load the input data from existing cp.x input file.

If clear_existing == 1, then the current input will be cleared, but otherwise the data will be simply added to the existing data.

ARGUMENTS

SOURCE

    ::pwtk::fileMustExist $cpi "cp.x input"

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

    # cp.x input file must contain the CONTROL namelist

    if { [catch {::pwtk::readNamelists $cpi CONTROL 1}] } {
        ::pwtk::error "input file \"$cpi\" does not appear to be a cp.x input file" 1
    }    

    set output [::pwtk::readNamelists $cpi $::pwtk::cpi::namelist_flow_list]
    append output [::pwtk::readCards $cpi $::pwtk::cpi::card_flow_list ENDRULES]
    
    eval $output
    ::pwtk::input::namelists_ityp2atmSymb_ $::pwtk::cpi::namelist_flow_list
}