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

Issue with Landscape File Initialization in Forefire Simulation #33

Closed
jsotomartin opened this issue Jul 11, 2024 · 1 comment
Closed

Comments

@jsotomartin
Copy link

I am trying to build a landscape function for a location of interest (Crete) and I am following the example of landscape_gen_funcs.py from py3_tools/forefirepy. My simulation setup is quite simple and includes:

  • Elevation Map: a .tiff file obtained from the STRM website.
  • Fuel Map: built in the same projection as the elevation map. Land has a value of 323, and sea has a value of 523, following the fuel.ff file. It is also a .tiff file.
  • Wind Field: using default_wind_generator() from the code, which generates wind assumed to be 10 m/s and calculated in 8 different directions.

However, when I run Forefire, I encounter the following error:
imagen

I have attempted to resolve this error in two ways:

  1. Debugging the code
  • I found that the error originates from DataBroker.cpp in the void DataBroker::initializePropagativeLayer(string filename) method (line 2155).

    It seems the NetCDF file is detected (as it is not null), but the exception message is thrown, and the code exits. My guess is that the NetCDF file format is not correct for Forefire to interpret it.

  1. Comparing NetCDF Files
  • I compared my NetCDF file with the aullene/landscape.nc file, which runs successfully in the example.

    What I found is that all variables in the aullene/landscape.nc domain are in a 32-bit format, whereas in my case, they are in a 64-bit format. Also, the aullene/landscape.nc file is in 'classic' NetCDF format, whereas mine is 'netCDF4'. Could these differences be causing the issue?

Additionally, I have a couple of questions:

  • Could you please clarify the roles of the wind_rows and wind_columns variables in the wind domain, as I am unsure how to interpret them in the NetCDF file?
  • In the tools/preprocessing folder, the documentation mentions using genForeFireCase.py that contains the routines for addFieldToNcFile. However, this script no longer exists, or it is in a different location. Could you update the documentation with its new location or name?

Best regards,
Jorge

@filippi
Copy link
Contributor

filippi commented Oct 4, 2024

Yes indeed !
you should use the classic version of netcdf, unless you link with a netcdf library that supports it... libnectcdf++
as for wind, please go and see pyForeFire in tools/wind.py
rows columns and directions are for potential wind perturbation relative to orography, you should precompute those if you want to use it.
tools/preprocessing please use pyForeFire... I cannot keep with having all these code and documentation up to date... genForeFireCase.py should not be here.

@filippi filippi closed this as completed Oct 4, 2024
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