Changeset 18264


Ignore:
Timestamp:
07/18/14 12:33:21 (11 years ago)
Author:
schlegel
Message:

CHG: add plot execise

Location:
issm/trunk-jpl/examples/Greenland
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/examples/Greenland/CheatSheet.m

    r18263 r18264  
    99
    1010        %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 ...
    1212                md.results.TransientSolution(i).SurfaceforcingsMassBalance]; end
    1313
     
    1919
    2020        %Save velocity by looping through 1000 steps
    21         vel=[]; for i=1:100; vel=[vel md.results.TransientSolution(i).Vel]; end
     21        vel=[]; for i=1:1000; vel=[vel md.results.TransientSolution(i).Vel]; end
    2222
    2323        %Plot velocity time series in second subplot
     
    2828
    2929        %Save Ice Volume by looping through 1000 steps
    30         volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end
     30        volume=[]; for i=1:1000; volume=[volume md.results.TransientSolution(i).IceVolume]; end
    3131
    3232        %Plot volume time series in third subplot
     
    3535        %Title this plot Mean Velocity and add an x label of years
    3636        title('Ice Volume'); xlabel('years');
    37 
    3837end
  • issm/trunk-jpl/examples/Greenland/runme.m

    r18263 r18264  
    146146if any(steps==6)
    147147        disp('   Step 6: Extract Box SMB');
     148        md = loadmodel('./Models/Greenland.Transient');
    148149
    149150        ncbox='../Data/Box_Greenland_SMB_monthly_1840-2012_5km_ver20140421.nc';
     
    164165        %Area of grid for 5km box
    165166        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;
    167168
    168169        %save surface mass balance mat dataset
     
    171172
    172173        %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 t
     174        plot(t,totalsmb/1e9); title('Total Surface mass balance, Gt'); xlabel('year'); ylabel('Gt/yr');
     175
     176        clear smbbox
    176177
    177178end
     
    211212
    212213        %load historic transient model
    213         md = loadmodel('./Models/Greenland.HistoricTransient');
    214214
    215215        %Create Line Plots of relaxation run.  Create a figure.
    216         figure
     216
    217217
    218218        %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
    221220
    222221        %Plot surface mass balance time series in first subplot
    223         subplot(3,1,1); plot([0.2:0.2:200],mean(surfmb));
     222
    224223       
    225224        %Title this plot Mean surface mass balance
    226         title('Mean Surface mass balance');
     225
    227226
    228227        %Save velocity by looping through 1000 steps
    229         vel=[]; for i=1:100; vel=[vel md.results.TransientSolution(i).Vel]; end
     228
    230229
    231230        %Plot velocity time series in second subplot
    232         subplot(3,1,2); plot([0.2:0.2:200],mean(vel));
     231
    233232       
    234233        %Title this plot Mean Velocity
    235         title('Mean Velocity');
     234
    236235
    237236        %Save Ice Volume by looping through 1000 steps
    238         volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end
     237
    239238
    240239        %Plot volume time series in third subplot
    241         subplot(3,1,3); plot([0.2:0.2:200],volume);
     240
    242241       
    243242        %Title this plot Mean Velocity and add an x label of years
    244         title('Ice Volume'); xlabel('years');
     243
    245244end
    246245
Note: See TracChangeset for help on using the changeset viewer.