% Combines all HMO realizations into one .mat file 

% HMO_batch

% ACCESS1-0 (1)

load /crane/s1/smiller/CMIP5/tas/ACCESS1-0/ACCESS1-0_hemimeans_all.mat
out_ACCESS1_0_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_ACCESS1_0_r1i1p1 '-append'
clear

% ACCESS1-3 (3)

load /crane/s1/smiller/CMIP5/tas/ACCESS1-3/ACCESS1-3_hemimeans_all.mat 
out_ACCESS1_3_r1i1p1=demean(finalT_r1i1p1);
out_ACCESS1_3_r2i1p1=demean(finalT_r2i1p1);
out_ACCESS1_3_r3i1p1=demean(finalT_r3i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_ACCESS1_3_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_ACCESS1_3_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_ACCESS1_3_r3i1p1 '-append'
clear

% bcc-csm1-1 (3)

load /crane/s1/smiller/CMIP5/tas/bcc-csm1-1/bcc-csm1-1_hemimeans_all.mat 
out_bcc_csm1_1_r1i1p1=demean(finalT_r1i1p1(1:1872,:));   % shorten to 2005
out_bcc_csm1_1_r2i1p1=demean(finalT_r2i1p1(1:1872,:));
out_bcc_csm1_1_r3i1p1=demean(finalT_r3i1p1(1:1872,:));
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_bcc_csm1_1_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_bcc_csm1_1_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_bcc_csm1_1_r3i1p1 '-append'
clear

% bcc-csm1-1-m (3)

load /crane/s1/smiller/CMIP5/tas/bcc-csm1-1-m/bcc-csm1-1-m_hemimeans_all.mat 
out_bcc_csm1_1_m_r1i1p1=demean(finalT_r1i1p1(1:1872,:));   % shorten to 2005
out_bcc_csm1_1_m_r2i1p1=demean(finalT_r2i1p1(1:1872,:));
out_bcc_csm1_1_m_r3i1p1=demean(finalT_r3i1p1(1:1872,:));
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_bcc_csm1_1_m_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_bcc_csm1_1_m_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_bcc_csm1_1_m_r3i1p1 '-append'
clear

% BNU-ESM (1)

load /crane/s1/smiller/CMIP5/tas/BNU-ESM/BNU-ESM_hemimeans_all.mat 
out_BNU_ESM_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_BNU_ESM_r1i1p1 '-append'
clear

% CanESM2 (5)

load /crane/s1/smiller/CMIP5/tas/CanESM2/CanESM2_hemimeans_all.mat 
out_CanESM2_r1i1p1=demean(finalT_r1i1p1);
out_CanESM2_r2i1p1=demean(finalT_r2i1p1);
out_CanESM2_r3i1p1=demean(finalT_r3i1p1);
out_CanESM2_r4i1p1=demean(finalT_r4i1p1);
out_CanESM2_r5i1p1=demean(finalT_r5i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CanESM2_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CanESM2_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CanESM2_r3i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CanESM2_r4i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CanESM2_r5i1p1 '-append'
clear

% CCSM4 (6)

load /crane/s1/smiller/CMIP5/tas/CCSM4/CCSM4_hemimeans_all.mat 
out_CCSM4_r1i1p1=demean(finalT_r1i1p1);
out_CCSM4_r2i1p1=demean(finalT_r2i1p1);
out_CCSM4_r3i1p1=demean(finalT_r3i1p1);
out_CCSM4_r4i1p1=demean(finalT_r4i1p1);
out_CCSM4_r5i1p1=demean(finalT_r5i1p1);
out_CCSM4_r6i1p1=demean(finalT_r6i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CCSM4_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CCSM4_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CCSM4_r3i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CCSM4_r4i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CCSM4_r5i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CCSM4_r6i1p1 '-append'
clear

% CESM1-BGC (1)

load /crane/s1/smiller/CMIP5/tas/CESM1-BGC/CESM1-BGC_hemimeans_all.mat 
out_CESM1_BGC_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CESM1_BGC_r1i1p1 '-append'
clear

% CESM1-CAM5 (3)

load /crane/s1/smiller/CMIP5/tas/CESM1-CAM5/CESM1-CAM5_hemimeans_all.mat 
out_CESM1_CAM5_r1i1p1=demean(finalT_r1i1p1);
out_CESM1_CAM5_r2i1p1=demean(finalT_r2i1p1);
out_CESM1_CAM5_r3i1p1=demean(finalT_r3i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CESM1_CAM5_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CESM1_CAM5_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CESM1_CAM5_r3i1p1 '-append'
clear

% CESM1-FASTCHEM (3)

load /crane/s1/smiller/CMIP5/tas/CESM1-FASTCHEM/CESM1-FASTCHEM_hemimeans_all.mat 
out_CESM1_FASTCHEM_r1i1p1=demean(finalT_r1i1p1);
out_CESM1_FASTCHEM_r2i1p1=demean(finalT_r2i1p1);
out_CESM1_FASTCHEM_r3i1p1=demean(finalT_r3i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CESM1_FASTCHEM_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CESM1_FASTCHEM_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CESM1_FASTCHEM_r3i1p1 '-append'
clear

% CESM1-WACCM (1)

load /crane/s1/smiller/CMIP5/tas/CESM1-WACCM/CESM1-WACCM_hemimeans_all.mat 
out_CESM1_WACCM_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CESM1_WACCM_r1i1p1 '-append'
clear

% CMCC-CESM (1)

load /crane/s1/smiller/CMIP5/tas/CMCC-CESM/CMCC-CESM_hemimeans_all.mat 
out_CMCC_CESM_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CMCC_CESM_r1i1p1 '-append'
clear

% CMCC-CM (1)

load /crane/s1/smiller/CMIP5/tas/CMCC-CM/CMCC-CM_hemimeans_all.mat 
out_CMCC_CM_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CMCC_CM_r1i1p1 '-append'
clear

% CMCC-CMS (1)

load /crane/s1/smiller/CMIP5/tas/CMCC-CMS/CMCC-CMS_hemimeans_all.mat 
out_CMCC_CMS_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CMCC_CMS_r1i1p1 '-append'
clear

% CNRM-CM5 (10)

load /crane/s1/smiller/CMIP5/tas/CNRM-CM5/CNRM-CM5_hemimeans_all.mat 
out_CNRM_CM5_r1i1p1=demean(finalT_r1i1p1);
out_CNRM_CM5_r2i1p1=demean(finalT_r2i1p1);
out_CNRM_CM5_r3i1p1=demean(finalT_r3i1p1);
out_CNRM_CM5_r4i1p1=demean(finalT_r4i1p1);
out_CNRM_CM5_r5i1p1=demean(finalT_r5i1p1);
out_CNRM_CM5_r6i1p1=demean(finalT_r6i1p1);
out_CNRM_CM5_r7i1p1=demean(finalT_r7i1p1);
out_CNRM_CM5_r8i1p1=demean(finalT_r8i1p1);
out_CNRM_CM5_r9i1p1=demean(finalT_r9i1p1);
out_CNRM_CM5_r10i1p1=demean(finalT_r10i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CNRM_CM5_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CNRM_CM5_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CNRM_CM5_r3i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CNRM_CM5_r4i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CNRM_CM5_r5i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CNRM_CM5_r6i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CNRM_CM5_r7i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CNRM_CM5_r8i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CNRM_CM5_r9i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CNRM_CM5_r10i1p1 '-append'
clear

% CNRM-CM5-2 (1)

load /crane/s1/smiller/CMIP5/tas/CNRM-CM5-2/CNRM-CM5-2_hemimeans_all.mat 
out_CNRM_CM5_2_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CNRM_CM5_2_r1i1p1 '-append'
clear

% CSIRO_Mk3_6_0 (10)

load /crane/s1/smiller/CMIP5/tas/CSIRO-Mk3-6-0/CSIRO-Mk3-6-0_hemimeans_all.mat 
out_CSIRO_Mk3_6_0_r1i1p1=demean(finalT_r1i1p1);
out_CSIRO_Mk3_6_0_r2i1p1=demean(finalT_r2i1p1);
out_CSIRO_Mk3_6_0_r3i1p1=demean(finalT_r3i1p1);
out_CSIRO_Mk3_6_0_r4i1p1=demean(finalT_r4i1p1);
out_CSIRO_Mk3_6_0_r5i1p1=demean(finalT_r5i1p1);
out_CSIRO_Mk3_6_0_r6i1p1=demean(finalT_r6i1p1);
out_CSIRO_Mk3_6_0_r7i1p1=demean(finalT_r7i1p1);
out_CSIRO_Mk3_6_0_r8i1p1=demean(finalT_r8i1p1);
out_CSIRO_Mk3_6_0_r9i1p1=demean(finalT_r9i1p1);
out_CSIRO_Mk3_6_0_r10i1p1=demean(finalT_r10i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CSIRO_Mk3_6_0_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CSIRO_Mk3_6_0_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CSIRO_Mk3_6_0_r3i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CSIRO_Mk3_6_0_r4i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CSIRO_Mk3_6_0_r5i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CSIRO_Mk3_6_0_r6i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CSIRO_Mk3_6_0_r7i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CSIRO_Mk3_6_0_r8i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CSIRO_Mk3_6_0_r9i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_CSIRO_Mk3_6_0_r10i1p1 '-append'
clear

% FIO-ESM (3)

load /crane/s1/smiller/CMIP5/tas/FIO-ESM/FIO-ESM_hemimeans_all.mat 
out_FIO_ESM_r1i1p1=demean(finalT_r1i1p1);
out_FIO_ESM_r2i1p1=demean(finalT_r2i1p1);
out_FIO_ESM_r3i1p1=demean(finalT_r3i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_FIO_ESM_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_FIO_ESM_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_FIO_ESM_r3i1p1 '-append'
clear

% GFDL-CM2p1 (10)

load /crane/s1/smiller/CMIP5/tas/GFDL-CM2p1/GFDL-CM2p1_hemimeans_all.mat 
out_GFDL_CM2p1_r1i1p1=demean(finalT_r1i1p1);
out_GFDL_CM2p1_r2i1p1=demean(finalT_r2i1p1);
out_GFDL_CM2p1_r3i1p1=demean(finalT_r3i1p1);
out_GFDL_CM2p1_r4i1p1=demean(finalT_r4i1p1);
out_GFDL_CM2p1_r5i1p1=demean(finalT_r5i1p1);
out_GFDL_CM2p1_r6i1p1=demean(finalT_r6i1p1);
out_GFDL_CM2p1_r7i1p1=demean(finalT_r7i1p1);
out_GFDL_CM2p1_r8i1p1=demean(finalT_r8i1p1);
out_GFDL_CM2p1_r9i1p1=demean(finalT_r9i1p1);
out_GFDL_CM2p1_r10i1p1=demean(finalT_r10i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM2p1_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM2p1_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM2p1_r3i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM2p1_r4i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM2p1_r5i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM2p1_r6i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM2p1_r7i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM2p1_r8i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM2p1_r9i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM2p1_r10i1p1 '-append'
clear

% GFDL-CM3 (4)

load /crane/s1/smiller/CMIP5/tas/GFDL-CM3/GFDL-CM3_hemimeans_all.mat 
out_GFDL_CM3_r1i1p1=demean(finalT_r1i1p1);
out_GFDL_CM3_r2i1p1=demean(finalT_r2i1p1);
out_GFDL_CM3_r3i1p1=demean(finalT_r3i1p1);
out_GFDL_CM3_r4i1p1=demean(finalT_r4i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM3_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM3_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM3_r3i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_CM3_r4i1p1 '-append'
clear

% GFDL-ESM2G (1)

load /crane/s1/smiller/CMIP5/tas/GFDL-ESM2G/GFDL-ESM2G_hemimeans_all.mat 
out_GFDL_ESM2G_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_ESM2G_r1i1p1 '-append'
clear

% GFDL-ESM2M (1)

load /crane/s1/smiller/CMIP5/tas/GFDL-ESM2M/GFDL-ESM2M_hemimeans_all.mat 
out_GFDL_ESM2M_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GFDL_ESM2M_r1i1p1 '-append'
clear

% GISS-E2-H (17)

load /crane/s1/smiller/CMIP5/tas/GISS-E2-H/GISS-E2-H_hemimeans_all.mat 
out_GISS_E2_H_r1i1p1=demean(finalT_r1i1p1);
out_GISS_E2_H_r2i1p1=demean(finalT_r2i1p1);
out_GISS_E2_H_r3i1p1=demean(finalT_r3i1p1);
out_GISS_E2_H_r4i1p1=demean(finalT_r4i1p1);
out_GISS_E2_H_r5i1p1=demean(finalT_r5i1p1);
out_GISS_E2_H_r6i1p1=demean(finalT_r6i1p1);
out_GISS_E2_H_r1i1p2=demean(finalT_r1i1p2);
out_GISS_E2_H_r2i1p2=demean(finalT_r2i1p2);
out_GISS_E2_H_r3i1p2=demean(finalT_r3i1p2);
out_GISS_E2_H_r4i1p2=demean(finalT_r4i1p2);
out_GISS_E2_H_r5i1p2=demean(finalT_r5i1p2);
out_GISS_E2_H_r1i1p3=demean(finalT_r1i1p3);
out_GISS_E2_H_r2i1p3=demean(finalT_r2i1p3);
out_GISS_E2_H_r3i1p3=demean(finalT_r3i1p3);
out_GISS_E2_H_r4i1p3=demean(finalT_r4i1p3);
out_GISS_E2_H_r5i1p3=demean(finalT_r5i1p3);
out_GISS_E2_H_r6i1p3=demean(finalT_r6i1p3);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r3i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r4i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r5i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r6i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r1i1p2 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r2i1p2 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r3i1p2 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r4i1p2 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r5i1p2 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r1i1p3 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r2i1p3 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r3i1p3 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r4i1p3 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r5i1p3 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_r6i1p3 '-append'
clear

% GISS-E2-H-CC (1)

load /crane/s1/smiller/CMIP5/tas/GISS-E2-H-CC/GISS-E2-H-CC_hemimeans_all.mat 
out_GISS_E2_H_CC_r1i1p1=demean(finalT_r1i1p1(1:1872,:));  % shorten to 2005
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_H_CC_r1i1p1 '-append'
clear

% GISS-E2-R (24)

load /crane/s1/smiller/CMIP5/tas/GISS-E2-R/GISS-E2-R_hemimeans_all.mat 
out_GISS_E2_R_r1i1p1=demean(finalT_r1i1p1);
out_GISS_E2_R_r2i1p1=demean(finalT_r2i1p1);
out_GISS_E2_R_r3i1p1=demean(finalT_r3i1p1);
out_GISS_E2_R_r4i1p1=demean(finalT_r4i1p1);
out_GISS_E2_R_r5i1p1=demean(finalT_r5i1p1);
out_GISS_E2_R_r6i1p1=demean(finalT_r6i1p1);
out_GISS_E2_R_r1i1p2=demean(finalT_r1i1p2);
out_GISS_E2_R_r2i1p2=demean(finalT_r2i1p2);
out_GISS_E2_R_r3i1p2=demean(finalT_r3i1p2);
out_GISS_E2_R_r4i1p2=demean(finalT_r4i1p2);
out_GISS_E2_R_r5i1p2=demean(finalT_r5i1p2);
out_GISS_E2_R_r6i1p2=demean(finalT_r6i1p2);
out_GISS_E2_R_r1i1p3=demean(finalT_r1i1p3);
out_GISS_E2_R_r2i1p3=demean(finalT_r2i1p3);
out_GISS_E2_R_r3i1p3=demean(finalT_r3i1p3);
out_GISS_E2_R_r4i1p3=demean(finalT_r4i1p3);
out_GISS_E2_R_r5i1p3=demean(finalT_r5i1p3);
out_GISS_E2_R_r6i1p3=demean(finalT_r6i1p3);
out_GISS_E2_R_r1i1p121=demean(finalT_r1i1p121(13:1872,:));
out_GISS_E2_R_r1i1p124=demean(finalT_r1i1p124(13:1872,:));
out_GISS_E2_R_r1i1p125=demean(finalT_r1i1p125(13:1872,:));
out_GISS_E2_R_r1i1p126=demean(finalT_r1i1p126(13:1872,:));
out_GISS_E2_R_r1i1p127=demean(finalT_r1i1p127(13:1872,:));
out_GISS_E2_R_r1i1p128=demean(finalT_r1i1p128(13:1872,:));
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r3i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r4i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r5i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r6i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r1i1p2 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r2i1p2 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r3i1p2 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r4i1p2 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r5i1p2 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r6i1p2 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r1i1p3 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r2i1p3 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r3i1p3 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r4i1p3 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r5i1p3 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r6i1p3 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r1i1p121 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r1i1p124 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r1i1p125 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r1i1p126 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r1i1p127 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_r1i1p128 '-append'
clear

% GISS-E2-R-CC (1)

load /crane/s1/smiller/CMIP5/tas/GISS-E2-R-CC/GISS-E2-R-CC_hemimeans_all.mat 
out_GISS_E2_R_CC_r1i1p1=demean(finalT_r1i1p1(1:1872,:));  % shorten to 2005
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_GISS_E2_R_CC_r1i1p1 '-append'
clear

% HadCM3 (10)

load /crane/s1/smiller/CMIP5/tas/HadCM3/HadCM3_hemimeans_all.mat 
out_HadCM3_r1i1p1=demean(finalT_r1i1p1);
out_HadCM3_r2i1p1=demean(finalT_r2i1p1);
out_HadCM3_r3i1p1=demean(finalT_r3i1p1);
out_HadCM3_r4i1p1=demean(finalT_r4i1p1);
out_HadCM3_r5i1p1=demean(finalT_r5i1p1);
out_HadCM3_r6i1p1=demean(finalT_r6i1p1);
out_HadCM3_r7i1p1=demean(finalT_r7i1p1);
out_HadCM3_r8i1p1=demean(finalT_r8i1p1);
out_HadCM3_r9i1p1=demean(finalT_r9i1p1);
out_HadCM3_r10i1p1=demean(finalT_r10i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadCM3_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadCM3_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadCM3_r3i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadCM3_r4i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadCM3_r5i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadCM3_r6i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadCM3_r7i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadCM3_r8i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadCM3_r9i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadCM3_r10i1p1 '-append'
clear

% HadGEM2-CC (1)

load /crane/s1/smiller/CMIP5/tas/HadGEM2-CC/HadGEM2-CC_hemimeans_all.mat 
out_HadGEM2_CC_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadGEM2_CC_r1i1p1 '-append'
clear

% HadGEM2-ES (5)

load /crane/s1/smiller/CMIP5/tas/HadGEM2-ES/HadGEM2-ES_hemimeans_all.mat 
out_HadGEM2_ES_r1i1p1=demean(finalT_r1i1p1);
out_HadGEM2_ES_r2i1p1=demean(finalT_r2i1p1);
out_HadGEM2_ES_r3i1p1=demean(finalT_r3i1p1);
out_HadGEM2_ES_r4i1p1=demean(finalT_r4i1p1);
out_HadGEM2_ES_r5i1p1=demean(finalT_r5i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadGEM2_ES_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadGEM2_ES_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadGEM2_ES_r3i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadGEM2_ES_r4i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_HadGEM2_ES_r5i1p1 '-append'
clear

% INMCM4 (1)

load /crane/s1/smiller/CMIP5/tas/INMCM4/INMCM4_hemimeans_all.mat 
out_INMCM4_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_INMCM4_r1i1p1 '-append'
clear

% IPSL-CM5A-LR (6)

load /crane/s1/smiller/CMIP5/tas/IPSL-CM5A-LR/IPSL-CM5A-LR_hemimeans_all.mat 
out_IPSL_CM5A_LR_r1i1p1=demean(finalT_r1i1p1);
out_IPSL_CM5A_LR_r2i1p1=demean(finalT_r2i1p1);
out_IPSL_CM5A_LR_r3i1p1=demean(finalT_r3i1p1);
out_IPSL_CM5A_LR_r4i1p1=demean(finalT_r4i1p1);
out_IPSL_CM5A_LR_r5i1p1=demean(finalT_r5i1p1);
out_IPSL_CM5A_LR_r6i1p1=demean(finalT_r6i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_IPSL_CM5A_LR_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_IPSL_CM5A_LR_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_IPSL_CM5A_LR_r3i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_IPSL_CM5A_LR_r4i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_IPSL_CM5A_LR_r5i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_IPSL_CM5A_LR_r6i1p1 '-append'
clear

% IPSL-CM5A-MR (3)

load /crane/s1/smiller/CMIP5/tas/IPSL-CM5A-MR/IPSL-CM5A-MR_hemimeans_all.mat 
out_IPSL_CM5A_MR_r1i1p1=demean(finalT_r1i1p1);
out_IPSL_CM5A_MR_r2i1p1=demean(finalT_r2i1p1);
out_IPSL_CM5A_MR_r3i1p1=demean(finalT_r3i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_IPSL_CM5A_MR_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_IPSL_CM5A_MR_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_IPSL_CM5A_MR_r3i1p1 '-append'
clear

% IPSL-CM5B-LR (1)

load /crane/s1/smiller/CMIP5/tas/IPSL-CM5B-LR/IPSL-CM5B-LR_hemimeans_all.mat 
out_IPSL_CM5B_LR_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_IPSL_CM5B_LR_r1i1p1 '-append'
clear

% MIROC5 (5)

load /crane/s1/smiller/CMIP5/tas/MIROC5/MIROC5_hemimeans_all.mat 
out_MIROC5_r1i1p1=demean(finalT_r1i1p1(1:1872,:));  % shorten to 2005
out_MIROC5_r2i1p1=demean(finalT_r2i1p1(1:1872,:));
out_MIROC5_r3i1p1=demean(finalT_r3i1p1(1:1872,:));
out_MIROC5_r4i1p1=demean(finalT_r4i1p1(1:1872,:));
out_MIROC5_r5i1p1=demean(finalT_r5i1p1(1:1872,:));
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MIROC5_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MIROC5_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MIROC5_r3i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MIROC5_r4i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MIROC5_r5i1p1 '-append'
clear

% MIROC-ESM (3)

load /crane/s1/smiller/CMIP5/tas/MIROC-ESM/MIROC-ESM_hemimeans_all.mat 
out_MIROC_ESM_r1i1p1=demean(finalT_r1i1p1);
out_MIROC_ESM_r2i1p1=demean(finalT_r2i1p1);
out_MIROC_ESM_r3i1p1=demean(finalT_r3i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MIROC_ESM_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MIROC_ESM_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MIROC_ESM_r3i1p1 '-append'
clear

% MPI-ESM-LR (2)

load /crane/s1/smiller/CMIP5/tas/MPI-ESM-LR/MPI-ESM-LR_hemimeans_all.mat 
out_MPI_ESM_LR_r1i1p1=demean(finalT_r1i1p1);
out_MPI_ESM_LR_r2i1p1=demean(finalT_r2i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MPI_ESM_LR_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MPI_ESM_LR_r2i1p1 '-append'
clear

% MRI-CGCM3 (4)

load /crane/s1/smiller/CMIP5/tas/MRI-CGCM3/MRI-CGCM3_hemimeans_all.mat 
out_MRI_CGCM3_r1i1p1=demean(finalT_r1i1p1);
out_MRI_CGCM3_r2i1p1=demean(finalT_r2i1p1);
out_MRI_CGCM3_r3i1p1=demean(finalT_r3i1p1);
out_MRI_CGCM3_r4i1p2=demean(finalT_r4i1p2);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MRI_CGCM3_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MRI_CGCM3_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MRI_CGCM3_r3i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MRI_CGCM3_r4i1p2 '-append'
clear

% MRI-ESM1 (1)

load /crane/s1/smiller/CMIP5/tas/MRI-ESM1/MRI-ESM1_hemimeans_all.mat 
out_MRI_ESM1_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_MRI_ESM1_r1i1p1 '-append'
clear

% NorESM1-M (3)

load /crane/s1/smiller/CMIP5/tas/NorESM1-M/NorESM1-M_hemimeans_all.mat 
out_NorESM1_M_r1i1p1=demean(finalT_r1i1p1);
out_NorESM1_M_r2i1p1=demean(finalT_r2i1p1);
out_NorESM1_M_r3i1p1=demean(finalT_r3i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_NorESM1_M_r1i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_NorESM1_M_r2i1p1 '-append'
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_NorESM1_M_r3i1p1 '-append'
clear

% Nor-ESM1-ME (1)

load /crane/s1/smiller/CMIP5/tas/NorESM1-ME/NorESM1-ME_hemimeans_all.mat 
out_NorESM1_ME_r1i1p1=demean(finalT_r1i1p1);
save /crane/s1/smiller/CMIP5/tos/GISS-E2-R/HMO_out.mat out_NorESM1_ME_r1i1p1 '-append'
clear