Changeset 236 for trunk/src/read_civxdata.m
- Timestamp:
- Apr 12, 2011, 12:12:19 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/read_civxdata.m
r221 r236 47 47 % 'nc2struct': reads a netcdf file 48 48 49 function [Field,VelTypeOut]=read_civxdata(filename,FieldNames,VelType) 49 function [Field,VelTypeOut,errormsg]=read_civxdata(filename,FieldNames,VelType) 50 errormsg=''; 51 DataTest=nc2struct(filename,'ListGlobalAttribute','Conventions'); 52 if isequal(DataTest.Conventions,'uvmat/civdata')%test for new civ format 53 [Field,VelTypeOut]=read_civdata(filename,FieldNames,VelType); 54 return 55 end 56 50 57 %% default input 51 58 if ~exist('VelType','var') … … 64 71 [Field,vardetect,ichoice]=nc2struct(filename,var);%read the variables in the netcdf file 65 72 if isfield(Field,'Txt') 73 errormsg=Field.Txt; 66 74 return 67 75 end 68 76 if vardetect(1)==0 69 Field.Txt=[ 'requested field not available in ' filename '/' VelType];77 errormsg=[ 'requested field not available in ' filename '/' VelType]; 70 78 return 71 79 end … … 117 125 Field.dt=double(Field.dt); 118 126 else 119 Field.Txt='the input file is not civx';127 errormsg='the input file is not civx'; 120 128 Field.CivStage=0; 121 129 Field.dt=0; … … 125 133 Field.dt=double(Field.dt2); 126 134 else 127 Field.Txt='the input file is not civx';135 errormsg='the input file is not civx'; 128 136 Field.CivStage=0; 129 137 Field.dt=0;
Note: See TracChangeset
for help on using the changeset viewer.