Closed rburghol closed 1 year ago
Debug ordering:
trib2.get_state('local_area_sqmi')
# 0.7380725832
trib2.get_state('trib_area_sqmi')
# 3.3810952139999992
trib2.get_state('drainage_area_sqmi')
# 3.7810582757999995
trib2.get_object('drainage_area_sqmi').equation
'local_area_sqmi + trib_area_sqmi'
# verify the ops:
trib2.get_object('drainage_area_sqmi').ops #returns: [1, 52, 1, 2, 44, 48]
# ops look good, since ix 44 and 48 point to the right state vars:
get_ix_path(state_paths,44) # returns: '/STATE/RCHRES_R001/nhd_8566731/local_area_sqmi'
get_ix_path(state_paths,48) # returns: '/STATE/RCHRES_R001/nhd_8566731/hydroObject/trib_area_sqmi'
# now, run it again, in case it is a funny ordering thing?
step_one(op_tokens, op_tokens[trib2.get_object('drainage_area_sqmi').ix], state_ix, dict_ix, ts_ix, 1)
# get the result:
trib2.get_state('drainage_area_sqmi') # returns the correct value: 4.119167797199999
# now if I run the next step?
pre_step_model(model_exec_list, op_tokens, state_ix, dict_ix, ts_ix, 2)
step_model(model_exec_list, op_tokens, state_ix, dict_ix, ts_ix, 2)
trib2.get_state('drainage_area_sqmi') # returns bad value: 3.7810582757999995
Iterate through checking the value of the drainage_area_sqmi continuously till it goes wrong (or right).
step = 1
pre_step_model(model_exec_list, op_tokens, state_ix, dict_ix, ts_ix, step)
i = 0
model=model_exec_list[i];print("The ",i,"th element is ID", model);step_one(op_tokens, op_tokens[model], state_ix, dict_ix, ts_ix, step); i=i+1;trib2.get_state('drainage_area_sqmi')
Tasks:
trib_area_sqmi
function appropriatelyQtrib
functionExplore the exec order
step = 1 pre_step_model(model_exec_list, op_tokens, state_ix, dict_ix, ts_ix, step)
i = 20 # start at the Qlocal of Trib1 print("Exec order", i,"is object",get_ix_path(state_paths, model_exec_list[i])) model = model_exec_list[i]; i = i+1 step_one(op_tokens, op_tokens[model], state_ix, dict_ix, ts_ix, step) trib2.get_object('hydroObject').get_object('Qtrib').get_object('Qtrib67').get_state() print("Qtrib(2) at exec step", i, "=",trib2.get_state('Qtrib')) print("Qtrib(2) at exec step", i, "=",trib2.get_state('Qtrib')) trib1.get_state('Qlocal')