% Master file for do regem/EIV reconstructions 
% each config file sets various experiments and targets
% Gavin Schmidt (Jan 2011), based on code from Mann et al (2007)

% preliminary setup
clear
path(path,'utilities')
dataout='../output'
[s,mess]=mkdir(dataout);

% option for low-f regpar (see eiv_recon.m)
retvar=0.5;

%%%% Do each pseudo-proxy case

% GKSS 59 proxies
config_gkss59;

nohyb=1;  %  no-hybrid first
[recon,eofnumb]=eiv_recon(targt,startyr,proxynorm,proxystart,targmin,targmax,runmax,retvar,nohyb);
outfile=strcat(dataout,'/eiv_nohyb_',EXP);
output
% 
nohyb=0;  %  hybrid 
[recon,eofnumb]=eiv_recon(targt,startyr,proxynorm,proxystart,targmin,targmax,runmax,retvar,nohyb);
outfile=strcat(dataout,'/eiv_hyb_',EXP);
output

%%%%%%

% GKSS 104 proxies
config_gkss104;

nohyb=1;  %  no-hybrid first
[recon,eofnumb]=eiv_recon(targt,startyr,proxynorm,proxystart,targmin,targmax,runmax,retvar,nohyb);
outfile=strcat(dataout,'/eiv_nohyb_',EXP);
output
% 
nohyb=0;  %  hybrid 
[recon,eofnumb]=eiv_recon(targt,startyr,proxynorm,proxystart,targmin,targmax,runmax,retvar,nohyb);
outfile=strcat(dataout,'/eiv_hyb_',EXP);
output

%%%%%%

% CSM 59 proxies
config_csm59;

nohyb=1;  %  no-hybrid first
[recon,eofnumb]=eiv_recon(targt,startyr,proxynorm,proxystart,targmin,targmax,runmax,retvar,nohyb);
outfile=strcat(dataout,'/eiv_nohyb_',EXP);
output
% 
nohyb=0;  %  hybrid 
[recon,eofnumb]=eiv_recon(targt,startyr,proxynorm,proxystart,targmin,targmax,runmax,retvar,nohyb);
outfile=strcat(dataout,'/eiv_hyb_',EXP);
output

%%%%%%

% CSM 104 proxies
config_csm104;

nohyb=1;  %  no-hybrid first
[recon,eofnumb]=eiv_recon(targt,startyr,proxynorm,proxystart,targmin,targmax,runmax,retvar,nohyb);
outfile=strcat(dataout,'/eiv_nohyb_',EXP);
output
%
nohyb=0;  %  hybrid 
[recon,eofnumb]=eiv_recon(targt,startyr,proxynorm,proxystart,targmin,targmax,runmax,retvar,nohyb);
outfile=strcat(dataout,'/eiv_hyb_',EXP);
output

% done
