source: Roms_tools/air_sea/clskswr.m @ 2

Last change on this file since 2 was 1, checked in by cholod, 13 years ago

import Roms_Agrif

File size: 2.2 KB
Line 
1function sradav = clskswr(yd,lat)
2% CLSKSWR: computes clear sky insolation following Seckel&Beaudry (1973).
3% sradav = CLSKSWR(yd,lat) computes average clear sky solar insolation
4% based on the Seckel and Beaudry (1973) formula presented in Reed (1977),
5% J. Phys. Ocean., 7, 482-485. Assumes the year is not a leap year.
6%
7% INPUT:   yd  -  yearday (e.g., Jan 10th is 10)
8%          lat -  latitude [deg]
9
10% OUTPUT:  sradav - clear sky mean daily insolation [W/m^2]
11
12% NOTE: The output appears to be very similar to what you would get by
13%       averaging soradna.m output over a day and then assuming an
14%       atmospheric transmission of 0.7 (with differences of order 10%
15%       for latitudes below 40N, and increasing to 30% in winter at 60N).
16%       In absolute terms the agreement is to within +/-25 W/m^2.
17
18%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19% 3/8/97: version 1.0
20% 8/28/98: version 1.1 (vectorized by RP)
21% 8/5/99: version 2.0
22%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23
24radlat = pi*lat/180;
25
26if length(lat)==1,
27 lat=lat+zeros(size(yd));
28end;
29
30% check if yd is negative
31ind=find(yd<0);
32yd(ind)=yd(ind)+365;
33% truncate to integer yearday for use with formula
34yd=fix(yd);
35
36phi = (yd-21)*360/365;
37phi = pi*phi/180;
38
39sradav=zeros(size(yd))+zeros(size(lat))+NaN;
40
41ii= lat>=-20 & lat<40;
42if any(ii(:)),
43  a0 = -15.82 + 326.87*cos(radlat(ii));
44  a1 = 9.63 + 192.44*cos(radlat(ii)+pi/2);
45  b1 = -3.27 + 108.70*sin(radlat(ii));
46  a2 = -0.64 + 7.80*sin(2*(radlat(ii)-pi/4));
47  b2 = -0.50 + 14.42*cos(2*(radlat(ii)-5*pi/180));
48  sradav(ii) = a0 + a1.*cos(phi(ii)) + b1.*sin(phi(ii)) + a2.*cos(2*phi(ii)) + b2.*sin(2*phi(ii));
49end
50
51ii= lat>=40 & lat<=60;;
52if any(ii(:)),
53  l2=lat(ii).^2;
54  a0 = 342.61 - 1.97*lat(ii) - 0.018*l2;
55  a1 = 52.08 - 5.86*lat(ii) + 0.043*l2;
56  b1 = -4.80 + 2.46*lat(ii) -0.017*l2;
57  a2 = 1.08 - 0.47*lat(ii) + 0.011*l2;
58  b2 = -38.79 + 2.43*lat(ii) - 0.034*l2;
59  sradav(ii) = a0 + a1.*cos(phi(ii)) + b1.*sin(phi(ii)) + a2.*cos(2*phi(ii)) + b2.*sin(2*phi(ii));
60end
61
62if any(lat>60 | lat<-20)
63  warning('Formula only works for latitudes 20S-60N, see help text for further help')
64end
65
66
Note: See TracBrowser for help on using the repository browser.