source:
issm/oecreview/Archive/17984-18295/ISSM-18010-18011.diff@
18296
Last change on this file since 18296 was 18296, checked in by , 11 years ago | |
---|---|
File size: 7.2 KB |
-
../trunk-jpl/src/m/mech/backstressfrominversion.m
22 22 % 'xy': x and y axes same as in polar stereographic projection 23 23 % 24 24 % Return values: 25 % 'backstress' is the inferred backstress necessary to balance the 26 % analytical solution (keeping damage within its appropriate limits, e.g. D 27 % in [0,1]). 25 % 'backstress' is the inferred backstress based on the analytical 26 % solution for ice shelf creep 28 27 % 29 28 % Usage: 30 29 % backstress=backstressfrominversion(md,options) -
../trunk-jpl/src/m/mech/calcbackstress.m
1 function backstress=calcbackstress(md,varargin) 2 %BACKSTRESSFROMINVERSION - compute ice shelf backstress 3 % 4 % This routine computes backstress based on the analytical formalism of 5 % Thomas (1973) and Borstad et al. (2013) based on the ice rigidity, 6 % thickness, the densities of ice and seawater, and (optionally) 7 % damage. Strain rates must also be included, either from observed or 8 % modeled velocities. 9 10 % Available options: 11 % - 'smoothing' : the amount of smoothing to be applied to the strain rate data. 12 % Type 'help averaging' for more information on its 13 % usage. Defaults to 0. 14 % - 'coordsys' : coordinate system for calculating the strain rate 15 % components. Must be one of: 16 % 'longitudinal': x axis aligned along a flowline at every point (default) 17 % 'principal': x axis aligned along maximum principal strain rate 18 % at every point 19 % 'xy': x and y axes same as in polar stereographic projection 20 % 21 % Return values: 22 % 'backstress' is the inferred backstress based on the analytical 23 % solution for ice shelf creep 24 % 25 % Usage: 26 % backstress=calcbackstress(md,options) 27 % 28 % Example: 29 % backstress=backstressfrominversion(md,'smoothing',2,'coordsys','longitudinal'); 30 31 % check inputs 32 if (nargin<1), 33 help backstressfrominversion 34 error('bad usage'); 35 end 36 if isempty(fieldnames(md.results)), 37 error(['md.results.strainrate is not present. Calculate using md=mechanicalproperties(md,vx,vy)']); 38 end 39 if dimension(md.mesh)~=2, 40 error('only 2d model supported currently'); 41 end 42 if any(md.flowequation.element_equation~=2), 43 disp('Warning: the model has some non SSA elements. These will be treated like SSA elements'); 44 end 45 46 % process options 47 options = pairoptions(varargin{:}); 48 smoothing = getfieldvalue(options,'smoothing',0); 49 coordsys = getfieldvalue(options,'coordsys','longitudinal'); 50 tempmask = getfieldvalue(options,'tempmask',false); 51 52 T=0.5*md.materials.rho_ice*md.constants.g*(1-md.materials.rho_ice/md.materials.rho_water)*md.geometry.thickness; 53 n=averaging(md,md.materials.rheology_n,0); 54 B=md.materials.rheology_B; 55 if md.damage.isdamage, 56 D=md.damage.D 57 else 58 D=0. 59 60 [a0,b0,theta0,ex0]=thomasparams(md,'eq','Thomas','smoothing',smoothing,'coordsys',coordsys); 61 62 % analytical backstress solution 63 backstress=T-(1.-D).*B.*sign(ex0).*(2+a0).*abs(ex0).^(1./n)./((1+a0+a0.^2+b0.^2).^((n-1)/2./n)); 64 backstress(find(backstress<0))=0; -
../trunk-jpl/src/m/mech/backstressfrominversion.py
7 7 Compute ice shelf backstress from inversion results. 8 8 9 9 This routine computes backstress based on the analytical formalism of 10 Thomas (1973) and Borstad et al. (2013, The Cryos hpere). The model10 Thomas (1973) and Borstad et al. (2013, The Cryosphere). The model 11 11 must contain inversion results for ice rigidity. Strain rates must 12 12 also be included, either from observed or modeled velocities. Ice 13 13 rigidity B is assumed to be parameterized by the ice temperature in … … 28 28 'xy': x and y axes same as in polar stereographic projection 29 29 30 30 Return values: 31 'backstress' is the inferred backstress necessary to balance the 32 analytical solution (keeping damage within its appropriate limits, e.g. D 33 in [0,1]). 31 'backstress' is the inferred backstress based on the analytical 32 solution for ice shelf creep 34 33 35 34 Usage: 36 35 backstress=backstressfrominversion(md,options) -
../trunk-jpl/src/m/mech/calcbackstress.py
1 import numpy as npy 2 from averaging import averaging 3 from thomasparams import thomasparams 4 5 def calcbackstress(md,**kwargs): 6 ''' 7 Compute ice shelf backstress. 8 9 This routine computes backstress based on the analytical formalism of 10 Thomas (1973) and Borstad et al. (2013, The Cryosphere) based on the 11 ice rigidity, thickness, the densities of ice and seawater, and 12 (optionally) damage. Strain rates must also be included, either from 13 observed or modeled velocities. 14 15 Available options: 16 - 'smoothing' : the amount of smoothing to be applied to the strain rate data. 17 Type 'help averaging' for more information on its 18 usage. Defaults to 0. 19 - 'coordsys' : coordinate system for calculating the strain rate 20 components. Must be one of: 21 'longitudinal': x axis aligned along a flowline at every point (default) 22 'principal': x axis aligned along maximum principal strain rate 23 at every point 24 'xy': x and y axes same as in polar stereographic projection 25 26 Return values: 27 'backstress' is the inferred backstress based on the analytical 28 solution for ice shelf creep 29 30 Usage: 31 backstress=calcbackstress(md,options) 32 33 Example: 34 backstress=calcbackstress(md,'smoothing',2,'coordsys','longitudinal') 35 ''' 36 37 # unpack kwargs 38 smoothing=kwargs.pop('smoothing',0) 39 if 'smoothing' in kwargs: del kwargs['smoothing'] 40 coordsys=kwargs.pop('coordsys','longitudinal') 41 if 'coordsys' in kwargs: del kwargs['coordsys'] 42 assert len(kwargs)==0, 'error, unexpected or misspelled kwargs' 43 44 # some checks 45 if not hasattr(md.results,'strainrate'): 46 raise StandardError('md.results.strainrate not present. Calculate using md=mechanicalproperties(md,vx,vy)') 47 if not '2d' in md.mesh.__doc__: 48 raise StandardError('only 2d (planview) model supported currently') 49 if any(md.flowequation.element_equation!=2): 50 raise StandardError('Warning: the model has some non-SSA elements. These will be treated like SSA elements') 51 52 T=0.5*md.materials.rho_ice*md.constants.g*(1-md.materials.rho_ice/md.materials.rho_water)*md.geometry.thickness 53 n=averaging(md,md.materials.rheology_n,0) 54 B=md.materials.rheology_B 55 if md.damage.isdamage: 56 D=md.damage.D 57 else: 58 D=0. 59 60 a0,b0,theta0,ex0=thomasparams(md,eq='Thomas',smoothing=smoothing,coordsys=coordsys) 61 62 # analytical backstress solution 63 backstress=T-(1.-D)*B*npy.sign(ex0)*(2+a0)*npy.abs(ex0)**(1./n)/((1+a0+a0**2+b0**2)**((n-1.)/2./n)) 64 backstress[npy.nonzero(backstress<0)]=0 65 66 return backstress
Note:
See TracBrowser
for help on using the repository browser.