source: issm/oecreview/Archive/22819-23185/ISSM-23031-23032.diff

Last change on this file was 23186, checked in by Mathieu Morlighem, 7 years ago

CHG: added Archive/22819-23185

File size: 2.2 KB
  • ../trunk-jpl/src/m/classes/maskpsl.m

     
    1515                function self = loadobj(self) % {{{
    1616                        % This function is directly called by matlab when a model object is
    1717                        % loaded. Update old properties here
    18 
    19                         %2014 February 5th
    20                         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                         end
    23 
    2418                end% }}}
    2519        end
    2620        methods
     
    4943                        md = checkfield(md,'fieldname','mask.ice_levelset'        ,'size',[md.mesh.numberofvertices 1]);
    5044                        md = checkfield(md,'fieldname','mask.ocean_levelset','size',[md.mesh.numberofvertices 1]);
    5145                        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                         end
    56                         if max(md.mask.ice_levelset)<0,
    57                                 warning('no ice front provided');
    58                         end
    59                         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                         end
    6346                end % }}}
    6447                function disp(self) % {{{
    6548                        disp(sprintf('   masks:'));
    66 
    6749                        fielddisplay(self,'groundedice_levelset','is ice grounded ? grounded ice if > 0, grounding line position if = 0, floating ice if < 0');
    6850                        fielddisplay(self,'ice_levelset','presence of ice if < 0, icefront position if = 0, no ice if > 0');
    6951                        fielddisplay(self,'ocean_levelset','is the vertex on the ocean ? yes if = 1, no if = 0');
     
    7860                        WriteData(fid,prefix,'object',self,'class','mask','fieldname','land_levelset','format','DoubleMat','mattype',1);
    7961                end % }}}
    8062                function savemodeljs(self,fid,modelname) % {{{
    81                
    8263                        fprintf(fid,'%s.mask=new maskpsl();\n',modelname);
    8364                        writejs1Darray(fid,[modelname '.mask.groundedice_levelset'],self.groundedice_levelset);
    8465                        writejs1Darray(fid,[modelname '.mask.ice_levelset'],self.ice_levelset);
Note: See TracBrowser for help on using the repository browser.