source:
issm/oecreview/Archive/15392-16133/ISSM-15599-15600.diff@
16134
Last change on this file since 16134 was 16134, checked in by , 12 years ago | |
---|---|
File size: 1.2 KB |
-
../trunk-jpl/src/m/classes/mask.py
48 48 md = checkfield(md,'mask.vertexongroundedice' ,'size',[md.mesh.numberofvertices],'values',[0,1]) 49 49 md = checkfield(md,'mask.vertexonwater' ,'size',[md.mesh.numberofvertices],'values',[0,1]) 50 50 md = checkfield(md,'mask.icelevelset' ,'size',[md.mesh.numberofvertices]) 51 isice=numpy.zeros_like(md.mesh.numberofvertices,int)52 53 54 totalyicefree=(numpy.sum(isice[md.mesh.elements-1],axis=1)==0).astype(int)55 if any(totalyicefree)56 51 isice=numpy.zeros(md.mesh.numberofvertices,int) 52 pos=npy.nonzero(md.mask.icelevelset>0) 53 isice[pos]=1 54 totallyicefree=(numpy.sum(isice[md.mesh.elements-1],axis=1)==0).astype(int) 55 if any(totallyicefree): 56 raise TypeError("elements with no ice not implemented yet, each element should have at least one vertex with md.mask.icelevelset > 0") 57 57 58 58 return md 59 59 # }}}
Note:
See TracBrowser
for help on using the repository browser.