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

corrige en partie un bug sur le type des attributs de variable

parent dc7c4b4b
No related branches found
No related tags found
No related merge requests found
......@@ -196,26 +196,23 @@ for key = ncv_keys
% -----------------------------------------------------------
if isnumeric(value)
% le cast ne marche pas avec cette toolbox de netcdf
% a voir
% -------------------------------
% if strcmp(fieldName, 'FillValue_')
% switch nctype
% case {'double', 'real'}
% value = double(value);
% case {'float', 'single'}
% value = single(value);
% case {'int', 'integer', 'int32'}
% value = int32(value);
% case {'short', 'int16'}
% value = int16(value);
% case {'byte', 'int8'}
% value = int8(value);
% end
% nc{variable}.(fieldName) = value;
% else
nc{variable}.(fieldName) = double(value);
% end
switch nctype
case {'double', 'real'}
value = double(value);
case {'float', 'single'}
value = single(value);
case {'int', 'integer', 'int32'}
value = int32(value);
case {'short', 'int16'}
value = int16(value);
case 'int8'
value = int8(value);
% bug dans la toolbox, le type uint ne marche pas
% on met int8
case {'byte', 'uint8'}
value = int8(value);
end
nc{variable}.(fieldName) = value;
else
nc{variable}.(fieldName) = char(value);
......
......@@ -205,7 +205,7 @@ end
% -------------------------
add_variables;
% additinnal coefficient variable here
% additionnal coefficient variable here
% ------------------------------------
%if ~isempty(tsg.SSJT_CALCOEF)
add_coefficients;
......
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