| 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 | tau_b = basalstress(md);
|
|---|
| 19 | drag_mag = tau_b/1000;
|
|---|
| 20 | ub_mag = sqrt(md.initialization.vx.^2+md.initialization.vy.^2)/md.constants.yts;
|
|---|
| 21 | sig=1;
|
|---|
| 22 |
|
|---|
| 23 | %compute horizontal velocity
|
|---|
| 24 | if strcmpi(type,'basal_drag')
|
|---|
| 25 | ub = ub_mag;
|
|---|
| 26 | title_str='Basal drag [kPa]';
|
|---|
| 27 | elseif strcmpi(type,'basal_dragx')
|
|---|
| 28 | ub=md.initialization.vx/md.constants.yts;
|
|---|
| 29 | sig=-1;
|
|---|
| 30 | title_str='Basal drag - x direction [kPa]';
|
|---|
| 31 | elseif strcmpi(type,'basal_dragy')
|
|---|
| 32 | ub=md.initialization.vy/md.constants.yts;
|
|---|
| 33 | sig=-1;
|
|---|
| 34 | title_str='Basal drag - y direction [kPa]';
|
|---|
| 35 | end
|
|---|
| 36 |
|
|---|
| 37 | %compute basal drag
|
|---|
| 38 | drag=sig*drag_mag.*ub./ub_mag;
|
|---|
| 39 |
|
|---|
| 40 | %Figure out if this is a Section plot
|
|---|
| 41 | if exist(options,'sectionvalue')
|
|---|
| 42 | plot_section(md,drag,options,width,i);
|
|---|
| 43 | return;
|
|---|
| 44 | else
|
|---|
| 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 |
|
|---|
| 59 | end
|
|---|