[21341] | 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,'Transient');
|
---|
| 31 |
|
---|
| 32 | save ./Models/Greenland.HistoricTransient_200yr md;
|
---|
| 33 | end
|
---|
| 34 |
|
---|
[18263] | 35 | if any(steps==8)
|
---|
| 36 | disp(' Step 8: Plotting exercise');
|
---|
| 37 |
|
---|
[18270] | 38 | %Load historic transient model
|
---|
[21341] | 39 | md = loadmodel('./Models/Greenland.HistoricTransient_200yr');
|
---|
[18263] | 40 |
|
---|
| 41 | %Create Line Plots of relaxation run. Create a figure.
|
---|
| 42 | figure
|
---|
| 43 |
|
---|
[21341] | 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 ...
|
---|
[20500] | 47 | md.results.TransientSolution(i).SmbMassBalance]; end
|
---|
[18263] | 48 |
|
---|
| 49 | %Plot surface mass balance time series in first subplot
|
---|
[21341] | 50 | subplot(3,1,1); plot([1:200],mean(surfmb));
|
---|
[18263] | 51 |
|
---|
| 52 | %Title this plot Mean surface mass balance
|
---|
| 53 | title('Mean Surface mass balance');
|
---|
| 54 |
|
---|
[21341] | 55 | %Save velocity by looping through 200 years
|
---|
| 56 | vel=[]; for i=2:201; vel=[vel md.results.TransientSolution(i).Vel]; end
|
---|
[18263] | 57 |
|
---|
| 58 | %Plot velocity time series in second subplot
|
---|
[21341] | 59 | subplot(3,1,2); plot([1:200],mean(vel));
|
---|
[18263] | 60 |
|
---|
| 61 | %Title this plot Mean Velocity
|
---|
| 62 | title('Mean Velocity');
|
---|
| 63 |
|
---|
[21341] | 64 | %Save Ice Volume by looping through 200 years
|
---|
| 65 | volume=[]; for i=2:201; volume=[volume md.results.TransientSolution(i).IceVolume]; end
|
---|
[18263] | 66 |
|
---|
| 67 | %Plot volume time series in third subplot
|
---|
[21341] | 68 | subplot(3,1,3); plot([1:200],volume);
|
---|
[18263] | 69 |
|
---|
| 70 | %Title this plot Mean Velocity and add an x label of years
|
---|
| 71 | title('Ice Volume'); xlabel('years');
|
---|
| 72 | end
|
---|