clear all;close all;

bmask=ncread('~/tools/data/mask_tnx1v1_basins.nc','pmask');

load NOIIANOC_mr03_hist2_Cant_CFC12_r8_s100_t2002_sigma.mat 
Cant8=double(Cant_ttd);
mage8=double(mage);

load NOIIANOC_mr03_hist2_Cant_CFC12_r10_s100_t2002_sigma.mat
Cant10=double(Cant_ttd);
mage10=double(mage);

load NOIIANOC_mr03_hist2_Cant_CFC12_r12_s100_t2002_sigma.mat
Cant12=double(Cant_ttd);
mage12=double(mage);

bmask=repmat(bmask,[1,1,53]);

NNAid=find(bmask==2 |bmask==3 |bmask==4);   %North Atlantic, Nordic Seas and Arctic id
NPid=find(bmask==9);	%North Pacific id
SOid=find(bmask==12);   %southern Ocean id

Cant081012=Cant10;
Cant081012(NNAid)=Cant8(NNAid);
Cant081012(NPid)=Cant12(NPid);
Cant081012(SOid)=Cant12(SOid);
Cant_ttd=single(Cant081012);

mage081012=mage10;
mage081012(NNAid)=mage8(NNAid);
mage081012(NPid)=mage12(NPid);
mage081012(SOid)=mage12(SOid);
mage=single(mage081012);

clear Cant08* mage08* NNAid NPid SOid bmask Cant8 mage8 Cant10 mage10 Cant12 mage12

ratio=[8 10 12];
save NOIIANOC_mr03_hist2_Cant_CFC12_r081012_s100_t2002_sigma