fclose('all');
%clear all;
%****
sgb=5.67e-8;
%Find the flux_file data 
f=['E:\ascii\main_file2_hd.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',[30,8600]);

[a,cnt_mx]=size(datz);

%(1)=decimal JD
%(2)=Press(mb)
%(3:4)=wind speed (m/s)at 2m, 10m
%(5:6)wind direction at 2m, 10 m
%(7:8)=temp(C) at 2 m, 10 m
%(9:10)=mixing ratio (g/kg) at 2 m, 10 m
%(11:12)=rhi at 2 10 m
%(13)General Eastern 12 cm temp (C)
%(14)= Eppley radiative surface temp (C)
%(15)= Barnes radiative surface temp (C)
%(16)= snow/ice interface temp (C)
%(17)= longwave down
%(18)= longwave up
%(19)= solar down (as if there was any)
%(20)= solar up
%(21)=orgx(i);%optical raingauge, mm/h
%(22)=ncrx(i);%ncar weighing raingauge, mm/h
%(23)=tower orientation
%(24)=w variance
%(25)=us_md(j);%ustar (m/s)
%(26)=hs_md(j);%sensible heat flux (W/m2)
%(27)=hl latent heat flux



jd2=datz(1,:);
press=datz(2,:);
ws2=datz(3,:);
ws10=datz(4,:);
wd2=datz(5,:);
wd10=datz(6,:);
Th2=datz(7,:)+0.025;
Th10=datz(8,:)+0.1;
q2=datz(9,:)+0.025;
q10=datz(10,:)+0.1;
rh2=datz(11,:)+0.025;
rh10=datz(12,:)+0.1;
Tge=datz(13,:);
Tse=datz(14,:);%eplley ts
Tsb=datz(15,:);%barnes ts
Tsi=datz(16,:);%snow-ice interface t
Rld=datz(17,:);
Rlu=datz(18,:);
Rsd=datz(19,:);
Rsu=datz(20,:);

%Tse=((Rlu-.01*Rld)/.99/sgb).^0.25-273.16;
%Ts=(Tsb+Tse)/2;


