Changeset 20741
- Timestamp:
- 06/15/16 17:41:06 (9 years ago)
- Location:
- issm/trunk-jpl/examples/Greenland
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/examples/Greenland/CheatSheet.m
r19629 r20741 1 if any(steps==7) 2 disp(' Step 7: Historical Relaxation run'); 3 md = loadmodel('./Models/Greenland.Control_drag'); 4 5 load smbbox 6 7 %convert mesh x,y into the Box projection 8 [md.mesh.lat,md.mesh.long] = xy2ll(md.mesh.x,md.mesh.y,+1,39,71); 9 [xi,yi]= ll2xy(md.mesh.lat,md.mesh.long,+1,45,70); 10 11 %Interpolate and set surface mass balance 12 index = BamgTriangulate(x1(:),y1(:)); 13 smb_mo = InterpFromMeshToMesh2d(index,x1(:),y1(:),smbmean(:),xi,yi); 14 smb = smb_mo*12/1000*md.materials.rho_freshwater/md.materials.rho_ice; 15 md.smb.mass_balance = [smb;1 ]; 16 17 %Set transient options, run for 20 years, saving every 5 timesteps 18 md.timestepping.time_step=0.2; 19 md.timestepping.final_time=200; 20 md.settings.output_frequency=5; 21 22 %Additional options 23 md.inversion.iscontrol=0; 24 md.transient.requested_outputs={'IceVolume','TotalSmb', ... 25 'SmbMassBalance'}; 26 md.verbose=verbose('solution',true,'module',true); 27 28 %Go solve 29 md.cluster=generic('name',oshostname,'np',2); 30 md=solve(md,TransientSolutionEnum); 31 32 save ./Models/Greenland.HistoricTransient_200yr md; 33 end 34 1 35 if any(steps==8) 2 36 disp(' Step 8: Plotting exercise'); 3 37 4 38 %Load historic transient model 5 md = loadmodel('./Models/Greenland.HistoricTransient ');39 md = loadmodel('./Models/Greenland.HistoricTransient_200yr'); 6 40 7 41 %Create Line Plots of relaxation run. Create a figure. 8 42 figure 9 43 10 %Save surface mass balance, by looping through 200 years, or 1000 steps 11 surfmb=[]; for i=1:1000; surfmb=[surfmb ... 44 %Save surface mass balance, by looping through 200 years (1000 steps) 45 % Note, the first output will always contain output from time step 1 46 surfmb=[]; for i=2:201; surfmb=[surfmb ... 12 47 md.results.TransientSolution(i).SmbMassBalance]; end 13 48 14 49 %Plot surface mass balance time series in first subplot 15 subplot(3,1,1); plot([ 0.2:0.2:200],mean(surfmb));50 subplot(3,1,1); plot([1:200],mean(surfmb)); 16 51 17 52 %Title this plot Mean surface mass balance 18 53 title('Mean Surface mass balance'); 19 54 20 %Save velocity by looping through 1000 steps21 vel=[]; for i= 1:1000; vel=[vel md.results.TransientSolution(i).Vel]; end55 %Save velocity by looping through 200 years 56 vel=[]; for i=2:201; vel=[vel md.results.TransientSolution(i).Vel]; end 22 57 23 58 %Plot velocity time series in second subplot 24 subplot(3,1,2); plot([ 0.2:0.2:200],mean(vel));59 subplot(3,1,2); plot([1:200],mean(vel)); 25 60 26 61 %Title this plot Mean Velocity 27 62 title('Mean Velocity'); 28 63 29 %Save Ice Volume by looping through 1000 steps30 volume=[]; for i= 1:1000; volume=[volume md.results.TransientSolution(i).IceVolume]; end64 %Save Ice Volume by looping through 200 years 65 volume=[]; for i=2:201; volume=[volume md.results.TransientSolution(i).IceVolume]; end 31 66 32 67 %Plot volume time series in third subplot 33 subplot(3,1,3); plot([ 0.2:0.2:200],volume);68 subplot(3,1,3); plot([1:200],volume); 34 69 35 70 %Title this plot Mean Velocity and add an x label of years -
issm/trunk-jpl/examples/Greenland/Greenland.par
r19628 r20741 69 69 md.initialization.pressure=md.materials.rho_ice*md.constants.g*md.geometry.thickness; 70 70 71 disp(' Single point constraint for continental model');72 % Set at least one vertex to velocity 0 so as to not get a singular problem (point on the wet peninsula)71 disp(' Single point constraints'); 72 %Initialize single point constraint arrarys 73 73 md.stressbalance.referential=NaN*ones(md.mesh.numberofvertices,6); 74 74 md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices,1); 75 75 md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices,1); 76 76 md.stressbalance.spcvz = NaN*ones(md.mesh.numberofvertices,1); 77 location = 1.0e+06 *[.32011 -2.2039];78 [dist pos]=min(sqrt((md.mesh.x - location(1)).^2 + (md.mesh.y - location(2)).^2));79 md.stressbalance.spcvx(pos) = 0;80 md.stressbalance.spcvy(pos) = 0;81 md.stressbalance.spcvz(pos) = 0;82 77 -
issm/trunk-jpl/examples/Greenland/runme.m
r20532 r20741 117 117 118 118 %Planview plots 119 plotmodel(md,'data',md.results.TransientSolution(end).Vel,'caxis',[1e-1 6000],'log', 10, 'title', 'Velocity (m/y)','gridded',11); 119 plotmodel(md,'data',md.results.TransientSolution(end).Vel,'log#1', 10, ... 120 'caxis#1', [1e-1 1e4], ... 121 'title#1', 'Velocity (m/y)',... 122 'data',md.results.TransientSolution(1).SmbMassBalance,... 123 'title#2', 'Surface Mass Balance (m/y)',... 124 'data',md.results.TransientSolution(end).Thickness,... 125 'title', 'Thickness (m)',... 126 'data',md.results.TransientSolution(end).Surface,... 127 'title', 'Surface (m)'); 120 128 121 129 %Line Plots … … 161 169 162 170 %plot a time series of total SMB 163 plot(t,totalsmb/1e9); title('Total Surface mass balance, Gt'); xlabel('year'); ylabel('Gt/yr');171 figure; plot(t,totalsmb/1e9); title('Total Surface mass balance, Gt'); xlabel('year'); ylabel('Gt/yr'); 164 172 165 173 clear smbbox … … 210 218 211 219 212 %Save surface mass balance, by looping through 200 years, or 1000 steps 220 %Save surface mass balance, by looping through 200 years (1000 steps) 221 % Note, the first output will always contain output from time step 1 213 222 214 223 … … 219 228 220 229 221 %Save velocity by looping through 1000 steps230 %Save velocity by looping through 200 years 222 231 223 232 … … 228 237 229 238 230 %Save Ice Volume by looping through 1000 steps239 %Save Ice Volume by looping through 200 years 231 240 232 241 … … 240 249 if any(steps==9) 241 250 disp(' Step 9: Box Transient run'); 242 md = loadmodel('./Models/Greenland.HistoricTransient ');251 md = loadmodel('./Models/Greenland.HistoricTransient_200yr'); 243 252 244 253 %load past transient results
Note:
See TracChangeset
for help on using the changeset viewer.