function retn = disp_ncdepth(fname) %disp_nedepth: displays the attributes associated with depth % % opens a netCDF file and displays the depth associated attributes and % variable depth % for use in validating runs of fix_meta_depth % % usage disp_ncdepth('7265sc-a.nc') % where the retn_status is 1 if no problems % the input argument is a netCDF file name % emontgomery@usgs.gov June, 2006 %%% START USGS BOILERPLATE ------------ % These programs are intened for us in adjusting metadata terms in % netCDF files from the USGS CMGP Oceanographic time-series data % archive % % Program written Matlab 7.6.0.342 (R2008a) % Program ran on Linux PC with RHEL4 and on Windows XP PC. % % "Although this program has been used by the USGS, no warranty, % expressed or implied, is made by the USGS or the United States % Government as to the accuracy and functioning of the program % and related program material nor shall the fact of distribution % constitute any such warranty, and no responsibility is assumed % by the USGS in connection therewith." %%% END USGS BOILERPLATE -------------- if nargin ~= 1; help (mfilename); retn=0; return; end if (exist(fname, 'file')) nc=netcdf(fname); disp ([fname ': WATER_DEPTH: ' num2str(nc.WATER_DEPTH(:))]); lendep=length(nc{'depth'}(:)); if lendep==1 disp (['depth coordinate variable is: ', num2str(nc{'depth'}(1))]); else disp('depth coordinate variable values are:') for ik=1:lendep disp(num2str(nc{'depth'}(ik))); end end vn=var(nc); %for ik=6:length(vn) for ik=1:length(vn) ndims=ncsize(vn{ik}); if(length(ndims) > 2) if (~isempty(vn{ik}.sensor_depth(:))) disp ([name(vn{ik}) ': sensor_depth = ' num2str(nc{name(vn{ik})}.sensor_depth(:))]) end if (~isempty(vn{ik}.initial_sensor_height)) disp ([name(vn{ik}) ': initial_inst_height = ' num2str(nc{name(vn{ik})}.initial_sensor_height(:))]) end end end close(nc) retn=1; else retn=0; end