| 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 md.dim==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 | %compute horizontal velocity
|
|---|
| 23 | if strcmpi(type,'basal_drag')
|
|---|
| 24 | ub=sqrt(md.vx.^2+md.vy.^2)/md.constants.yts;
|
|---|
| 25 | elseif strcmpi(type,'basal_dragx')
|
|---|
| 26 | ub=md.vx/md.constants.yts;
|
|---|
| 27 | elseif strcmpi(type,'basal_dragy')
|
|---|
| 28 | ub=md.vy/md.constants.yts;
|
|---|
| 29 | end
|
|---|
| 30 |
|
|---|
| 31 | %compute basal drag
|
|---|
| 32 | drag=(max(md.constants.g*(md.rho_ice*md.thickness+md.rho_water*md.bed),0)).^r.*(md.friction.coefficient).^2.*ub.^s/1000;
|
|---|
| 33 |
|
|---|
| 34 | %Figure out if this is a Section plot
|
|---|
| 35 | if exist(options,'sectionvalue')
|
|---|
| 36 | plot_section(md,drag,options,width,i);
|
|---|
| 37 | return;
|
|---|
| 38 | else
|
|---|
| 39 |
|
|---|
| 40 | %process data and model
|
|---|
| 41 | [x y z elements is2d isplanet]=processmesh(md,[],options);
|
|---|
| 42 | [basal_drag datatype]=processdata(md,drag,options);
|
|---|
| 43 |
|
|---|
| 44 | %plot basaldrag
|
|---|
| 45 | subplot(width,width,i);
|
|---|
| 46 | plot_unit(x,y,z,elements,basal_drag,is2d,isplanet,datatype,options);
|
|---|
| 47 |
|
|---|
| 48 | %apply options
|
|---|
| 49 | options=addfielddefault(options,'title','Basal drag [kPa]');
|
|---|
| 50 | options=addfielddefault(options,'view',2);
|
|---|
| 51 | applyoptions(md,basal_drag,options);
|
|---|
| 52 |
|
|---|
| 53 | end
|
|---|