% driver script to compute kdms & kco2 for entire cruise

clear all
% load raw met data, including timestamp yday
load /Users/byronb/Raw_Data_Files.noindex/High_Wind_Flux_2013/C35_Gas_Trans_Coeff/C35input_r2.mat

[C35,Gdms] = cor35_ks_dms_hiwings(u,zu,t,zt,rh,zq,P,ts,Rs,Rl,lat,zi,rain,cp,sigH);
Gdms = [yday Gdms];
save /Users/byronb/Raw_Data_Files.noindex/High_Wind_Flux_2013/C35_Gas_Trans_Coeff/coareg_kdms_hiwings_1636.txt Gdms -tabs -ascii
C35 = [yday C35];
save /Users/byronb/Raw_Data_Files.noindex/High_Wind_Flux_2013/C35_Gas_Trans_Coeff/coare35_nohd.txt C35 -tabs -ascii

[C35,Gco2] = cor35_ks_co2_hiwings(u,zu,t,zt,rh,zq,P,ts,Rs,Rl,lat,zi,rain,cp,sigH);
Gco2 = [yday Gco2];
save /Users/byronb/Raw_Data_Files.noindex/High_Wind_Flux_2013/C35_Gas_Trans_Coeff/coareg_kco2_hiwings_1636.txt Gco2 -tabs -ascii

% [C35,Gdms0] = cor35_ks_dms_monahan(u,zu,t,zt,rh,zq,P,ts,Rs,Rl,lat,zi,rain,cp,sigH);
% Gdms0 = [yday Gdms0];
% save /Users/byronb/Raw_Data_Files.noindex/High_Wind_Flux_2013/C35_Gas_Trans_Coeff/coareg_kdms_monahan1618.txt Gdms0 -tabs -ascii
% 
% [C35,Gco20] = cor35_ks_co2_monahan(u,zu,t,zt,rh,zq,P,ts,Rs,Rl,lat,zi,rain,cp,sigH);
% Gco20 = [yday Gco20];
% save /Users/byronb/Raw_Data_Files.noindex/High_Wind_Flux_2013/C35_Gas_Trans_Coeff/coareg_kco2_monahan_nohd1618.txt Gco20 -tabs -ascii

% % C35=[usr tau hsb hlb hbb hsbb tsr qsr zot zoq Cd Ch Ce  L zet dter dqer tkt Urf Trf Qrf RHrf UrfN Rnl Le rhoa UN U10 U10N Cdn_10 Chn_10 Cen_10];
% %       1   2   3   4   5   6    7   8   9  10   1  2 3   4  5    6    7   8   9  20   1    2    3   4   5   6   7   8   9    30      1      2
% % Gdms = [yday U10N rwo ra rw vtco vtc phi sol alc scwc vtc2 kbb k660];
% %          1    2    3  4  5   6    7   8   9  10   11   12   13  14

% figure; plot(Gdms0(:,2),100*Gdms0(:,14)*3600,'-',Gco20(:,2),100*Gco20(:,14)*3600,'-',Gdms(:,2),100*Gdms(:,14)*3600,'-o',Gco2(:,2),100*Gco2(:,14)*3600,'-d');
% figure; plot(Gco20(:,2),100*Gco20(:,14)*3600,'-',Gco2(:,2),100*Gco2(:,14)*3600,'-d');
% ylabel('k (cm/hr)'); xlabel('U_{10N} (m/s)');
