0001 function md=icediagnostic(md);
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 iceglobal
0013
0014
0015 if strcmpi(md.cluster,'yes'), cluster=1; else cluster=0;end;
0016
0017
0018 if cluster,
0019 error('icediagnostic error message: parallel support not implemented yet');
0020 end
0021
0022
0023 fem=struct();
0024
0025 [fem.ishutter,fem.ismacayealpattyn,fem.isstokes]=DiagnosticSolutionType(md.elements_type);
0026
0027 if strcmpi(md.type,'2d'),
0028
0029
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
0039 if ~isnan(md.vx) & ~isnan(md.vy) & fem.ismacayealpattyn,
0040
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
0050 u_g=icediagnostic2d(md,fem);
0051
0052
0053 md=Loadresults(md,fem,u_g);
0054
0055 else
0056
0057
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
0074 if ~isnan(md.vx) & ~isnan(md.vy) & fem.ismacayealpattyn,
0075
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
0085 u_g=icediagnostic3d(md,fem);
0086
0087
0088 md=Loadresults(md,fem,u_g);
0089 end