source:
issm/oecreview/Archive/22819-23185/ISSM-23031-23032.diff
Last change on this file was 23186, checked in by , 7 years ago | |
---|---|
File size: 2.2 KB |
-
../trunk-jpl/src/m/classes/maskpsl.m
15 15 function self = loadobj(self) % {{{ 16 16 % This function is directly called by matlab when a model object is 17 17 % loaded. Update old properties here 18 19 %2014 February 5th20 if numel(self.ice_levelset)>1 & all(self.ice_levelset>=0),21 disp('WARNING: md.mask.ice_levelset>=0, you probably need to change the sign of this levelset');22 end23 24 18 end% }}} 25 19 end 26 20 methods … … 49 43 md = checkfield(md,'fieldname','mask.ice_levelset' ,'size',[md.mesh.numberofvertices 1]); 50 44 md = checkfield(md,'fieldname','mask.ocean_levelset','size',[md.mesh.numberofvertices 1]); 51 45 md = checkfield(md,'fieldname','mask.land_levelset','size',[md.mesh.numberofvertices 1]); 52 isice=(md.mask.ice_levelset<=0);53 if sum(isice)==0,54 warning('no ice present in the domain');55 end56 if max(md.mask.ice_levelset)<0,57 warning('no ice front provided');58 end59 icefront=sum(md.mask.ice_levelset(md.mesh.elements)==0,2);60 if (max(icefront)==3 & strcmp(elementtype(md.mesh),'Tria')) | (max(icefront==6) & strcmp(elementtype(md.mesh),'Penta')),61 error('At least one element has all nodes on ice front, change md.mask.ice_levelset to fix it')62 end63 46 end % }}} 64 47 function disp(self) % {{{ 65 48 disp(sprintf(' masks:')); 66 67 49 fielddisplay(self,'groundedice_levelset','is ice grounded ? grounded ice if > 0, grounding line position if = 0, floating ice if < 0'); 68 50 fielddisplay(self,'ice_levelset','presence of ice if < 0, icefront position if = 0, no ice if > 0'); 69 51 fielddisplay(self,'ocean_levelset','is the vertex on the ocean ? yes if = 1, no if = 0'); … … 78 60 WriteData(fid,prefix,'object',self,'class','mask','fieldname','land_levelset','format','DoubleMat','mattype',1); 79 61 end % }}} 80 62 function savemodeljs(self,fid,modelname) % {{{ 81 82 63 fprintf(fid,'%s.mask=new maskpsl();\n',modelname); 83 64 writejs1Darray(fid,[modelname '.mask.groundedice_levelset'],self.groundedice_levelset); 84 65 writejs1Darray(fid,[modelname '.mask.ice_levelset'],self.ice_levelset);
Note:
See TracBrowser
for help on using the repository browser.