source: issm/oecreview/Archive/17984-18295/ISSM-18010-18011.diff@ 18296

Last change on this file since 18296 was 18296, checked in by Mathieu Morlighem, 11 years ago

Added 17984-18295

File size: 7.2 KB
  • ../trunk-jpl/src/m/mech/backstressfrominversion.m

     
    2222%                               'xy': x and y axes same as in polar stereographic projection
    2323%
    2424%   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
    2827%
    2928%   Usage:
    3029%      backstress=backstressfrominversion(md,options)
  • ../trunk-jpl/src/m/mech/calcbackstress.m

     
     1function 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
     32if (nargin<1),
     33        help backstressfrominversion
     34        error('bad usage');
     35end
     36if isempty(fieldnames(md.results)),
     37        error(['md.results.strainrate is not present.  Calculate using md=mechanicalproperties(md,vx,vy)']);
     38end
     39if dimension(md.mesh)~=2,
     40        error('only 2d model supported currently');
     41end
     42if any(md.flowequation.element_equation~=2),
     43        disp('Warning: the model has some non SSA elements. These will be treated like SSA elements');
     44end
     45
     46% process options
     47options = pairoptions(varargin{:});
     48smoothing = getfieldvalue(options,'smoothing',0);
     49coordsys = getfieldvalue(options,'coordsys','longitudinal');
     50tempmask = getfieldvalue(options,'tempmask',false);
     51
     52T=0.5*md.materials.rho_ice*md.constants.g*(1-md.materials.rho_ice/md.materials.rho_water)*md.geometry.thickness;
     53n=averaging(md,md.materials.rheology_n,0);
     54B=md.materials.rheology_B;
     55if md.damage.isdamage,
     56        D=md.damage.D
     57else
     58        D=0.
     59
     60[a0,b0,theta0,ex0]=thomasparams(md,'eq','Thomas','smoothing',smoothing,'coordsys',coordsys);
     61
     62% analytical backstress solution
     63backstress=T-(1.-D).*B.*sign(ex0).*(2+a0).*abs(ex0).^(1./n)./((1+a0+a0.^2+b0.^2).^((n-1)/2./n));
     64backstress(find(backstress<0))=0;
  • ../trunk-jpl/src/m/mech/backstressfrominversion.py

     
    77        Compute ice shelf backstress from inversion results.
    88
    99        This routine computes backstress based on the analytical formalism of
    10         Thomas (1973) and Borstad et al. (2013, The Cryoshpere).  The model
     10        Thomas (1973) and Borstad et al. (2013, The Cryosphere).  The model
    1111        must contain inversion results for ice rigidity.  Strain rates must
    1212        also be included, either from observed or modeled velocities.  Ice
    1313        rigidity B is assumed to be parameterized by the ice temperature in
     
    2828                                'xy': x and y axes same as in polar stereographic projection
    2929
    3030   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
    3433
    3534   Usage:
    3635      backstress=backstressfrominversion(md,options)
  • ../trunk-jpl/src/m/mech/calcbackstress.py

     
     1import numpy as npy
     2from averaging import averaging
     3from thomasparams import thomasparams
     4
     5def 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.