Skip to content
Snippets Groups Projects
Commit c329f9d2 authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

sous Linux, ecrite une variable empty dans une variable a la dimension...

sous Linux, ecrite une variable empty dans une variable a la dimension unlimited crash, mise en place d'un test pour prevenir
parent e793e682
No related branches found
No related tags found
No related merge requests found
......@@ -84,7 +84,7 @@ for i=1:numel(nca_keys)
end
% Create NetCDF variables and attributes
% ---------------------------------------------------
% --------------------------------------
for i=1:numel(ncv_keys)
for j=1:numel(ncv_fieldNames)
fn = ncv_fieldNames{j};
......@@ -124,11 +124,18 @@ for i=1:numel(ncv_keys)
% display waitbar
waitbar( i/numel(ncv_keys), wb, ['writing ' ncv_keys{i} ' variable']);
% DATE as two dimension
% don't work under windows
% nc{ncv_keys{i}}(:) = tsg.(ncv_keys{i});
if strmatch('DATE',ncv_keys(i))
nc{ncv_keys{i}}(:,:) = tsg.(ncv_keys{i});
else
% other one dimension
nc{ncv_keys{i}}(:) = tsg.(ncv_keys{i});
% under Linux, when you write an with empty matrix to an unlimited
% variable dimension, nc was corrupted to double object
% works well on windows
if ~isempty(tsg.(ncv_keys{i}))
nc{ncv_keys{i}}(:) = tsg.(ncv_keys{i});
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment