-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathalbedo.m
33 lines (26 loc) · 1009 Bytes
/
albedo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function alb=albedo(trans,sunalt)
% ALBEDO: computes sea surface albedo following Payne (1972).
% alb=ALBEDO(trans,sunalt) computes the sea surface albedo from the
% atmospheric transmittance and sun altitude by linear interpolation
% using Table 1 in Payne (1972), J. Atm. Sci., 29, 959-970. Assumes
% trans and sunalt both matrices of same size. Table 1 is called
% albedot1.mat.
%
% INPUT: trans - atmospheric transmittance
% sunalt - sun altitude [deg]
%
% OUTPUT: alb - albedo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 3/10/96: version 1.0
% 7/24/98: version 1.1 (rev. to handle out-of-range input values by RP)
% 8/5/99: version 2.0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% load table 1
load albedot1
% create axes
x=[0:2:90];
y=[0:.05:1.0]';
alb=ones(size(trans))+NaN;
k=sunalt>0 & finite(trans) & trans<=1.01;
% interpolate
alb(k)=interp2(x,y,albedot1,sunalt(k),trans(k));