Changeset 140 for trunk/src/struct2nc.m
- Timestamp:
- Nov 29, 2010, 9:55:54 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/struct2nc.m
r128 r140 51 51 return 52 52 end 53 [Data,errormsg]=check_field_structure(Data);%check the validity of the input field structure 53 [Data,errormsg]=check_field_structure(Data)%check the validity of the input field structure 54 if ~isempty(errormsg) 55 errormsg=['invalid input structure:' errormsg]; 56 return 57 end 54 58 ListVarName=Data.ListVarName; 55 59 nc=netcdf.create(flname,'NC_CLOBBER');%,'clobber'); %create the netcdf file with name flname … … 110 114 eval(['VarVal=Data.' ListVarName{ivar} ';'])%varval=values of the current variable 111 115 VarDimIndex=Data.VarDimIndex{ivar}; %indices of the variable dimensions in the list of dimensions 112 siz=size(VarVal);113 116 VarDimName=Data.VarDimName{ivar}; 114 117 if ischar(VarDimName) 115 118 VarDimName={VarDimName}; 116 119 end 120 siz=size(VarVal); 117 121 testrange=(numel(VarDimName)==1 && strcmp(VarDimName{1},ListVarName{ivar}) && numel(VarVal)==2);% case of a coordinate defined on a regular mesh by the first and last values. 118 122 testline=isequal(length(siz),2) && isequal(siz(1),1)&& isequal(siz(2), Data.DimValue(VarDimIndex));%matlab vector
Note: See TracChangeset
for help on using the changeset viewer.