7.3 supos.for


This is a very simple program that enables you to calculate the position of the sun based on simple geographical data (Lat/Lon, local time, local time meridian). From this input data the program generates values for local solar noon, solar altitude, azimuth, and zenith angle, as well as some other parameters (e.g. "mass of the atmosphere").

User instruction

To start the program, simply type <sunpos>. You don't need to add any additional parameters. All necessary questions are asked in a simple user interface. You will need to enter the following parameters: Note that longitudes west of Greenwich and latitudes south of the equator have to be entered as negative values. Also, the values of latitude and longitude must be entered in decimal degrees. The local time meridian (LTM) is the center (longitude) of the time zone the time is based on. You can simply calculate this LTM by considering how many hours you are in advance (east of), or behind (west of) Greenwich. One hour makes up 15 degrees in latitude. Thus, Mountain Time in the US (-8h) has a local time meridian of -112.5° (wich is 7.5 * -15°, since the meridian is in the center of the 8th hours time  zone....).

Output values

As output, you will get the following values: The local solar noon is the time when the sun reaches the highest position (altitude angle) at the location (lat/lon) given as input at the console. It is based on the deviation (east/west) from the local time meridian. The altitude angle is the angle  between a level surface and the position of the sun at the time entered. The azimuth angle is the corresponding (compass) direction of the sun. At the local solar noon, this value would be 180°. The zenith angle describes the angle between the sun altitude and the zenith (90°) position. It is simply the complement of the altitude angle to 90°. The declination of the sun is the latitudinal position of the at the sun at this Julian day. This is as much as 23.45° (north) in summer and as much as -23.45° (south) in winter. The air mass describes an empirical value of the distance the suns rays have to pass through the atmosphere at the given time. At low altitudinal angles the air mass is very high, since the rays have to pass a long distance through the atmosphere, compared to a time when the sun is near its zenith.The empirical formula (1) used to describe the airmass is:

    (1)        air mass  =  [1229.0  +  (614.0  *  sin(alt_rad))2).5  -  (614  *  sin(alt_rad)]

where: alt_rad = the altitude angle of the sun in radians.
Finally, the tau base is a help variable for dealing with atmospheric transmittance values (called Tau). Transmittance describes the rate of loss of energy between ground measured solar radiation and the radiation at the edge of the atmosphere. It is a function of the atmospheric density (due to dust, humidity, etc.), but also due to the altitude angle of the sun. At lower altitude angles, there is a greater loss in energy due to the longer path (higher air mass) through the earth's atmosphere. The following function (2) describes the altitude angle dependent loss in transmittance:

    (2)        tau  =  0.56  *  exp(-.65*mass)+exp(-.09*mass)

where: mass is the air mass of a "normal" clear-sky atmosphere. This results in a zenith angle tau value of 0.8. Since there is rarely such a clear sky, we can change the repective sun angle dependent tau values proportionally, if we can derive the effective, zenith angle tau for a specific sky. The output value I called here "tau base" is simply the following equation (3) out of eqn. (2):

    (3)        exp(-.65*mass)+exp(-.09*mass)

Thus, if we know the "real" zenith angle transmittance (e.g. .75), then we easily can calculate the respetive sun altitude dependent tau as follows (4):

    (4)        taueff  =  0.56  *  0.75  /  0.8 * tau base

General specifications of the AML:

Command: sunpos
Required input: Lat / Lon / LTM / Julian Day / time
Output units: Various sun position measures, and some atmospheric values 
Speed of calculations: very fast, due to simplicity
Flexibility of the routine: can be used for other, more complexe programs
User interface: simple & effective user interface 
Known errors:  -
Programmer N.E. Zimmermann
Download Source Code: supos.for       (use: "save link as")
Download DOS-compiled: sunpos.zip    (use: "save link as")
Download UNIX-compiled: sunpos          (use: "save link as")
Contact: niklaus.zimmermann @ wsl.ch




[top] [back] [home]

Last Updated: 9/24/03
By Niklaus E. Zimmermann