| 1 | function md=setmask(md,floatingicename,groundedicename)
|
|---|
| 2 | %SETMASK - establish boundaries between grounded and floating ice.
|
|---|
| 3 | %
|
|---|
| 4 | % By default, ice is considered grounded. The contour floatingicename defines nodes
|
|---|
| 5 | % for which ice is floating. The contour groundedicename defines nodes inside an floatingice,
|
|---|
| 6 | % that are grounded (ie: ice rises, islands, etc ...)
|
|---|
| 7 | % All input files are in the Argus format (extension .exp).
|
|---|
| 8 | %
|
|---|
| 9 | % Usage:
|
|---|
| 10 | % md=setmask(md,floatingicename,groundedicename)
|
|---|
| 11 | %
|
|---|
| 12 | % Examples:
|
|---|
| 13 | % md=setmask(md,'all','');
|
|---|
| 14 | % md=setmask(md,'Iceshelves.exp','Islands.exp');
|
|---|
| 15 |
|
|---|
| 16 | %some checks on list of arguments
|
|---|
| 17 | if ((nargin~=3) | (nargout~=1)),
|
|---|
| 18 | help mask
|
|---|
| 19 | error('mask error message');
|
|---|
| 20 | end
|
|---|
| 21 |
|
|---|
| 22 | %Get assigned fields
|
|---|
| 23 | x=md.mesh.x;
|
|---|
| 24 | y=md.mesh.y;
|
|---|
| 25 | elements=md.mesh.elements;
|
|---|
| 26 |
|
|---|
| 27 | %Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{
|
|---|
| 28 | elementonfloatingice=FlagElements(md,floatingicename);
|
|---|
| 29 | elementongroundedice=FlagElements(md,groundedicename);
|
|---|
| 30 |
|
|---|
| 31 | %Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous
|
|---|
| 32 | %arrays come from domain outlines that can intersect one another:
|
|---|
| 33 | elementonfloatingice=double((elementonfloatingice & ~elementongroundedice));
|
|---|
| 34 | elementongroundedice=double(~elementonfloatingice);
|
|---|
| 35 |
|
|---|
| 36 | %the order here is important. we choose vertexongroundedice as default on the grounding line.
|
|---|
| 37 | vertexonfloatingice=zeros(md.mesh.numberofvertices,1);
|
|---|
| 38 | vertexongroundedice=zeros(md.mesh.numberofvertices,1);
|
|---|
| 39 | vertexongroundedice(md.mesh.elements(find(elementongroundedice),:))=1;
|
|---|
| 40 | vertexonfloatingice(find(~vertexongroundedice))=1;
|
|---|
| 41 | %}}}
|
|---|
| 42 |
|
|---|
| 43 | %Return:
|
|---|
| 44 | md.mask.elementonfloatingice=elementonfloatingice;
|
|---|
| 45 | md.mask.vertexonfloatingice=vertexonfloatingice;
|
|---|
| 46 | md.mask.elementongroundedice=elementongroundedice;
|
|---|
| 47 | md.mask.vertexongroundedice=vertexongroundedice;
|
|---|
| 48 | md.mask.vertexonwater=zeros(md.mesh.numberofvertices,1);
|
|---|
| 49 | md.mask.elementonwater=zeros(md.mesh.numberofelements,1);
|
|---|
| 50 | md.mask.icelevelset=ones(md.mesh.numberofvertices,1);
|
|---|