Improved algorithm to compute terrain horizon and Sky View Factor #428
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Algorithm
Description:
The algorithm to compute terrain horizon (and derived Sky View Factor) for ICON is replaced by a C++ routine that used the high-performance ray tracing library Embree (and Intel TBB). The general idea is based on the this reference. I've already tested the new algorithm for the official MeteoSwiss ICON domains (1km & 2km resolution) and for various other Alpine domains with resolutions from ~100 m to 2km.
Improvements:
(but still no added margin to compute terrain horizon correctly close to the boundary):
Shortcomings of new algorithm:
Remaining questions:
Dependencies, compilation and linking of code
The new code depends on two external libraries, Intel Embree and TBB. For testing, I install the binaries of these dependencies manually but they can also be installed via various package managers (e.g., APT).
Install Embree
Install TBB
For testing purposes, I also didn't properly adapt the Makefile yet and I compiled and linked the new code with the following workaround:
With this workaround, I can successfully run the first EXTPAR step (extpar_topo_to_buffer.exe).