def test1(): c = channels_kinematic_wave.channels_component() c.CCA = False c.DEBUG = False #---------------------------------------------- # Get path to the current file (framework.py) # At top need: "#! /usr/bin/env python" ?? #---------------------------------------------- paths = framework.get_package_paths() framework_dir = paths['framework'] examples_dir = paths['examples'] #------------------------------------------- # Set cfg_prefix and cfg_directory for test #------------------------------------------- cfg_prefix = 'June_20_67' cfg_directory = examples_dir + 'Treynor_Iowa/' # c.site_prefix = 'Treynor' #### Still need this ? #----------------------------------------- # This function adjusts for the platform # and can be changed in "tf_utils.py". #----------------------------------------- ## cfg_directory = tf_utils.TF_Test_Directory() ## cfg_prefix = tf_utils.TF_Test_Case_Prefix() ## c.site_prefix = 'Treynor' ########### ## cfg_directory = '/data/progs/topoflow/3.0/data/test_plane_canal/' #cfg_directory = '/Applications/TopoFlow/Data/Test_Plane_Canal/' #cfg_prefix = 'Case5' #c.site_prefix = 'plane' ######## #------------------------------------------- # Call initialize() and call update() once #------------------------------------------- ## print 'STATUS =', c.get_status() ## c.initialize(mode="driver") ## print 'STATUS =', c.get_status() ## time_sec = float64(0) ## c.update(time_sec) ## print 'STATUS =', c.get_status() #------------------------------------------------- # Can't run this without the framework, because # it provides refs to vars from other components. # This fails when self.P is needed (from met). #------------------------------------------------- c.run_model( cfg_directory=cfg_directory, cfg_prefix=cfg_prefix )
def test1(): c = channels_kinematic_wave.channels_component() c.CCA = False c.DEBUG = False #---------------------------------------------- # Get path to the current file (framework.py) # At top need: "#! /usr/bin/env python" ?? #---------------------------------------------- paths = framework.get_package_paths() framework_dir = paths['framework'] examples_dir = paths['examples'] #------------------------------------------- # Set cfg_prefix and cfg_directory for test #------------------------------------------- cfg_prefix = 'June_20_67' cfg_directory = examples_dir + 'Treynor_Iowa/' # c.site_prefix = 'Treynor' #### Still need this ? #----------------------------------------- # This function adjusts for the platform # and can be changed in "tf_utils.py". #----------------------------------------- ## cfg_directory = tf_utils.TF_Test_Directory() ## cfg_prefix = tf_utils.TF_Test_Case_Prefix() ## c.site_prefix = 'Treynor' ########### ## cfg_directory = '/data/progs/topoflow/3.0/data/test_plane_canal/' #cfg_directory = '/Applications/TopoFlow/Data/Test_Plane_Canal/' #cfg_prefix = 'Case5' #c.site_prefix = 'plane' ######## #------------------------------------------- # Call initialize() and call update() once #------------------------------------------- ## print 'STATUS =', c.get_status() ## c.initialize(mode="driver") ## print 'STATUS =', c.get_status() ## time_sec = float64(0) ## c.update(time_sec) ## print 'STATUS =', c.get_status() #------------------------------------------------- # Can't run this without the framework, because # it provides refs to vars from other components. # This fails when self.P is needed (from met). #------------------------------------------------- c.run_model(cfg_directory=cfg_directory, cfg_prefix=cfg_prefix)
from topoflow.components import channels_kinematic_wave # Kinematic Wave wave = channels_kinematic_wave.channels_component() wave.initialize(cfg_file="cfg/Treynor_channels_kinematic_wave.cfg") wave.P_rain = 100 wave.SM = 0 wave.ET = 0 wave.GW = 0 wave.IN = 0 wave.MR = 0 wave.rho_H2O = 1000 wave.update() wave.finalize() ################################################################################## # Copying a variable from kinematic wave because of formatting S_free = wave.S_bed from topoflow.components import channels_diffusive_wave # Diffusive Wave wave = channels_diffusive_wave.channels_component() wave.initialize(cfg_file="cfg/Treynor_channels_diffusive_wave.cfg")