| 1 | function parameterize(md){
|
|---|
| 2 |
|
|---|
| 3 | //Geometry
|
|---|
| 4 | var hmin=300;
|
|---|
| 5 | var hmax=1000;
|
|---|
| 6 | var ymin=ArrayMin(md.mesh.y);
|
|---|
| 7 | var ymax=ArrayMax(md.mesh.y);
|
|---|
| 8 | var xmin=ArrayMin(md.mesh.x);
|
|---|
| 9 | var xmax=ArrayMax(md.mesh.x);
|
|---|
| 10 |
|
|---|
| 11 | md.geometry.thickness=NewArrayFill(md.mesh.numberofvertices,0);
|
|---|
| 12 | md.geometry.base=NewArrayFill(md.mesh.numberofvertices,0);
|
|---|
| 13 | md.geometry.surface=NewArrayFill(md.mesh.numberofvertices,0);
|
|---|
| 14 | md.geometry.bed=NewArrayFill(md.mesh.numberofvertices,0);
|
|---|
| 15 |
|
|---|
| 16 | for(i=0;i<md.mesh.numberofvertices;i++){
|
|---|
| 17 | md.geometry.thickness[i]=hmax+(hmin-hmax)*(md.mesh.y[i]-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x[i]-xmin)/(xmax-xmin);
|
|---|
| 18 | md.geometry.base[i]=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness[i];
|
|---|
| 19 | md.geometry.surface[i]=md.geometry.base[i]+md.geometry.thickness[i];
|
|---|
| 20 | md.geometry.bed[i]=md.geometry.base[i]-10;
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | //Initial velocity: no ncreader for now, so we just load arrays.
|
|---|
| 24 | /*x = transpose(ncread('../Data/SquareShelfConstrained.nc','x'));
|
|---|
| 25 | y = transpose(ncread('../Data/SquareShelfConstrained.nc','y'));
|
|---|
| 26 | vx = transpose(ncread('../Data/SquareShelfConstrained.nc','vx'));
|
|---|
| 27 | vy = transpose(ncread('../Data/SquareShelfConstrained.nc','vy'));
|
|---|
| 28 | index = transpose(ncread('../Data/SquareShelfConstrained.nc','index'));*/
|
|---|
| 29 |
|
|---|
| 30 | md.initialization.vx=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y);
|
|---|
| 31 | md.initialization.vy=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y);
|
|---|
| 32 | md.initialization.vel=ArrayMag(md.initialization.vx,md.initialization.vy);
|
|---|
| 33 | md.initialization.vz=NewArrayFill(md.mesh.numberofvertices,0);
|
|---|
| 34 | md.initialization.pressure=NewArrayFill(md.mesh.numberofvertices,0);
|
|---|
| 35 |
|
|---|
| 36 | //Materials
|
|---|
| 37 | md.initialization.temperature=NewArrayFill(md.mesh.numberofvertices,273-20);
|
|---|
| 38 | md.materials.rheology_B=paterson(md.initialization.temperature);
|
|---|
| 39 | md.materials.rheology_n=NewArrayFill(md.mesh.numberofelements,3);
|
|---|
| 40 |
|
|---|
| 41 | //Surface mass balance and basal melting
|
|---|
| 42 | md.smb.mass_balance=NewArrayFill(md.mesh.numberofvertices,10);
|
|---|
| 43 | md.basalforcings.floatingice_melting_rate=NewArrayFill(md.mesh.numberofvertices,5.0);
|
|---|
| 44 | md.basalforcings.groundedice_melting_rate=NewArrayFill(md.mesh.numberofvertices,5.0);
|
|---|
| 45 |
|
|---|
| 46 | //Friction
|
|---|
| 47 | md.friction.coefficient=NewArrayFill(md.mesh.numberofvertices,20);
|
|---|
| 48 | for(var i=0;i<md.mesh.numberofvertices;i++)if(md.mask.groundedice_levelset[i]<0)md.friction.coefficient[i]=0;
|
|---|
| 49 | md.friction.p=NewArrayFill(md.mesh.numberofelements,1);
|
|---|
| 50 | md.friction.q=NewArrayFill(md.mesh.numberofelements,1);
|
|---|
| 51 |
|
|---|
| 52 | //Numerical parameters
|
|---|
| 53 | md.stressbalance.viscosity_overshoot=0.0;
|
|---|
| 54 | return;
|
|---|
| 55 | md.masstransport.stabilization=1;
|
|---|
| 56 | md.thermal.stabilization=1;
|
|---|
| 57 | md.verbose=verbose(0);
|
|---|
| 58 | md.settings.waitonlock=30;
|
|---|
| 59 | md.stressbalance.restol=0.05;
|
|---|
| 60 | md.stressbalance.reltol=0.05;
|
|---|
| 61 | md.steadystate.reltol=0.05;
|
|---|
| 62 | md.stressbalance.abstol=NaN;
|
|---|
| 63 | md.timestepping.time_step=1;
|
|---|
| 64 | md.timestepping.final_time=3;
|
|---|
| 65 |
|
|---|
| 66 | //Deal with boundary conditions:
|
|---|
| 67 | md=SetIceShelfBC(md);
|
|---|
| 68 |
|
|---|
| 69 | //Change name so that no tests have the same name
|
|---|
| 70 | //A=dbstack;
|
|---|
| 71 | //if (length(A)>2), md.miscellaneous.name=A(3).file(1:end-2); end
|
|---|
| 72 |
|
|---|
| 73 | }
|
|---|