icediagnostic

PURPOSE ^

ICEDIAGNOSTIC - compute the velocity field of a model

SYNOPSIS ^

function md=icediagnostic(md);

DESCRIPTION ^

ICEDIAGNOSTIC - compute the velocity field of a model

   this routine is a Matlab drivn solution
   
   Usage:
      u_g=icediagnostic_core_linear(m,analysis_type,varargin);

   See also: ICEDIAGNOSTIC2D, ICEDIAGNOSTIC3D, ICEDIAGNOSTIC_CORE_NONLINEAR ICEDIAGNOSTIC_CORE_LINEAR

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function md=icediagnostic(md);
0002 %ICEDIAGNOSTIC - compute the velocity field of a model
0003 %
0004 %   this routine is a Matlab drivn solution
0005 %
0006 %   Usage:
0007 %      u_g=icediagnostic_core_linear(m,analysis_type,varargin);
0008 %
0009 %   See also: ICEDIAGNOSTIC2D, ICEDIAGNOSTIC3D, ICEDIAGNOSTIC_CORE_NONLINEAR ICEDIAGNOSTIC_CORE_LINEAR
0010 
0011 %define global variables
0012 iceglobal
0013 
0014 %determine if run is parallel
0015 if strcmpi(md.cluster,'yes'), cluster=1; else cluster=0;end;
0016 
0017 %for now, only serial support is in
0018 if cluster,
0019     error('icediagnostic error message: parallel support not implemented yet');
0020 end
0021 
0022 %Create fem structure (input of icediagnostic3d)
0023 fem=struct();
0024 %Figure out which type of elements are present
0025 [fem.ishutter,fem.ismacayealpattyn,fem.isstokes]=DiagnosticSolutionType(md.elements_type);
0026 
0027 if strcmpi(md.type,'2d'),
0028 
0029     %First, build elements,grids,loads, etc ... for horizontal model
0030     if fem.ishutter,
0031         fem.m_ss=CreateFemModel(md,'surface_slope_compute');
0032         fem.m_dhu=CreateFemModel(md,'diagnostic_hutter');
0033     end
0034     if fem.ismacayealpattyn,
0035         fem.m_dh=CreateFemModel(md,'diagnostic_horiz');
0036     end
0037 
0038     %plug inputs in fem (existing velocity)
0039     if ~isnan(md.vx) & ~isnan(md.vy) & fem.ismacayealpattyn,
0040         %an input velocity is present in the model, use it to bootstrap the diagnostic core nonlinear solution.
0041         m_dh=fem.m_dh;
0042         fem.inputs.velocity=zeros(m_dh.gridset.gsize,1);
0043         fem.inputs.velocity(1:6:m_dh.gridset.gsize)=md.vx/md.yts;
0044         fem.inputs.velocity(2:6:m_dh.gridset.gsize)=md.vy/md.yts;
0045     else
0046         fem.inputs=struct();
0047     end
0048 
0049     %compute solution
0050     u_g=icediagnostic2d(md,fem);
0051 
0052     %Load results onto model
0053     md=Loadresults(md,fem,u_g);
0054 
0055 else
0056 
0057     %First, build elements,grids,loads, etc ... for horizontal, base vertical and vertical model
0058     fem.m_dbv=CreateFemModel(md,'diagnostic_basevert');
0059     fem.m_dv=CreateFemModel(md,'diagnostic_vert');
0060 
0061     if fem.ismacayealpattyn,
0062         fem.m_dh=CreateFemModel(md,'diagnostic_horiz');
0063     end
0064     if fem.ishutter,
0065         fem.m_ss=CreateFemModel(md,'surface_slope_compute');
0066         fem.m_dhu=CreateFemModel(md,'diagnostic_hutter');
0067     end
0068     if fem.isstokes,
0069         fem.m_bs=CreateFemModel(md,'bed_slope_compute');
0070         fem.m_ds=CreateFemModel(md,'diagnostic_stokes');
0071     end
0072 
0073     %plug inputs in fem (existing velocity)
0074     if ~isnan(md.vx) & ~isnan(md.vy) & fem.ismacayealpattyn,
0075         %an input velocity is present in the model, use it to bootstrap the diagnostic core nonlinear solution.
0076         m_dh=fem.m_dh;
0077         fem.inputs.velocity=zeros(m_dh.gridset.gsize,1);
0078         fem.inputs.velocity(1:6:m_dh.gridset.gsize)=md.vx/md.yts;
0079         fem.inputs.velocity(2:6:m_dh.gridset.gsize)=md.vy/md.yts;
0080     else
0081         fem.inputs=struct();
0082     end
0083 
0084     %compute solution
0085     u_g=icediagnostic3d(md,fem);
0086 
0087     %Load results onto model
0088     md=Loadresults(md,fem,u_g);
0089 end

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