source:
issm/oecreview/Archive/20545-21336/ISSM-20742-20743.diff@
21337
Last change on this file since 21337 was 21337, checked in by , 8 years ago | |
---|---|
File size: 12.7 KB |
-
../trunk-jpl/examples/IceBridge/Greenland_cheatsheet.par
1 %Name and Coordinate system1 %Name and hemisphere 2 2 md.miscellaneous.name='SeaRISEgreenland'; 3 md.mesh.epsg=3413;4 3 4 5 5 disp(' Loading SeaRISE data from NetCDF'); 6 6 ncdata='../Data/Greenland_5km_dev1.2.nc'; 7 7 x1 = ncread(ncdata,'x1'); … … 43 43 bed_jks=InterpFromGridToMesh(bedx(1,:)',bedy(:,1),bed,xi,yi,NaN); 44 44 surf_jks=InterpFromGridToMesh(bedx(1,:)',bedy(:,1),surf,xi,yi,NaN); 45 45 in=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,... 46 ' ./Jak_grounded.exp','node',1);46 'Jak_grounded.exp','node',1); 47 47 bed_jks(~in)=NaN; 48 48 surf_jks(~in)=NaN; 49 49 pos=find(~isnan(bed_jks)); … … 65 65 md.initialization.temperature=InterpFromGridToMesh(x1,y1,temp,md.mesh.x,md.mesh.y,0)+273.15; 66 66 67 67 disp(' Interpolating surface mass balance'); 68 md.s mb.mass_balance=InterpFromGridToMesh(x1,y1,smb,md.mesh.x,md.mesh.y,0);69 md.s mb.mass_balance=md.smb.mass_balance*md.materials.rho_water/md.materials.rho_ice;68 md.surfaceforcings.mass_balance=InterpFromGridToMesh(x1,y1,smb,md.mesh.x,md.mesh.y,0); 69 md.surfaceforcings.mass_balance=md.surfaceforcings.mass_balance*md.materials.rho_water/md.materials.rho_ice; 70 70 71 71 disp(' Construct basal friction parameters'); 72 72 md.friction.coefficient=30*ones(md.mesh.numberofvertices,1); … … 83 83 84 84 disp(' Set other boundary conditions'); 85 85 md.mask.ice_levelset(md.mesh.vertexonboundary==1)=0; 86 md.basalforcings.groundedice_melting_rate = zeros(md.mesh.numberofvertices,1); 87 md.basalforcings.floatingice_melting_rate = zeros(md.mesh.numberofvertices,1); 86 md.basalforcings.melting_rate = zeros(md.mesh.numberofvertices,1); 88 87 md.thermal.spctemperature = [md.initialization.temperature;1]; %impose observed temperature on surface 89 88 md.masstransport.spcthickness = NaN*ones(md.mesh.numberofvertices,1); 90 89 -
../trunk-jpl/examples/IceBridge/Greenland.par
26 26 md.geometry.thickness(pos0)=1; 27 27 md.geometry.surface=md.geometry.thickness+md.geometry.base; 28 28 29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%30 %Reading IceBridge data for Jakobshavn31 disp(' reading IceBridge Jakobshavn bedrock');32 fid = fopen('../Data/Jakobshavn_2008_2011_Composite_XYZGrid.txt');33 titles = fgets(fid); data = fscanf(fid,'%g,%g,%g,%g,%g',[5 266400])';34 fclose(fid);35 36 [xi,yi]= ll2xy(md.mesh.lat,md.mesh.long,+1,45,70);37 bed = flipud(reshape(data(:,5),[360 740])); bed(find(bed==-9999))=NaN;38 bedy = flipud(reshape(data(:,1),[360 740]));39 bedx = flipud(reshape(data(:,2),[360 740]));40 41 %Insert Icebridge bed and recalculate thickness42 bed_jks=InterpFromGridToMesh(bedx(1,:)',bedy(:,1),bed,xi,yi,NaN);43 in=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,...44 './Jak_grounded.exp','node',1);45 bed_jks(~in)=NaN;46 pos=find(~isnan(bed_jks));47 md.geometry.base(pos)=bed_jks(pos);48 md.geometry.thickness=md.geometry.surface-md.geometry.base;49 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%50 51 29 disp(' Interpolating velocities '); 52 30 md.inversion.vx_obs = InterpFromGridToMesh(x1,y1,velx,md.mesh.x,md.mesh.y,0); 53 31 md.inversion.vy_obs = InterpFromGridToMesh(x1,y1,vely,md.mesh.x,md.mesh.y,0); … … 79 57 80 58 disp(' Set other boundary conditions'); 81 59 md.mask.ice_levelset(md.mesh.vertexonboundary==1)=0; 82 md.basalforcings.groundedice_melting_rate = zeros(md.mesh.numberofvertices,1);83 60 md.basalforcings.floatingice_melting_rate = zeros(md.mesh.numberofvertices,1); 61 md.basalforcings.groundedice_melting_rate = zeros(md.mesh.numberofvertices,1); 84 62 md.thermal.spctemperature = [md.initialization.temperature;1]; %impose observed temperature on surface 85 63 md.masstransport.spcthickness = NaN*ones(md.mesh.numberofvertices,1); 86 64 … … 90 68 disp(' Set Pressure'); 91 69 md.initialization.pressure=md.materials.rho_ice*md.constants.g*md.geometry.thickness; 92 70 93 disp(' Single point constraint for continental model');94 % Set at least one vertex to velocity 0 so as to not get a singular problem (point on the wet peninsula)71 disp(' Single point constraints'); 72 %Initialize single point constraint arrarys 95 73 md.stressbalance.referential=NaN*ones(md.mesh.numberofvertices,6); 96 74 md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices,1); 97 75 md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices,1); 98 76 md.stressbalance.spcvz = NaN*ones(md.mesh.numberofvertices,1); 99 location = 1.0e+06 *[.32011 -2.2039];100 [dist pos]=min(sqrt((md.mesh.x - location(1)).^2 + (md.mesh.y - location(2)).^2));101 md.stressbalance.spcvx(pos) = 0;102 md.stressbalance.spcvy(pos) = 0;103 md.stressbalance.spcvz(pos) = 0;104 77 -
../trunk-jpl/examples/IceBridge/runme.m
1 1 clear all; 2 close all; 2 3 steps=[1]; 3 4 4 5 %Location of SeaRISE dataset … … 20 21 vel = sqrt(vx.^2+vy.^2); 21 22 22 23 %Mesh greenland without refinement in Jak basin 23 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%24 24 md=bamg(md,'hmax',400000,'hmin',5000,'gradation',1.7,'field',vel,'err',8); 25 save ./Models/Greenland.Mesh_generation_old md;26 25 return; 27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 26 29 27 %Refine mesh in the region of Jakobshavn (resolution = 3000 m) 30 28 hmaxVertices=NaN*ones(md.mesh.numberofvertices,1); 31 29 in=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,... 32 ' ./Jak_outline.exp','node',1);30 'Jak_outline.exp','node',1); 33 31 hmaxVertices(find(in))=3000; 34 32 md=bamg(md,'hmax',400000,'hmin',5000,'gradation',1.7,'field',vel,... 35 33 'err',8,'hmaxVertices',hmaxVertices); … … 45 43 md = loadmodel('./Models/Greenland.Mesh_generation'); 46 44 47 45 md = setmask(md,'',''); 48 md = parameterize(md,'./Greenland.par'); 49 %md = parameterize(md,'./Greenland_noOIB.par'); 46 md = parameterize(md,'Greenland.par'); 50 47 md = setflowequation(md,'SSA','all'); 51 48 52 49 save ./Models/Greenland.Parameterization2 md; … … 76 73 md.inversion.min_parameters=1*ones(md.mesh.numberofvertices,1); 77 74 md.inversion.max_parameters=200*ones(md.mesh.numberofvertices,1); 78 75 in=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,... 79 ' ./data_gaps.exp','node',1);76 'data_gaps.exp','node',1); 80 77 md.inversion.cost_functions_coefficients(find(in),1)=0.0; 81 78 md.inversion.cost_functions_coefficients(find(in),2)=0.0; 82 79 … … 142 139 143 140 %Line Plots 144 141 figure 142 time_plot=md.results.TransientSolution(1).time:md.timestepping.time_step:md.timestepping.final_time; 145 143 146 144 %Plot surface mass balance 147 145 surfmb=[]; for i=1:100; surfmb=[surfmb ... 148 146 md.results.TransientSolution(i).SmbMassBalance]; end 149 subplot(3,1,1); plot( [0.2:0.2:20],mean(surfmb)); title('Mean Surface mass balance');147 subplot(3,1,1); plot(time_plot,mean(surfmb)); title('Mean Surface mass balance'); 150 148 151 149 %Plot velocity 152 150 vel=[]; for i=1:100; vel=[vel md.results.TransientSolution(i).Vel]; end 153 subplot(3,1,2); plot( [0.2:0.2:20],mean(vel)); title('Mean Velocity');151 subplot(3,1,2); plot(time_plot,mean(vel)); title('Mean Velocity'); 154 152 155 153 %Plot Volume 156 154 volume=[]; for i=1:100; volume=[volume md.results.TransientSolution(i).IceVolume]; end 157 subplot(3,1,3); plot( [0.2:0.2:20],volume); title('Ice Volume');155 subplot(3,1,3); plot(time_plot,volume); title('Ice Volume'); 158 156 xlabel('years') 159 157 end -
../trunk-jpl/examples/IceBridge/Greenland_solution.par
1 %Name and hemisphere 2 md.miscellaneous.name='SeaRISEgreenland'; 3 4 5 disp(' Loading SeaRISE data from NetCDF'); 6 ncdata='../Data/Greenland_5km_dev1.2.nc'; 7 x1 = ncread(ncdata,'x1'); 8 y1 = ncread(ncdata,'y1'); 9 usrf = ncread(ncdata,'usrf')'; 10 topg = ncread(ncdata,'topg')'; 11 velx = ncread(ncdata,'surfvelx')'; 12 vely = ncread(ncdata,'surfvely')'; 13 temp = ncread(ncdata,'airtemp2m')'; 14 smb = ncread(ncdata,'smb')'; 15 gflux = ncread(ncdata,'bheatflx')'; 16 17 disp(' Interpolating surface and bedrock'); 18 md.geometry.base = InterpFromGridToMesh(x1,y1,topg,md.mesh.x,md.mesh.y,0); 19 md.geometry.surface = InterpFromGridToMesh(x1,y1,usrf,md.mesh.x,md.mesh.y,0); 20 21 disp(' Constructing thickness'); 22 md.geometry.thickness=md.geometry.surface-md.geometry.base; 23 24 %Set min thickness to 1 meter 25 pos0=find(md.geometry.thickness<=0); 26 md.geometry.thickness(pos0)=1; 27 md.geometry.surface=md.geometry.thickness+md.geometry.base; 28 29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 30 %Reading IceBridge data for Jakobshavn 31 disp(' reading IceBridge Jakobshavn bedrock'); 32 fid = fopen('../Data/Jakobshavn_2008_2011_Composite_XYZGrid.txt'); 33 titles = fgets(fid); data = fscanf(fid,'%g,%g,%g,%g,%g',[5 266400])'; 34 fclose(fid); 35 36 [xi,yi]= ll2xy(md.mesh.lat,md.mesh.long,+1,45,70); 37 bed = flipud(reshape(data(:,5),[360 740])); bed(find(bed==-9999))=NaN; 38 surf = flipud(reshape(data(:,4),[360 740])); surf(find(surf==-9999))=NaN; 39 bedy = flipud(reshape(data(:,1),[360 740])); 40 bedx = flipud(reshape(data(:,2),[360 740])); 41 42 %Insert Icebridge bed and recalculate thickness 43 bed_jks=InterpFromGridToMesh(bedx(1,:)',bedy(:,1),bed,xi,yi,NaN); 44 surf_jks=InterpFromGridToMesh(bedx(1,:)',bedy(:,1),surf,xi,yi,NaN); 45 in=ContourToMesh(md.mesh.elements,md.mesh.x,md.mesh.y,... 46 'Jak_grounded.exp','node',1); 47 bed_jks(~in)=NaN; 48 surf_jks(~in)=NaN; 49 pos=find(~isnan(bed_jks)); 50 md.geometry.base(pos)=bed_jks(pos); 51 md.geometry.surface(pos)=surf_jks(pos); 52 md.geometry.thickness=md.geometry.surface-md.geometry.base; 53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 54 55 disp(' Interpolating velocities '); 56 md.inversion.vx_obs = InterpFromGridToMesh(x1,y1,velx,md.mesh.x,md.mesh.y,0); 57 md.inversion.vy_obs = InterpFromGridToMesh(x1,y1,vely,md.mesh.x,md.mesh.y,0); 58 md.inversion.vel_obs = sqrt(md.inversion.vx_obs.^2+md.inversion.vy_obs.^2); 59 md.initialization.vx = md.inversion.vx_obs; 60 md.initialization.vy = md.inversion.vy_obs; 61 md.initialization.vz = zeros(md.mesh.numberofvertices,1); 62 md.initialization.vel= md.inversion.vel_obs; 63 64 disp(' Interpolating temperatures'); 65 md.initialization.temperature=InterpFromGridToMesh(x1,y1,temp,md.mesh.x,md.mesh.y,0)+273.15; 66 67 disp(' Interpolating surface mass balance'); 68 md.surfaceforcings.mass_balance=InterpFromGridToMesh(x1,y1,smb,md.mesh.x,md.mesh.y,0); 69 md.surfaceforcings.mass_balance=md.surfaceforcings.mass_balance*md.materials.rho_water/md.materials.rho_ice; 70 71 disp(' Construct basal friction parameters'); 72 md.friction.coefficient=30*ones(md.mesh.numberofvertices,1); 73 pos=find(md.mask.groundedice_levelset<0); 74 md.friction.coefficient(pos)=0; %no friction applied on floating ice 75 md.friction.p=ones(md.mesh.numberofelements,1); 76 md.friction.q=ones(md.mesh.numberofelements,1); 77 78 disp(' Construct ice rheological properties'); 79 md.materials.rheology_n=3*ones(md.mesh.numberofelements,1); 80 md.materials.rheology_B=paterson(md.initialization.temperature); 81 md.friction.q=ones(md.mesh.numberofelements,1); 82 md.friction.p=ones(md.mesh.numberofelements,1); 83 84 disp(' Set other boundary conditions'); 85 md.mask.ice_levelset(md.mesh.vertexonboundary==1)=0; 86 md.basalforcings.melting_rate = zeros(md.mesh.numberofvertices,1); 87 md.thermal.spctemperature = [md.initialization.temperature;1]; %impose observed temperature on surface 88 md.masstransport.spcthickness = NaN*ones(md.mesh.numberofvertices,1); 89 90 disp(' Set geothermal heat flux'); 91 md.basalforcings.geothermalflux=InterpFromGridToMesh(x1,y1,gflux,md.mesh.x,md.mesh.y,0); 92 93 disp(' Set Pressure'); 94 md.initialization.pressure=md.materials.rho_ice*md.constants.g*md.geometry.thickness; 95 96 disp(' Single point constraint for continental model'); 97 %Set at least one vertex to velocity 0 so as to not get a singular problem (point on the wet peninsula) 98 md.stressbalance.referential=NaN*ones(md.mesh.numberofvertices,6); 99 md.stressbalance.spcvx = NaN*ones(md.mesh.numberofvertices,1); 100 md.stressbalance.spcvy = NaN*ones(md.mesh.numberofvertices,1); 101 md.stressbalance.spcvz = NaN*ones(md.mesh.numberofvertices,1); 102 location = 1.0e+06 *[.32011 -2.2039]; 103 [dist pos]=min(sqrt((md.mesh.x - location(1)).^2 + (md.mesh.y - location(2)).^2)); 104 md.stressbalance.spcvx(pos) = 0; 105 md.stressbalance.spcvy(pos) = 0; 106 md.stressbalance.spcvz(pos) = 0; 107
Note:
See TracBrowser
for help on using the repository browser.