source: issm/trunk-jpl/src/m/contrib/hack/sia.m@ 19121

Last change on this file since 19121 was 19121, checked in by Mathieu Morlighem, 10 years ago

BUG: fixed SIA module with new md structure

File size: 722 bytes
Line 
1function [velx,vely,vel]=sia(md)
2%SIA - computation of Shallow Ice velocities
3%
4% This routine uses the model of SIA to compute the velocities
5% of a 2d model using the surface slope
6%
7% Usage:
8% [velx,vely,vel]=sia(md)
9
10if md.mesh.dimension~=2,
11 error('Only 2d meshes are allowed to compute velocity balances');
12end
13
14%Get slope
15[sx,sy,s]=slope(md);
16
17%Average thickness and B over all elements.
18summer=[1;1;1];
19hel=md.geometry.thickness(md.mesh.elements)*summer/3;
20Bel=md.materials.rheology_B(md.mesh.elements)*summer/3;
21
22Ael=Bel.^(-3);
23
24velx=-2*(md.materials.rho_ice*md.constants.g)^3*s.^2.*sx.*Ael/4.*hel.^4;
25vely=-2*(md.materials.rho_ice*md.constants.g)^3*s.^2.*sy.*Ael/4.*hel.^4;
26vel=sqrt(velx.^2+vely.^2);
Note: See TracBrowser for help on using the repository browser.