[16] | 1 |
|
---|
| 2 | %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
|
---|
| 15 | %parallelization
|
---|
| 16 | md.cluster='none';
|
---|
| 17 | md.np=2;
|
---|
| 18 | md.time=1;
|
---|
| 19 | md.exclusive=0;
|
---|
| 20 |
|
---|
| 21 | %statics
|
---|
| 22 | md.eps_rel=0.01;
|
---|
| 23 | md.eps_abs=10;
|
---|
| 24 | %md.penalty_horiz=10^25; %penalty parameters for rifts
|
---|
| 25 | %md.penalty_vert=10^15; %penalty parameters for rifts
|
---|
| 26 | md.lowmem=1;
|
---|
| 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 |
|
---|
| 48 |
|
---|
| 49 | disp(' creating thickness');
|
---|
| 50 | hmax=1000;
|
---|
| 51 | md.thickness=hmax*ones(md.numberofgrids,1);
|
---|
| 52 | md.firn_layer=10*ones(md.numberofgrids,1);
|
---|
| 53 | md.surface=zeros(md.numberofgrids,1);
|
---|
| 54 | md.bed=-md.thickness;
|
---|
| 55 |
|
---|
| 56 | disp(' creating velocities');
|
---|
| 57 | md.vx_obs=zeros(md.numberofgrids,1);
|
---|
| 58 | md.vy_obs=zeros(md.numberofgrids,1);
|
---|
| 59 | md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2);
|
---|
| 60 |
|
---|
| 61 | disp(' creating drag');
|
---|
| 62 | md.drag_type=2; %0 none 1 plastic 2 viscous
|
---|
| 63 | md.drag=200*ones(md.numberofgrids,1); %q=1.
|
---|
| 64 | %Take care of iceshelves: no basal drag
|
---|
| 65 | pos=find(md.elementoniceshelf);
|
---|
| 66 | md.drag(md.elements(pos,:))=0;
|
---|
| 67 | md.p=ones(md.numberofelements,1);
|
---|
| 68 | md.q=ones(md.numberofelements,1);
|
---|
| 69 |
|
---|
| 70 | disp(' creating temperatures');
|
---|
| 71 | md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
|
---|
| 72 |
|
---|
| 73 | disp(' creating flow law paramter');
|
---|
| 74 | md.B=paterson(md.observed_temperature);
|
---|
| 75 | md.n=3*ones(md.numberofelements,1);
|
---|
| 76 |
|
---|
| 77 | disp(' creating accumulation rates');
|
---|
| 78 | md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
|
---|
| 79 | md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
|
---|
| 80 |
|
---|
| 81 | %Deal with boundary conditions:
|
---|
| 82 |
|
---|
| 83 | disp(' boundary conditions for diagnostic model: ');
|
---|
| 84 | %Build gridonicefront, array of boundary grids belonging to the icefront:
|
---|
| 85 | gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
|
---|
| 86 | gridonicefront=double(md.gridonboundary & gridinsideicefront);
|
---|
| 87 |
|
---|
| 88 | md.gridondirichlet_diag=zeros(md.numberofgrids,1);
|
---|
| 89 | pos=find(md.gridonboundary & ~gridonicefront);md.gridondirichlet_diag(pos)=1;
|
---|
| 90 | md.dirichletvalues_diag=zeros(md.numberofgrids,2);
|
---|
| 91 |
|
---|
| 92 | pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
|
---|
| 93 | md.segmentonneumann_diag=md.segments(pos,:);
|
---|
| 94 | md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
|
---|
| 95 |
|
---|
| 96 | disp(' boundary conditions for prognostic model');
|
---|
| 97 | md.gridondirichlet_prog=zeros(md.numberofgrids,1);
|
---|
| 98 | md.dirichletvalues_prog=zeros(md.numberofgrids,1);
|
---|
| 99 | pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
|
---|
| 100 | md.segmentonneumann_prog=md.segments(pos,:);
|
---|
| 101 | md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
|
---|
| 102 | md.neumannvalues_prog(:)=NaN; %free radiation
|
---|
| 103 |
|
---|
| 104 | pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
|
---|
| 105 | md.segmentonneumann_prog2=md.segments(pos,:);
|
---|
| 106 | md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
|
---|
| 107 | md.neumannvalues_prog2(:)=NaN; %free radiation
|
---|
| 108 |
|
---|
| 109 | disp(' boundary conditions for thermal model');
|
---|
| 110 | md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
|
---|
| 111 | md.dirichletvalues_thermal=md.observed_temperature;
|
---|
| 112 | md.geothermalflux=zeros(md.numberofgrids,1);
|
---|
| 113 | pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=0.1; %1 mW/m^2
|
---|
| 114 |
|
---|
| 115 |
|
---|
| 116 |
|
---|
| 117 |
|
---|
| 118 | % Some Cielo code, ignore.
|
---|
| 119 | if strcmp(md.cluster,'yes')
|
---|
| 120 | ServerDisconnect;
|
---|
| 121 | end
|
---|