I have "Error in run coastal blue carbon model."

What is the issue or question you have?

When running the coastal blue carbon model, it shows the following error. I don’t know what to do to run the model

2024-02-20 13:03:19,086 (pygeoprocessing.geoprocessing) geoprocessing.raster_calculator(583) INFO Waiting for raster stats worker result.
2024-02-20 13:03:19,370 (natcap.invest.utils) utils.prepare_workspace(166) ERROR Exception while executing natcap.invest.coastal_blue_carbon.coastal_blue_carbon
Traceback (most recent call last):
File “natcap\invest\utils.py”, line 164, in prepare_workspace
File “invest\cli.py”, line 470, in main
File “natcap\invest\coastal_blue_carbon\coastal_blue_carbon.py”, line 956, in execute
KeyError: ‘soil’
2024-02-20 13:03:19,386 (natcap.invest.utils) utils.prepare_workspace(169) INFO Elapsed time: 3m 9.680000000000007s
2024-02-20 13:03:19,386 (natcap.invest.utils) utils.prepare_workspace(172) INFO Execution finished

What do you expect to happen?run the model

What have you tried so far? I don’t know what to do to run the model I can translate the given text to English while following the rules of grammar as follows:

“I suspect there is an issue with the biophysical file. I will upload the biophysical file, could you please point out the problem so that I can correct it?”
carbon_biophysical_table_template_hormozgan_2020.csv (1.3 KB)

Upload the logfile using the :outbox_tray: button

InVEST-natcap.invest.coastal_blue_carbon.coastal_blue_carbon-log-2024-02-20–11_11_38.txt (12.7 KB)

It appears that you are running the model on just one year (2020). What happens if you set the Analysis Year to 2021?

Hello, thank you for your answer. I only have the information for 2020 and the goal is to calculate the amount of coastal carbon in 2020. Can you please help me how to fix the model error, thanks

This is a bug in the model when you only provide one year and no analysis year. Setting the analysis year to 2021, even if you only use the 2020 results, may circumvent the problem.

However, if you only use one year, the results will be very simple. Everything interesting about the model (accumulations and emissions, transitions, valuation) requires multiple years.

Your expertise and guidance were invaluable and made a huge difference. I truly appreciate the time and effort you put into helping me, and I couldn’t have done it without you.
Thank you again for your help.
Best regards

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.