TABLE OF CONTENTS


::pwtk::mdi::load_fromMDI

SYNOPSIS

proc ::pwtk::mdi::load_fromMDI {mdi {clear_existing 1}} {

PURPOSE

Load the input data from the existing matdyn.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 $mdi "matdyn.x input"

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

    set fid [open $mdi r]

    # matdyn.x input file must contain the INPUT namelist

    if { [catch {set nml [::pwtk::readNml $fid INPUT]}] } {
        ::pwtk::error "input file \"$mdi\" does not appear to be a matdyn.x input file" 1
    }
    # replace INPUT with MATDYN
    eval [regsub INPUT $nml MATDYN]
          
    # read the rest of the matdyn.x input file
    while { ! [eof $fid] } {
        ::pwtk::input::cardAppend MATDYN.affixCards [gets $fid]
    }
    close $fid
    variable input_flow_list
    ::pwtk::input::namelists_ityp2atmSymb_ $input_flow_list
}