Opened 7 years ago

Closed 6 years ago

#3052 closed defect (fixed)

Watts to MegaJoules/Day conversion issue

Reported by: cholmes Owned by: grass-dev@…
Priority: normal Milestone: 7.0.5
Component: Imagery Version: svn-releasebranch70
Keywords: Cc: ychemin
CPU: Unspecified Platform: All

Description (last modified by neteler)

I think I may have found an error in a few files from the grass-ci repo.

A few files:

contain a line like:

ra = ra * (84600.0 * 1000.0);	/*convert W -> MJ/d */

I'm guessing the magic constant 84600 is intended to be the number of seconds in a day, which is actually 86400. Also, Watts * Seconds gives Joules. If you intend to get MegaJoules, you must divide by 1000, not multiply (but maybe the comment is just wrong, and you wanted milliJoules?).

Change History (7)

comment:1 by martinl, 7 years ago

Component: DefaultImagery
Keywords: added

comment:2 by ychemin, 7 years ago

article is here for file mh_eto.c :

ref to equation 5 page 40.

equation 1 page 36 references the units used: RA-> MJ / m2 / d

MegaJoules per meter square per day.

So the conversion is indeed wrong in the ticket.

comment:3 by ychemin, 7 years ago

Resolution: fixed
Status: newclosed

comment:4 by neteler, 7 years ago

For reference: r68564

comment:5 by neteler, 7 years ago

Cc: ychemin added
Description: modified (diff)
Resolution: fixed
Status: closedreopened
Version: unspecifiedsvn-releasebranch70

Reopening for the issue: 84600 should be 86400 (?)

comment:6 by neteler, 7 years ago

Backported changes for i.eb.* + i.evapo.*: fix for MegaJoules per meter square per day (backport of r68564, r68572, r68573, r68574, r68579, trac #3052); all sync'ed to trunk

Done in r68580 (releasebranch_7_2) and r68581 (releasebranch_7_0).

@cholmes: thanks for your important hint and please test.

comment:7 by martinl, 6 years ago

Resolution: fixed
Status: reopenedclosed

No activity, closing, feel free to reopen if needed.

Note: See TracTickets for help on using tickets.