Changeset 9640 for issm/trunk/src/m/model/mask.m
- Timestamp:
- 09/07/11 08:24:03 (14 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/model/mask.m
r9636 r9640 1 function md= geography(md,iceshelfname,icesheetname)1 function md=setmask(md,floatingicename,groundedicename) 2 2 %GEOGRAPHY - establish boundaries between grounded and floating ice. 3 3 % 4 % By default, ice is considered grounded. The contour iceshelfname defines nodes5 % for which ice is floating. The contour icesheetname defines nodes inside an iceshelf,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 6 % that are grounded (ie: ice rises, islands, etc ...) 7 7 % All input files are in the Argus format (extension .exp). 8 8 % 9 9 % Usage: 10 % md= geography(md,iceshelfname,icesheetname)10 % md=setmask(md,floatingicename,groundedicename) 11 11 % 12 12 % Examples: 13 % md= geography(md,'all','');14 % md= geography(md,'Iceshelves.exp','Islands.exp');13 % md=setmask(md,'all',''); 14 % md=setmask(md,'Iceshelves.exp','Islands.exp'); 15 15 16 16 %some checks on list of arguments 17 17 if ((nargin~=3) | (nargout~=1)), 18 help geography19 error(' geographyerror message');18 help mask 19 error('mask error message'); 20 20 end 21 21 … … 25 25 elements=md.elements; 26 26 27 %Assign elementon iceshelf, elementonicesheet, nodeonicesheet and nodeoniceshelf. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{128 elementon iceshelf=FlagElements(md,iceshelfname);29 elementon icesheet=FlagElements(md,icesheetname);27 %Assign elementonfloatingice, elementongroundedice, vertexongroundedice and vertexonfloatingice. Only change at your own peril! This is synchronized heavily with the GroundingLineMigration module. {{{1 28 elementonfloatingice=FlagElements(md,floatingicename); 29 elementongroundedice=FlagElements(md,groundedicename); 30 30 31 %Because icesheet nodes and elements can be included into an iceshelf, we need to update. Remember, all the previous31 %Because groundedice nodes and elements can be included into an floatingice, we need to update. Remember, all the previous 32 32 %arrays come from domain outlines that can intersect one another: 33 elementon iceshelf=double((elementoniceshelf & ~elementonicesheet));34 elementon icesheet=double(~elementoniceshelf);33 elementonfloatingice=double((elementonfloatingice & ~elementongroundedice)); 34 elementongroundedice=double(~elementonfloatingice); 35 35 36 %the order here is important. we choose nodeonicesheetas default on the grounding line.37 nodeoniceshelf=zeros(md.numberofnodes,1);38 nodeonicesheet=zeros(md.numberofnodes,1);39 nodeonicesheet(md.elements(find(elementonicesheet),:))=1;40 nodeoniceshelf(find(~nodeonicesheet))=1;36 %the order here is important. we choose vertexongroundedice as default on the grounding line. 37 vertexonfloatingice=zeros(md.numberofnodes,1); 38 vertexongroundedice=zeros(md.numberofnodes,1); 39 vertexongroundedice(md.elements(find(elementongroundedice),:))=1; 40 vertexonfloatingice(find(~vertexongroundedice))=1; 41 41 %}}} 42 42 43 43 %Return: 44 md.elementoniceshelf=elementoniceshelf; 45 md.nodeoniceshelf=nodeoniceshelf; 46 47 md.elementonicesheet=elementonicesheet; 48 md.nodeonicesheet=nodeonicesheet; 49 50 md.nodeonwater=zeros(md.numberofnodes,1); 51 md.elementonwater=zeros(md.numberofelements,1); 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.numberofnodes,1); 49 md.mask.elementonwater=zeros(md.numberofelements,1);
Note:
See TracChangeset
for help on using the changeset viewer.