%% compute semi-variogram using specified parameters on the panel

%%  Kriging Software Package  version 1.0 beta,   October 29, 1998
%%  Copyright (c) 1998, property of Dezhang Chu and Woods Hole Oceanographic
%%  Institution.  All Rights Reserved.


if ~isempty(lag)
[model,nugt,sill,L,b,p]=getvariopara;
hp=findobj(gcf,'Tag','variogramAxes1');
hchd=get(hp,'children');
lag=get(hchd(1),'XDATA');
model_para=[nugt sill L b p];
gammah_theo=variogrammodel(model,lag,model_para);
if model > 0
   hv0=plot(lag,gammah,'o',lag,gammah_theo);
   hy=ylabel('Variogram');
else
   hv0=plot(lag,1-gammah,'o',lag,1-gammah_theo);
   hy=ylabel('Correlogram');
end
if ~isempty(hv0)
   set(get(hv0(1),'parent'),'Tag','variogramAxes1')
   status=2;
end
hx=xlabel('Lag (km)');
set([hx hy],'fontsize',12,'fontweight','bold')
checksliderposition
else
   dd=warningtext;  
end
