% topo_comp

%-------------------------------------------------------------------------------
%  Set input parameters.
%-------------------------------------------------------------------------------

%topfile = '/home/haley/Pjhgrid/Norway/SRTM30/topo_p5min_40to90N_20Wto20E.nc';
topfile = '/home/haley/Pjhgrid/Norway/DBDBV/topo_p5min_45to70N_10Wto20E.nc';

latlim = [53.82954407 64.38609314];
lonlim = [-4.60359526 13.89270401];

clvl = [(-3500):500:(-1500) (-1250):250:(-750) (-500):100:(-300) ...
        (-250):50:(-150) (-125):25:(-50) (-40):10:0];

%-------------------------------------------------------------------------------
%  Extract plotting labels from topography file.
%-------------------------------------------------------------------------------

ncid = netcdf(topfile);
ttl = ncid.title(:);
xlbl = ncid.comment(:);
close(ncid);
clear ncid;

%-------------------------------------------------------------------------------
%  Read topography.
%-------------------------------------------------------------------------------

[lon,lat,topo,status] = get_topo_doit (topfile,lonlim,latlim);
if (status~=0),
   disp (' ');
   disp ('***Error:  TOPO_COMP - unable to read file:');
   disp (['           ',setstr(34),topfile,setstr(34)]);
   disp (' ');
   return;
end;

clear topfile;

%-------------------------------------------------------------------------------
%  Plot topography.
%-------------------------------------------------------------------------------

plot_fld (lon,lat,topo,clvl);
set (gca,'XLim',lonlim,'YLim',latlim);
title(ttl,'Interpreter','None');
if ~isempty(xlbl)
   xlabel(xlbl,'Interpreter','None');
end;
