source: issm/oecreview/Archive/23390-24306/ISSM-24110-24111.diff

Last change on this file was 24307, checked in by Mathieu Morlighem, 5 years ago

NEW: adding Archive/23390-24306

File size: 1.3 KB
  • ../trunk-jpl/src/m/parameterization/killberg.m

     
    1616mask         = zeros(md.mesh.numberofvertices,1);
    1717element_flag = zeros(md.mesh.numberofelements,1);
    1818
    19 %Step 1, go through all elements and put 1 in local_mask if the element is grounded
    2019disp('Looking for isolated patches of floating ice (icebergs)');
    21 isice      = min(md.mask.ice_levelset(md.mesh.elements),[],2)<0;
     20
     21%do not go through elements that don't have ice, mark flag as 1 (done)
     22isice = min(md.mask.ice_levelset(md.mesh.elements),[],2)<0;
     23element_flag(find(~isice)) = 1;
     24
     25%do not go through elements that are grounded, mark flag as 1 (done)
     26%and initialize mask as 1 for all vertices of these elements
    2227isgrounded = max(md.mask.groundedice_levelset(md.mesh.elements),[],2)>0;
    2328pos = find(isgrounded);
    2429element_flag(pos) = 1;
     
    3035        disp(['   -- iteration ' num2str(iter)]);
    3136        more = false;
    3237
    33         pos = find(~element_flag & isice);
    34         if numel(pos)==0
    35                 break;
    36         end
    37 
    38         for i=pos'
     38        for i=find(~element_flag)'
    3939                indices = md.mesh.elements(i,:);
    4040                MAX=max(mask(indices));
    4141                if(MAX==0)
Note: See TracBrowser for help on using the repository browser.