%%%%%%%%计算1991-2020气候态，放数组
clear
clc

depth_std=ncread('../../CAS_v1_temp_monthly_netCDF_GTSPP/CAS_v1_2000m_year_1955_month_01.nc','depth_std');
lat=ncread('../../CAS_v1_temp_monthly_netCDF_GTSPP/CAS_v1_2000m_year_1955_month_01.nc','lat');
lon=ncread('../../CAS_v1_temp_monthly_netCDF_GTSPP/CAS_v1_2000m_year_1955_month_01.nc','lon');

for month=1:12
    month
    m=1;
    temp_all=NaN(16,41,360,180);
    for year=2005:2020
        year
        filename=['../../CAS_v1_temp_monthly_netCDF_GTSPP/CAS_v1_2000m_year_',num2str(year),'_month_',num2str(month,'%02d'),'.nc'];
         temp=ncread(filename,'temp');
         temp_all(m,:,:,:)=temp;
         m=m+1;
    end
    COMS_temp_clim_monthly=squeeze(nanmean(temp_all,1));    
    
   eval(['save ./CAS_2005_2020_clim_month',num2str(month),'.mat COMS_temp_clim_monthly lat lon depth_std'])  
end



% plot_lat_lon(lon,lat,squeeze(COMS_temp_clim_monthly(25,:,:)),'s',1)