| | 28 | }}} |
| | 29 | ThicknessCorrection is the following routine: |
| | 30 | |
| | 31 | {{{ |
| | 32 | #!m |
| | 33 | |
| | 34 | function md=ThicknessCorrection(md,distance) |
| | 35 | %THICKNESSCORRECTION - correct the thickness of the ice shelf near the grounding line |
| | 36 | % |
| | 37 | % This routine corrects the thickness and the bed on the transition zone |
| | 38 | % by forcing the hydrostatic equilibrium. |
| | 39 | % the thickness is modified as follows: |
| | 40 | % thickness = coeff * thickness_observation + (1-coeff) * thickness_hydrostatic |
| | 41 | % where: |
| | 42 | % coeff=(d/distance)^2; |
| | 43 | % distance=10km by default but can be specified |
| | 44 | % |
| | 45 | % Usage: |
| | 46 | % md=ThicknessCorrection(md,distance); |
| | 47 | % |
| | 48 | % Example: |
| | 49 | % md=ThicknessCorrection(md,15000); |
| | 50 | |
| | 51 | %initialize thickness with the observations, and get hydrostatic thickness from the dem |
| | 52 | thickness=md.thickness; |
| | 53 | thickness_hydro=md.surface/(1-md.rho_ice/md.rho_water); |
| | 54 | |
| | 55 | %get nodes on ice sheet and on ice shelf |
| | 56 | pos_shelf=find(~md.gridonicesheet); |
| | 57 | pos_GL=intersect(unique(md.elements(find(md.elementonicesheet),:)),unique(md.elements(find(md.elementoniceshelf),:))); |
| | 58 | debug=(length(pos_shelf)>50000); |
| | 59 | |
| | 60 | %modify thickness |
| | 61 | if (debug), fprintf('%s',' correction progress: 0.00 %'); end |
| | 62 | for i=1:length(pos_shelf) |
| | 63 | |
| | 64 | %search the grid on ice sheet the closest to i |
| | 65 | [d posd]=min(sqrt((md.x(pos_shelf(i))-md.x(pos_GL)).^2+(md.y(pos_shelf(i))-md.y(pos_GL)).^2)); |
| | 66 | |
| | 67 | if d>distance, |
| | 68 | |
| | 69 | %if d > 15km, hydrostatique equilibrium |
| | 70 | thickness(pos_shelf(i))=thickness_hydro(pos_shelf(i)); |
| | 71 | |
| | 72 | else |
| | 73 | |
| | 74 | %else: quadratic combination of hydrostatic equilibrium and observations (this line might be commented if the original thickness is good close to the GL) |
| | 75 | coeff=(d/distance)^2; |
| | 76 | thickness(pos_shelf(i))=(1-coeff)*thickness(pos_shelf(i))+coeff*thickness_hydro(pos_shelf(i)); |
| | 77 | |
| | 78 | end |
| | 79 | end |
| | 80 | |
| | 81 | %check the computed thickness |
| | 82 | minth=1/(1-md.rho_ice/md.rho_water); |
| | 83 | pos=find(isnan(md.thickness) | (md.thickness<=0)); |
| | 84 | thickness(pos)=minth; |
| | 85 | |
| | 86 | %change bed to take into account the changes in thickness |
| | 87 | md.thickness=thickness; |
| | 88 | md.bed=md.surface-md.thickness; |
| | 89 | }}} |