function DM_editdunedimensions(handles)

global data

prompt={'Enter height of dune (m)','Enter width of dune crest (m)','Enter elevation where excavation can commence (m)',...
    'Enter seaward dune slope','Enter landward dune slope','Enter digging option (0 = NOURISH, 1 = SCRAPE)'};
name='Edit Dune Dimensions';
numlines=1;
defaultanswer={num2str(data.duneheight),num2str(data.dunewidth),num2str(data.startheight),num2str(data.duneslope_sea),num2str(data.duneslope_land),num2str(data.digoption)};
options.Resize='off';
options.WindowStyle='normal';
answer=inputdlg(prompt,name,numlines,defaultanswer,options);

if ~isempty(answer)
data.duneheight = str2num(answer{1});
data.dunewidth = str2num(answer{2});
data.startheight = str2num(answer{3});
data.duneslope_sea = str2num(answer{4});
data.duneslope_land = str2num(answer{5});
data.digoption = str2num(answer{6});
ButtonName = questdlg('Recalculate the dune with these settings?', ...
                         'Recalculate dune?', ...
                         'Yes', 'No','No');
switch ButtonName,
     case 'Yes',
        DM_startdigging
        DM_plot_dune(handles)
        crest_line = getPosition(data.duneline);
        crest_line = interp1(crest_line(:,2),crest_line(:,1),data.y(:,1)); %Interp crest line 2 grid
        crest_line_y = data.y(~isnan(crest_line),1);
        Index = interp1(data.y(:,1),1:length(data.y(:,1)),(max(crest_line_y)+min(crest_line_y))/2,'nearest');
        DM_plot_profile(handles,Index)
       case 'No'
end % switch
end

