source:
issm/oecreview/Archive/21337-21723/ISSM-21647-21648.diff@
21726
Last change on this file since 21726 was 21726, checked in by , 8 years ago | |
---|---|
File size: 2.6 KB |
-
../trunk-jpl/src/m/contrib/defleurian/netCDF/export_netCDF.m
72 72 else 73 73 listsize=length(Var); 74 74 subgroupID=netcdf.defGrp(groupID,groupfields{j}); 75 netcdf.putAtt(subgroupID,netcdf.getConstant('NC_GLOBAL'),'classtype',class( md.(groups{i}).(groupfields{j})));75 netcdf.putAtt(subgroupID,netcdf.getConstant('NC_GLOBAL'),'classtype',class(Var)); 76 76 for l=1:listsize 77 77 if isprop(Var{l},'name') 78 78 lname=Var{l}.name; … … 91 91 end 92 92 end 93 93 end 94 elseif isa(Var,'struct') && ~strcmp(groupfields{j},'bamg') 95 classtype=class(md.(groups{i})); 96 if strcmp(classtype,'struct') 97 classtype=groups{i}; 98 end 99 netcdf.putAtt(groupID,netcdf.getConstant('NC_GLOBAL'),'classtype',classtype); 100 if length(Var)>1 101 listsize=length(Var); 102 subgroupID=netcdf.defGrp(groupID,groupfields{j}); 103 classtype=class(Var); 104 if strcmp(classtype,'struct') 105 classtype=groups{i}; 106 end 107 netcdf.putAtt(subgroupID,netcdf.getConstant('NC_GLOBAL'),'classtype',classtype); 108 for l=1:listsize 109 if isfield(Var(l),'step') 110 lname=[int2str(Var(l).step)]; 111 else 112 lname=[class(Var(l)) int2str(l)]; 113 end 114 classtype=class(Var(l)); 115 if strcmp(classtype,'struct') 116 classtype=groups{i}; 117 end 118 listgroupID=netcdf.defGrp(subgroupID,lname); 119 netcdf.putAtt(listgroupID,netcdf.getConstant('NC_GLOBAL'),'classtype',classtype); 120 subfields=fields(Var(l)); 121 for m=1:length(subfields) 122 if ~strcmp(subfields{m},'outlog') 123 [DimSize,DimValue]=DefCreateVar(ncid,Var(l).(subfields{m}),listgroupID,subfields{m},DimSize,DimValue); 124 end 125 end 126 end 127 else 128 subgroupID=netcdf.defGrp(groupID,groupfields{j}); 129 classtype=class(Var); 130 if strcmp(classtype,'struct') 131 classtype=groups{i}; 132 end 133 netcdf.putAtt(subgroupID,netcdf.getConstant('NC_GLOBAL'),'classtype',classtype); 134 subfields=fields(Var); 135 for m=1:length(subfields) 136 if ~strcmp(subfields{m},'outlog') 137 [DimSize,DimValue]=DefCreateVar(ncid,Var.(subfields{m}),subgroupID,subfields{m},DimSize,DimValue); 138 end 139 end 140 end 94 141 else 95 142 netcdf.putAtt(groupID,netcdf.getConstant('NC_GLOBAL'),'classtype',class(md.(groups{i}))); 96 143 [DimSize,DimValue]=DefCreateVar(ncid,Var,groupID,groupfields{j},DimSize,DimValue);
Note:
See TracBrowser
for help on using the repository browser.