c$Author: fredfox $ c$Date: 2002-05-08 18:47:45 $ c$Revision: 1.2 $ c$Source: /weru/cvs/weps/weps.src/util/solar/daylen.for,v $ real function daylen(dlat,idoy,riseangle) c + + + PURPOSE + + + c This function calculates the daylength (hours) for any simulation c site based on the global position of the site, and day of the c year. The inputs for the function are day of the year, and latitude c of the site. c + + + KEYWORDS + + + c day length c + + + ARGUMENT DECLARATIONS + + + integer idoy real dlat real riseangle c + + + ARGUMENT DEFINITIONS + + + c idoy - Day of year c dlat - Latitude of the site, degrees (north > 0, south < 0) c riseangle - angle of earths rotation where sunrise occurs c this varies depending on whether you are calculating c direct beam, civil twilight, nautical twilight or c astronomical twilight daylength c + + + LOCAL VARIABLES + + + real b, dec, e, h, coshr c + + + LOCAL DEFINITIONS + + + c dec - declination of earth wrt the sun (degrees) c e - Equation of time (minutes) c h - Hour angle (degrees) c + + + COMMON BLOCKS + + + include 'p1unconv.inc' c + + + FUNCTION DECLARATIONS + + + real declination real hourangle c + + + END SPECIFICATIONS + + + c declination angle (dec) dec = declination(idoy) c sunrise or sunset hour angle h = hourangle(dlat, dec, riseangle) c Calculate the length of the day daylen= 2.0*h/15.0 return end