plot_basaldrag

PURPOSE ^

PLOT_BASALDRAG - plot basal drag

SYNOPSIS ^

function plot_basaldrag(md,options_structure,width,i);

DESCRIPTION ^

PLOT_BASALDRAG - plot basal drag

   Usage:
      plot_basaldrag(md,options_structure,width,i);

   See also: PLOTMODEL

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function plot_basaldrag(md,options_structure,width,i);
0002 %PLOT_BASALDRAG - plot basal drag
0003 %
0004 %   Usage:
0005 %      plot_basaldrag(md,options_structure,width,i);
0006 %
0007 %   See also: PLOTMODEL
0008 
0009 %check layer
0010 if strcmpi(md.type,'3d')
0011     if options_structure.layer~=1,
0012         disp('plot_basaldrag warning: basal drag is displayed in the lower layer')
0013         options_structure.layer=1;
0014     end
0015 end
0016 
0017 %compute exponents
0018 s=averaging(md,1./md.p,0);
0019 r=averaging(md,md.p./md.q,0);
0020 
0021 %compute horizontal velocity
0022 ub=sqrt(md.vx.^2+md.vy.^2)/md.yts;
0023 
0024 %compute basal drag
0025 drag=(md.g*(md.rho_ice*md.thickness+md.rho_water*md.bed)).^r.*(md.drag).^2.*ub.^s/1000;
0026 
0027 %process data and model
0028 [x y z elements is2d]=processmesh(md,options_structure);
0029 [basal_drag isongrid]=processdata(md,drag,options_structure);
0030 
0031 %plot mesh quivervel
0032 subplot(width,width,i); 
0033 
0034 %edgecolor?
0035 if ~isnan(options_structure.edgecolor),
0036     edgecolor=options_structure.edgecolor;
0037 else
0038     edgecolor='none';
0039 end
0040 
0041 %plot basal basal drag
0042 A=elements(:,1); B=elements(:,2); C=elements(:,3);
0043 
0044 patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData',basal_drag,'FaceColor','interp','EdgeColor',edgecolor);
0045 
0046 %apply options
0047 if isnan(options_structure.title)
0048     options_structure.title='Basal drag [kPa]';
0049 end 
0050 options_structure.view=2;
0051 applyoptions(md,basal_drag,options_structure);

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003