编辑:我需要的代码添加到计算辐射和太阳常数修正。
空白getSolRadBird(输入我SOLPOS SOLPOS, SOLRAD * o){双degRad = 0.017453292519943295769236907684886;/ /相对空气质量双= 1。/ (cos (solpos。Z * degRad) + 0.15 *战俘(93.885 -solpos.z, -1.25));双AMp = 1013 * i.sitePressure /。/ /瑞利双Tr = exp(-0.0903 *战俘(AMp, 0.84) * (1 + AMp-pow (AMp, 1.01)));/ /臭氧双Ozm = i.ozone *点;双Toz = 1. - -0.1611 * Ozm *战俘(1 + 139.48 * Ozm, -0.3035) -0.002715 * Ozm / (1 + 0.044 * Ozm + 0.0003 *战俘(Ozm 2。));/ /混合气体双Tm = exp(-0.0127 *战俘(AMp, 0.26));/ /水蒸气双Wm =我* i.water;/ /总水汽双Tw = 1. - -2.4959 * Wm /((1。+战俘(79.034 * Wm, 0.6828)) + 6.385 * Wm); // daily turbidity // Ta5=A*sin((Dan-B)*PI/180.)+C; aerosol optical depth at 500 nm // Ta3=Ta5+0.1; double Ta5=i.AOT500; double Ta3=i.AOT380; double Tau=0.2758*Ta3+0.35*Ta5; double Ta=exp((-pow(Tau,0.873))*(1.+Tau-(pow(Tau,0.7088)))*pow(AM,0.9108)); double TAA=1.-0.1*(1.-AM+pow(AM,1.06))*(1.-Ta); double TAs=Ta/TAA; double Rs=0.0685+(1.-0.84)*(1.-TAs); // clear irradiance double Io=i.SolConst; // direct // Earth/sun distance correction, Rsq = 1/R^2 // double d=f.doy; // double Rsq=(1.00011+0.034221*cos(6.28318*(d-1)/365)+0.00128*sin(6.28318*(d-1)/365)+0.000719*cos(2*(6.28318*(d-1)/365))+0.000077*sin(2*(6.28318*(d-1)/365))); double Rsq=1.0/ (solpos.R*solpos.R) ; //alert("R= "+Rsq); double Id=Rsq*Io*.9662*Tr*Toz*Tm*Tw*Ta; // direct on horizontal surface double Idh=Id*cos(solpos.Z*degRad); // diffuse (scattered) double Ias=0.79*Io*cos(solpos.Z*degRad)*Toz*Tm*Tw*TAA; Ias=Ias*(0.5*(1.-Tr)+0.85*(1.-TAs))/(1.-AM+pow(AM,1.02)); // total dif + dir on horizontal double Itot=(Idh+Ias)/(1.-i.albedo*Rs); double Idif=Itot-Idh; // Save the values o->air_m = AM; o->direct = Idh; o->diffuse = Idif; o->total = Itot; o->S_corrected = Rsq*Io; }