[16] | 1 |
|
---|
| 2 | %Ok, start defining model parameters here
|
---|
| 3 |
|
---|
| 4 | %material parameters
|
---|
| 5 | md.g=9.8;
|
---|
| 6 | md.rho_ice=910;
|
---|
| 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.lowmem=1;
|
---|
| 23 | md.eps_abs=NaN;
|
---|
| 24 | md.eps_rel=0.01;
|
---|
| 25 | md.penalty_offset=3;
|
---|
| 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 | md.viscosity_overshoot=0;
|
---|
| 38 |
|
---|
| 39 | %control
|
---|
| 40 | md.control_type={'drag'}; %'drag', 'B'
|
---|
| 41 | md.nsteps=5;
|
---|
| 42 | md.tolx=10^-4;
|
---|
| 43 | md.maxiter=20;
|
---|
| 44 | md.optscal=10;
|
---|
| 45 | md.fit='logarithmic'; %'absolute','relative','logarithmic'
|
---|
| 46 | md.meanvel=1000/md.yts; %1000 meters/year
|
---|
| 47 | md.epsvel=eps;
|
---|
| 48 |
|
---|
| 49 |
|
---|
| 50 | disp(' creating thickness');
|
---|
| 51 | md.surface=2000-md.x*tan(0.1*pi/180); %to have z>0
|
---|
| 52 | md.bed=md.surface-1000;
|
---|
| 53 | md.thickness=md.surface-md.bed;
|
---|
| 54 | md.firn_layer=0*ones(md.numberofgrids,1);
|
---|
| 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=sqrt(md.yts.*(1000+1000*sin(md.x*2*pi/max(md.x)))./(md.g*(md.rho_ice*md.thickness+md.rho_water*md.bed)));
|
---|
| 64 |
|
---|
| 65 | %Take care of iceshelves: no basal drag
|
---|
| 66 | pos=find(md.elementoniceshelf);
|
---|
| 67 | md.drag(md.elements(pos,:))=0;
|
---|
| 68 | md.p=ones(md.numberofelements,1);
|
---|
| 69 | md.q=ones(md.numberofelements,1);
|
---|
| 70 |
|
---|
| 71 | disp(' creating temperature');
|
---|
| 72 | md.observed_temperature=(273-20)*ones(md.numberofgrids,1);
|
---|
| 73 |
|
---|
| 74 | disp(' creating flow law paramter');
|
---|
| 75 | md.B=6.8067*10^7*ones(md.numberofgrids,1);
|
---|
| 76 | md.n=3*ones(md.numberofelements,1);
|
---|
| 77 |
|
---|
| 78 | disp(' creating accumulation rates');
|
---|
| 79 | md.accumulation=ones(md.numberofgrids,1)/md.yts; %1m/a
|
---|
| 80 | md.melting=0*ones(md.numberofgrids,1)/md.yts; %1m/a
|
---|
| 81 |
|
---|
| 82 | %Deal with boundary conditions:
|
---|
| 83 |
|
---|
| 84 | %Create grid on boundary fist (because wi can not use mesh)
|
---|
| 85 | md.gridonboundary=zeros(md.numberofgrids,1);
|
---|
| 86 | pos=find(md.x==0 | md.y==0 | md.x==max(md.x) | md.y==max(md.y));
|
---|
| 87 | md.gridonboundary(pos)=1;
|
---|
| 88 |
|
---|
| 89 | disp(' boundary conditions for diagnostic model: ');
|
---|
| 90 | %Build gridonicefront, array of boundary grids belonging to the icefront:
|
---|
| 91 | gridinsideicefront=ArgusContourToMesh(md.elements,md.x,md.y,expread('Front.exp',1),'node',2);
|
---|
| 92 | gridonicefront=double(md.gridonboundary & gridinsideicefront);
|
---|
| 93 |
|
---|
| 94 | md.gridondirichlet_diag=zeros(md.numberofgrids,1);
|
---|
| 95 | pos=find(md.gridonboundary);md.gridondirichlet_diag(pos)=1;
|
---|
| 96 | md.dirichletvalues_diag=zeros(md.numberofgrids,2);
|
---|
| 97 |
|
---|
| 98 | %pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
|
---|
| 99 | %md.segmentonneumann_diag=md.segments(pos,:);
|
---|
| 100 | md.segmentonneumann_diag=zeros(0,3);
|
---|
| 101 | %md.neumannvalues_diag=NaN*ones(length(md.segmentonneumann_diag),1); %dynamic boundary conditions (water pressure)
|
---|
| 102 |
|
---|
| 103 | disp(' boundary conditions for prognostic model: ');
|
---|
| 104 | md.gridondirichlet_prog=zeros(md.numberofgrids,1);
|
---|
| 105 | md.dirichletvalues_prog=zeros(md.numberofgrids,1);
|
---|
| 106 | %pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
|
---|
| 107 | %md.segmentonneumann_prog=md.segments(pos,:);
|
---|
| 108 | md.segmentonneumann_prog=zeros(0,3);
|
---|
| 109 | md.neumannvalues_prog=zeros(size(md.segmentonneumann_prog,1),1);
|
---|
| 110 | md.neumannvalues_prog(:)=NaN; %free radiation
|
---|
| 111 |
|
---|
| 112 | %pos=find(gridonicefront(md.segments(:,1)) | gridonicefront(md.segments(:,2)));
|
---|
| 113 | %md.segmentonneumann_prog2=md.segments(pos,:);
|
---|
| 114 | md.segmentonneumann_prog2=zeros(0,3);
|
---|
| 115 | md.neumannvalues_prog2=zeros(size(md.segmentonneumann_prog2,1),1);
|
---|
| 116 | md.neumannvalues_prog2(:)=NaN; %free radiation
|
---|
| 117 |
|
---|
| 118 | disp(' boundary conditions for thermal model: ');
|
---|
| 119 | md.gridondirichlet_thermal=ones(md.numberofgrids,1); %surface temperature
|
---|
| 120 | md.dirichletvalues_thermal=md.observed_temperature;
|
---|
| 121 | md.geothermalflux=zeros(md.numberofgrids,1);
|
---|
| 122 | pos=find(md.elementonicesheet);md.geothermalflux(md.elements(pos,:))=50*10^-3; %50 mW/m^2
|
---|
| 123 |
|
---|
| 124 |
|
---|
| 125 |
|
---|
| 126 |
|
---|
| 127 | % Some Cielo code, ignore.
|
---|
| 128 | if strcmp(md.cluster,'yes')
|
---|
| 129 | ServerDisconnect;
|
---|
| 130 | end
|
---|