fclose('all');
clear all;
%****
sgb=5.67e-8;
%Find the flux_file data 
f=['D:\cwf\data\sheba\mettwr_1&2.txt'];

flist=fopen(f,'r');
flx_lab1=fgets(flist);
flx_lab2=fgets(flist);
datz=fscanf(flist,'%g%g%g%g%g%g%g%g%g%g%g%g%g%g%g%g%g%g%g%g%g',[21,2000]);
[a,cnt_mx]=size(datz);

%jazz(1)=jd_son(j);%decimal JD
%jazz(2:3)=ws_i(j,1:2);%wind speed (m/s)at 2m, 10m
%jazz(4:5)=wd_i(j,1:2);%wind direction at 2m, 10 m
%jazz(6:7)=t_v_i(i,1:2);%temp(C) at 2 m, 10 m
%jazz(8:9)=q_v_i(i,1:2);%mixing ratio (g/kg) at 2 m, 10 m
%jazz(10)=us_md(j);%ustar (m/s)
%jazz(11)=hs_md(j);%sensible heat flux (W/m2)
%jazz(12)=T_sn_an(i);%General Eastern 12 cm temp (C)
%jazz(13)=Tsnwr(i);%radiative surface temp (C)
%jazz(14)=Tice(i);%snow/ice interface temp (C)
%jazz(15)=Rtdx(i);%longwave down
%jazz(16)=Rtux(i);%longwave up
%jazz(17)=Rsdx(i);%solar down (as if there was any)
%jazz(18)=Rsux(i);%solar up
%jazz(19)=orgx(i);%optical raingauge, mm/h
%jazz(20)=ncrx(i);%ncar weighing raingauge, mm/h
%vectorized print, 20 columns, 1 rows

jd2=datz(2,:);
Tsb=datz(14,:);%barnes ts
Tsi=datz(15,:);%snow-ice interface t
Rld=datz(16,:);
Rlu=datz(17,:);
Tse=((Rlu-.01*Rld)/.99/sgb).^0.25-273.16;
Ts=(Tsb+Tse)/2;
Th10=datz(8,:)+0.1;

