| 1 |
From Thomas.Huld jrc.it Thu Jul 26 11:01:44 2007 |
| 2 |
To: Markus Neteler <neteler itc.it> |
| 3 |
CC: Jaro Hofierka <hofierka geomodel.sk>, "marcel.suri jrc.it" |
| 4 |
<marcel.suri jrc.it>, Tomas Cebecauer <tomas.cebecauer jrc.it> |
| 5 |
Date: Thu, 26 Jul 2007 11:01:44 +0200 |
| 6 |
Subject: Re: r.horizon source code |
| 7 |
Lines: 1533 |
| 8 |
|
| 9 |
I'm sending the r.sun sources to you here, even though the description is not |
| 10 |
yet up to date. I think it works OK now, though I haven't tried all possible |
| 11 |
combinations of options. For instance, I haven't ever used the incidence |
| 12 |
angle or insolation time outputs. There's no reason why they should have |
| 13 |
stopped working but there are always changes that break something unexpected. |
| 14 |
|
| 15 |
The main changes are: |
| 16 |
|
| 17 |
- possibility to read in horizon rasters to use with the shadow calculation. |
| 18 |
|
| 19 |
- Calculation of the shadowing effect should now also work in lat/lon |
| 20 |
projection. |
| 21 |
|
| 22 |
- There was a bug in r.sun whereby the shadowing effect was calculated wrong |
| 23 |
when the left-right and up-down directions in the projection are different |
| 24 |
from east-west and north-south, as is the case in the projection we use |
| 25 |
(Lambert Azimuthal) when moving away from the point of origin. This has been |
| 26 |
fixed now though only checked with Lambert Azimuthal. |
| 27 |
|
| 28 |
- I'm not sure if this went in already in a previous version, but the |
| 29 |
algorithm now also takes into account the curvature of the earth when |
| 30 |
calculating shadows. |
| 31 |
|
| 32 |
- new output possibility: glob_rad, which is the sum of the three radiation |
| 33 |
components |
| 34 |
|
| 35 |
- new input parameter: <i>civiltime</i>. When this parameter is given, the |
| 36 |
single time calculation will calculate the irradiance at the *same* time for |
| 37 |
the entire raster instead of using the local solar time. The value of |
| 38 |
<i>civiltime</i> is the timezone, relative to GMT. (+1 for central Europe) |
| 39 |
|
| 40 |
- new input parameter <i>numpartitions</i> No change in the calculation |
| 41 |
methods, but the program will read the input rasters and do the calculations |
| 42 |
in a number of chunks, instead of reading in everything at the start. Output |
| 43 |
is still only at the very end. This is only to save memory. It will not work |
| 44 |
if you try to calculate shadows without the horizon information, and the |
| 45 |
program will tell you so. |
| 46 |
|
| 47 |
- I reorganized the source code quite a lot. In particular, I spun off several |
| 48 |
functions into a separate source file called rsunlib.c. I also organized many |
| 49 |
of the global variables into <i>struct</i>'s for an easier overview. I did |
| 50 |
this because we work here with several derivatives of r.sun: |
| 51 |
|
| 52 |
* r.sunyear which calculates the optimum inclination angle for maximum |
| 53 |
insolation |
| 54 |
* r.pv which calculates the PV output taking into account also temperature |
| 55 |
effects |
| 56 |
* r.sun.2axis which is r.sun for a moving plane, whose normal always points |
| 57 |
to the sun (two-axis tracking solar energy systems). |
| 58 |
|
| 59 |
Splitting the source code made it easier to reuse bits for these r.sun |
| 60 |
derivatives. I haven't updated the Makefile to account for these changes yet. |
| 61 |
Look at the little script "compdebug" in the source directory. |
| 62 |
|
| 63 |
|
| 64 |
There may be other changes that I've forgotten about but nothing dramatic. |
| 65 |
|
| 66 |
Have fun! |
| 67 |
|
| 68 |
|
| 69 |
Thomas |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
-- |
| 74 |
-------------------------------------------------- |
| 75 |
Thomas Huld |
| 76 |
Joint Research Centre of the European Commission |
| 77 |
T.P. 450 |
| 78 |
I-21020 Ispra, Italy |
| 79 |
phone: +39 0332785273 |
| 80 |
e-mail: [email protected] |
| 81 |
-------------------------------------------------- |