Home > custom > glimmer > btrc4.m

btrc4

PURPOSE ^

function to calc basal slip coefficient for the GLIMMER model option

SYNOPSIS ^

function btrc=btrc4(bmelt,varargin)

DESCRIPTION ^

 function to calc basal slip coefficient for the GLIMMER model option
 slip_coeff=4: function of basal melt
 varargins are btrc_max (default 0.001), btrc_coeff (default 0.0001) and
 btrc_slope (default 0.005). Input bmelt is the basal melt rate

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function btrc=btrc4(bmelt,varargin)
0002 % function to calc basal slip coefficient for the GLIMMER model option
0003 % slip_coeff=4: function of basal melt
0004 % varargins are btrc_max (default 0.001), btrc_coeff (default 0.0001) and
0005 % btrc_slope (default 0.005). Input bmelt is the basal melt rate
0006 
0007 
0008 %% defaults
0009 btrc_max=0.001;
0010 btrc_coeff=0.0001;
0011 btrc_slope=0.005;
0012 
0013 %parse inputs
0014 if isempty(varargin)~=1     % check if any arguments are given
0015     [m1,n1]=size(varargin);
0016     opts={'btrc_max';'btrc_coeff';'btrc_slope'};
0017     for i=1:n1;             % check which parameters are given
0018         indi=strcmpi(varargin{i},opts);
0019         ind=find(indi==1);
0020         if isempty(ind)~=1
0021             switch ind
0022                 case 1
0023                     btrc_max=varargin{i+1};
0024                 case 2
0025                     btrc_coeff=varargin{i+1};
0026                 case 3
0027                     btrc_slope=varargin{i+1};
0028             end
0029         end
0030     end
0031 end
0032 
0033 btrc=bmelt;
0034 btrc(:)=0;
0035 btrc(bmelt>0)=min(btrc_max,btrc_coeff+(btrc_slope.*bmelt(bmelt>0)));

Generated on Tue 24-Feb-2009 19:14:50 by m2html © 2003