% calculate rank correlation coefficients and confidence intervals
% makes the following 1x6 arrays:
  % tss_rank_coor (corr of tss and bac, wetlabs, ysi, insitu, mcvan, aquatec) 
  % tss_rank_number (number of data points)
  % tss_rank_coor_min (minimum confidence interval)
  % tss_rank_coor_max (maximun confidence interval)
  
  % tss_rank_coor_noHawaii (same as above with Hawaii data removed)
  % tss_rank_number_noHawaii
  % tss_rank_coor_min_noHawaii
  % tss_rank_coor_max_noHawaii
  
  % POC_rank_coor (corr of POC and bac, wetlabs, ysi, insitu, mcvan, aquatec)
  % POC_rank_number (number of data points)
  % POC_rank_coor_min (minimum confidence interval)
  % POC_rank_coor_max (maximum confidence interval)
  
  % POC_rank_coor_noHawaii (same as above with Hawaii data removed)
  % POC_rank_number_noHawaii
  % POC_rank_coor_min_noHawaii
  % POC_rank_coor_max_noHawaii
  
% saves actRankCoorData

close all
clear all

load actData_5Days
% actData_5Days contains:
  % bac4h, tss, poc, fluor
  % cbl (15x15, all parameters), cbl_bac, cbl_bac4h, cbl_poc, cbl_poc_sd, cbl_tss, ... 
    % cbl_tss_sd, cbl_fluor, cbl_fluor4h, cbl_aqua, cbl_insitu, cbl_mcvan, ...
    % cbl_wetlabs, cbl_ysi, cbl_count, cbl_date, repeated for all sites ...  
  % aqua, insitu, mcvan, wetlabs, ysi (all instrument readings - all sites)
  % index (1=cbl, 2=hawaii, 3=maine, 4=michigan, 5=michigan2, 6=mlml, 7=skio, and 8=usf
  % backscatter and sidescatter (all backscatter sensors in one, all
    % sidescatter sensors in one

    % bac data have been corrected for water leaving radiance
% use index to filter by site

% find all Hawaii records
noHawaii=find(index~=2);
tss_=tss(noHawaii);
poc_=poc(noHawaii);
bac4h_=bac4h(noHawaii);
wetlabs_=wetlabs(noHawaii);
ysi_=ysi(noHawaii);
insitu_=insitu(noHawaii);
mcvan_=mcvan(noHawaii);
aqua_=aqua(noHawaii);

% r is the Spearman's rank correlation coefficient.
% t is the t-ratio of r.
% p is the corresponding p-value.
% correlation min and max from Huijie handout.

% get tss rank correlation (all sites) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I=find(isfinite(tss.*bac4h)); % remove NaNs from corr calculation
[r,t,p] = spear(tss(I),bac4h(I)); % get rank correlation tss vs bac
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

tss_rank_coor=[r];
tss_rank_t=[t];
tss_rank_p=[p];
tss_rank_number=[b];
tss_rank_coor_min=[corr_min];
tss_rank_coor_max=[corr_max];

I=find(isfinite(tss.*wetlabs)); % remove NaNs from corr calculation
[r,t,p] = spear(tss(I),wetlabs(I)); % get rank correlation tss vs wetlabs
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

tss_rank_coor=[tss_rank_coor r];
tss_rank_t=[tss_rank_t t];
tss_rank_p=[tss_rank_p p];
tss_rank_number=[tss_rank_number b];
tss_rank_coor_min=[tss_rank_coor_min corr_min];
tss_rank_coor_max=[tss_rank_coor_max corr_max];

I=find(isfinite(tss.*ysi)); % remove NaNs from corr calculation
[r,t,p] = spear(tss(I),ysi(I)); % get rank correlation tss vs ysi
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

tss_rank_coor=[tss_rank_coor r];
tss_rank_t=[tss_rank_t t];
tss_rank_p=[tss_rank_p p];
tss_rank_number=[tss_rank_number b];
tss_rank_coor_min=[tss_rank_coor_min corr_min];
tss_rank_coor_max=[tss_rank_coor_max corr_max];

I=find(isfinite(tss.*insitu)); % remove NaNs from corr calculation
[r,t,p] = spear(tss(I),insitu(I)); % get rank correlation tss vs insitu
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

tss_rank_coor=[tss_rank_coor r];
tss_rank_t=[tss_rank_t t];
tss_rank_p=[tss_rank_p p];
tss_rank_number=[tss_rank_number b];
tss_rank_coor_min=[tss_rank_coor_min corr_min];
tss_rank_coor_max=[tss_rank_coor_max corr_max];

I=find(isfinite(tss.*mcvan)); % remove NaNs from corr calculation
[r,t,p] = spear(tss(I),mcvan(I)); % get rank correlation tss vs mcvan
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

tss_rank_coor=[tss_rank_coor r];
tss_rank_t=[tss_rank_t t];
tss_rank_p=[tss_rank_p p];
tss_rank_number=[tss_rank_number b];
tss_rank_coor_min=[tss_rank_coor_min corr_min];
tss_rank_coor_max=[tss_rank_coor_max corr_max];

I=find(isfinite(tss.*aqua)); % remove NaNs from corr calculation
[r,t,p] = spear(tss(I),aqua(I)); % get rank correlation tss vs aquatec
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

tss_rank_coor=[tss_rank_coor r];
tss_rank_t=[tss_rank_t t];
tss_rank_p=[tss_rank_p p];
tss_rank_number=[tss_rank_number b];
tss_rank_coor_min=[tss_rank_coor_min corr_min];
tss_rank_coor_max=[tss_rank_coor_max corr_max];

% get tss rank correlation (remove Hawaii) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I=find(isfinite(tss_.*bac4h_)); % remove NaNs from corr calculation
[r,t,p] = spear(tss_(I),bac4h_(I)); % get rank correlation tss vs bac
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

tss_rank_coor_noHawaii=[r];
tss_rank_t_noHawaii=[t];
tss_rank_p_noHawaii=[p];
tss_rank_number_noHawaii=[b];
tss_rank_coor_min_noHawaii=[corr_min];
tss_rank_coor_max_noHawaii=[corr_max];

I=find(isfinite(tss_.*wetlabs_)); % remove NaNs from corr calculation
[r,t,p] = spear(tss_(I),wetlabs_(I)); % get rank correlation tss vs wetlabs
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

tss_rank_coor_noHawaii=[tss_rank_coor r];
tss_rank_t_noHawaii=[tss_rank_t t];
tss_rank_p_noHawaii=[tss_rank_p p];
tss_rank_number_noHawaii=[tss_rank_number b];
tss_rank_coor_min_noHawaii=[tss_rank_coor_min_noHawaii corr_min];
tss_rank_coor_max_noHawaii=[tss_rank_coor_max_noHawaii corr_max];

I=find(isfinite(tss_.*ysi_)); % remove NaNs from corr calculation
[r,t,p] = spear(tss_(I),ysi_(I)); % get rank correlation tss vs ysi
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

tss_rank_coor_noHawaii=[tss_rank_coor r];
tss_rank_t_noHawaii=[tss_rank_t t];
tss_rank_p_noHawaii=[tss_rank_p p];
tss_rank_number_noHawaii=[tss_rank_number b];
tss_rank_coor_min_noHawaii=[tss_rank_coor_min_noHawaii corr_min];
tss_rank_coor_max_noHawaii=[tss_rank_coor_max_noHawaii corr_max];

I=find(isfinite(tss_.*insitu_)); % remove NaNs from corr calculation
[r,t,p] = spear(tss_(I),insitu_(I)); % get rank correlation tss vs insitu
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

tss_rank_coor_noHawaii=[tss_rank_coor r];
tss_rank_t_noHawaii=[tss_rank_t t];
tss_rank_p_noHawaii=[tss_rank_p p];
tss_rank_number_noHawaii=[tss_rank_number b];
tss_rank_coor_min_noHawaii=[tss_rank_coor_min_noHawaii corr_min];
tss_rank_coor_max_noHawaii=[tss_rank_coor_max_noHawaii corr_max];

I=find(isfinite(tss_.*mcvan_)); % remove NaNs from corr calculation
[r,t,p] = spear(tss_(I),mcvan_(I)); % get rank correlation tss vs mcvan
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

tss_rank_coor_noHawaii=[tss_rank_coor r];
tss_rank_t_noHawaii=[tss_rank_t t];
tss_rank_p_noHawaii=[tss_rank_p p];
tss_rank_number_noHawaii=[tss_rank_number b];
tss_rank_coor_min_noHawaii=[tss_rank_coor_min_noHawaii corr_min];
tss_rank_coor_max_noHawaii=[tss_rank_coor_max_noHawaii corr_max];

I=find(isfinite(tss_.*aqua_)); % remove NaNs from corr calculation
[r,t,p] = spear(tss_(I),aqua_(I)); % get rank correlation tss vs aquatec
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

tss_rank_coor_noHawaii=[tss_rank_coor r];
tss_rank_t_noHawaii=[tss_rank_t t];
tss_rank_p_noHawaii=[tss_rank_p p];
tss_rank_number_noHawaii=[tss_rank_number b];
tss_rank_coor_min_noHawaii=[tss_rank_coor_min_noHawaii corr_min];
tss_rank_coor_max_noHawaii=[tss_rank_coor_max_noHawaii corr_max];

% get POC correlation (all sites) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I=find(isfinite(poc.*bac4h)); % remove NaNs from corr calculation
[r,t,p] = spear(poc(I),bac4h(I)); % get rank correlation POC vs bac
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

poc_rank_coor=[r];
poc_rank_t=[t];
poc_rank_p=[p];
poc_rank_number=[b];
poc_rank_coor_min=[corr_min];
poc_rank_coor_max=[corr_max];

I=find(isfinite(poc.*wetlabs)); % remove NaNs from corr calculation
[r,t,p] = spear(poc(I),wetlabs(I)); % get rank correlation POC vs wetlabs
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

poc_rank_coor=[poc_rank_coor r];
poc_rank_t=[poc_rank_t t];
poc_rank_p=[poc_rank_p p];
poc_rank_number=[poc_rank_number b];
poc_rank_coor_min=[poc_rank_coor_min corr_min];
poc_rank_coor_max=[poc_rank_coor_max corr_max];

I=find(isfinite(poc.*ysi)); % remove NaNs from corr calculation
[r,t,p] = spear(poc(I),ysi(I)); % get rank correlation POC vs ysi
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

poc_rank_coor=[poc_rank_coor r];
poc_rank_t=[poc_rank_t t];
poc_rank_p=[poc_rank_p p];
poc_rank_number=[poc_rank_number b];
poc_rank_coor_min=[poc_rank_coor_min corr_min];
poc_rank_coor_max=[poc_rank_coor_max corr_max];

I=find(isfinite(poc.*insitu)); % remove NaNs from corr calculation
[r,t,p] = spear(poc(I),insitu(I)); % get rank correlation POC vs insitu
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

poc_rank_coor=[poc_rank_coor r];
poc_rank_t=[poc_rank_t t];
poc_rank_p=[poc_rank_p p];
poc_rank_number=[poc_rank_number b];
poc_rank_coor_min=[poc_rank_coor_min corr_min];
poc_rank_coor_max=[poc_rank_coor_max corr_max];

I=find(isfinite(poc.*mcvan)); % remove NaNs from corr calculation
[r,t,p] = spear(poc(I),mcvan(I)); % get rank correlation POC vs mcvan
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

poc_rank_coor=[poc_rank_coor r];
poc_rank_t=[poc_rank_t t];
poc_rank_p=[poc_rank_p p];
poc_rank_number=[poc_rank_number b];
poc_rank_coor_min=[poc_rank_coor_min corr_min];
poc_rank_coor_max=[poc_rank_coor_max corr_max];

I=find(isfinite(poc.*aqua)); % remove NaNs from corr calculation
[r,t,p] = spear(poc(I),aqua(I)); % get rank correlation POC vs aquatec
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

poc_rank_coor=[poc_rank_coor r];
poc_rank_t=[poc_rank_t t];
poc_rank_p=[poc_rank_p p];
poc_rank_number=[poc_rank_number b];
poc_rank_coor_min=[poc_rank_coor_min corr_min];
poc_rank_coor_max=[poc_rank_coor_max corr_max];

% get POC correlation (remove Hawaii) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I=find(isfinite(poc_.*bac4h_)); % remove NaNs from corr calculation
[r,t,p] = spear(poc_(I),bac4h_(I)); % get rank correlation POC vs bac
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

poc_rank_coor_noHawaii=[r];
poc_rank_t_noHawaii=[t];
poc_rank_p_noHawaii=[p];
poc_rank_number_noHawaii=[b];
poc_rank_coor_min_noHawaii=[corr_min];
poc_rank_coor_max_noHawaii=[corr_max];

I=find(isfinite(poc_.*wetlabs_)); % remove NaNs from corr calculation
[r,t,p] = spear(poc_(I),wetlabs_(I)); % get rank correlation POC vs wetlabs
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

poc_rank_coor_noHawaii=[poc_rank_coor r];
poc_rank_t_noHawaii=[poc_rank_t t];
poc_rank_p_noHawaii=[poc_rank_p p];
poc_rank_number_noHawaii=[poc_rank_number b];
poc_rank_coor_min_noHawaii=[poc_rank_coor_min_noHawaii corr_min];
poc_rank_coor_max_noHawaii=[poc_rank_coor_max_noHawaii corr_max];

I=find(isfinite(poc_.*ysi_)); % remove NaNs from corr calculation
[r,t,p] = spear(poc_(I),ysi_(I)); % get rank correlation POC vs ysi
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

poc_rank_coor_noHawaii=[poc_rank_coor r];
poc_rank_t_noHawaii=[poc_rank_t t];
poc_rank_p_noHawaii=[poc_rank_p p];
poc_rank_number_noHawaii=[poc_rank_number b];
poc_rank_coor_min_noHawaii=[poc_rank_coor_min_noHawaii corr_min];
poc_rank_coor_max_noHawaii=[poc_rank_coor_max_noHawaii corr_max];

I=find(isfinite(poc_.*insitu_)); % remove NaNs from corr calculation
[r,t,p] = spear(poc_(I),insitu_(I)); % get rank correlation POC vs insitu
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

poc_rank_coor_noHawaii=[poc_rank_coor r];
poc_rank_t_noHawaii=[poc_rank_t t];
poc_rank_p_noHawaii=[poc_rank_p p];
poc_rank_number_noHawaii=[poc_rank_number b];
poc_rank_coor_min_noHawaii=[poc_rank_coor_min_noHawaii corr_min];
poc_rank_coor_max_noHawaii=[poc_rank_coor_max_noHawaii corr_max];

I=find(isfinite(poc_.*mcvan_)); % remove NaNs from corr calculation
[r,t,p] = spear(poc_(I),mcvan_(I)); % get rank correlation POC vs mcvan
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

poc_rank_coor_noHawaii=[poc_rank_coor r];
poc_rank_t_noHawaii=[poc_rank_t t];
poc_rank_p_noHawaii=[poc_rank_p p];
poc_rank_number_noHawaii=[poc_rank_number b];
poc_rank_coor_min_noHawaii=[poc_rank_coor_min_noHawaii corr_min];
poc_rank_coor_max_noHawaii=[poc_rank_coor_max_noHawaii corr_max];

I=find(isfinite(poc_.*aqua_)); % remove NaNs from corr calculation
[r,t,p] = spear(poc_(I),aqua_(I)); % get rank correlation POC vs aquatec
b=length(I); % get number of points
z=0.5*log((1+r)/(1-r));
v=1/(b-3);
alpha=exp(2*(z-sqrt(v)*1.96));
beta=exp(2*(z+sqrt(v)*1.96));
corr_min=(alpha-1)/(alpha+1);
corr_max=(beta-1)/(beta+1);

poc_rank_coor_noHawaii=[poc_rank_coor r];
poc_rank_t_noHawaii=[poc_rank_t t];
poc_rank_p_noHawaii=[poc_rank_p p];
poc_rank_number_noHawaii=[poc_rank_number b];
poc_rank_coor_min_noHawaii=[poc_rank_coor_min_noHawaii corr_min];
poc_rank_coor_max_noHawaii=[poc_rank_coor_max_noHawaii corr_max];

% clear unneccessary variables
clear I alpha b beta p r t;
clear cbl_aqua cbl_bac cbl_bac4h cbl_count cbl_date cbl_fluor cbl_fluor4h cbl_insitu cbl_mcvan cbl_poc cbl_poc_sd cbl_tss cbl_tss_sd cbl_wetlabs cbl_ysi;
clear corr_max corr_min index v z;
clear hawaii_aqua hawaii_bac hawaii_bac4h hawaii_count hawaii_date hawaii_fluor hawaii_fluor4h hawaii_insitu hawaii_mcvan hawaii_poc hawaii_poc_sd hawaii_tss hawaii_tss_sd hawaii_wetlabs hawaii_ysi;
clear aqua_ bac_ poc_ insitu_ mcvan_ aqua_ ysi_ wetlabs_ noHawaii tss_;
clear maine_aqua maine_bac maine_bac4h maine_count maine_date maine_fluor maine_fluor4h maine_insitu maine_mcvan maine_poc maine_poc_sd maine_tss maine_tss_sd maine_wetlabs maine_ysi;
clear michigan_aqua michigan_bac michigan_bac4h michigan_count michigan_date michigan_fluor michigan_fluor4h michigan_insitu michigan_mcvan michigan_poc michigan_poc_sd michigan_tss michigan_tss_sd michigan_wetlabs michigan_ysi;
clear michigan2_aqua michigan2_bac michigan2_bac4h michigan2_count michigan2_date michigan2_fluor michigan2_fluor4h michigan2_insitu michigan2_mcvan michigan2_poc michigan2_poc_sd michigan2_tss michigan2_tss_sd michigan2_wetlabs michigan2_ysi;
clear mlml_aqua mlml_bac mlml_bac4h mlml_count mlml_date mlml_fluor mlml_fluor4h mlml_insitu mlml_mcvan mlml_poc mlml_poc_sd mlml_tss mlml_tss_sd mlml_wetlabs mlml_ysi;
clear skio_aqua skio_bac skio_bac4h skio_count skio_date skio_fluor skio_fluor4h skio_insitu skio_mcvan skio_poc skio_poc_sd skio_tss skio_tss_sd skio_wetlabs skio_ysi;
clear usf_aqua usf_bac usf_bac4h usf_count usf_date usf_fluor usf_fluor4h usf_insitu usf_mcvan usf_poc usf_poc_sd usf_tss usf_tss_sd usf_wetlabs usf_ysi;

save actRankCoorData -v6