close all

% 9/11: Plot theta0=Convection radius as a function of Kp and CTPOTEN
%   with dynamic and static crit(1,2) also

for kp=0:9
 rkp(kp+1) = kp;
 cpkp(kp+1) = 15. + 15*kp + 0.8*kp*kp;
 theta0kp(kp+1) = -2.80+8.48*(cpkp(kp+1)^0.1875);
 cp(kp+1) = (kp+1)*25.;
 theta0cp(kp+1) = -2.80+8.48*(cp(kp+1)^0.1875);
end

crit1con = [15. 15.];
crit2con = [30. 30.];
xkp = [0 9];
xcp = [25 250];
fsize=12;
fsiz=12;
dark_green = [0 0.5 0];
orange = [0.57 0.49 0];
purple = [0.48, 0.06, 0.89];
dark_green = [0 0.5 0];
red_brown = [0.6 0.2 0];
yel_grn = [0.75 0.75 0];

figure;
subplot ('Position',[0.1,0.1,0.83,0.83]);
plot (rkp,theta0kp,'-kx','MarkerSize',10);
hold on;
title ('TI(M)EGCM Crad=-3.8+8.48*CP^0.1875','fontsize',fsize,'fontweight','bold');
plot (xkp,crit1con,'--r');
plot (xkp,crit2con,'--r');
plot (rkp,theta0kp+5,'LineStyle','--','Color',dark_green);
plot (rkp,theta0kp+20,'--','Color',dark_green);
plot (rkp,theta0kp+15,'-.','Color',orange);
grid;
text (8.9,27.,'Dynamic crit(1)','Color',dark_green,'fontsize',fsize, 'fontweight','bold','HorizontalAlignment','right');
text (8.9,42.,'Dynamic crit(2)','Color',dark_green,'fontsize',fsize, 'fontweight','bold','HorizontalAlignment','right');
text (8.9,37.,'First Dynamic crit(2)','Color',orange,'fontsize',fsize, 'fontweight','bold','HorizontalAlignment','right');
text (8.9,16.,'Constant crit(1)','Color','r','fontsize',fsize, 'fontweight','bold','HorizontalAlignment','right');
text (8.9,31.,'Constant crit(2)','Color','r','fontsize',fsize, 'fontweight','bold','HorizontalAlignment','right');
text (0.1,9.,'Convection radius (Crad or theta0)','Color','k','fontsize',fsize, 'fontweight','bold','HorizontalAlignment','left');
        xlabel('Kp','fontsize',fsize,'fontweight','bold')
        ylabel('Co-Latitude (deg)','fontsize',fsize,'fontweight','bold')
	set (gca,'Xlim',xkp,'Ylim',[0 45],'fontsize',fsize,'fontweight','bold');
hold off;

figure;
subplot ('Position',[0.1,0.1,0.83,0.83]);
plot (cp,theta0cp,'-kx','MarkerSize',10);
hold on;
title ('TI(M)EGCM Crad=-3.8+8.48*CP^0.1875','fontsize',fsize,'fontweight','bold');
plot (xcp,crit1con,'--r');
plot (xcp,crit2con,'--r');
plot (cp,theta0cp+5,'LineStyle','--','Color',dark_green);
plot (cp,theta0cp+20,'--','Color',dark_green);
plot (cp,theta0cp+15,'--','Color',orange);
grid;
text (249.,28.,'Dynamic crit(1)','Color',dark_green,'fontsize',fsize, 'fontweight','bold','HorizontalAlignment','right');
text (249.,43.,'Dynamic crit(2)','Color',dark_green,'fontsize',fsize, 'fontweight','bold','HorizontalAlignment','right');
text (249.,38.,'First Dynamic crit(2)','Color',orange,'fontsize',fsize, 'fontweight','bold','HorizontalAlignment','right');
text (249,16.,'Constant crit(1)','Color','r','fontsize',fsize, 'fontweight','bold','HorizontalAlignment','right');
text (249,31.,'Constant crit(2)','Color','r','fontsize',fsize, 'fontweight','bold','HorizontalAlignment','right');
text (26.,11.5,'Convection radius (Crad or theta0)','Color','k','fontsize',fsize, 'fontweight','bold','HorizontalAlignment','left');
        xlabel('CP (kV)','fontsize',fsize,'fontweight','bold')
        ylabel('Co-Latitude (deg)','fontsize',fsize,'fontweight','bold')
	set (gca,'Xlim',xcp,'Ylim',[0 45],'fontsize',fsize,'fontweight','bold');
hold off;


figure;
subplot ('Position',[0.1,0.1,0.83,0.83]);
plot (cp,theta0cp,'-kx','MarkerSize',10);
hold on;
title ('TI(M)EGCM Crad=-3.8+8.48*CP^0.1875','fontsize',fsize,'fontweight','bold');
plot (xcp,crit1con,'--b');
plot (xcp,crit2con,'-.b');
plot (cp,theta0cp+2.5,'LineStyle','--','Color','g');
plot (cp,theta0cp+5,'LineStyle','--','Color','r');
plot (cp,theta0cp+7.5,'LineStyle','--','Color',yel_grn);
plot (cp,theta0cp+10,'LineStyle','-.','Color',purple);
plot (cp,theta0cp+15,'LineStyle','-.','Color',dark_green);
plot (cp,theta0cp+17.5,'LineStyle','-.','Color','g');
plot (cp,theta0cp+20,'LineStyle','-.','Color','r');
plot (cp,theta0cp+22.5,'LineStyle','-.','Color',red_brown);
grid;
text (240.,24,'D1','Color','g','fontsize',fsize, 'fontweight','bold');
text (240.,26.5,'D1','Color','r','fontsize',fsize, 'fontweight','bold');
text (230.,26.5,'D1','Color',dark_green,'fontsize',fsize, 'fontweight','bold');
text (220.,26.5,'D1','Color',purple,'fontsize',fsize, 'fontweight','bold');
text (240.,29.,'D1','Color',yel_grn,'fontsize',fsize, 'fontweight','bold');

text (240.,31.5,'D2','Color',purple,'fontsize',fsize, 'fontweight','bold');
text (240.,36.5,'D2','Color',dark_green,'fontsize',fsize, 'fontweight','bold');
text (240.,39.,'D1','Color',red_brown,'fontsize',fsize, 'fontweight','bold');
text (230.,39.,'D2','Color','g','fontsize',fsize, 'fontweight','bold');
text (240.,41.5,'D2','Color','r','fontsize',fsize, 'fontweight','bold');
text (240.,44.,'D2','Color',yel_grn,'fontsize',fsize, 'fontweight','bold');
text (230.,44.,'D2','Color',red_brown,'fontsize',fsize, 'fontweight','bold');

text (150.,16.,'Constant crit(1)','Color','b','fontsize',fsize, 'fontweight','bold');
text (150.,31.,'Constant crit(2)','Color','b','fontsize',fsize, 'fontweight','bold');
text (26.,11.5,'Convection radius (Crad or theta0)','Color','k','fontsize',fsize, 'fontweight','bold','HorizontalAlignment','left');
        xlabel('CP (kV)','fontsize',fsize,'fontweight','bold')
        ylabel('Co-Latitude (deg)','fontsize',fsize,'fontweight','bold')
	set (gca,'Xlim',xcp,'Ylim',[0 50],'fontsize',fsize,'fontweight','bold');
hold off;
