Changeset 1267


Ignore:
Timestamp:
07/08/09 20:06:22 (15 years ago)
Author:
Eric.Larour
Message:

Added final checks to geography2.m

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/classes/public/geography2.m

    r1223 r1267  
    121121end
    122122
     123
     124%some final checks:
     125%check that no grid thinks it's on an ice shelf or ice sheet, and lies actually in the middle of the water.
     126gridsgrounded=find(~gridonwater);
     127lengthconnectivity=size(md.nodeconnectivity,2);
     128groundedcounters=md.nodeconnectivity(gridsgrounded,lengthconnectivity);
     129groundedconnectivity=md.nodeconnectivity(gridsgrounded,1:lengthconnectivity-1);
     130pos=find(groundedconnectivity);
     131groundedconnectivity(pos)=elementonwater(groundedconnectivity(pos));
     132groundedsum=sum(groundedconnectivity,2);
     133errorflags=find(groundedsum==groundedcounters);
     134errorgrids=gridsgrounded(errorflags);
     135
     136gridonwater(errorgrids)=1;
     137gridonicesheet(errorgrids)=0;
     138gridoniceshelf(errorgrids)=0;
     139
    123140%Return:
    124141md.gridoniceshelf=gridoniceshelf;
Note: See TracChangeset for help on using the changeset viewer.