source:
issm/oecreview/Archive/21724-22754/ISSM-22152-22153.diff@
22755
Last change on this file since 22755 was 22755, checked in by , 7 years ago | |
---|---|
File size: 1.3 KB |
-
../trunk-jpl/src/m/geometry/VolumeAboveFloatation.m
1 function V = VolumeAboveFloatation(md) 2 %VOLUMEABOVEFLOATATION - returns volume above floatation 3 % 4 % Usage: 5 % V = VolumeAboveFloatation(md) 6 7 %Special case if 3d 8 if isa(md.mesh,'mesh3dprisms') 9 index = md.mesh.elements2d; 10 x = md.mesh.x2d; 11 y = md.mesh.y2d; 12 elseif isa(md.mesh,'mesh2d'), 13 index = md.mesh.elements; 14 x = md.mesh.x; 15 y = md.mesh.y; 16 else 17 error('not supported yet'); 18 end 19 %1. get some parameters 20 rho_ice = md.materials.rho_ice; 21 rho_water = md.materials.rho_water; 22 23 %2. compute averages 24 base = mean(md.geometry.base(index),2); 25 surface = mean(md.geometry.surface(index),2); 26 bathymetry = mean(md.geometry.bed(index),2); 27 28 %3. get areas of all triangles 29 areas = GetAreas(index,x,y); 30 31 %4. Compute volume above floatation 32 V = areas.*(surface-base+min(rho_water/rho_ice*bathymetry,0.)); 33 34 %5. take out the ones that are outside of levelset or floating 35 pos = find(min(md.mask.ice_levelset(index),[],2)>0 | min(md.mask.groundedice_levelset(index),[],2)<0); 36 V(pos) = 0; 37 38 %sum individual contributions 39 V = sum(V);
Note:
See TracBrowser
for help on using the repository browser.