# interpolation using the cosine of the solar zenith angle

From: Montane Caminal, Francesc <fmontane_at_nyahnyahspammersnyahnyah>
Date: Tue Mar 12 2013 - 10:42:22 MDT

Hi,
I have a netcdf file with short-wave radiation data for one year and I have to interpolate the data from 6-h to 3-h data. It is recommended to use interpolation using the cosine of the solar zenith angle, instead of linear interpolation (for linear interpolation, I am using “linint1_n_Wrap”). Does anyone know if both interpolation methods give quite similar results?
To perform the interpolation using the cosine of the solar zenith angle, I would need to calculate the solar zenith angle with a code of the form, Z = f(longitude, latitude, day of year, hour).
To interpolate from 6hr to 3 hr. Let's say the radiation data for a 6hr period is:

Hr 0-6: Srad = 100 W m-2

To interpolate, it would be necessary to use the above function to calculate the average solar zenith angle for each 3-hour period. Let's say, for example, that we get these results:

Hr 0-3: Z1 = 0 degrees --> cos(Z1) = 1
Hr 3-6: Z2 = 60 degrees --> cos(Z2) = 0.5

It is possible to use that to interpolate the 6 hourly data to 3-hourly:

Hr 0-3: Srad1 = Srad*cos(Z1) / ((cos(Z1) + cos(Z2))/2) = 133.3 W m-2
Hr 3-6: Srad2 = Srad*cos(Z2) / ((cos(Z1) + cos(Z2))/2) = 66.7 W m-2

Is there a similar function available in NCL to perform the interpolation using the cosine of the solar zenith angle as explained above? I had a look at the website but did not find it.