source: issm/oecreview/Archive/12678-13393/ISSM-12959-12960.diff@ 13394

Last change on this file since 13394 was 13394, checked in by Mathieu Morlighem, 13 years ago

Added 12678-13393

File size: 2.8 KB
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/utils/consistency/checkfield.m

     
    135135        field2=reshape(field,prod(size(field)),1);
    136136        if any(field2<lowerbound),
    137137                md = checkmessage(md,getfieldvalue(options,'message',...
    138                         ['field ''' fieldname ''' should have values above ' num2str(lowerbound)]));
     138                        ['field ''' fieldname ''' should have values above ' num2str(lowerbound(1,1))]));
    139139        end
    140140end
    141141if exist(options,'>')
     
    143143        field2=reshape(field,prod(size(field)),1);
    144144        if any(field2<=lowerbound),
    145145                md = checkmessage(md,getfieldvalue(options,'message',...
    146                         ['field ''' fieldname ''' should have values above ' num2str(lowerbound)]));
     146                        ['field ''' fieldname ''' should have values above ' num2str(lowerbound(1,1))]));
    147147        end
    148148end
    149149
     
    153153        field2=reshape(field,prod(size(field)),1);
    154154        if any(field2>upperbound),
    155155                md = checkmessage(md,getfieldvalue(options,'message',...
    156                         ['field ''' fieldname ''' should have values below ' num2str(upperbound)]));
     156                        ['field ''' fieldname ''' should have values below ' num2str(upperbound(1,1))]));
    157157        end
    158158end
    159159if exist(options,'<')
     
    161161        field2=reshape(field,prod(size(field)),1);
    162162        if any(field2>=upperbound),
    163163                md = checkmessage(md,getfieldvalue(options,'message',...
    164                         ['field ''' fieldname ''' should have values below ' num2str(upperbound)]));
     164                        ['field ''' fieldname ''' should have values below ' num2str(upperbound(1,1))]));
    165165        end
    166166end
    167167
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/mesh.m

     
    8686                        md = checkfield(md,'mesh.elementonsurface','size',[md.mesh.numberofelements 1],'values',[0 1]);
    8787                        md = checkfield(md,'mesh.vertexonbed','size',[md.mesh.numberofvertices 1],'values',[0 1]);
    8888                        md = checkfield(md,'mesh.vertexonsurface','size',[md.mesh.numberofvertices 1],'values',[0 1]);
     89                        if (md.mesh.dimension==3),
     90                                md = checkfield(md,'mesh.z','>=',md.geometry.bed,'message','''mesh.z'' should be above the bed');
     91                                md = checkfield(md,'mesh.z','<=',md.geometry.surface,'message','''mesh.z'' should be below the ice surface');
     92                        end
    8993                        if (md.mesh.dimension==2),
    9094                                md = checkfield(md,'mesh.average_vertex_connectivity','>=',9,'message','''mesh.average_vertex_connectivity'' should be at least 9 in 2d');
    9195                        else
Note: See TracBrowser for help on using the repository browser.