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