Search the web
Sign In
New User? Sign Up
HydroLightUsers · HydroLight Users Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
bug in sun azimuthal angle computation   Message List  
Reply | Forward Message #60 of 88 |
Re: bug in sun azimuthal angle computation

Any one having a problem trying to fix this?


I keep on getting 'rsunz' is used but never set in line 388.

Same with 'rsuna'.


--- In HydroLightUsers@yahoogroups.com, "Curtis Mobley"
<curtis.mobley@...> wrote:
>
> Hello HydroLight users,
>
> Marcos Montes and Joe Rhea of the U.S. Naval Research Lab recently
> noted that the solar azimuthal angle computed by HydroLight when you
> enter the date, time, and location is incorrect. This does NOT affect
> HydroLight's computations, since only the zenith angle (which is
> correct) is used to determine the sky radiance. (Indeed, the sun's
> azimuthal angle is set to zero by H after it is computed within the
> RADTRAN subroutine "sunang".) However, the incorrect azimuthal angle
> is in the printout and therefore should be correct, even if it is not
> used in computations.
>
> To correct this bug:
>
> 1) go to file qasky.f in the maincode directory
> 2) go to subroutine sunang in that file
> 3) replace (or comment out) these four lines of code:
>
> sintmp = sin(abs(rha))*cos(rsdec)/sin(rsunz)
> rsuna = asin(sintmp)
> if(ylat .gt. sdec) rsuna = 180.0 / rad - rsuna
> if(xha .gt. 0.) rsuna = 360.0/rad - rsuna
>
> with these three lines of code:
>
> sna=cos(rsdec)*sin(rha)
> csa=sin(rlat)*cos(rha)*cos(rsdec)-sin(rsdec)*cos(rlat)
> rsuna=(atan2(sna,csa)+4.0*atan(1.0))
>
> The computed sun azimuth angle will then be correct.
>
> As a test case, if you use (in the H GUI)
> day=164
> GMT=12.0
> longitude=-80.100
> latitude=26.020
>
> the printout should show
> sun zenith angle = 71.57 deg
> sun azimuth angle = 72.60 deg
>
> (The old, incorrect azimuth was 107.40 deg.)
>
> Many thanks to Joe and Marcos for finding this bug and for giving me
> code that works. This is what I had in mind when I set up this users'
> forum.
>
> Cheers,
>
> Curt
>





Wed Aug 13, 2008 6:17 pm

caffe1nefree
Offline Offline
Send Email Send Email

Forward
Message #60 of 88 |
Expand Messages Author Sort by Date

Hello HydroLight users, Marcos Montes and Joe Rhea of the U.S. Naval Research Lab recently noted that the solar azimuthal angle computed by HydroLight when you...
Curtis Mobley
hydrolightman
Offline Send Email
May 11, 2005
8:18 pm

Any one having a problem trying to fix this? I keep on getting 'rsunz' is used but never set in line 388. Same with 'rsuna'....
caffe1nefree
Offline Send Email
Aug 13, 2008
6:17 pm

Mimi, No, if you just replace the 4 lines with the new lines it should work. Note that this fix has been included in HE5 (which will be released shortly). I...
Lydia Sundman
lksundman
Offline Send Email
Aug 13, 2008
6:29 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help