Hi all

I have this project that im doing and some of the code is from another real earlyer version and im trying to clean it up a bit or alot. Here is the code im working on.

Option Base 1
Dim zflag As Integer
Dim la As Integer 'latdir number
Dim lo As Integer 'longdir number
Dim elat As Double 'geocentric latitude (degrees)
Dim elon As Double 'geocentric longitude (degrees)
Dim iday As Integer 'day of ambient table
Dim imonth As Integer 'month of ambient table
Dim iyear As Integer 'year of ambient table
Dim slat As Double 'sine of geocentric latitude
Dim clat As Double 'cosine of geocentric latitude
Dim dis As Double 'geocentric distance (kms)
Dim wlon As Double 'western longitude (hours)
Dim ajd As Double 'astronomical julian day of the month
Dim aday As Double 'day of the year
Dim gast As Double 'correction for nutation and aberration
Dim jds As Double 'julian day for space
Dim lha0s 'local hour angle of sun (degrees)
Dim dhas As Double 'hour angle displacement of sun
Dim sdelta As Double 'declination of first day (sun)
Dim dsdec As Double 'dec. displacement of two days (sun)
Dim pcmoon As Integer 'percentage illumination of the moon
Dim lha0 As Double 'local hour angle of moon (degrees)
Dim dha As Double 'hour angle displacement of moon
Dim delta As Double 'declination of the first day (moon)
Dim ddec As Double 'dec. displacement of two days (moon)
Dim lha00 As Double 'initial value of lha0
Dim dha0 As Double 'initial value of dha
Dim delta0 As Double 'initial value of delta
Dim ddec0 As Double 'initial value of ddecdim
Dim id, im, iy As Long 'calender date from caldat
Dim idow As Integer ' day of the week number
Dim ut As Double
Dim sset As Double 'sunset (hours)
Dim srise As Double 'sunrise (hours)
Dim mrise As Double 'moonrise (hours)
Dim mset As Double 'moonset (hours)
Dim az1 As Double 'solar azimuth as sunset (degrees)
Dim az2 As Double 'solar azimuth as sunrise (degrees)
Dim el1 As Double 'solar elevation
Dim CTW(2) As Double ' civil twilight (eve,morn) (hours)
Dim NTW(2) As Double ' nautical twilight (eve,morn) (hours)
Dim ATW(2) As Double ' astronomical twilight (eve,morn) (hours)
Dim TOTAL As Integer ' number of pieces of data
Dim HR(50) As Integer ' array of hours
Dim mn(50) As Integer ' array of minute
Dim AZ(50) As Double ' array of lunar azimuths / half hour
Dim ELEV(50) As Double ' array of lunar elevations / half-hour (degrees)
Dim AZS(50) As Double ' array of solar azimuths / half hour
Dim ELEVS(50) As Double ' array of solar elevations / half-hour (degrees)
Dim WXFACT(50) As Integer ' WX forecast factors
Dim ILLM(50) As Double ' modified illuminance
Dim IRRM(50) As Double ' modified irradiance
Dim range As Double
Dim inputgood As Boolean 'dates and lat/long goodF
'for LIGHT
Dim moonrise(31) As Double 'hours
Dim moonset(31) As Double 'hours
Dim sunrise(31) As Double 'hours
Dim sunset(31) As Double 'hours
Dim dlhrs(31) As Double 'total daylight hours (hours)
Dim atw1(31) As Double 'evening astronomical twilight (hours)
Dim ntw1(31) As Double 'evening nautical twilight (hours)
Dim ctw1(31) As Double 'evening civil twilight (hours)
Dim ctw2(31) As Double 'morning civil twilight (hours)
Dim ntw2(31) As Double 'morning nautical twilight (hours)
Dim atw2(31) As Double 'morning astronomical twilight (hours)
Dim pcmoon2(31) As Integer 'percentage illumination of moon
Dim idow2(31) As Integer 'day of the week
Dim illum(50) As Double ' array of illum/half-hour
Dim irrad(50) As Double ' array of irrad/half-hour uw/m2)
'
Public tLocationName As String 'Station Information Variables
Public tStationID As String 'for info to be passed from
Public tPoliticalID As String 'StationAddition form to frmMain


I now it looks messey but any help is appreciated
Ed