Changeset 22793
- Timestamp:
- 05/17/18 12:19:20 (7 years ago)
- Location:
- issm/trunk-jpl/examples/EsaWahr
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/examples/EsaWahr/runme.m
r22791 r22793 1 1 2 2 clear all; 3 steps=[ 4];3 steps=[1:6]; % [1:6]; 4 4 5 if any(steps== 1)6 disp(' Step 1: Mesh creation');5 if any(steps==0) 6 disp(' Step 0: Mesh creation'); 7 7 8 % Generate initial uniform mesh8 % Generate initial uniform mesh 9 9 md=roundmesh(model,100000,10000); % Domain radius and element size (meters) 10 10 11 11 save ./Models/EsaWahr.Mesh md; 12 12 13 plotmodel(md,'data','mesh'); 14 %export_fig('Fig0.pdf'); 15 16 end 17 18 if any(steps==1) 19 disp(' Step 1: Anisotropic mesh creation'); 20 21 % Generate initial uniform mesh 22 md=roundmesh(model,100000,1000); % Domain radius and element size (meters) 23 %plotmodel(md,'data','mesh'); 24 25 % Define a fake field to have anisotropic meshing 26 disc_radius=20*1000; % km => m 27 rad_dist=sqrt(md.mesh.x.^2+md.mesh.y.^2); % radial distance [m] 28 field = abs(rad_dist-disc_radius); 29 %plotmodel(md,'data',field); 30 31 md = bamg(md,'field',field,'err',50,'hmax',10000); % error in field in m 32 33 save ./Models/EsaWahr.Mesh md; 34 13 35 plotmodel (md,'data','mesh'); 36 %export_fig('Fig1.pdf'); 14 37 15 38 end … … 20 43 21 44 % primer 22 nv=md.mesh.numberofvertices;23 ne=md.mesh.numberofelements;24 45 rho_w_i=md.materials.rho_freshwater/md.materials.rho_ice; 25 46 … … 30 51 31 52 % Define a 20-km radius disc and unload it by 1 meter water height equivalent uniformly 32 md.esa.deltathickness = zeros( ne,1);53 md.esa.deltathickness = zeros(md.mesh.numberofelements,1); 33 54 disc_radius=20; % km 34 55 rad_dist=sqrt(x_cent.^2+y_cent.^2)/1000; % radial distance in km … … 38 59 39 60 plotmodel (md,'data',md.esa.deltathickness,'title','Ice height equivalent [m]'); 61 %export_fig('Fig2.pdf'); 40 62 41 63 end … … 67 89 % Miscellaneous: 68 90 md.miscellaneous.name='EsaWahr'; 91 %% IGNORE BUT DO NOT DELETE %% 69 92 70 93 save ./Models/EsaWahr.Parameterization md; … … 86 109 md=solve(md,'Esa'); 87 110 88 save ./Models/EsaWahr. EsaSolutionsmd;111 save ./Models/EsaWahr.Solution md; 89 112 90 113 end 91 114 92 return; 115 if any(steps==5) 116 disp(' Step 5: Plot solutions'); 117 md = loadmodel('./Models/EsaWahr.Solution'); 93 118 94 % high-res mesh... 95 % plot step. 96 % analytical step. 97 98 119 % m => mm 99 120 vert = md.results.EsaSolution.EsaUmotion*1000; % [mm] 100 horz_n = md.results.EsaSolution.Esa Nmotion*1000; % [mm]101 horz_e = md.results.EsaSolution.Esa Emotion*1000; % [mm]121 horz_n = md.results.EsaSolution.EsaYmotion*1000; % [mm] 122 horz_e = md.results.EsaSolution.EsaXmotion*1000; % [mm] 102 123 horz = sqrt(horz_n.^2+horz_e.^2); 103 124 104 % grid data from the center 105 xi=[0:100:60000]; % 100 m resolution 106 yi=zeros(1,length(xi)); 107 vert_track=griddata(md.mesh.x,md.mesh.y,vert,xi,yi,'linear'); 108 horz_track=griddata(md.mesh.x,md.mesh.y,horz,xi,yi,'linear'); 109 110 return; 111 112 % figure S1a {{{ 125 % plot 113 126 set(0,'DefaultAxesFontSize',24,'DefaultAxesLineWidth',1,'DefaultTextFontSize',24,'DefaultLineMarkerSize',6); 114 127 figure('Position', [100, 100, 800, 600]); … … 116 129 'xTickLabel#all',[],'yTickLabel#all',[],... 117 130 'colormap#all','jet','colorbarcornerposition#all','south',... 118 'expdisp#all','. ./Exp/RoundDomain.exp',...131 'expdisp#all','./RoundDomain.exp',... 119 132 'gridded#all',1,... 120 133 'axispos#1',[0.02 0.505 0.47 0.47],... … … 132 145 'axispos',[0.505 0.02 0.47 0.47],... 133 146 'colorbarpos',[0.53,0.065,0.18,0.02],'colorbartitle#4','East-west [mm]'); 134 % }}}135 %export_fig('./Fig/Fig_S1a.pdf');136 147 137 % figure S1b {{{ 138 set(0,'DefaultAxesFontSize',24,'DefaultAxesLineWidth',1,'DefaultTextFontSize',24,'DefaultLineMarkerSize',6); 148 %export_fig('Fig5.pdf'); 149 150 end 151 152 if any(steps==6) 153 disp(' Step 6: Compare results against Wahr semi-analytic solutions'); 154 md = loadmodel('./Models/EsaWahr.Solution'); 155 156 % numerical solutions 157 % m => mm 158 vert = md.results.EsaSolution.EsaUmotion*1000; % [mm] 159 horz_n = md.results.EsaSolution.EsaYmotion*1000; % [mm] 160 horz_e = md.results.EsaSolution.EsaXmotion*1000; % [mm] 161 horz = sqrt(horz_n.^2+horz_e.^2); 162 % grid data from the center 163 xi=[0:500:100000]; % 500 m resolution 164 yi=zeros(1,length(xi)); 165 vert_track=griddata(md.mesh.x,md.mesh.y,vert,xi,yi,'linear'); 166 horz_track=griddata(md.mesh.x,md.mesh.y,horz,xi,yi,'linear'); 167 168 % semi-analytic solution (Wahr et al., 2013, JGR, Figure 1) 169 disc_radius = 20*1000; % 20 km 170 [vert_wahr, horz_wahr] = wahr(disc_radius,xi,md.esa.love_h,md.esa.love_l); 171 172 % plot 173 set(0,'DefaultAxesFontSize',16,'DefaultAxesLineWidth',1,'DefaultTextFontSize',16,'DefaultLineMarkerSize',6); 139 174 figure1=figure('Position', [100, 100, 700, 400]); 140 175 ylabel_1={'0',' ','1','','2','','3',''}; 141 176 axes1 = axes('Layer','top','Position',[0.1 0.15 0.8 0.8],... 142 'XTick',[0:10: 60],'xlim',[0 60],...177 'XTick',[0:10:100],'xlim',[0 100],... 143 178 'ylim',[0 3.5],'Ytick',[0:0.5:3.5],'yticklabel',ylabel_1); 144 179 box(axes1,'on'); hold(axes1,'all'); grid on; 145 180 xlabel(axes1,'Radial distance [km]'); 146 181 ylabel(axes1,'Displacement [mm]'); 147 plot([20 20],[0 3.5],'-.k','linewidth',2,'parent',axes1); 148 h1=plot(xi/1000,vert_track*917/1000,'color',[0.8500 0.3250 0.0980],'linewidth',3,'parent',axes1); 149 h2=plot(xi/1000,horz_track*917/1000,'b','linewidth',3,'parent',axes1); 182 plot([20 20],[0 3.5],'-k','linewidth',2,'parent',axes1); 183 % analytic soln 184 h3=plot(xi/1000,vert_wahr,'-r','linewidth',5,'parent',axes1); 185 h4=plot(xi/1000,horz_wahr,'-m','linewidth',5,'parent',axes1); 186 % ISSM 187 h1=plot(xi/1000,vert_track*917/1000,'-b','linewidth',3,'parent',axes1); 188 h2=plot(xi/1000,horz_track*917/1000,'-c','linewidth',3,'parent',axes1); 150 189 % first box 151 190 ag1 = gca; 152 leg1a = legend(ag1,[h 1,h2],'Vertical (upward)','Horizontal (away from disc)',1);153 set(leg1a,'location','east','Orientation','Vertical','Box','Off','FontSize', 24);191 leg1a = legend(ag1,[h3,h1,h4,h2],'Vertical (Wahr)','Vertical (ISSM)','Horizontal (Wahr)','Horizontal (ISSM)',1); 192 set(leg1a,'location','east','Orientation','Vertical','Box','Off','FontSize',16); 154 193 % 155 194 set(gcf,'color','w'); 156 % }}}157 %export_fig(' ./Fig/Fig_S1b.pdf');195 196 %export_fig('Fig6.pdf'); 158 197 198 end 159 199
Note:
See TracChangeset
for help on using the changeset viewer.