Changeset 3510


Ignore:
Timestamp:
04/12/10 08:46:50 (15 years ago)
Author:
Mathieu Morlighem
Message:

updated Bumps tests

Location:
issm/trunk/examples/Bumps/Bump2_bed
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/examples/Bumps/Bump2_bed/Square.par

    r1 r3510  
    11
    22%Ok, start defining model parameters here
    3 
    4 %material parameters
    5         md.g=9.8;
    6         md.rho_ice=917;
    7         md.rho_water=1023;
    8         di=md.rho_ice/md.rho_water;
    9         md.yts=365*24*3600;
    10         md.heatcapacity=2009;
    11         md.thermalconductivity=2.2; %W/mK
    12         md.beta=9.8*10^-8;
    13 
    14 %Solution parameters
    153        %parallelization
    16         md.cluster='none';
    17         md.np=2;
     4        md.cluster=oshostname;
     5        md.np=8;
    186        md.time=1;
    19         md.exclusive=0;
    207
    218        %statics
    22         md.lowmem=1;
    239        md.eps_rel=0.01;
    2410        md.eps_abs=10; %m/yr
    25         md.penalty_offset=4;
    26         md.penalty_melting=10^7;
    27         if md.numberofgrids<1000000,
    28         md.sparsity=.001;
    29         else
    30         md.sparsity=.0001;
    31         end
    32 
    33         %dynamics
    34         md.dt=1*md.yts; %1 year
    35         md.ndt=md.dt*10;
    36         md.artificial_diffusivity=1;
    37 
    38         %control
    39         md.control_type={'drag'}; %'drag', 'B'
    40         md.nsteps=5;
    41         md.tolx=10^-4;
    42         md.maxiter=20;
    43         md.optscal=10;
    44         md.fit='logarithmic'; %'absolute','relative','logarithmic'
    45         md.meanvel=1000/md.yts; %1000 meters/year
    46         md.epsvel=eps;
    47 
    4811
    4912        disp('      creating thickness');
    50         hmin=500;
    51         hmax=500;
    52         ymin=min(md.y);
    53         ymax=max(md.y);
    54         md.thickness=hmax+(hmin-hmax)*(md.y-ymin)/(ymax-ymin);
     13        md.thickness=500*ones(md.numberofgrids,1);
    5514        md.firn_layer=10*ones(md.numberofgrids,1);
    56         md.bed=-di*md.thickness-50; %*10^(-4)*min(0,md.y-900000);;
     15        md.bed=-md.rho_ice/md.rho_water*md.thickness+5;
    5716
    5817        md.surface=md.bed+md.thickness;
    5918
    6019        %Add bumps to the ice sheet :
    61         pos=find(sqrt((md.x-500000).^2+(md.y-500000).^2)<100000); %for a cicular bump
    62         md.bed(pos)=md.bed(pos)+150*cos(pi/200000*(sqrt((md.y(pos)-500000).^2+(md.x(pos)-500000).^2))); %for a circular bump
     20        radius= 500000;
     21        center=[500000 500000];
     22        height=150;
     23        pos=find(sqrt((md.x-center(1)).^2+(md.y-center(2)).^2)<radius); %for a cicular bump
     24        md.bed(pos)=md.bed(pos)+height*cos(pi/(2*radius)*(sqrt((md.y(pos)-center(1)).^2+(md.x(pos)-center(2)).^2))); %for a circular bump
    6325
    6426        %Change the thickness to follow the new bed
     27        %height=-15;
     28        %md.surface(pos)=md.surface(pos)+height*cos(pi/(2*radius)*(sqrt((md.y(pos)-center(1)).^2+(md.x(pos)-center(2)).^2))); %for a circular bump
    6529        md.thickness=md.surface-md.bed;
    6630
    6731        disp('      creating velocities');
    68         md.vx_obs=zeros(md.numberofgrids,1);
    69         md.vy_obs=zeros(md.numberofgrids,1);
     32        md.vx_obs=   0*ones(md.numberofgrids,1);
     33        md.vy_obs=100*ones(md.numberofgrids,1);
    7034        md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
    7135       
     
    7337        md.drag_type=2; %0 none 1 plastic 2 viscous
    7438        md.drag=10*ones(md.numberofgrids,1); %q=1.
    75         %Take care of iceshelves: no basal drag
    7639        pos=find(md.elementoniceshelf);
    7740        md.drag(md.elements(pos,:))=0;
     
    8649        md.n=3*ones(md.numberofelements,1);
    8750
    88         disp('      creating accumulation rates');
    89         md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
    90         md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
    91 
    9251        %Deal with boundary conditions:
    93        
    94         disp('      boundary conditions for diagnostic model: ');
    95         %Build gridonicefront, array of boundary grids belonging to the icefront:
    96         gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
    97         gridonicefront=double(md.gridonboundary & gridinsideicefront);
    98 
    99         md.gridondirichlet_diag=zeros(md.numberofgrids,1);
    100         pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
    101         md.dirichletvalues_diag=100*ones(md.numberofgrids,2)*[0,0;0,1];
    102 
    103         pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
    104         md.segmentonneumann_diag=md.segments(pos,:);
    105         md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
    106 
    107         disp('      boundary conditions for prognostic model: ');
    108         md.gridondirichlet_prog=zeros(md.numberofgrids,1);
    109         md.dirichletvalues_prog=zeros(md.numberofgrids,1);
    110         pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
    111         md.segmentonneumann_prog=md.segments(pos,:);
    112         md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
    113         md.neumannvalues_prog(:)=NaN; %free radiation
    114        
    115         pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
    116         md.segmentonneumann_prog2=md.segments(pos,:);
    117         md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
    118         md.neumannvalues_prog2(:)=NaN; %free radiation
    119        
    120         disp('      boundary conditions for thermal model: ');
    121         md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
    122         md.dirichletvalues_thermal=md.observed_temperature;
    123         md.geothermalflux=zeros(md.numberofgrids,1);
    124 
    125 
    126 % Some Cielo code, ignore.
    127 if strcmp(md.cluster,'yes')
    128         ServerDisconnect;
    129 end   
     52        md=SetIceShelfBC(md,'Front.exp');
     53        md.verbose=10;
  • issm/trunk/examples/Bumps/Bump2_bed/runme.m

    r1 r3510  
    88% Create macayeal model;
    99
    10 mdm=model;
    11 mdm=mesh(mdm,'DomainOutline.exp',150000);
     10mdm=mesh(model,'DomainOutline.exp',150000);
    1211mdm=geography(mdm,'','');
    1312mdm=parameterize(mdm,'Square.par');
     
    1615
    1716%Compute solution with Ice model
    18 mdm=solve(mdm,'diagnostic','ice');
     17mdm.cluster=oshostname;
     18mdm=solve(mdm,'analysis_type','diagnostic');
    1919
    2020save modelmacayeal mdm
     
    2222% Create pattyn model;
    2323
    24 mdp=model;
    25 mdp=mesh(mdp,'DomainOutline.exp',150000);
     24mdp=mesh(model,'DomainOutline.exp',150000);
    2625mdp=geography(mdp,'','');
    2726mdp=parameterize(mdp,'Square.par');
     
    3029
    3130%Compute solution with Ice model
    32 mdp=solve(mdp,'diagnostic','ice');
     31mdp=solve(mdp,'analysis_type','diagnostic');
    3332
    3433save modelpattyn mdp
     
    3635% Create stokes model;
    3736
    38 mds=model;
    39 mds=mesh(mds,'DomainOutline.exp',150000);
     37mds=mesh(model,'DomainOutline.exp',150000);
    4038mds=geography(mds,'','');
    4139mds=parameterize(mds,'Square.par');
     
    4442
    4543%Compute solution with Ice model
    46 mds=solve(mds,'diagnostic','ice');
     44mds=solve(mds,'analysis_type','diagnostic');
    4745
    4846save modelstokes mds
Note: See TracChangeset for help on using the changeset viewer.