1 | function 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
|
---|
11 | if dimension(md.mesh)==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
|
---|
16 | end
|
---|
17 |
|
---|
18 | %compute exponents
|
---|
19 | s=averaging(md,1./md.friction.p,0);
|
---|
20 | r=averaging(md,md.friction.q./md.friction.p,0);
|
---|
21 |
|
---|
22 | ub_mag=sqrt(md.initialization.vx.^2+md.initialization.vy.^2)/md.constants.yts;
|
---|
23 | drag_mag=(max(md.constants.g*(md.materials.rho_ice*md.geometry.thickness+md.materials.rho_water*md.geometry.base),0)).^r.*(md.friction.coefficient).^2.*ub_mag.^s/1000;
|
---|
24 | sig=1;
|
---|
25 |
|
---|
26 | %compute horizontal velocity
|
---|
27 | if strcmpi(type,'basal_drag')
|
---|
28 | ub=sqrt(md.initialization.vx.^2+md.initialization.vy.^2)/md.constants.yts;
|
---|
29 | title_str='Basal drag [kPa]';
|
---|
30 | elseif strcmpi(type,'basal_dragx')
|
---|
31 | ub=md.initialization.vx/md.constants.yts;
|
---|
32 | sig=-1;
|
---|
33 | title_str='Basal drag - x direction [kPa]';
|
---|
34 | elseif strcmpi(type,'basal_dragy')
|
---|
35 | ub=md.initialization.vy/md.constants.yts;
|
---|
36 | sig=-1;
|
---|
37 | title_str='Basal drag - y direction [kPa]';
|
---|
38 | end
|
---|
39 |
|
---|
40 | %compute basal drag
|
---|
41 | drag=sig*drag_mag.*ub./ub_mag;
|
---|
42 |
|
---|
43 | %Figure out if this is a Section plot
|
---|
44 | if exist(options,'sectionvalue')
|
---|
45 | plot_section(md,drag,options,width,i);
|
---|
46 | return;
|
---|
47 | else
|
---|
48 |
|
---|
49 | %process data and model
|
---|
50 | [x y z elements is2d isplanet]=processmesh(md,[],options);
|
---|
51 | [basal_drag datatype]=processdata(md,drag,options);
|
---|
52 |
|
---|
53 | %plot basaldrag
|
---|
54 | subplot(width,width,i);
|
---|
55 | plot_unit(x,y,z,elements,basal_drag,is2d,isplanet,datatype,options);
|
---|
56 |
|
---|
57 | %apply options
|
---|
58 | options=addfielddefault(options,'title',title_str);
|
---|
59 | options=addfielddefault(options,'view',2);
|
---|
60 | applyoptions(md,basal_drag,options);
|
---|
61 |
|
---|
62 | end
|
---|