-
Notifications
You must be signed in to change notification settings - Fork 1
Improved algorithm to compute terrain horizon and Sky View Factor #405
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
base: master
Are you sure you want to change the base?
Conversation
…s the numerical accuracy for e.g. computing the ASTER grid spacing, it produces erroneous results when the boundary coordinates of a tile does not exactly match integer coordinates (e.g. the case for MERIT). Furthermore, the signs for adding ‘half_gridp’ to latitudinal coordinates is erroneous because the decreasing nature of latitude values was already accounted for while reading them in.
…increases the numerical accuracy for e.g. computing the ASTER grid spacing, it produces erroneous results when the boundary coordinates of a tile does not exactly match integer coordinates (e.g. the case for MERIT). Furthermore, the signs for adding ‘half_gridp’ to latitudinal coordinates is erroneous because the decreasing nature of latitude values was already accounted for while reading them in." This reverts commit 238a2e7.
…ON C++ interface works.
…aining the North/South Pole and/or crossing the +/- 180 deg meridian
One additional small problem just came to my mind (not sure if it ever occurs but it could lead to strange behaviour). If a ICON grid cell circumcenter aligns perfectly with either the North or South Pole, it is obviously not possible to define the aspect (slope azimuth) angle for this point .This information is, together with the slope angle, required for the radiation-topography-correction scheme. I think there is a similar quantity in the SSO scheme that is expressed as an azimuth angle. However, it seems that for a global grid, the ICON vertices typically align with the Poles (and no the circumcenters) and for the regional domain, it is very unlikely that his happens - so it might not be necessary to address this issue... |
…on the fly (more memory efficient), obsolete function 'vector_matrix_multiplication' removed
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: