


dischargeTrue = mStatesNOKF(:,526);
vInitTrue = mStatesNOKF(:,527);
vPrecTrue = mStatesNOKF(:,528);
vSinkTrue = mStatesNOKF(:,529);
vSeepTrue = mStatesNOKF(:,530);
vEndTrue = mStatesNOKF(:,531);


% correct these two volumes...
vEndTrue(1,1) = vInitTrue(2,1);
vInitTrue(1,1) = NaN;

% ...before calulating the innovation volume:
vInnTrue = repmat(NaN,[size(mStatesNOKF,1),1]);
vInnTrue(1:end-1) = vInitTrue(2:end,1)-vEndTrue(1:end-1,1);

save('water-balance-components.mat','dischargeTrue','vInitTrue',...
    'vPrecTrue','vSinkTrue','vSeepTrue','vEndTrue','vInnTrue')

balance = vInitTrue(2)+sum(vPrecTrue)+sum(vSinkTrue)+sum(vSeepTrue)+sum(vInnTrue(1:end-1))-vEndTrue(end)


disp(['vInitTrue(2) = ',num2str(vInitTrue(2)),char(10),...
'sum(vPrecTrue) = ',num2str(sum(vPrecTrue)),char(10),...
'sum(vSinkTrue) = ',num2str(sum(vSinkTrue)),char(10),...
'sum(vSeepTrue) = ',num2str(sum(vSeepTrue)),char(10),...
'sum(vInnTrue(1:end-1)) = ',num2str(sum(vInnTrue(1:end-1))),char(10),...
'vEndTrue(end) = ',num2str(vEndTrue(end)),char(10),...
'balance = ',num2str(balance)])



artifObs.times=(96:1.00:216)';   % times
artifObs.Q=mStatesNOKF(:,526);   % discharge
artifObs.h=mStatesNOKF(:,1:105); % presHead1Old

save('artificial-obs.mat','artifObs')