Changeset 14045


Ignore:
Timestamp:
11/28/12 15:38:57 (12 years ago)
Author:
Eric.Larour
Message:

CHG: last minute changes

Location:
issm/workshop/2012/Talks/09_PIG_Application
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/workshop/2012/Talks/09_PIG_Application/Exp_Par/Pig.par

    r14029 r14045  
     1% Parameters to change/Try
     2friction_coefficient = 10; % default [10]
     3Temp_change          =  0;  % default [0 K]
     4
    15%Name and hemisphere
    26md.miscellaneous.name='PIG';
     
    4953
    5054disp('   Interpolating temperatures');
    51 md.initialization.temperature=InterpFromGridToMesh(x1,y1,temp,md.mesh.x,md.mesh.y,0)+273.15;
     55md.initialization.temperature=InterpFromGridToMesh(x1,y1,temp,md.mesh.x,md.mesh.y,0)+273.15+Temp_change;
    5256
    5357disp('   Interpolating surface mass balance');
     
    5660
    5761disp('   Construct basal friction parameters');
    58 md.friction.coefficient=10*ones(md.mesh.numberofvertices,1);
     62md.friction.coefficient=friction_coefficient*ones(md.mesh.numberofvertices,1);
    5963pos=find(md.mask.vertexonfloatingice);
    6064md.friction.coefficient(pos)=0; %no friction applied on floating ice
  • TabularUnified issm/workshop/2012/Talks/09_PIG_Application/runme.m

    r14029 r14045  
    1 steps=[1 2 3 4];
    2 
    3 %SeaRISe dataset for Antarctica. Can be downloaded at: 
    4 %http://websrv.cs.umt.edu/isis/index.php/Present_Day_Antarctica
    5 
     1% MacAyeal Steps
     2steps=[1 2 3 4 5];
     3
     4% Blatter-Pattyn Steps
     5% steps=[6 7];
     6
     7%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     8% SeaRISe dataset for Antarctica. Can be downloaded at: 
     9% http://websrv.cs.umt.edu/isis/index.php/Present_Day_Antarctica
    610searise='./Data/Antarctica_5km_withshelves_v0.75.nc';
    711
    8 %Rignot et al, 2011. NSIDC available velocities (at http://nsidc.org/data/nsidc-0484.html)
     12% Rignot et al, 2011. NSIDC available velocities (at http://nsidc.org/data/nsidc-0484.html)
    913nsidc_vel='./Data/Antarctica_ice_velocity.nc'; 
    1014
     15%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     16% Create Mesh
    1117if any(steps==1)
    1218        disp('   Step 1: Mesh creation');
    1319
    14 
    15         %Generate initial uniform mesh (resolution = 10000 m)
     20        % Generate an initial uniform mesh (resolution = 10000 m)
    1621        md=bamg(model,'domain','Exp_Par/DomainOutline.exp','hmax',10000,'MaxCornerAngle',1);
    1722
    1823        % Get velocities (Note: You can use ncdisp('file') to see an ncdump)
    1924        xmin = ncreadatt(nsidc_vel,'/','xmin');
    20         xmin = strtrim(xmin);  %this is a string, and we need to recover the double value
    21         xmin = xmin(1:end-2);  %get rid of the unit
    22         xmin = str2num(xmin);  %convert to double
     25        xmin = strtrim(xmin);  % this is a string, and we need to recover the double value
     26        xmin = xmin(1:end-2);  % get rid of the unit
     27        xmin = str2num(xmin);  % convert to double
    2328        ymax = ncreadatt(nsidc_vel,'/','ymax'); ymax = strtrim(ymax);  ymax = ymax(1:end-2);  ymax = str2num(ymax);
    2429        nx = ncreadatt(nsidc_vel,'/','nx');
     
    3035        y=(ymax-ny*spacing)+(0:1:ny)'*spacing; y=double(y);
    3136
    32         %interpolate velocities onto coarse mesh
     37        % Interpolate velocities onto coarse mesh
    3338        vx_obs=InterpFromGridToMesh(x,y,flipud(vx'),md.mesh.x,md.mesh.y,0);
    3439        vy_obs=InterpFromGridToMesh(x,y,flipud(vy'),md.mesh.x,md.mesh.y,0);
    3540        vel_obs=sqrt(vx_obs.^2+vy_obs.^2);
    3641
    37         %Adapt the mesh to minimize error in velocity interpolation
     42        % Adapt the mesh to minimize error in velocity interpolation
    3843        md=bamg(md,'hmax',400000,'hmin',5000,'gradation',1.7,'field',vel_obs,'err',8);
    3944       
    40         %convert x,y coordinates (Polar stereo) to lat/lon
     45        % Convert x,y coordinates (Polar stereo) to lat/lon
    4146        [md.mesh.lat,md.mesh.long]=xy2ll(md.mesh.x,md.mesh.y,+1,39,71);
    4247       
     48        % Save model
    4349        save ./Models/Pig.Mesh_generation md;
    4450end
    4551
     52%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     53% Masks
     54
    4655if any(steps==2)
     56       
    4757        disp('   Step 2: Mask (floating vs grounded)');
    4858        md = loadmodel('./Models/Pig.Mesh_generation');
     
    6373        md=setmask(md,elementoniceshelf,'');
    6474
     75        % Save model
    6576        save ./Models/Pig.Mask md;
    6677end
    6778
     79%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     80% Parameterization
     81
    6882if any(steps==3)
     83
    6984        disp('   Step 3: Parameterization');
    7085        md = loadmodel('./Models/Pig.Mask');
    71        
    7286        md = parameterize(md,'./Exp_Par/Pig.par');
     87
     88        % Use a MacAyeal flow model
    7389        md = setflowequation(md,'macayeal','all');
    74 
     90       
     91        % Save model
    7592        save ./Models/Pig.Parameterization md;
    7693end
     94
     95%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     96% Control Method on Friction Coefficient
    7797if any(steps==4)
    7898        disp('   Step 4: Control method friction');
    7999        md = loadmodel('./Models/Pig.Parameterization');
    80100
    81         %Control general
     101        % Control general
    82102        md.inversion.iscontrol=1;
    83103        md.inversion.nsteps=20;
     
    86106        md.verbose=verbose('solution',true,'control',true);
    87107
    88         %Cost functions
     108        % Cost functions
    89109        md.inversion.cost_functions=[[103*ones(md.inversion.nsteps/2,1); 101*ones(md.inversion.nsteps/2,1)] 501*ones(md.inversion.nsteps,1)];
    90110        md.inversion.cost_functions_coefficients=ones(md.mesh.numberofvertices,2);
     
    92112        md.inversion.cost_functions_coefficients(:,2)=8e-15;
    93113
    94         %Controls
     114        % Controls
    95115        md.inversion.control_parameters={'FrictionCoefficient'};
    96116        md.inversion.gradient_scaling=50*ones(md.inversion.nsteps,1);
     
    98118        md.inversion.max_parameters=200*ones(md.mesh.numberofvertices,1);
    99119
    100         %Additional parameters
     120        % Additional parameters
    101121        md.diagnostic.restol=0.01;
    102122        md.diagnostic.reltol=0.1;
    103123        md.diagnostic.abstol=NaN;
    104124
    105         %Go solve
     125        % Solve
    106126        md.solver=addoptions(md.solver,NoneAnalysisEnum,asmoptions);
    107127        md.solver=addoptions(md.solver,DiagnosticVertAnalysisEnum,jacobiasmoptions);
     
    110130        md=solve(md,DiagnosticSolutionEnum);
    111131
    112         %Update model friction fields accordingly
     132        % Update model friction fields accordingly
    113133        md.friction.coefficient=md.results.DiagnosticSolution.FrictionCoefficient;
    114134
     135        % Save model
    115136        save ./Models/Pig.Control_drag md;
    116137end
     138
     139%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     140% Plot MacAyeal Results
     141if any(steps==5)
     142
     143        disp('   Plotting MacAyeal Model Results')
     144        md = loadmodel('./Models/Pig.Control_drag');
     145
     146        plotmodel(md,'nlines',2,'ncols',2,'unit#all','km','axis#all','equal',...
     147                'xlim#all',[min(md.mesh.x) max(md.mesh.x)]/10^3,...
     148                'ylim#all',[min(md.mesh.y) max(md.mesh.y)]/10^3,...
     149                'FontSize#all',12,...
     150                'data',md.initialization.vel,'title','Observed velocity',...
     151                'data',md.results.DiagnosticSolution.Vel,'title','Modeled Velocity',...
     152                'data',md.geometry.bed,'title','Bed elevation',...
     153                'data',md.results.DiagnosticSolution.FrictionCoefficient,'title','Friction Coefficient',...
     154                'colorbar#all','on','colorbartitle#1-2','[m/yr]',...
     155                'caxis#1-2',([1.5,4000]),...
     156                'colorbartitle#3','[m]', 'log#all',10);
     157end
     158
     159%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     160% Use a Blatter-Pattyn Flow Model
     161if any(steps==6)
     162
     163        % Load Model
     164        md = loadmodel('./Models/Pig.Control_drag');
     165        md.inversion.iscontrol=0;
     166       
     167        disp('   Extruding mesh')
     168        number_of_layers=3;
     169        md=extrude(md, number_of_layers, 0.9);
     170
     171        disp('   Using Batter-Pattyn Ice Flow Model')
     172        md=setflowequation(md, 'pattyn', 'all');
     173
     174        % Solve
     175        md=solve(md,DiagnosticSolutionEnum);
     176
     177        % Save Model
     178        save ./Models/Pig.Control_drag_pattyn md;
     179end
     180
     181%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     182% Plot Blatter-Pattyn Results
     183if any(steps==7)
     184
     185        disp('   Plotting Pattyn Model Results')
     186        md = loadmodel('./Models/Pig.Control_drag_pattyn');
     187
     188        plotmodel(md,'nlines',2,'ncols',2,'unit#all','km','axis#all','equal',...
     189                'xlim#all',[min(md.mesh.x) max(md.mesh.x)]/10^3,...
     190                'ylim#all',[min(md.mesh.y) max(md.mesh.y)]/10^3,...
     191                'FontSize#all',12,...
     192                'data',md.initialization.vel,'title','Observed velocity',...
     193                'data',md.results.DiagnosticSolution.Vel,'title','Modeled Velocity',...
     194                'data',md.geometry.bed,'title','Bed elevation',...
     195                'data',md.friction.coefficient,'title','Friction Coefficient',...
     196                'caxis#1-2',([1.5,4000]),...
     197                'colorbar#all','on','view#all',2,...
     198                'colorbartitle#1-2','[m/yr]','colorbartitle#3','[m]',...
     199                'layer#1-3',(md.mesh.numberoflayers),'layer#4',1, 'log#all', 10);
     200end
Note: See TracChangeset for help on using the changeset viewer.