Now start the models"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"t_end = RT_model.get_end_time()\n",
"t = RT_model.get_start_time()\n",
"\n",
"res = []\n",
"resq = []\n",
"\n",
"# Loop in time and put output of SBM in seperate routing module - 1way link\n",
"while t < t_end:\n",
" LA_model.update()\n",
" # Now set the output from the LA model (specific Q) as input to the RT model\n",
" thevar = LA_model.get_value(\"InwaterMM\")\n",
" RT_model.set_value(\"IW\",thevar) # The IW is set in the wflow_routing.ini var as a forcing\n",
" RT_model.update()\n",
" resq.append(RT_model.get_value(\"SurfaceRunoff\"))\n",
" res.append(thevar)\n",
" t = RT_model.get_current_time()\n",
" \n",
" print datetime.datetime.fromtimestamp(t)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"LA_model.finalize()\n",
"RT_model.finalize()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"