source: issm/trunk/src/m/model/plot/plot_basaldrag.m@ 9610

Last change on this file since 9610 was 9610, checked in by Mathieu Morlighem, 14 years ago

Added friction object

File size: 1.4 KB
Line 
1function plot_basaldrag(md,options,width,i,type);
2
3%PLOT_BASALDRAG - plot basal drag
4%
5% Usage:
6% plot_basaldrag(md,options,width,i,type);
7%
8% See also: PLOTMODEL
9
10%check layer
11if md.dim==3,
12 if getfieldvalue(options,'layer',1)~=1;
13 disp('plot_basaldrag warning: basal drag is displayed in the lower layer')
14 changefieldvalue(options,'layer',1);
15 end
16end
17
18%compute exponents
19s=averaging(md,1./md.friction.p,0);
20r=averaging(md,md.friction.q./md.friction.p,0);
21
22%compute horizontal velocity
23if strcmpi(type,'basal_drag')
24 ub=sqrt(md.vx.^2+md.vy.^2)/md.constants.yts;
25elseif strcmpi(type,'basal_dragx')
26 ub=md.vx/md.constants.yts;
27elseif strcmpi(type,'basal_dragy')
28 ub=md.vy/md.constants.yts;
29end
30
31%compute basal drag
32drag=(max(md.constants.g*(md.rho_ice*md.thickness+md.rho_water*md.bed),0)).^r.*(md.friction.coefficient).^2.*ub.^s/1000;
33
34%Figure out if this is a Section plot
35if exist(options,'sectionvalue')
36 plot_section(md,drag,options,width,i);
37 return;
38else
39
40 %process data and model
41 [x y z elements is2d isplanet]=processmesh(md,[],options);
42 [basal_drag datatype]=processdata(md,drag,options);
43
44 %plot basaldrag
45 subplot(width,width,i);
46 plot_unit(x,y,z,elements,basal_drag,is2d,isplanet,datatype,options);
47
48 %apply options
49 options=addfielddefault(options,'title','Basal drag [kPa]');
50 options=addfielddefault(options,'view',2);
51 applyoptions(md,basal_drag,options);
52
53end
Note: See TracBrowser for help on using the repository browser.