Changeset 18264
- Timestamp:
- 07/18/14 12:33:21 (11 years ago)
- Location:
- issm/trunk-jpl/examples/Greenland
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/examples/Greenland/CheatSheet.m
r18263 r18264 9 9 10 10 %Save surface mass balance, by looping through 200 years, or 1000 steps 11 surfmb=[]; for i=1:100 ; surfmb=[surfmb ...11 surfmb=[]; for i=1:1000; surfmb=[surfmb ... 12 12 md.results.TransientSolution(i).SurfaceforcingsMassBalance]; end 13 13 … … 19 19 20 20 %Save velocity by looping through 1000 steps 21 vel=[]; for i=1:100 ; vel=[vel md.results.TransientSolution(i).Vel]; end21 vel=[]; for i=1:1000; vel=[vel md.results.TransientSolution(i).Vel]; end 22 22 23 23 %Plot velocity time series in second subplot … … 28 28 29 29 %Save Ice Volume by looping through 1000 steps 30 volume=[]; for i=1:100 ; volume=[volume md.results.TransientSolution(i).IceVolume]; end30 volume=[]; for i=1:1000; volume=[volume md.results.TransientSolution(i).IceVolume]; end 31 31 32 32 %Plot volume time series in third subplot … … 35 35 %Title this plot Mean Velocity and add an x label of years 36 36 title('Ice Volume'); xlabel('years'); 37 38 37 end -
issm/trunk-jpl/examples/Greenland/runme.m
r18263 r18264 146 146 if any(steps==6) 147 147 disp(' Step 6: Extract Box SMB'); 148 md = loadmodel('./Models/Greenland.Transient'); 148 149 149 150 ncbox='../Data/Box_Greenland_SMB_monthly_1840-2012_5km_ver20140421.nc'; … … 164 165 %Area of grid for 5km box 165 166 area_of_grid=5000*5000; 166 totalsmb=reshape(sum(sum(smbbox ,1),2),length(t),1);167 totalsmb=reshape(sum(sum(smbbox/1000,1),2),length(t),1)*area_of_grid; 167 168 168 169 %save surface mass balance mat dataset … … 171 172 172 173 %plot a time series of total SMB 173 plot(t,totalsmb ); title('Total Surface mass balance, m^3');174 175 clear smbbox smbmean totalsmb x1 y1 t174 plot(t,totalsmb/1e9); title('Total Surface mass balance, Gt'); xlabel('year'); ylabel('Gt/yr'); 175 176 clear smbbox 176 177 177 178 end … … 211 212 212 213 %load historic transient model 213 md = loadmodel('./Models/Greenland.HistoricTransient');214 214 215 215 %Create Line Plots of relaxation run. Create a figure. 216 figure 216 217 217 218 218 %Save surface mass balance, by looping through 200 years, or 1000 steps 219 surfmb=[]; for i=1:100; surfmb=[surfmb ... 220 md.results.TransientSolution(i).SurfaceforcingsMassBalance]; end 219 221 220 222 221 %Plot surface mass balance time series in first subplot 223 subplot(3,1,1); plot([0.2:0.2:200],mean(surfmb)); 222 224 223 225 224 %Title this plot Mean surface mass balance 226 title('Mean Surface mass balance'); 225 227 226 228 227 %Save velocity by looping through 1000 steps 229 vel=[]; for i=1:100; vel=[vel md.results.TransientSolution(i).Vel]; end 228 230 229 231 230 %Plot velocity time series in second subplot 232 subplot(3,1,2); plot([0.2:0.2:200],mean(vel)); 231 233 232 234 233 %Title this plot Mean Velocity 235 title('Mean Velocity'); 234 236 235 237 236 %Save Ice Volume by looping through 1000 steps 238 volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end 237 239 238 240 239 %Plot volume time series in third subplot 241 subplot(3,1,3); plot([0.2:0.2:200],volume); 240 242 241 243 242 %Title this plot Mean Velocity and add an x label of years 244 title('Ice Volume'); xlabel('years'); 243 245 244 end 246 245
Note:
See TracChangeset
for help on using the changeset viewer.