%radiationplots.m June 9, 2015
%This code makes plots for lw, sw, and net radiation.

load('cf_avg_sd.mat');

%make Marat style plots
grids(1,1) = 16;
gridt(1,1) = 8;
gridu(1,1) = 4;
gridv(1,1) = 2;
gridw(1,1) = 1;
gridx(1,1) = .5;

gridset = ([16, 8, 4, 2, 1]);
gridset2 = ([16, 8, 4, 2, 1, .5]);

LWCFsetNOSHOC1M = ([lw_cf_avg(1,1,6), lw_cf_avg(1,1,5), lw_cf_avg(1,1,4), lw_cf_avg(1,1,3), lw_cf_avg(1,1,2), lw_cf_avg(1,1,1)]);
SWCFsetNOSHOC1M = ([sw_cf_avg(1,1,6), sw_cf_avg(1,1,5), sw_cf_avg(1,1,4), sw_cf_avg(1,1,3), sw_cf_avg(1,1,2), sw_cf_avg(1,1,1)]);
NCFsetNOSHOC1M = ([net_cf_avg(1,1,6), net_cf_avg(1,1,5), net_cf_avg(1,1,4), net_cf_avg(1,1,3), net_cf_avg(1,1,2), net_cf_avg(1,1,1)]);

figure(1)
%set(gcf,'Renderer','zbuffer');
hold on;
plot(gridset2, LWCFsetNOSHOC1M,'-bo','MarkerSize',10,'MarkerFaceColor','b','LineWidth',2);
plot(gridset2, SWCFsetNOSHOC1M,'-rs','MarkerSize',10,'MarkerFaceColor','r','LineWidth',2);
plot(gridset2, NCFsetNOSHOC1M,'-go','MarkerSize',10,'MarkerFaceColor','g','LineWidth',2);
errorbar(grids, lw_cf_avg(1,1,6),lw_cf_sd(1,1,6), lw_cf_sd(1,1,6), 'b', 'LineWidth', 1.5);
errorbar(gridt, lw_cf_avg(1,1,5),lw_cf_sd(1,1,5), lw_cf_sd(1,1,5), 'b', 'LineWidth', 1.5);
errorbar(gridu, lw_cf_avg(1,1,4),lw_cf_sd(1,1,4), lw_cf_sd(1,1,4), 'b', 'LineWidth', 1.5);
errorbar(gridv, lw_cf_avg(1,1,3),lw_cf_sd(1,1,3), lw_cf_sd(1,1,3), 'b', 'LineWidth', 1.5);
errorbar(gridw, lw_cf_avg(1,1,2),lw_cf_sd(1,1,2), lw_cf_sd(1,1,2), 'b', 'LineWidth', 1.5);
errorbar(gridx, lw_cf_avg(1,1,1),lw_cf_sd(1,1,1), lw_cf_sd(1,1,1), 'b', 'LineWidth', 1.5);
errorbar(grids, sw_cf_avg(1,1,6),sw_cf_sd(1,1,6), sw_cf_sd(1,1,6), 'r', 'LineWidth', 1.5);
errorbar(gridt, sw_cf_avg(1,1,5),sw_cf_sd(1,1,5), sw_cf_sd(1,1,5), 'r', 'LineWidth', 1.5);
errorbar(gridu, sw_cf_avg(1,1,4),sw_cf_sd(1,1,4), sw_cf_sd(1,1,4), 'r', 'LineWidth', 1.5);
errorbar(gridv, sw_cf_avg(1,1,3),sw_cf_sd(1,1,3), sw_cf_sd(1,1,3), 'r', 'LineWidth', 1.5);
errorbar(gridw, sw_cf_avg(1,1,2),sw_cf_sd(1,1,2), sw_cf_sd(1,1,2), 'r', 'LineWidth', 1.5);
errorbar(gridx, sw_cf_avg(1,1,1),sw_cf_sd(1,1,1), sw_cf_sd(1,1,1), 'r', 'LineWidth', 1.5);
errorbar(grids, net_cf_avg(1,1,6),net_cf_sd(1,1,6), net_cf_sd(1,1,6), 'g', 'LineWidth', 1.5);
errorbar(gridt, net_cf_avg(1,1,5),net_cf_sd(1,1,5), net_cf_sd(1,1,5), 'g', 'LineWidth', 1.5);
errorbar(gridu, net_cf_avg(1,1,4),net_cf_sd(1,1,4), net_cf_sd(1,1,4), 'g', 'LineWidth', 1.5);
errorbar(gridv, net_cf_avg(1,1,3),net_cf_sd(1,1,3), net_cf_sd(1,1,3), 'g', 'LineWidth', 1.5);
errorbar(gridw, net_cf_avg(1,1,2),net_cf_sd(1,1,2), net_cf_sd(1,1,2), 'g', 'LineWidth', 1.5);
errorbar(gridx, net_cf_avg(1,1,1),net_cf_sd(1,1,1), net_cf_sd(1,1,1), 'g', 'LineWidth', 1.5);
hold off;
axis([.25 32 -3 3])
grid on;
legend('LW Cloud Feedback','SW Cloud Feedback','Net Cloud Feedback', 2);
set(gca,'FontSize',16,'FontWeight','bold');
xlabel('Grid Size (km)','FontSize',16,'FontWeight','bold');
ylabel('Cloud Feedback{(W {m^{-2}}{K^{-1}})}','FontSize',16,'FontWeight','bold');
title('RCE-GREY, NOSHOC, 1M','FontSize',16,'FontWeight','bold');

LWCFsetSHOC1M = ([lw_cf_avg(2,1,6), lw_cf_avg(2,1,5), lw_cf_avg(2,1,4), lw_cf_avg(2,1,3), lw_cf_avg(2,1,2)]);
SWCFsetSHOC1M = ([sw_cf_avg(2,1,6), sw_cf_avg(2,1,5), sw_cf_avg(2,1,4), sw_cf_avg(2,1,3), sw_cf_avg(2,1,2)]);
NCFsetSHOC1M = ([net_cf_avg(2,1,6), net_cf_avg(2,1,5), net_cf_avg(2,1,4), net_cf_avg(2,1,3), net_cf_avg(2,1,2)]);

figure(2)
%set(gcf,'Renderer','zbuffer');
hold on;
plot(gridset, LWCFsetSHOC1M,'-bo','MarkerSize',10,'MarkerFaceColor','b','LineWidth',2);
plot(gridset, SWCFsetSHOC1M,'-rs','MarkerSize',10,'MarkerFaceColor','r','LineWidth',2);
plot(gridset, NCFsetSHOC1M,'-go','MarkerSize',10,'MarkerFaceColor','g','LineWidth',2);
errorbar(grids, lw_cf_avg(2,1,6),lw_cf_sd(2,1,6), lw_cf_sd(2,1,6), 'b', 'LineWidth', 1.5);
errorbar(gridt, lw_cf_avg(2,1,5),lw_cf_sd(2,1,5), lw_cf_sd(2,1,5), 'b', 'LineWidth', 1.5);
errorbar(gridu, lw_cf_avg(2,1,4),lw_cf_sd(2,1,4), lw_cf_sd(2,1,4), 'b', 'LineWidth', 1.5);
errorbar(gridv, lw_cf_avg(2,1,3),lw_cf_sd(2,1,3), lw_cf_sd(2,1,3), 'b', 'LineWidth', 1.5);
errorbar(gridw, lw_cf_avg(2,1,2),lw_cf_sd(2,1,2), lw_cf_sd(2,1,2), 'b', 'LineWidth', 1.5);
errorbar(grids, sw_cf_avg(2,1,6),sw_cf_sd(2,1,6), sw_cf_sd(2,1,6), 'r', 'LineWidth', 1.5);
errorbar(gridt, sw_cf_avg(2,1,5),sw_cf_sd(2,1,5), sw_cf_sd(2,1,5), 'r', 'LineWidth', 1.5);
errorbar(gridu, sw_cf_avg(2,1,4),sw_cf_sd(2,1,4), sw_cf_sd(2,1,4), 'r', 'LineWidth', 1.5);
errorbar(gridv, sw_cf_avg(2,1,3),sw_cf_sd(2,1,3), sw_cf_sd(2,1,3), 'r', 'LineWidth', 1.5);
errorbar(gridw, sw_cf_avg(2,1,2),sw_cf_sd(2,1,2), sw_cf_sd(2,1,2), 'r', 'LineWidth', 1.5);
errorbar(grids, net_cf_avg(2,1,6),net_cf_sd(2,1,6), net_cf_sd(2,1,6), 'g', 'LineWidth', 1.5);
errorbar(gridt, net_cf_avg(2,1,5),net_cf_sd(2,1,5), net_cf_sd(2,1,5), 'g', 'LineWidth', 1.5);
errorbar(gridu, net_cf_avg(2,1,4),net_cf_sd(2,1,4), net_cf_sd(2,1,4), 'g', 'LineWidth', 1.5);
errorbar(gridv, net_cf_avg(2,1,3),net_cf_sd(2,1,3), net_cf_sd(2,1,3), 'g', 'LineWidth', 1.5);
errorbar(gridw, net_cf_avg(2,1,2),net_cf_sd(2,1,2), net_cf_sd(2,1,2), 'g', 'LineWidth', 1.5);
hold off;
axis([.25 32 -5 2])
grid on;
legend('LW Cloud Feedback','SW Cloud Feedback','Net Cloud Feedback', 2);
set(gca,'FontSize',16,'FontWeight','bold');
xlabel('Grid Size (km)','FontSize',16,'FontWeight','bold');
ylabel('Cloud Feedback{(W {m^{-2}}{K^{-1}})}','FontSize',16,'FontWeight','bold');
title('RCE-GREY, SHOC, 1M','FontSize',16,'FontWeight','bold');

LWCFsetNOSHOC2M = ([lw_cf_avg(1,2,6), lw_cf_avg(1,2,5), lw_cf_avg(1,2,4), lw_cf_avg(1,2,3), lw_cf_avg(1,2,2)]);
SWCFsetNOSHOC2M = ([sw_cf_avg(1,2,6), sw_cf_avg(1,2,5), sw_cf_avg(1,2,4), sw_cf_avg(1,2,3), sw_cf_avg(1,2,2)]);
NCFsetNOSHOC2M = ([net_cf_avg(1,2,6), net_cf_avg(1,2,5), net_cf_avg(1,2,4), net_cf_avg(1,2,3), net_cf_avg(1,2,2)]);

figure(3)
%set(gcf,'Renderer','zbuffer');
hold on;
plot(gridset, LWCFsetNOSHOC2M,'-bo','MarkerSize',10,'MarkerFaceColor','b','LineWidth',2);
plot(gridset, SWCFsetNOSHOC2M,'-rs','MarkerSize',10,'MarkerFaceColor','r','LineWidth',2);
plot(gridset, NCFsetNOSHOC2M,'-go','MarkerSize',10,'MarkerFaceColor','g','LineWidth',2);
errorbar(grids, lw_cf_avg(1,2,6),lw_cf_sd(1,2,6), lw_cf_sd(1,2,6), 'b', 'LineWidth', 1.5);
errorbar(gridt, lw_cf_avg(1,2,5),lw_cf_sd(1,2,5), lw_cf_sd(1,2,5), 'b', 'LineWidth', 1.5);
errorbar(gridu, lw_cf_avg(1,2,4),lw_cf_sd(1,2,4), lw_cf_sd(1,2,4), 'b', 'LineWidth', 1.5);
errorbar(gridv, lw_cf_avg(1,2,3),lw_cf_sd(1,2,3), lw_cf_sd(1,2,3), 'b', 'LineWidth', 1.5);
errorbar(gridw, lw_cf_avg(1,2,2),lw_cf_sd(1,2,2), lw_cf_sd(1,2,2), 'b', 'LineWidth', 1.5);
errorbar(grids, sw_cf_avg(1,2,6),sw_cf_sd(1,2,6), sw_cf_sd(1,2,6), 'r', 'LineWidth', 1.5);
errorbar(gridt, sw_cf_avg(1,2,5),sw_cf_sd(1,2,5), sw_cf_sd(1,2,5), 'r', 'LineWidth', 1.5);
errorbar(gridu, sw_cf_avg(1,2,4),sw_cf_sd(1,2,4), sw_cf_sd(1,2,4), 'r', 'LineWidth', 1.5);
errorbar(gridv, sw_cf_avg(1,2,3),sw_cf_sd(1,2,3), sw_cf_sd(1,2,3), 'r', 'LineWidth', 1.5);
errorbar(gridw, sw_cf_avg(1,2,2),sw_cf_sd(1,2,2), sw_cf_sd(1,2,2), 'r', 'LineWidth', 1.5);
errorbar(grids, net_cf_avg(1,2,6),net_cf_sd(1,2,6), net_cf_sd(1,2,6), 'g', 'LineWidth', 1.5);
errorbar(gridt, net_cf_avg(1,2,5),net_cf_sd(1,2,5), net_cf_sd(1,2,5), 'g', 'LineWidth', 1.5);
errorbar(gridu, net_cf_avg(1,2,4),net_cf_sd(1,2,4), net_cf_sd(1,2,4), 'g', 'LineWidth', 1.5);
errorbar(gridv, net_cf_avg(1,2,3),net_cf_sd(1,2,3), net_cf_sd(1,2,3), 'g', 'LineWidth', 1.5);
errorbar(gridw, net_cf_avg(1,2,2),net_cf_sd(1,2,2), net_cf_sd(1,2,2), 'g', 'LineWidth', 1.5);
hold off;
axis([.25 32 -3 3])
grid on;
legend('LW Cloud Feedback','SW Cloud Feedback','Net Cloud Feedback', 2);
set(gca,'FontSize',16,'FontWeight','bold');
xlabel('Grid Size (km)','FontSize',16,'FontWeight','bold');
ylabel('Cloud Feedback{(W {m^{-2}}{K^{-1}})}','FontSize',16,'FontWeight','bold');
title('RCE-GREY, NOSHOC, M2005','FontSize',16,'FontWeight','bold');