clearvars -except cmaps
clear global
close all

global_var

load('../model_illust_cases/condonly_illust.mat')
load('../model_illust_cases/evaponly_illust.mat')
load('../model_illust_cases/fullmp_illust.mat')

%% fig 2 plot
close all
f=figure('Position',[1797 477 801 284]);
tl=tiledlayout(1,3);
nexttile(1,[1,2])
hold on
wmax=max(fullmp_illust.w(:));
plot(fullmp_illust.time,fullmp_illust.w(:,1)/wmax,'LineWidth',1,...
   'DisplayName','Full MP')
wmax=max(condonly_illust.w(:));
plot(condonly_illust.time,condonly_illust.w(:,1)/wmax,...
   'LineWidth',3,'LineStyle',':','DisplayName','Cond.')
wmax=max(abs(evaponly_illust.w(:)));
plot(evaponly_illust.time,evaponly_illust.w(:,1)/wmax,...
   'LineWidth',2,'LineStyle','--','DisplayName','Evap.')
title('(a)')
hold off
legend('show')
set(gca,'FontSize',18)
xlim([0 1800])
xlabel('Time [s]')
ylabel('Vertical velocity [m/s]')
yticks([-1 0 1])
yticklabels({'-w_{max}','0','w_{max}'})

nexttile
fullmp_illust.z = [fullmp_illust.z;[6050:50:8000]'];
fullmp_illust.RH(1,end+1:end+40) = fullmp_illust.RH(1,end);
yyaxis left
set(gca,'YColor','none')
yyaxis right
rectangle('position', [0 600 max(fullmp_illust.RH(:)) 600], ...
   'facecolor', [color_order{5} .3], 'linestyle', 'none')
rectangle('position', [0 5500 max(fullmp_illust.RH(:)) 7000], ...
   'facecolor', [color_order{6} .3], 'linestyle', 'none')
hold on
plot(fullmp_illust.RH(1,:),fullmp_illust.z,'LineWidth',2)
title('(b)')
set(gca,'xTick',[0 100])
set(gca,'xticklabels',{'0' 'RH_{max}'})
hold off
set(gca,'FontSize',18)
xlabel('RH [%]')
ylabel('Altitude [m]')
ylim([0 8000])


exportgraphics(gcf,['plots/2 model setup.pdf'],'Resolution',300)
