[GRASS5] r.sun questions

Hamish hamish_nospam at yahoo.com
Mon Sep 22 08:02:43 EDT 2003


Some questions & comments about r.sun:

[sample output for "mode 2" for a non-Lat/Lon proj]
r.info:
 |                                                                            |
 |   Data Source:                                                             |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |   Data Description:                                                        |
 |    generated by r.sun                                                      |
 |                                                                            |
 |   Comments:                                                                |
 |     ----------------------------------------------------------------       |
 |     Day [1-365]:                              300                          |
 |     Solar constant (W/m^2):                   1367                         |
 |     Extraterrestrial irradiance (W/m^2):      1384.778926                  |
 |     Declination (rad):                        -0.221957                    |
 |     Latitude min-max(deg):                    -45.3119 - 0.0000            |
 |     Sunrise time min-max (hr.):               5.12 - 5.12                  |
 |     Sunset time min-max (hr.):                18.88 - 18.88                |
 |     Time step (hr.):                          0.5000                       |
 |     Linke turbidity factor:                   3.0                          |
 |     Ground albedo:                            0.200                        |
 |     -----------------------------------------------------------------      |
 |                                                                            |
 |    r.sun elevin=t3 aspin=t3_asp slopein=t3_slp lin=3.00000 alb=0.200000 \  |
 |        beam_rad=t3_sunREALLY_LONG_NAME \                                   |
 |        insol_time=t3_insol_timeREALLY_LONG_NAME \                          |
 |        diff_rad=t3_diff_radREALLY_LONG_NAME \                              |
 |        refl_rad=t3_refl_radREALLY_LONG_NAME day=300 step=0.5 dist=1.0      |
 |                                                                            |
 +----------------------------------------------------------------------------+

Comments:
mode 1: instantaneous solar incidence angle & irradiance using a set local time
mode 2: integrated daily irradiation

* I moved the output of r.sun_out.txt into the "history" of each output file.
This was an issue when running mode 2 for each day of the year and creating 
statistics on the results with r.series. Each day would overwrite the last.
It can be viewed with r.info or parsed using the map's file in the 
$MAPSET/hist/ directory. The appended command history at the bottom is from a
library function G_command_history() I wrote for src/libes/gis/history.c that
isn't in CVS yet.


Questions:
- Declination:  Meaningless in mode 2?
- Latitude min-max:  I'm not sure if the PROJ updates changed this. Are the
recent speedups caused by it only transforming one position (center of the 
map*) or does it calculate for each cell, and what gets reported above is 
simply the last instance? And why is la_max=0 (ie unset after init)?.
????
   * if so, 'g.region -l' shows "-45.3119" near the SE corner, not the middle.
     Maybe this a common southern hemisphere bug: (-45 + 15/60) != -45.25  ?
- sunrise & sunset times are infact slightly different for bigger maps; ok.


I'm working on:
- currently seg faults with incidout=
- currently lets you mix mode 1 and mode 2 only options without error



also in anyone can help, I'm having problems getting gdb to work with GRASS.
I compiled with:
CFLAGS="-O3 -march=pentium4 -Wall -ggdb" LDFLAGS="-s" ./configure ...

but gdb can't find any debug info:

GRASS:~ > gdb r.sun
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...(no debugging symbols found)...
(gdb) break 460
No symbol table is loaded.  Use the "file" command.
(gdb) run 
Starting program: /usr/src/grass/grass53-CVS/dist.i686-pc-linux-gnu/bin/r.sun 
(no debugging symbols found)...
Program received signal SIGTRAP, Trace/breakpoint trap.
0x40000c10 in _start () from /lib/ld-linux.so.2
(gdb) bt f
#0  0x40000c10 in _start () from /lib/ld-linux.so.2
No symbol table info available.
(gdb) 


any clues appreciated.


thanks,
Hamish




More information about the grass-dev mailing list