<s> """<STR_LIT>""" <EOL> import os . path <EOL> import shutil <EOL> import sys <EOL> if '<STR_LIT:.>' not in sys . path : <EOL> sys . path . append ( '<STR_LIT:.>' ) <EOL> from numpy import float32 , zeros , ndarray <EOL> from openmdao . main . api import Component , Container <EOL> from openmdao . main . datatypes . api import Float , Array , Str , Int <EOL> __all__ = ( '<STR_LIT>' , ) <EOL> _ZEROS48 = zeros ( ( <NUM_LIT> , ) , float32 ) <EOL> _ZEROS5 = zeros ( ( <NUM_LIT:5> , ) , float32 ) <EOL> class Datain ( Container ) : <EOL> ttin = Float ( iotype = '<STR_LIT>' , units = '<STR_LIT>' , <EOL> desc = '<STR_LIT>' ) <EOL> ptin = Float ( iotype = '<STR_LIT>' , units = '<STR_LIT>' , <EOL> desc = '<STR_LIT>' ) <EOL> pfind = Float ( iotype = '<STR_LIT>' , <EOL> desc = '<STR_LIT>' ) <EOL> rpm = Float ( iotype = '<STR_LIT>' , units = ( '<STR_LIT>' ) , desc = '<STR_LIT>' ) <EOL> seta = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> scf = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> reta = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> rcf = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> ttinh = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> ptinh = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> alf0h = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> wair = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> fair = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> ptps = Float ( iotype = '<STR_LIT>' , <EOL> desc = '<STR_LIT>' ) <EOL> delc = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> dell = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> dela = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> stg = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> sect = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> expn = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> rg = Float ( iotype = '<STR_LIT>' , units = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> paf = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> sli = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> aacs = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> vctd = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> pcnh = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> wg = Float ( iotype = '<STR_LIT>' , units = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> epr = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> wtol = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> rhotol = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> prtol = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> trloop = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> pfind = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> dhfind = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> iar = Int ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> icyl = Int ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> icf = Int ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> endplt = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> endjob = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> stage = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> gamg = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> dr = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> dt = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> rwg = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> twg = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> pwg = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> sdia = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> sdea = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> spa = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> sesth = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> rdia = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> rdea = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> rpa = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> rerth = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> srec = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> rrec = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> rtf = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> rvu1 = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> rvu2 = Array ( _ZEROS5 , dtype = float32 , shape = ( <NUM_LIT:5> , ) , iotype = '<STR_LIT>' ) <EOL> endstg = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> expp = Float ( iotype = '<STR_LIT>' , desc = '<STR_LIT>' ) <EOL> def __init__ ( self ) : <EOL> super ( Datain , self ) . __init__ ( ) <EOL> self . _inputs = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> self . ind = <NUM_LIT:0> <EOL> self . _nml_modified = [ ] <EOL> self . on_trait_change ( self . _trait_change , '<STR_LIT>' ) <EOL> def _trait_change ( self , obj , name , old , new ) : <EOL> """<STR_LIT>""" <EOL> if name not in self . _nml_modified : <EOL> self . _nml_modified . append ( name ) <EOL> def read ( self , stream ) : <EOL> self . _nml_modified = [ ] <EOL> line = stream . readline ( ) . strip ( ) <EOL> while line : <EOL> if '<STR_LIT:/>' in line : return True <EOL> if '<STR_LIT>' in line : return True <EOL> if '<STR_LIT>' in line : return True <EOL> fields = line . split ( '<STR_LIT:=>' ) <EOL> name0 = fields [ <NUM_LIT:0> ] . strip ( ) . lower ( ) <EOL> for name in self . _inputs : <EOL> if name == name0 : <EOL> if name not in self . _nml_modified : <EOL> self . _nml_modified . append ( name ) <EOL> value0 = fields [ - <NUM_LIT:1> ] <EOL> val_field = value0 . split ( '<STR_LIT:U+002C>' ) <EOL> if len ( val_field ) > <NUM_LIT:2> : <EOL> i = <NUM_LIT:1> <EOL> while i < len ( val_field ) : <EOL> if ( '<STR_LIT:*>' in val_field [ i - <NUM_LIT:1> ] ) : <EOL> fld = val_field [ i - <NUM_LIT:1> ] . split ( '<STR_LIT:*>' ) <EOL> ndi = int ( fld [ <NUM_LIT:0> ] ) <EOL> id = <NUM_LIT:1> <EOL> while id < ndi : <EOL> val = float ( fld [ <NUM_LIT:1> ] ) <EOL> self . set ( name , val , [ i - <NUM_LIT:1> ] ) <EOL> value = float ( val ) <EOL> id = id + <NUM_LIT:1> <EOL> i = i + <NUM_LIT:1> <EOL> else : <EOL> val = float ( val_field [ i - <NUM_LIT:1> ] ) <EOL> self . set ( name , val , [ i - <NUM_LIT:1> ] ) <EOL> value = float ( val ) <EOL> i = i + <NUM_LIT:1> <EOL> else : <EOL> val = val_field [ <NUM_LIT:0> ] <EOL> if ( '<STR_LIT:*>' in val ) : <EOL> fld = val . split ( '<STR_LIT:*>' ) <EOL> nfld = int ( fld [ <NUM_LIT:0> ] ) <EOL> val1 = float ( fld [ - <NUM_LIT:1> ] ) <EOL> value = float ( val1 ) <EOL> ii = <NUM_LIT:0> <EOL> while ii < nfld : <EOL> self . set ( name , value , [ ii ] ) <EOL> ii = ii + <NUM_LIT:1> <EOL> else : <EOL> attrval = getattr ( self , name ) <EOL> if isinstance ( attrval , int ) : <EOL> value = int ( val ) <EOL> setattr ( self , name , value ) <EOL> else : <EOL> value = float ( val ) <EOL> setattr ( self , name , value ) <EOL> line = stream . readline ( ) . strip ( ) <EOL> return False <EOL> def write ( self , stream ) : <EOL> stream . write ( '<STR_LIT>' ) <EOL> for name in self . _nml_modified : <EOL> value = getattr ( self , name ) <EOL> if isinstance ( value , ndarray ) : <EOL> stream . write ( '<STR_LIT>' % name . upper ( ) ) <EOL> for val in value : <EOL> stream . write ( '<STR_LIT>' % val ) <EOL> stream . write ( '<STR_LIT:\n>' ) <EOL> else : <EOL> stream . write ( '<STR_LIT>' % ( name . upper ( ) , value ) ) <EOL> stream . write ( '<STR_LIT>' ) <EOL> return </s>
