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

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

CHG: call basalstress instead of recalculating manually

File size: 1.4 KB
RevLine 
[13730]1function plot_basaldrag(md,options,width,i,type)
[2439]2
[1]3%PLOT_BASALDRAG - plot basal drag
4%
5% Usage:
[2439]6% plot_basaldrag(md,options,width,i,type);
[1]7%
8% See also: PLOTMODEL
9
10%check layer
[17686]11if dimension(md.mesh)==3,
[2439]12 if getfieldvalue(options,'layer',1)~=1;
[1]13 disp('plot_basaldrag warning: basal drag is displayed in the lower layer')
[2439]14 changefieldvalue(options,'layer',1);
[1]15 end
16end
17
[27596]18tau_b = basalstress(md);
19drag_mag = tau_b/1000;
20ub_mag = sqrt(md.initialization.vx.^2+md.initialization.vy.^2)/md.constants.yts;
[24480]21sig=1;
22
23%compute horizontal velocity
[27]24if strcmpi(type,'basal_drag')
[27596]25 ub = ub_mag;
[24480]26 title_str='Basal drag [kPa]';
[27]27elseif strcmpi(type,'basal_dragx')
[9684]28 ub=md.initialization.vx/md.constants.yts;
[24480]29 sig=-1;
30 title_str='Basal drag - x direction [kPa]';
[27]31elseif strcmpi(type,'basal_dragy')
[9684]32 ub=md.initialization.vy/md.constants.yts;
[24480]33 sig=-1;
34 title_str='Basal drag - y direction [kPa]';
[27]35end
[1]36
37%compute basal drag
[24480]38drag=sig*drag_mag.*ub./ub_mag;
[1]39
[27]40%Figure out if this is a Section plot
[2439]41if exist(options,'sectionvalue')
42 plot_section(md,drag,options,width,i);
[27]43 return;
44else
[1]45
[27]46 %process data and model
[8472]47 [x y z elements is2d isplanet]=processmesh(md,[],options);
[4330]48 [basal_drag datatype]=processdata(md,drag,options);
[1]49
[27]50 %plot basaldrag
51 subplot(width,width,i);
[8472]52 plot_unit(x,y,z,elements,basal_drag,is2d,isplanet,datatype,options);
[1]53
[27]54 %apply options
[24480]55 options=addfielddefault(options,'title',title_str);
[2439]56 options=addfielddefault(options,'view',2);
57 applyoptions(md,basal_drag,options);
[1]58
[27]59end
Note: See TracBrowser for help on using the repository browser.