diff --git a/2. State Vectors and Ensembles/@ensemble/load.m b/2. State Vectors and Ensembles/@ensemble/load.m index a56b1937..fc5ffcbf 100644 --- a/2. State Vectors and Ensembles/@ensemble/load.m +++ b/2. State Vectors and Ensembles/@ensemble/load.m @@ -24,7 +24,7 @@ if isempty(loadH) loadH = 1:obj.ensSize(1); end -[scsRow, keepRows] = loadKeep( loadH ); +[scsRow, keepRows] = loadKeep( find(loadH) ); rows = scsIndices( scsRow ); % Attempt to load the entire panel diff --git a/2. State Vectors and Ensembles/@ensembleMetadata/coordinates.m b/2. State Vectors and Ensembles/@ensembleMetadata/coordinates.m index a8fd7808..b439ebc9 100644 --- a/2. State Vectors and Ensembles/@ensembleMetadata/coordinates.m +++ b/2. State Vectors and Ensembles/@ensembleMetadata/coordinates.m @@ -18,25 +18,29 @@ for v = 1:numel(obj.varName) try latlon = obj.getLatLonSequence( obj.varName(v) ); + + % Replicate over a complete grid + nIndex = prod(obj.varSize(v,:)); + nRep = nIndex ./ size(latlon,1); + latlon = repmat( latlon, [nRep,1] ); + + % Reduce if a partial grid + if obj.partialGrid(v) + latlon = latlon(obj.partialH{v}, :); + end + trycat = true; catch - warning('Unable to determine coordinates for variable %s.', obj.varName(v)); - end - - % Replicate over a complete grid - nIndex = prod(obj.varSize(v,:)); - nRep = nIndex ./ size(latlon,1); - latlon = repmat( latlon, [nRep,1] ); - - % Reduce if a partial grid - if obj.partialGrid(v) - latlon = latlon(obj.partialH{v}, :); + fprintf('Warning: Unable to determine coordinates for variable %s.\n', obj.varName(v)); + trycat = false; end % Try concatenating the data - try - coord( obj.varIndices(obj.varName(v)), : ) = latlon; - catch - warning('Cannot concatenate coordinates for variable %s.', obj.varName(v) ); + if trycat + try + coord( obj.varIndices(obj.varName(v)), : ) = latlon; + catch + fprintf('Warning: Cannot concatenate coordinates for variable %s.\n', obj.varName(v) ); + end end end