Difference between revisions of "TopoFlow V3"
Line 86: | Line 86: | ||
Soon (stuff bob busey will do as a side project): | Soon (stuff bob busey will do as a side project): | ||
# pass an additional config file on the command line similiar to the .ini that I've been using for a while. | # pass an additional config file on the command line similiar to the .ini that I've been using for a while. | ||
− | # instead of bob_start.py make a bob_busey_start.py... pass the command line file here to Unit_Test(input_file as string) read it in and then pass this information to the a new sub in the topoflow.py file that is pretty darn similar to '''def Unit_Test1():''' and start running the model from there. | + | # instead of bob_start.py make a bob_busey_start.py... pass the command line file here to Unit_Test(input_file as string) read it in and then pass this information to the a new sub in the topoflow.py file that is pretty darn similar to '''def Unit_Test1():''' and start running the model from there... due to embedded directory checking this may be more difficult than it seems perhaps to the point of pointless-ness. It looks like the program has been designed to allow this at some point but it may be tricky. |
Revision as of 11:34, 3 November 2009
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.
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 summary, to run topoflow (9/30/2009 edition)
- Edit tf_utils.py and specify: The working directory, the data prefix, and the case prefix
- Make sure that your configuration files (*.cfg) are set correctly. Method 0 = don't use the module, Method = 1 to n = use a method corresponding to that integer value and then the required parameters are listed below in the rest of the .cfg file.
- Once all the configuration stuff is good to go you can run the program from the command line:
$python bob_start.py
- The program will hopefully run to completion.
Some additional tips:
- Be sure you don't have a mix of data prefix names in your configuration files
- It's possible to specify directories in the configuration files such as
T_air: Time_series ./2007/AT.dat [deg C]
- more to come once I use my own data, I'm sure...
- Unit_Test1() -->
- In topoflow.py -->
- read in directory, data prefix, case prefix -->
- create a topoflow instance -->
- set the 'CCA' state -->
- run the model and pass the directory, data prefix, and case prefix information.
Soon (stuff bob busey will do as a side project):
- pass an additional config file on the command line similiar to the .ini that I've been using for a while.
- instead of bob_start.py make a bob_busey_start.py... pass the command line file here to Unit_Test(input_file as string) read it in and then pass this information to the a new sub in the topoflow.py file that is pretty darn similar to def Unit_Test1(): and start running the model from there... due to embedded directory checking this may be more difficult than it seems perhaps to the point of pointless-ness. It looks like the program has been designed to allow this at some point but it may be tricky.