[Dart-dev] [6270] DART/trunk/diagnostics/matlab: Better comments and accurate examples .

nancy at ucar.edu nancy at ucar.edu
Fri Jun 14 08:46:15 MDT 2013


Revision: 6270
Author:   thoar
Date:     2013-06-14 08:46:14 -0600 (Fri, 14 Jun 2013)
Log Message:
-----------
Better comments and accurate examples.
m-lint compliant.

Modified Paths:
--------------
    DART/trunk/diagnostics/matlab/get_varnames.m
    DART/trunk/diagnostics/matlab/get_varsNdims.m

-------------- next part --------------
Modified: DART/trunk/diagnostics/matlab/get_varnames.m
===================================================================
--- DART/trunk/diagnostics/matlab/get_varnames.m	2013-06-13 21:40:55 UTC (rev 6269)
+++ DART/trunk/diagnostics/matlab/get_varnames.m	2013-06-14 14:46:14 UTC (rev 6270)
@@ -1,5 +1,5 @@
 function bob = get_varnames(fname)
-%% get_varnames returns JUST the 'atmospheric' variable names in the netCDF file - ie - not the coordinate variables.
+%% get_varnames returns NON-coordinate variables.
 %
 % the result is a cell array of strings ... must use {} notation to address elements.
 %
@@ -42,7 +42,7 @@
 end
 
 if (isempty(inds))
-   error('No atmospheric variables in %s',fname)
+   error('There are only coordinate variables in %s',fname)
 end
 
 % coerce just the names into a cell array 

Modified: DART/trunk/diagnostics/matlab/get_varsNdims.m
===================================================================
--- DART/trunk/diagnostics/matlab/get_varsNdims.m	2013-06-13 21:40:55 UTC (rev 6269)
+++ DART/trunk/diagnostics/matlab/get_varsNdims.m	2013-06-14 14:46:14 UTC (rev 6270)
@@ -1,4 +1,4 @@
-function [y, ydims] = get_varsNdims(fname);
+function [y, ydims] = get_varsNdims(fname)
 %% Get the dimension (strings) for each atmospheric variable.
 % [y, ydims] = get_vars_dims(fname);
 %
@@ -12,11 +12,11 @@
 % fname      = 'obs_seq.final.nc';
 % [y, ydims] = get_varsNdims(fname);
 %
-% >> plotdat.allvarnames{20}  
+% >> y{20}  
 %
 %    AIRCRAFT_U_WIND_COMPONENT_guess
 %
-% >> plotdat.allvardims{20}
+% >> ydims{20}
 %    region plevel copy time
 
 %% DART software - Copyright 2004 - 2013 UCAR. This open source software is
@@ -28,6 +28,9 @@
 ALLvarnames = get_varnames(fname);
 Nvarnames   = length(ALLvarnames);
 
+y     = cell(Nvarnames,1);
+ydims = cell(Nvarnames,1);
+
 for i = 1:Nvarnames
 
    varname = ALLvarnames{i};


More information about the Dart-dev mailing list