function D=getDONARdata(s)

clearvars -except s

%% Parameters (check on: opendap.deltares.nl)
Locations   = {'IJMDMNTSPS.nc','EURPFM.nc','EIELSGT.nc'};
Parameters  = {'sea_surface_wave_significant_height','sea_surface_wave_from_direction','sea_surface_wind_wave_tm02'};
url_ini     = 'http://opendap.deltares.nl/thredds/dodsC/opendap/rijkswaterstaat/waterbase/';

meta        = nc_info([url_ini Parameters{1} '/id22-' Locations{1}]);
t_end       = meta.Attribute(find(strcmp({meta.Attribute.Name},'time_coverage_end'))).Value;

%% get data from DONAR database
for i=1:length(Locations)
    D(i).loc = Locations(i);
    for j=1:length(Parameters)
        url     = [url_ini Parameters{j} '/id2' num2str(j+1) '-' Locations{i}]; % nc_dump(url)
        if     j==1; D(i).hm0.val   = nc_varget(url,Parameters{1});  D(i).hm0.time = nc_cf_time(url,'time')';  
        elseif j==2; D(i).th0.val   = nc_varget(url,Parameters{2});  D(i).th0.time = nc_cf_time(url,'time')'; 
        elseif j==3; D(i).tm02.val  = nc_varget(url,Parameters{3});  D(i).tm02.time = nc_cf_time(url,'time')'; 
        end
        clear url;
    end
end
