c file name: dawn.for real function dawn(dlat,dlong,idoy) c + + + PURPOSE + + + c This function calculates the time of sunrise 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, latitude c of the site, and longitude of the site. c DATE: 03/10/92 (SUN.FOR) c MODIFIED: 12/10/93 c + + + KEYWORDS + + + c sunrise c + + + ARGUMENT DECLARATIONS + + + integer idoy real dlat real dlong c + + + ARGUMENT DEFINITIONS + + + c idoy - Day of year c dlat - Latitude of the site, degrees c dlong - Longitude of the site, degrees c + + + LOCAL VARAIBLES + + + real b, dec, e, h, coshr, sn real rise c + + + LOCAL DEFINITIONS + + + c irise - Time of sunrise (local standard time) as an integer c e - Equation of time c h - Hour angle c coshr - Cosine of hour angle at sunrise c sn - Solar noon c + + + COMMON BLOCKS + + + *$noereference include 'p1const.inc' *$reference c + + + END SPECIFICATIONS + + + c Calculate declinatrion angle (dec) b= (360.0/365.0)*(idoy-81.25) !h-55 dec= 23.5*sin(b*pi/180.0) !h-58 c Calculate the equation of time (e) e = 9.87*sin(2*b*pi/180.0)-7.53*cos(b*pi/180.0)-1.5* !h-54 & sin(b*pi/180.) c Calculate solar noon (sn) sn = 12.0-e/60.0-4.0*mod(dlong,15.0)/60.0 !h-53 c Calculate the cosine of hour angle (h) at sunrise coshr = -1.0*sin(dlat*pi/180.0)/cos(dlat*pi/180.)* !h-57 & sin(dec*pi/180.)/cos(dec*pi/180.) c Calculate the hour angle (h) h= pi/2 - atan(coshr/(sqrt(1-coshr*coshr))) !h-56 h= -h*180/pi c Calculate the time of sunrise (rise) rise= h/15.0 + sn !h-52 dawn=rise return end