Enter a ZIP code to get a forecast:
Setup Location

WRN Logo

SUNCALC

Sections

NAME

suncalc - Computes sunrise/sunset times.

SYNOPSIS

suncalc [parameters...] location date

PARAMETERS

Command Line Resource Default Description
-h help No Lists basic help information.
-df=filename default .wxpdef Sets the name of the resource file.
-na=name name tafcvt Specifies the name used in resource file parsing.
-ba batch No Run program in batch mode
-me=level message out2 Specifies level of messages to be displayed
  • output - print
-fp=filepath file_path current directory Specifies location of database files.  
-cf=cityfile city_file None Specifies the name of the city database file used in finding station names.
-pa=param[,param...] parameter None Extra parameters (none currently)
location date value None
User Pompt
The location is either:
lat,lon[,zone] or ident[,zone]

The date is either:
yyyy/mm/dd/dd[+nn] or cyear, cmonth, cday[+nn]

DESCRIPTION

This program does general sunrise and sunset computations. The input to the program is two parameters:

  1. location -- This is specified with either the latitude and longitude of the site or a station identifier which is looked up in the sao.cty city database file for location. Remember that latitude is positive north and longitude is positive east. The time zone is computed from the longitude but this often does not give the true time zone. The zone parameter is an hour offset from GMT. For example, EST is "-5". There is an optional "N" parameter if the site does not go on daylight time.
  2. date -- This is specified either with the exact date or with the current date which can be cyear, cmonth, or cday. An optional minute increment can be specified "+nn".

The "DST" environment variable can be set to toggle the zone computation into daylight time.

   setenv DST yes

The program output varies on the input to the program.

  • year only -- This specifies to give sunrise, sunset information for an entire year.
    Lat:   40.42 Lon:  -86.93 Zone:  -5.0
    Year: 1997
    Day    Jan       Feb       Mar       Apr       May       Jun       Jul       Aug       Sep       Oct       Nov       Dec
     1  0811-1732 0757-1806 0721-1839 0631-1912 0547-1943 0520-2012 0521-2022 0545-2002 0615-1919 0644-1830 0718-1744 0752-1722 
     2  0811-1733 0756-1807 0720-1841 0630-1913 0546-1944 0519-2013 0522-2022 0546-2001 0616-1918 0645-1828 0719-1743 0753-1722 
     3  0811-1734 0755-1809 0718-1842 0628-1915 0544-1945 0519-2013 0522-2021 0547-2000 0617-1916 0646-1826 0720-1742 0754-1721 
     4  0811-1735 0754-1810 0717-1843 0626-1916 0543-1946 0518-2014 0523-2021 0548-1959 0618-1915 0647-1825 0721-1741 0755-1721 
    ...
    24  0804-1757 0729-1834 0644-1904 0556-1936 0524-2006 0518-2022 0538-2010 0607-1932 0637-1841 0709-1755 0744-1724 0809-1726 
    25  0803-1758 0727-1835 0643-1905 0555-1937 0523-2006 0519-2022 0539-2009 0608-1930 0638-1840 0710-1753 0745-1724 0809-1727 
    26  0802-1759 0726-1836 0641-1906 0553-1938 0523-2007 0519-2022 0540-2008 0609-1929 0639-1838 0711-1752 0746-1723 0810-1727 
    27  0801-1800 0724-1837 0639-1907 0552-1939 0522-2008 0520-2022 0541-2007 0610-1927 0640-1836 0712-1751 0748-1723 0810-1728 
    28  0801-1801 0723-1838 0638-1908 0551-1940 0522-2009 0520-2022 0541-2006 0611-1926 0641-1835 0713-1749 0749-1723 0810-1729 
    29  0800-1803 0721-1839 0636-1909 0549-1941 0521-2010 0520-2022 0542-2005 0612-1924 0642-1833 0714-1748 0750-1722 0810-1730 
    30  0759-1804           0635-1910 0548-1942 0521-2010 0521-2022 0543-2004 0613-1923 0643-1831 0715-1747 0751-1722 0811-1730 
    31  0758-1805           0633-1911           0520-2011           0544-2003 0614-1921           0717-1746           0811-1731 
  • year and month only -- This specifies to give more detailed information on sunrise, sunset, twilight and solar noon for each day during the month.
    Lat:   40.42 Lon:  -86.93 Zone:  -5.0
    Year: 1997 Month: 6
    Day    Dawn   | Sunrise   Sunset  |   Dusk   =   Noon    DayLen  Twilight
     1 : 04:47:11 | 05:19:37 20:11:52 | 20:44:23 = 12:45:45 14:52:15 00:32:26
     2 : 04:46:42 | 05:19:12 20:12:35 | 20:45:09 = 12:45:54 14:53:22 00:32:30
     3 : 04:46:15 | 05:18:50 20:13:16 | 20:45:55 = 12:46:03 14:54:26 00:32:34
     4 : 04:45:51 | 05:18:29 20:13:56 | 20:46:38 = 12:46:13 14:55:26 00:32:38
     5 : 04:45:29 | 05:18:11 20:14:35 | 20:47:21 = 12:46:23 14:56:23 00:32:42
    ...
    27 : 04:46:21 | 05:19:30 20:21:59 | 20:55:06 = 12:50:44 15:02:29 00:33:09
    28 : 04:46:47 | 05:19:54 20:21:58 | 20:55:04 = 12:50:56 15:02:03 00:33:07
    29 : 04:47:14 | 05:20:20 20:21:55 | 20:54:59 = 12:51:08 15:01:35 00:33:05
    30 : 04:47:44 | 05:20:48 20:21:50 | 20:54:52 = 12:51:19 15:01:02 00:33:03   
  • year, month and day -- This specifies to give sunrise, sunset, extended twilight information for that day
    Lat:   40.42 Lon:  -86.93 Zone:  -5.0
    Year: 1997 Month: 6 Day: 4
    
    Ast Dawn:  03:16:51
    Nau Dawn:  04:04:36
    Dawn:      04:45:51
    Sunrise:   05:18:29
    Sunset:    20:13:56
    Dusk:      20:46:38
    Nau Dusk:  21:28:00
    Ast Dusk:  22:15:58
    -------------------
    Sol Noon:  12:46:13
    Daylength: 14:55:26
    Twilight:  00:32:38          
  • year, month, day and minute increment -- This specifies to give detailed solar location information including elevation, azimuth, zenith angle and declination. The minute increment sets the difference between each computation which is 10 minutes in the sample output.
    Lat:   40.42 Lon:  -86.93 Zone:  -5.0
    Year: 1997 Month: 6 Day: 4
      Time     UTC      Elev   Elev(R) Azimuth  Zenith  Declin RtAscen
    00:00:00 05:00:00  -26.24           348.15  116.24   22.43   72.24
    00:10:00 05:10:00  -26.59           350.70  116.59   22.43   72.25
    00:20:00 05:20:00  -26.85           353.27  116.85   22.44   72.26
    00:30:00 05:30:00  -27.03           355.85  117.03   22.44   72.27
    00:40:00 05:40:00  -27.13           358.45  117.13   22.44   72.27
    00:50:00 05:50:00  -27.14             1.04  117.14   22.44   72.28      
    ...
    03:00:00 08:00:00  -19.83            32.84  109.83   22.45   72.37
    03:10:00 08:10:00  -18.76            35.01  108.76   22.45   72.38
    ---- AST DAWN ----------------------------------------------------
    03:20:00 08:20:00  -17.64            37.14  107.64   22.45   72.39
    03:30:00 08:30:00  -16.46            39.22  106.46   22.45   72.39
    03:40:00 08:40:00  -15.23            41.25  105.23   22.45   72.40
    03:50:00 08:50:00  -13.95            43.24  103.95   22.45   72.41
    04:00:00 09:00:00  -12.63            45.18  102.63   22.45   72.42
    ---- NAU DAWN ----------------------------------------------------
    04:10:00 09:10:00  -11.25            47.08  101.25   22.45   72.42
    04:20:00 09:20:00   -9.84            48.94   99.84   22.45   72.43
    04:30:00 09:30:00   -8.38            50.75   98.38   22.46   72.44
    04:40:00 09:40:00   -6.89            52.53   96.89   22.46   72.44
    ------ DAWN ------------------------------------------------------
    04:50:00 09:50:00   -5.36            54.27   95.36   22.46   72.45
    05:00:00 10:00:00   -3.80            55.98   93.80   22.46   72.46
    05:10:00 10:10:00   -2.21            57.66   92.21   22.46   72.47
    ----- SUNRISE ----------------------------------------------------
    05:20:00 10:20:00   -0.58            59.30   90.58   22.46   72.47
    05:30:00 10:30:00    1.07     1.42   60.92   88.93   22.46   72.48 
    05:40:00 10:40:00    2.74     2.98   62.51   87.26   22.46   72.49
    05:50:00 10:50:00    4.44     4.62   64.07   85.56   22.46   72.49
    06:00:00 11:00:00    6.17     6.30   65.62   83.83   22.46   72.50
    06:10:00 11:10:00    7.91     8.02   67.15   82.09   22.46   72.51
    06:20:00 11:20:00    9.67     9.76   68.66   80.33   22.46   72.52

The output has the following data:

  • sunrise - the time at which the first part of the sun appears above the horizon in the morning.
  • sunset - the time at this the last part of the sun disappears below the horizon in the evening.
  • dawn or civil dawn - this is the time at which the sun is 6 degrees below the horizon in the morning. Civil dawn is defined as that time at which there is enough light for objects to be distinguishable and that outdoor activities can commence.
  • nautical dawn - this is the time at which the sun is 12 degrees below the horizon in the morning. Nautical dawn is defined as that time at which there is just enough sunlight for objects to be distiguishable.
  • astronomical dawn - this is the time at which the sun is 18 degrees below the horizon in the morning. Astronomical dawn is that point in time at which the sun starts lightening the sky. Prior to this time, the sky is completely dark
  • dusk or civil dusk - this is the time at which the sun is 6 degrees below the horizon in the evening. At this time objects are distinguishable but there is no longer enough light to perform any outdoor activities.
  • nautical dusk - this is the time at which the sun is 12 degrees below the horizon in the evening. At this time, objects are no longer distinguishable.
  • astronomical dusk - this is the time at which the sun is 18 degrees below the horizon in the evening. At this time the sun no longer illuminates the sky.
  • solar noon - this is the time at which the sun is the highest in the sky. This time varies through the year due to the change in speed of the earth's orbit around the sun.
  • daylength - the total time the sun is above the horizon
  • twilight - the average time of civil twilight which is the time between civil dawn and sunrise and sunset and civil dusk.
  • elevation - the angle that the sun is above the horizon (assuming no atmosphere)
  • elevation (r) - the angle that the sun appears to be above the horizon assuming the refraction of the earth's atmosphere.
  • azimuth - the direction that the sun appears to be over with 0 degrees being north, 90 being east, 180 being south and 270 being west.
  • zenith angle - the angle between the sun and directly overhead, the zenith
  • declination - the latitude that the sun is directly over which is ~23N in the summer, ~23S in the winter and 0 at the equinoxes.
  • right ascension - the celestial longitude of the sun. This value is 0 at the vernal equinox, 90 at the summer solstice, 180 at the autumnal equinox and 270 at the winter solstice.

FILES

  • sao.cty  - used to cross reference station identifiers with location
  • cities.raw - a list of stations with location and time zone data.

SEE ALSO


For further information about WXP, email technical-support@weather.unisys.com
Last updated by Dan Vietor on Jun 4, 1997