Changeset 3111


Ignore:
Timestamp:
02/24/10 09:46:29 (15 years ago)
Author:
seroussi
Message:

small modifications of geography2 when land in specified with a list of elements

File:
1 edited

Legend:

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

    r3099 r3111  
    3333elementonland(wrongelements)=1;
    3434
    35 %any element with its barycentre on land should be on land:
     35%any element with its barycentre on land should be on land: (only if landname is an expfile)
     36if ischar(landname),
    3637weights={[1;1;1],[2;1;1],[1;2;1],[1;1;2]};
    37 for i=1:length(weights),
    38         xelem=x(md.elements)*weights{i}/sum(weights{i});
    39         yelem=y(md.elements)*weights{i}/sum(weights{i});
     38        for i=1:length(weights),
     39                xelem=x(md.elements)*weights{i}/sum(weights{i});
     40                yelem=y(md.elements)*weights{i}/sum(weights{i});
     41        end
     42        baryonland=ContourToNodes(xelem,yelem,expread(landname,1),1);
     43        pos=find(~baryonland); elementonland(pos)=0;
     44        pos=find(baryonland); elementonland(pos)=1;
    4045end
    41 baryonland=ContourToNodes(xelem,yelem,expread(landname,1),1);
    42 pos=find(~baryonland); elementonland(pos)=0;
    43 pos=find(baryonland); elementonland(pos)=1;
    4446
    4547%figure out which elements on land are actually in the middle of the ocean!
Note: See TracChangeset for help on using the changeset viewer.