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

Last change on this file since 24480 was 24480, checked in by tsantos, 5 years ago

BUG: wrong computation of basal drag in x and in y directions

File size: 1.7 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
18%compute exponents
19s=averaging(md,1./md.friction.p,0);
20r=averaging(md,md.friction.q./md.friction.p,0);
21
22ub_mag=sqrt(md.initialization.vx.^2+md.initialization.vy.^2)/md.constants.yts;
23drag_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;
24sig=1;
25
26%compute horizontal velocity
27if strcmpi(type,'basal_drag')
28 ub=sqrt(md.initialization.vx.^2+md.initialization.vy.^2)/md.constants.yts;
29 title_str='Basal drag [kPa]';
30elseif strcmpi(type,'basal_dragx')
31 ub=md.initialization.vx/md.constants.yts;
32 sig=-1;
33 title_str='Basal drag - x direction [kPa]';
34elseif strcmpi(type,'basal_dragy')
35 ub=md.initialization.vy/md.constants.yts;
36 sig=-1;
37 title_str='Basal drag - y direction [kPa]';
38end
39
40%compute basal drag
41drag=sig*drag_mag.*ub./ub_mag;
42
43%Figure out if this is a Section plot
44if exist(options,'sectionvalue')
45 plot_section(md,drag,options,width,i);
46 return;
47else
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
62end
Note: See TracBrowser for help on using the repository browser.