source: issm/trunk-jpl/test/Par/SquareShelfConstrained.js@ 19718

Last change on this file since 19718 was 19718, checked in by Eric.Larour, 9 years ago

CHG: starting parameterization routines in javascript.

  • Property svn:executable set to *
File size: 2.7 KB
Line 
1function 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 }
21
22 //Initial velocity
23 x = transpose(ncread('../Data/SquareShelfConstrained.nc','x'));
24 y = transpose(ncread('../Data/SquareShelfConstrained.nc','y'));
25 vx = transpose(ncread('../Data/SquareShelfConstrained.nc','vx'));
26 vy = transpose(ncread('../Data/SquareShelfConstrained.nc','vy'));
27 index = transpose(ncread('../Data/SquareShelfConstrained.nc','index'));
28 md.initialization.vx=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y);
29 md.initialization.vy=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y);
30 clear vx vy x y index;
31 md.initialization.vz=zeros(md.mesh.numberofvertices,1);
32 md.initialization.pressure=zeros(md.mesh.numberofvertices,1);
33
34 //Materials
35 md.initialization.temperature=(273-20)*ones(md.mesh.numberofvertices,1);
36 md.materials.rheology_B=paterson(md.initialization.temperature);
37 md.materials.rheology_n=3*ones(md.mesh.numberofelements,1);
38
39 //Surface mass balance and basal melting
40 md.smb.mass_balance=10*ones(md.mesh.numberofvertices,1);
41 md.basalforcings.floatingice_melting_rate=5*ones(md.mesh.numberofvertices,1);
42 md.basalforcings.groundedice_melting_rate=5*ones(md.mesh.numberofvertices,1);
43
44 //Friction
45 md.friction.coefficient=20*ones(md.mesh.numberofvertices,1);
46 md.friction.coefficient(find(md.mask.groundedice_levelset<0.))=0.;
47 md.friction.p=ones(md.mesh.numberofelements,1);
48 md.friction.q=ones(md.mesh.numberofelements,1);
49
50 //Numerical parameters
51 md.stressbalance.viscosity_overshoot=0.0;
52 md.masstransport.stabilization=1;
53 md.thermal.stabilization=1;
54 md.verbose=verbose(0);
55 md.settings.waitonlock=30;
56 md.stressbalance.restol=0.05;
57 md.stressbalance.reltol=0.05;
58 md.steadystate.reltol=0.05;
59 md.stressbalance.abstol=NaN;
60 md.timestepping.time_step=1;
61 md.timestepping.final_time=3;
62
63 //Deal with boundary conditions:
64 md=SetIceShelfBC(md);
65
66 //Change name so that no tests have the same name
67 A=dbstack;
68 if (length(A)>2), md.miscellaneous.name=A(3).file(1:end-2); end
69
70}
Note: See TracBrowser for help on using the repository browser.