disp('read_sondeProfile_edouard');
%This program reads stored dropsonde profiles from each of 4 platforms
%The file is a matlab .mat file.

%select the aircraft by uncommenting the one you want
flt='G4';%G4
% flt='I1';%P3
 %flt='GH';%global hawk
 %flt='H1';%P3

way_raw_file='C:\data\cwf\Dropbox\data\ENRR\data\'
sondex=load([way_raw_file 'ENRR_' flt '_sonde_all.mat'], 'jdxh', 'zhh','Uhh','rhahh','tahh','lathh','lonhh','Phh','qahh','udirhh');
rhahh=sondex.rhahh;
zhh=sondex.zhh;
Uhh=sondex.Uhh;
tahh=sondex.tahh;
lathh=sondex.lathh;
lonhh=sondex.lonhh;
Phh=sondex.Phh;
qahh=sondex.qahh;
jdxh=sondex.jdxh;
jk=length(lathh);
[i mon dttn hr mn sec]=datevec(jdxh);

[nn nm]=size(zhh);
disp(['Number of profiles= ' num2str(nm)]) 


%select a profile to plot
jj=10;
ii=find(zhh(:,jj)>0);size(ii);
disp(['Max Altitude= ' num2str(zhh(length(ii),jj)) ' m']) 
figure;
subplot(1,2,1);plot(Uhh(:,jj),zhh(:,jj)/1e3);ylabel('Alt (km)');xlabel('U (m/s)');title(['Edouard ' flt ' 2014 '  num2str(mon(jj)) '/' num2str(dttn(jj)) ' '  num2str(hr(jj)+mn(jj)/60)]);ylim([0 5]);
subplot(1,2,2);plot(rhahh(:,jj),zhh(:,jj)/1e3,[100 100],[0  15],'--');;xlabel('RH water-ice (%)');xlim([0 105]);ylim([0 5]);



