Changeset 9001
- Timestamp:
- 07/14/11 16:31:16 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/model/ismodelselfconsistent.m
r8930 r9001 95 95 %}}} 96 96 %SIZE NUMBEROFNODES {{{1 97 fields={'x','y','z','rheology_B','drag_coefficient','basal_melting_rate','surface _mass_balance','surface','thickness','bed','nodeonbed','nodeonsurface'};97 fields={'x','y','z','rheology_B','drag_coefficient','basal_melting_rate','surface','thickness','bed','nodeonbed','nodeonsurface'}; 98 98 checksize(md,fields,[md.numberofnodes 1]); 99 99 %}}} … … 295 295 if ~ismember(md.isthermal,[0 1]), 296 296 message('model not consistent: isthermal should be a scalar (1 or 0)'); 297 end298 299 %Check that all forcings have length numberofnodes+1300 forcingnames=fieldnames(md.forcings);301 forcingfields={};302 for i=1:length(forcingnames),303 forcingfields{end+1}=['forcings.' forcingnames{i}];304 end305 checksize(md,forcingfields,[md.numberofnodes+1 NaN])306 307 %Check that forcing columns are properly ordered308 for i=1:length(forcingnames),309 if any(md.forcings.(forcingnames{i})(end,:)~=sort(md.forcings.(forcingnames{i})(end,:))),310 message(['model not consistent: model ' md.name ' forcings.' forcingnames{i} ' columns should be chronological']);311 end312 if any(md.forcings.(forcingnames{i})(end,1:end-1)==md.forcings.(forcingnames{i})(end,2:end)),313 message(['model not consistent: model ' md.name ' forcings.' forcingnames{i} ' columns must not contain duplicate timesteps']);314 end315 297 end 316 298 end … … 744 726 end 745 727 %}}} 728 %checkforcing {{{1 729 function checkforcing(md,fieldname) 730 731 eval(['field=md.' fieldname ';']); 732 checksize(md,{fieldname},[md.numberofnodes+1 NaN]) 733 734 if any(field(end,:)~=sort(field(end,:))), 735 message(['model not consistent: model ' md.name ': ' fieldname ' columns should be chronological']); 736 end 737 if any(field(end,1:end-1)==field(end,2:end)), 738 message(['model not consistent: model ' md.name ': ' fieldname ' columns must not contain duplicate timesteps']); 739 end 740 end 741 %}}} 746 742 747 743 %error messages
Note:
See TracChangeset
for help on using the changeset viewer.