Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when generating timeseries report for water use module #169

Open
Nooshdokht-Bayatafshary opened this issue Aug 24, 2024 · 1 comment

Comments

@Nooshdokht-Bayatafshary

Dear developers,

I am trying to generate a timeseries report for the water use module in my model. I added the following command to the XML file (settings_calibrationRun_test.zip):

<setoption choice="1" name="repwateruseGauges"/>

However, after adding this command, the model fails to run successfully. Before making this change, the model ran without any issues.

The error I encountered is as follows:

Traceback (most recent call last):
  File "/home/n.bayatafshary74.student.sharif/.conda/envs/lis3.8/bin/lisflood", line 41, in <module>
    sys.exit(main())
  File "/home/n.bayatafshary74.student.sharif/.conda/envs/lis3.8/lib/python3.8/site-packages/lisflood/main.py", line 226, in main
    lisfloodexe(lissettings)
  File "/home/n.bayatafshary74.student.sharif/.conda/envs/lis3.8/lib/python3.8/site-packages/lisflood/main.py", line 157, in lisfloodexe
    model_to_run.run()
  File "/home/n.bayatafshary74.student.sharif/.conda/envs/lis3.8/lib/python3.8/site-packages/lisflood/global_modules/zusatz.py", line 147, in run
    self._runDynamic()
  File "/home/n.bayatafshary74.student.sharif/.conda/envs/lis3.8/lib/python3.8/site-packages/pcraster/framework/frameworkBase.py", line 371, in _runDynamic
    self._userModel().dynamic()
  File "/home/n.bayatafshary74.student.sharif/.conda/envs/lis3.8/lib/python3.8/site-packages/lisflood/Lisflood_dynamic.py", line 248, in dynamic
    self.output_module.dynamic()
  File "/home/n.bayatafshary74.student.sharif/.conda/envs/lis3.8/lib/python3.8/site-packages/lisflood/global_modules/output.py", line 575, in dynamic
    self.var.Tss[tss].sample(decompress(eval(what)))
  File "/home/n.bayatafshary74.student.sharif/.conda/envs/lis3.8/lib/python3.8/site-packages/lisflood/global_modules/add1.py", line 289, in decompress
    dmap[~maskinfo.info.maskflat] = map[:]
TypeError: 'pcraster._pcraster.Field' object is not subscriptable

Could you please help me understand how I can successfully generate reports on water usage in my region?

Best regards,
Nooshdokht

@StefaniaGrimaldi
Copy link
Contributor

Dear @Nooshdokht-Bayatafshary ,

well-spotted (again)! We do not use such option in our operational protocols, therefore we were not aware of the issue.
@doc78 and I identified the solution, which is now available the development branch: https://github.com/ec-jrc/lisflood-code/tree/development

We also tested the identified solution using the set-up that you kindly shared with us some time ago. The solution of the development branch runs correctly, however, depending on the settings, and on the implemented Environmental Flow Threshold, the wateruseUps.tss file might (correctly) contain all zeros.

We hope that we were able to help,
kind regards,
Carlo and Stefania

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants