TopoFlow V3

From IARC 207 Wiki
Revision as of 14:13, 2 November 2009 by 137.229.92.231 (talk)
Jump to navigation Jump to search

This is the new (2009) verison of TopoFlow, still in active develop. Included here are some notes I'm working on (Bob Busey) as I get up to speed on the latest version of the model.

So, several configuration elements. The highlights is to start you need a python with these packages installed:
Numpy
MatPlotLib
SciPy
WxPython

At present there is quite a collection of subroutines and such:

CSDMS_base.py			diversions_base.py		rtg_file.py
CSDMS_component.py		energy_balance.py		rti_file.py
ET_base.py			gc2d_funcs.py			rts_file.py
ET_energy_balance.py		get_values_BITS.py		save_load.py
ET_priestley_taylor.py		ice_base.py			snow_base.py
GW_base.py			idl_func.py			snow_degree_day.py
GW_darcy_layers.py		infil_base.py			snow_energy_balance.py
basins.py			infil_beven.py			soil_base.py
bob_start.py			infil_green_ampt.py		soil_funcs.py
channels_base.py		infil_richards_1D.py		tf_input.py
channels_diffusive_wave.py	infil_smith_parlange.py		tf_output.py
channels_dynamic_wave.py	met_base.py			tf_utils.py
channels_kinematic_wave.py	pixels2.py			topoflow.py
d8_base.py			precip_base.py			topoflow_Impl.py
d8_flow_funcs.py		radiation_funcs.py
diversions.py			rt3_file.py

To start, run bob_start.py

In those files you'll need to make a few edits. Specifically, tf_utils.py has a function TF_Test_Directory(). In that function you'll see the working directory returned. Change the line appropriate for your OS to where the input files are located and where the output files should go. There are a couple more things you might find worth changing:

def TF_Test_Data_Prefix():
def TF_Test_Directory():
def TF_Test_Case_Prefix():

So, that's it for functions in tf_utils.py. In the working directory there are a series of *.cfg files. Treat them as you would the old menu system from the previous version of TopoFlow. Up to and including the integer based options. So, when setting things up you may find it useful to run the old IDL based TopoFlow to see what method is first, second, third etc. Here is some example configuration, from *_met.cfg:

--------------------------------------------------
 Meteorological Variables
--------------------------------------------------
Method code:            1
Method name:            Mostly_Dingman
Time step:              Scalar         3600.00000000           [sec]
rho_H2O:                Scalar         1000.00000000           [kg/m^3]
Cp_air:                 Scalar         1005.70001221           [J/kg/K]
rho_air:                Scalar         1.26139998              [kg/m^3]
T_air:                  Scalar         20.00000000             [deg C]
T_surf:                 Scalar         -5.00000000             [deg C]
RH:                     Scalar         0.50000000              [none]
p0:                     Scalar         1000.00000000           [mbar]
uz:                     Scalar         3.00000000              [m/s]
z:                      Scalar         10.00000000             [m]
z0_air:                 Scalar         0.02000000              [m]
Qn_SW:                  Scalar         100.00000000            [W/m^2]
Qn_LW:                  Scalar         10.00000000             [W/m^2]
Save grid timestep:     Scalar         60.00000000             [sec]
Save ea grids:          0              Case5_2D-ea.rts         [mbar]
Save es grids:          0              Case5_2D-es.rts         [mbar]
Save pixels timestep:   Scalar         60.00000000             [sec]
Save ea pixels:         0              Case5_0D-ea.txt         [mbar]
Save es pixels:         0              Case5_0D-es.txt         [mbar]

Nomenclature for units, time series etc. is the same as with the old IDL. Oh, also, Method Name doesn't do anything at present. You should know that Method Code 1 is the Mostly Dingman method name but if you put in a 2 for method code but don't change the name the program will be running method 2 rather than Mostly Dingman which is method 1...

I also imagine the units are rigid but haven't investigated for certain.


In addition, in Topoflow.py you'll need to specify which modules to include. For the 9/30/2009 version that's on lines ~395 - ~405. Comment out an import statement to exclude that routine from running.