[Dart-dev] DART/branches Revision: 11140
dart at ucar.edu
dart at ucar.edu
Wed Feb 22 14:57:46 MST 2017
thoar at ucar.edu
2017-02-22 14:57:44 -0700 (Wed, 22 Feb 2017)
166
Removing an unused function - get_state_copy.m
Added comments to GetNCindices to note that the start/count
variables are now appropriate for ncread (1,N, not 0,N-1)
Modified: DART/branches/rma_trunk/matlab/GetNCindices.m
===================================================================
--- DART/branches/rma_trunk/matlab/GetNCindices.m 2017-02-22 20:53:02 UTC (rev 11139)
+++ DART/branches/rma_trunk/matlab/GetNCindices.m 2017-02-22 21:57:44 UTC (rev 11140)
@@ -1,8 +1,11 @@
function [start, count] = GetNCindices(pinfo, whichfile, varname)
-%% GETNCindices returns a start,count array for use with nc_getvar.
+%% GETNCindices returns a start,count array for use with ncread.
% At present, all times, all copies for a specific level,lat,lon.
% Does not assume anything about the dimension of the variable.
%
+% ncread uses 1-based addressing for the 'start',
+% rather than the 0-based system used in C-style indexing.
+%
% USAGE:
% [start, count] = GetNCindices(pinfo, whichfile, varname);
%
Deleted: DART/branches/rma_trunk/matlab/get_state_copy.m
===================================================================
--- DART/branches/rma_trunk/matlab/get_state_copy.m 2017-02-22 20:53:02 UTC (rev 11139)
+++ DART/branches/rma_trunk/matlab/get_state_copy.m 2017-02-22 21:57:44 UTC (rev 11140)
@@ -1,49 +0,0 @@
-function state_vec = get_state_copy(fname, varname, copyindex, tstartind, tcount)
-%% GET_STATE_COPY Gets a particular copy (one ensemble member) of state from netcdf file
-% Retrieves a particular copy of a state vector from a file whose
-% full or relative path is specified in the file argument.
-
-%% DART software - Copyright UCAR. This open source software is provided
-% by UCAR, "as is", without charge, subject to all terms of use at
-% http://www.image.ucar.edu/DAReS/DART/DART_download
-%
-% DART $Id$
-
-error('get_state_copy() is deprecated, use get_hyperslab() instead.')
-
-
-if ( exist(fname,'file') ~= 2 ), error('%s does not exist.',fname); end
-
-if (nargin == 3)
- tstartind = 1;
- [tcount,~] = nc_dim_info(fname,'time');
-end
-
-myinfo.diagn_file = fname;
-myinfo.copyindex = copyindex;
-[start, count] = GetNCindices(myinfo, 'diagn', varname);
-
-varinfo = nc_getvarinfo(fname,varname);
-
-for i = 1:length(varinfo.Dimension)
- switch( lower(varinfo.Dimension{i}))
- case{'time'}
- start(i) = tstartind - 1;
- count(i) = tcount;
- break
- otherwise
- end
-end
-
-state_vec = nc_varget(fname, varname, start, count);
-
-if (sum(isfinite(state_vec(:))) == 0)
- error('%s %s copy %d has all missing values ... exiting.', ...
- fname, varname, copyindex )
-end
-
-
-% <next few lines under version control, do not edit>
-% $URL$
-% $Revision$
-% $Date$
More information about the Dart-dev
mailing list