I would like to calculate (estimate) air temperature at given time, location and altitude.
All I have is air pressure for 20°C. The formula based on NTP (Normal Temperature and Pressure) to calculate pressure.
=101325*(1 - 2,25577*10^-5*h)^5,25588
h is height in meters` result is in Pascals.
I expect that the formula for calculation of the temperature would depend on sun position or even solar radiation. I know that the formulas for calculation of the sun position or solar radiation are complicated but maybe there are source codes/programs which can do that? So I could use such program to calculate what I need? I have found SolTrack (C/C++) on SourceForge which calculates various data like rise time, transit time, azimuth, altitude, ecliptic longitude, latitude, right ascension, declination... However I cannot use these results to calculate temperature.
Purpose of the calculation
I would like to use the calculation for game, to generate air temperatures for map. The game is not simulator it is just game. So I need to add some values to the map so when the aircraft flies it can accept some temperature changes. The values are important in vicinity of terrain, mountains and hills. I don't need include winds into the calculation.
Calculation of Solar Radiation What I have found so far is calculation of solar radiation written in Visual Basic - it is xls table (Excel) ecy.wa.gov/programs/eap/models/solrad.zip. Where I have added the pressure for 20°C. Of sure the problem here is unsolved because I suppose the temperature and pressure changes during time. So I need to improve the formula to calculate the pressure for given location, time and altitude.
Site data and time info:
latitude in decimal degrees (positive in northern hemisphere)
longitude in decimal degrees (negative for western hemisphere)
ground surface elevation (m)
time zone in hours relative to GMT/UTC (PST= -8, MST= -7, CST= -6, EST= -5)
daylight savings time (no= 0, yes= 1)
start date to calculate solar position and radiation start time
time step (hours):
number of days to calculate solar position and radiation
Bird model parameters:
barometric pressure (mb, sea level = 1013)
ozone thickness of atmosphere (cm, typical 0.05 to 0.4 cm)
water vapor thickness of atmosphere (cm, typical 0.01 to 6.5 cm)
aerosol optical depth at 500 nm (typical 0.02 to 0.5)
aerosol optical depth at 380 nm (typical 0.1 to 0.5)
forward scattering of incoming radiation (typical 0.85)
surface albedo (typical 0.2 for land, 0.25 for vegetation, 0.9 for snow)
Bras model parameter:
Bras atmospheric turbidity factor (2=clear, 5=smoggy, default = 2)
Ryan-Stolzenbach model parameter
Ryan-Stolzenbach atmospheric transmission factor (0.70-0.91, default 0.8)
Cloud attenuation parameters:
Coefficient for cloud correction (default 0.65)
Exponent for cloud adjustment (default 2)
Cloud cover fraction (0-1)