clear;close all




figure;set(gcf,'position',[0 0 1000 700])

[X,Y]=meshgrid(lon_u10,lat_u10);
m_proj('Robinson','lon',[lon_u10(1) lon_u10(end)],'lat',[lat_u10(1) lat_u10(end)]);
set(gca,'FontSize',10);
hold on;
%
for m = 1:size(Trend_test,1);
    m
    for n = 1:size(Trend_test,2);
        if Trend_test_position(m,n) ==1
            m_plot(lon_u10(m),lat_u10(n),'k.','Markersize',5.5);hold on
        end
    end
end
m_pcolor(X,Y,(Bhist_trend_num')*10);shading interp;caxis([-2 2]);colormap(flipud(dif_color_inter20))
% 
m_coast('patch',[0.9 0.9 0.9]);
m_grid('linestyle',':','box','on','tickdir','in', 'xlim',[60 300],'xtick',60:60:300,'ylim',[-90 90],'ytick',[-90 -60 -20 0 20 60 90],'FontSize',12);

hold on
m_plot([140 140],[45 32],'r','Linewidth',2);hold on;hold on
m_plot([180 180],[45 32],'r','Linewidth',2);hold on;%long lat
m_plot([140 180],[32 32],'r','Linewidth',2);hold on;hold on
m_plot([140 180],[45 45],'r','Linewidth',2);hold on;%long lat
m_plot([290 290],[45 32],'r','Linewidth',2);hold on;hold on
m_plot([320 320],[45 32],'r','Linewidth',2);hold on;%long lat
m_plot([290 320],[32 32],'r','Linewidth',2);hold on;hold on
m_plot([290 320],[45 45],'r','Linewidth',2);hold on;%long lat
m_plot([15 15],[-48 -36],'r','Linewidth',2);hold on;hold on
m_plot([70 70],[-48 -36],'r','Linewidth',2);hold on;%long lat
m_plot([15 70],[-36 -36],'r','Linewidth',2);hold on;hold on
m_plot([15 70],[-48 -48],'r','Linewidth',2);hold on;%long lat
m_plot([295 295],[-52 -36],'r','Linewidth',2);hold on;hold on
m_plot([345 345],[-52 -36],'r','Linewidth',2);hold on;%long lat
m_plot([295 345],[-36 -36],'r','Linewidth',2);hold on;hold on
m_plot([295 345],[-52 -52],'r','Linewidth',2);hold on;%long lat

gca = colorbar('southoutside');
set(gca,'position',[0.195 0.14 0.65 0.02]);
h = colorbar('horizon','position',[0.195 0.14 0.65 0.02]);set(h,'TickLength',0.018,'color',[0.99 1 1],'ticks',-2:0.2:2,'TickLabels',[],'LineWidth',1.5);
set(gca,'XTick',-2:0.4:2,'Fontsize',12)
caxis([-2 2])
set(get(gca,'Xlabel'),'string','(W·m^-^2·℃^-^1·decade^-^1)');
set(gca,'Fontsize',12)
clear gca
clear nonzero
title('Mesoscale SST-LHF Coupling Trend in CESM-HR (1979-2022 )')
set(gca,'Fontsize',14)
text(-2.795,1.74,'b','FontSize',22,'FontWeight','bold')



% 
% figure;set(gcf,'position',[0 0 1000 700])
% m_pcolor(X,Y,mean(SST_LHF_p,3)');shading interp;caxis([-50 50]);colormap(flipud(dif_color_inter20))
% m_coast('patch',[0.9 0.9 0.9]);
% m_grid('linestyle',':','box','on','tickdir','in', 'xlim',[60 300],'xtick',60:60:300,'ylim',[-90 90],'ytick',[-90 -60 -20 0 20 60 90],'FontSize',12);
% 
% hold on
% m_plot([140 140],[45 32],'r','Linewidth',2);hold on;hold on
% m_plot([180 180],[45 32],'r','Linewidth',2);hold on;%long lat
% m_plot([140 180],[32 32],'r','Linewidth',2);hold on;hold on
% m_plot([140 180],[45 45],'r','Linewidth',2);hold on;%long lat
% m_plot([290 290],[45 32],'r','Linewidth',2);hold on;hold on
% m_plot([320 320],[45 32],'r','Linewidth',2);hold on;%long lat
% m_plot([290 320],[32 32],'r','Linewidth',2);hold on;hold on
% m_plot([290 320],[45 45],'r','Linewidth',2);hold on;%long lat
% m_plot([15 15],[-48 -36],'r','Linewidth',2);hold on;hold on
% m_plot([70 70],[-48 -36],'r','Linewidth',2);hold on;%long lat
% m_plot([15 70],[-36 -36],'r','Linewidth',2);hold on;hold on
% m_plot([15 70],[-48 -48],'r','Linewidth',2);hold on;%long lat
% m_plot([295 295],[-52 -36],'r','Linewidth',2);hold on;hold on
% m_plot([345 345],[-52 -36],'r','Linewidth',2);hold on;%long lat
% m_plot([295 345],[-36 -36],'r','Linewidth',2);hold on;hold on
% m_plot([295 345],[-52 -52],'r','Linewidth',2);hold on;%long lat
% 
% hold on
% gca = colorbar('southoutside');
% set(gca,'position',[0.195 0.14 0.65 0.02]);
% h = colorbar('horizon','position',[0.195 0.14 0.65 0.02]);set(h,'TickLength',0.018,'color',[0.99 1 1],'ticks',-50:5:50,'TickLabels',[],'LineWidth',1.5);
% set(gca,'XTick',-50:10:50,'Fontsize',12)
% caxis([-50 50])
% set(get(gca,'Xlabel'),'string','(W·m^-^2·℃^-^1)');
% set(gca,'Fontsize',12)
% clear gca
% clear nonzero
% title('Mesoscale SSTa-LHFa in CESM (1979-2022 )')
% set(gca,'Fontsize',14)
% 
