Changeset 18263


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

CHG: update runme

Location:
issm/trunk-jpl/examples/Greenland
Files:
1 added
1 edited

Legend:

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

    r18214 r18263  
    115115        disp('   Step 5: Plotting');
    116116        md = loadmodel('./Models/Greenland.Transient');
    117         %md = loadmodel('./Models/Greenland.HistoricTransient');
    118117
    119118        %Planview plots
     
    146145
    147146if any(steps==6)
    148         disp('   Step 6: Historical Relaxation run');
    149         md = loadmodel('./Models/Greenland.Control_drag');
     147        disp('   Step 6: Extract Box SMB');
    150148
    151149        ncbox='../Data/Box_Greenland_SMB_monthly_1840-2012_5km_ver20140421.nc';
     
    161159        [x1 y1]=ll2xy(lat,lon,+1,45,70);
    162160
    163         %surface mass balance
     161        years_of_simulation = 1840:2012;
     162        t = [years_of_simulation(1):1/12:years_of_simulation(end)+11/12];
     163
     164        %Area of grid for 5km box
     165        area_of_grid=5000*5000;
     166        totalsmb=reshape(sum(sum(smbbox,1),2),length(t),1);
     167
     168        %save surface mass balance mat dataset
    164169        smbmean = mean(mean(smbbox,3),4);
    165         save -v7.3 smbbox smbbox x1 y1;
    166         clear smbbox
     170        save -v7.3 smbbox smbmean totalsmb smbbox x1 y1 t;
     171
     172        %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
     176
     177end
     178
     179if any(steps==7)
     180        disp('   Step 7: Historical Relaxation run');
     181        md = loadmodel('./Models/Greenland.Control_drag');
     182
     183        load smbbox
    167184
    168185        %Interpolate and set surface mass balance
     
    190207end
    191208
    192 if any(steps==7)
    193         disp('   Step 7: Box Transient run');
     209if any(steps==8)
     210        disp('   Step 8: Plotting exercise');
     211
     212        %load historic transient model
     213        md = loadmodel('./Models/Greenland.HistoricTransient');
     214
     215        %Create Line Plots of relaxation run.  Create a figure.
     216        figure
     217
     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
     221
     222        %Plot surface mass balance time series in first subplot
     223        subplot(3,1,1); plot([0.2:0.2:200],mean(surfmb));
     224       
     225        %Title this plot Mean surface mass balance
     226        title('Mean Surface mass balance');
     227
     228        %Save velocity by looping through 1000 steps
     229        vel=[]; for i=1:100; vel=[vel md.results.TransientSolution(i).Vel]; end
     230
     231        %Plot velocity time series in second subplot
     232        subplot(3,1,2); plot([0.2:0.2:200],mean(vel));
     233       
     234        %Title this plot Mean Velocity
     235        title('Mean Velocity');
     236
     237        %Save Ice Volume by looping through 1000 steps
     238        volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end
     239
     240        %Plot volume time series in third subplot
     241        subplot(3,1,3); plot([0.2:0.2:200],volume);
     242       
     243        %Title this plot Mean Velocity and add an x label of years
     244        title('Ice Volume'); xlabel('years');
     245end
     246
     247if any(steps==9)
     248        disp('   Step 9: Box Transient run');
    194249        md = loadmodel('./Models/Greenland.HistoricTransient');
    195250
     
    246301end
    247302
    248 if any(steps==8)
    249         disp('   Step 8: Plot Box Transient');
     303if any(steps==10)
     304        disp('   Step 10: Plot Box Transient');
    250305        md = loadmodel('./Models/Greenland.BoxTransient');
    251306
Note: See TracChangeset for help on using the changeset viewer.