


SWHF: computes net shortwave heat flux into the ocean and albedo.
[qsw,alb]=SWHF(yd,yr,long,lat,dsw) computes the net shortwave heat
flux into the ocean and albedo, using Payne (1972), J. Atm. Sci., 29,
959-970, to estimate the instantaneous albedo given the atmospheric
transmittance (the ratio of measured insolation to the no-atmosphere
insolation).
INPUT: yd - decimal yearday (e.g., 0000Z Jan 1 is 0.0)
yr - year (e.g., 1995)
long - longitude [deg]
lat - latitude [deg]
dsw - (measured) insolation [W/m^2]
OUTPUT: qsw - net shortwave heat flux [W/m^2]
alb - albedo

0001 function [qsw,alb]=swhf(yd,yr,long,lat,dsw) 0002 % SWHF: computes net shortwave heat flux into the ocean and albedo. 0003 % [qsw,alb]=SWHF(yd,yr,long,lat,dsw) computes the net shortwave heat 0004 % flux into the ocean and albedo, using Payne (1972), J. Atm. Sci., 29, 0005 % 959-970, to estimate the instantaneous albedo given the atmospheric 0006 % transmittance (the ratio of measured insolation to the no-atmosphere 0007 % insolation). 0008 % 0009 % INPUT: yd - decimal yearday (e.g., 0000Z Jan 1 is 0.0) 0010 % yr - year (e.g., 1995) 0011 % long - longitude [deg] 0012 % lat - latitude [deg] 0013 % dsw - (measured) insolation [W/m^2] 0014 % 0015 % OUTPUT: qsw - net shortwave heat flux [W/m^2] 0016 % alb - albedo 0017 0018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0019 % 3/8/97: version 1.0 0020 % 7/29/99: version 1.1 0021 % 8/5/99: version 2.0 0022 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0023 0024 % compute sun altitude and no atm solar radiation 0025 [sunalt, sorad]=soradna1(yd,yr,long,lat); 0026 0027 % compute atm transmittance (note: trans=Inf when sorad=0) 0028 trans=inf.*ones(size(sorad)); 0029 j=find(sorad>0); 0030 trans(j)=dsw(j)./sorad(j); 0031 0032 % compute albedo (note: alb=NaN when trans>1 or sunalt<0) 0033 alb=albedo(trans, sunalt); 0034 0035 % compute net shortwave heat flux 0036 % (note: qsw set equal to 0 when alb=NaN) 0037 qsw=(1-alb).*dsw; 0038 ind=find(isnan(qsw)); 0039 qsw(ind)=zeros(size(ind)); 0040 0041 0042