Changeset 806
- Timestamp:
- 06/05/09 07:25:02 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/classes/public/ismodelselfconsistent.m
r804 r806 67 67 'tolx','np','eps_rel','exclusive','n','gridonbed','gridonsurface','elementonbed','elementonsurface','deltaH','DeltaH','timeacc','timedec'}; 68 68 for i=1:length(fields), 69 if ~isempty( eval(['md.' fields{i}])),70 if any(isnan( eval(['md.' fields{i}]))),69 if ~isempty(md.(fields{i})), 70 if any(isnan(md.(fields{i}))), 71 71 disp(['model ' md.name ' has an NaN value in field ' fields{i} '!']); 72 72 bool=0; return; … … 80 80 'sparsity','lowmem','n','gridonbed','gridonsurface','elementonbed','elementonsurface','deltaH','DeltaH','timeacc','timedec'}; 81 81 for i=1:length(fields), 82 if ~isempty( eval(['md.' fields{i}])),83 if any( (eval(['md.' fields{i}]))<0),82 if ~isempty(md.(fields{i})), 83 if any(md.(fields{i})<0), 84 84 disp(['model ' md.name ' has a <0 value in field ' fields{i} '!']); 85 85 bool=0; return; … … 97 97 'sparsity','deltaH','DeltaH','timeacc','timedec'}; 98 98 for i=1:length(fields), 99 if ~isempty( eval(['md.' fields{i}])),100 if any( (eval(['md.' fields{i}]))==0),99 if ~isempty(md.(fields{i})), 100 if any(md.(fields{i})==0), 101 101 disp(['model ' md.name ' has a =0 value in field ' fields{i} '!']); 102 102 bool=0; return; … … 108 108 fields={'elements','p','q','elementoniceshelf','n','elementonbed'}; 109 109 for i=1:size(fields,2), 110 if (size( eval(['md.' fields{i}]),1)~=md.numberofelements),110 if (size(md.(fields{i}),1)~=md.numberofelements), 111 111 disp(['model ' md.name ' field ' fields{i} ' should be of size ' num2str(md.numberofelements) '!']); 112 112 bool=0; return; … … 117 117 fields={'x','y','z','B','drag','gridondirichlet_diag','melting','accumulation','surface','thickness','bed','gridonbed','gridonsurface'}; 118 118 for i=1:length(fields), 119 if length( eval(['md.' fields{i}]))~=md.numberofgrids,119 if length(md.(fields{i}))~=md.numberofgrids, 120 120 disp(['model ' md.name ' field ' fields{i} ' should be of size ' num2str(md.numberofgrids) '!']); 121 121 bool=0; return; … … 258 258 fields={'dt','ndt'}; 259 259 for i=1:length(fields), 260 if any( (eval(['md.' fields{i}]))<0),260 if any(md.(fields{i})<0), 261 261 disp(['model ' md.name ' has a <0 value in field ' fields{i} '!']); 262 262 bool=0; return; … … 329 329 fields={'vx_obs','vy_obs'}; 330 330 for i=1:length(fields), 331 if any(length( eval(['md.' fields{i}]))~=md.numberofgrids),331 if any(length(md.(fields{i}))~=md.numberofgrids), 332 332 disp(['model ' md.name ' field ' fields{i} ' should be of size ' num2str(md.numberofgrids) '!']); 333 333 bool=0; return; … … 371 371 fields={'sparsity'}; 372 372 for i=1:length(fields), 373 if ~isempty( eval(['md.' fields{i}])),374 if any(isnan( eval(['md.' fields{i}]))),373 if ~isempty(md.(fields{i})), 374 if any(isnan(md.(fields{i}))), 375 375 disp(['model ' md.name ' has an NaN value in field ' fields{i} '!']); 376 376 bool=0; return; … … 382 382 fields={'sparsity'}; 383 383 for i=1:length(fields), 384 if ~isempty( eval(['md.' fields{i}])),385 if any( (eval(['md.' fields{i}]))<0),384 if ~isempty(md.(fields{i})), 385 if any(md.(fields{i})<0), 386 386 disp(['model ' md.name ' has a <0 value in field ' fields{i} '!']); 387 387 bool=0; return; … … 393 393 fields={'sparsity'}; 394 394 for i=1:length(fields), 395 if ~isempty( eval(['md.' fields{i}])),396 if any( (eval(['md.' fields{i}]))==0),395 if ~isempty(md.(fields{i})), 396 if any(md.(fields{i})==0), 397 397 disp(['model ' md.name ' has a =0 value in field ' fields{i} '!']); 398 398 bool=0; return; … … 444 444 fields={'time','np'}; 445 445 for i=1:length(fields), 446 if ~isempty( eval(['md.' fields{i}])),447 if any(isnan( eval(['md.' fields{i}]))),446 if ~isempty(md.(fields{i})), 447 if any(isnan(md.(fields{i}))), 448 448 disp(['model ' md.name ' has an NaN value in field ' fields{i} '!']); 449 449 bool=0; return; … … 455 455 fields={'time','np'}; 456 456 for i=1:length(fields), 457 if ~isempty( eval(['md.' fields{i}])),458 if any( (eval(['md.' fields{i}]))<0),457 if ~isempty(md.(fields{i})), 458 if any(md.(fields{i})<0), 459 459 disp(['model ' md.name ' has a <0 value in field ' fields{i} '!']); 460 460 bool=0; return; … … 466 466 fields={'time','np'}; 467 467 for i=1:length(fields), 468 if ~isempty( eval(['md.' fields{i}])),469 if any( (eval(['md.' fields{i}]))==0),468 if ~isempty(md.(fields{i})), 469 if any(md.(fields{i})==0), 470 470 disp(['model ' md.name ' has a =0 value in field ' fields{i} '!']); 471 471 bool=0; return;
Note:
See TracChangeset
for help on using the changeset viewer.