Open pyested opened 7 years ago
Hi,
did you solve this? I am also getting the same error ERROR:write>> dtype=np.float64) ERROR:write>> TypeError ERROR:write>> : ERROR:write>> 'float' object cannot be interpreted as an integer
A solution for the invalid literal for float(): 0, 86400
error is described in #96 by @frezersa. I made those changes and it fixed the error for me; perhaps it will help you as well.
We are currently working in an application of the VIC model without post-processing the runoff outputs with a routing scheme, so we have overcome this problem for the time being. However, we are planning to use a routing scheme at some point, and a little research reveals that there are some interesting alternatives besides RVIC:
You can use the previous version of VIC, VIC 4 with the routing scheme of Lohmann et al. (1996). I don't know if this routing scheme can be used with VIC 5 since the grid cell outputs files of the new version include a header that you cannot omit (in the previous version you can specify if you want the header to appear or not). The code is here, and RVIC is just a modern implementation of this routing procedure.
The mizuRoute routine is an interesting tool that works with the real boundaries of the subwatershed given that is not dependent on the resolution of the grid cells. This scheme has been used with VIC 4, for instance, in Melsen et al. (2019).
The mRM routing model is another alternative that initially was coupled to the mHM model and now can be used as a standalone application.
Hi corviday,
thanks for the reply! but the error is when running the parameters. if the solution in #96 helps it didn't help when running rvic.parameters.
DEBUG:subset>> Subset Length: 10.0
DEBUG:subset>> full_time_length: 50
ERROR:write>> Traceback (most recent call last):
ERROR:write>> File "/home/shg1f19/.conda/envs/solenv/bin/rvic", line 61, in
Best, Solomon
@solomonsg Could you solve this problem? I have the same problem and I cannot solve it.
@solomonsg and @navass11 In Line 327 of param_file.py change out_uh = np.zeros((subset_length, outlet.unit_hydrograph.shape[1]), dtype=np.float64) with out_uh = np.zeros((int(subset_length), utlet.unit_hydrograph.shape[1]), dtype=np.float64). This is happening because subset_length=10.0 or 15.0 that is a float so just use int before subset_length. Also Change
tot = outlet.unit_hydrograph[left:right), j].sum()
out_uh[:, j] = outlet.unit_hydrograph[left:right, j] / tot
with
tot = outlet.unit_hydrograph[int(left):int(right), j].sum()
out_uh[:, j] = outlet.unit_hydrograph[int(left):int(right), j] / tot
You also need to change one more thing in same code nearly in line 401 Change
gd['unit_hydrograph'] = np.empty(subset_length, n_sources),
with # Source specific values gd['unit_hydrograph'] = np.empty((int(subset_length), n_sources), and Code will Run Fine. Thanks adpandit
I get some error messages when executing rvic parameters with the RASM sample dataset, but the code is able to generate a final parameter file in netcdf format. Although, when using this parameter file for executing rvic convolution I get more errors. Here are the lines with the error messages when generating RVIC parameters:
I attach the file with the whole log: run_rvic_parameters.txt
On the other hand, the error messages that appear when running rvic convolution are shown below:
And this is the log file for the convolution: run_rvic_convolution.txt
I am trying to find the solution on internet, but it seems that there is nobody with the same problem. I will really appreciate it if you give me some help. I also attach the paramater and convolution configuration files:
rvic.parameters.rasm.txt
rvic.convolution.rasm.txt
Thanks!!