
disp([ 'Running short mexnc-opendap test with ' which(mfilename)])

disp(' ')
disp('Test will use the first mexnc in this list:')
which mexnc -all

% opendap url
url='http://tashtego.marine.rutgers.edu:8080/thredds/dodsC/nena/hycom_801/diagnostics';
disp(' ' )
disp('Reading data from opendap URL:')
disp(url)

try 
  % get a variable attribute
  unitsattribute = nc_attget(url,'ocean_time','units')

  % get some data
  data = nc_varget(url,'ocean_time',0,10)

  disp('SUCCESS')
  
catch
  
  disp(['TEST FAILED to read from ' url])
  disp('Need to add mexnc-opendap to the path before the default mexnc')
  disp('addpath /opt/MatlabR2006a/toolbox/local/mexcdf/mexnc-opendap')
  error(' ')
  
end

