clear;

load data/midterm_isabel_dat;

[d3 d2 d1]=size(Hydrometer);


%---method 1
lwp(1:d2,1:d1)=0;
for k=1:d3
    lwp(:,:)=lwp(:,:)+squeeze(Hydrometer(k,:,:).*(z(k+1,:,:)-z(k,:,:)));
end

%---method 2
dz=z(2:end,:,:)-z(1:end-1,:,:);
var=Hydrometer.*dz;
lwp1=squeeze(sum(var,1));

figure(1);
subplot(2,2,1);
contourf(lwp,'edgecolor','none');
colorbar;

subplot(2,2,2);
contourf(lwp1,'edgecolor','none');
colorbar;

figure(2);
contourf(lwp,[0:0.5:50],'edgecolor','none');
colorbar;




