source: issm/trunk-jpl/src/m/plot/plot_basaldrag.m@ 27596

Last change on this file since 27596 was 27596, checked in by Mathieu Morlighem, 2 years ago

CHG: call basalstress instead of recalculating manually

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 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
16end
17
18tau_b = basalstress(md);
19drag_mag = tau_b/1000;
20ub_mag = sqrt(md.initialization.vx.^2+md.initialization.vy.^2)/md.constants.yts;
21sig=1;
22
23%compute horizontal velocity
24if strcmpi(type,'basal_drag')
25 ub = ub_mag;
26 title_str='Basal drag [kPa]';
27elseif strcmpi(type,'basal_dragx')
28 ub=md.initialization.vx/md.constants.yts;
29 sig=-1;
30 title_str='Basal drag - x direction [kPa]';
31elseif strcmpi(type,'basal_dragy')
32 ub=md.initialization.vy/md.constants.yts;
33 sig=-1;
34 title_str='Basal drag - y direction [kPa]';
35end
36
37%compute basal drag
38drag=sig*drag_mag.*ub./ub_mag;
39
40%Figure out if this is a Section plot
41if exist(options,'sectionvalue')
42 plot_section(md,drag,options,width,i);
43 return;
44else
45
46 %process data and model
47 [x y z elements is2d isplanet]=processmesh(md,[],options);
48 [basal_drag datatype]=processdata(md,drag,options);
49
50 %plot basaldrag
51 subplot(width,width,i);
52 plot_unit(x,y,z,elements,basal_drag,is2d,isplanet,datatype,options);
53
54 %apply options
55 options=addfielddefault(options,'title',title_str);
56 options=addfielddefault(options,'view',2);
57 applyoptions(md,basal_drag,options);
58
59end
Note: See TracBrowser for help on using the repository browser.