Changeset 25937
- Timestamp:
- 01/14/21 16:11:11 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/examples/SlrGRACE/runme.m
r25915 r25937 2 2 addpath('../Data','../Functions'); 3 3 4 steps=[1:7]; 5 6 try 7 % [1:7] 4 steps=[6]; 8 5 9 6 if any(steps==1) %{{{ … … 11 8 12 9 numrefine=1; 13 resolution= 150*1e3; % inital resolution [m]10 resolution=300*1e3; % inital resolution [m] 14 11 radius = 6.371012*10^6; % mean radius of Earth, m 15 12 mindistance_coast=150*1e3; % coastal resolution [m] … … 22 19 for i=1:numrefine, 23 20 24 md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long);21 ocean_mask=gmtmask(md.mesh.lat,md.mesh.long); 25 22 26 23 distance=zeros(md.mesh.numberofvertices,1); 27 24 28 pos=find(~ md.mask.ocean_levelset); coaste.lat=md.mesh.lat(pos); coaste.long=md.mesh.long(pos);29 pos=find( md.mask.ocean_levelset); coasto.lat=md.mesh.lat(pos); coasto.long=md.mesh.long(pos);25 pos=find(~ocean_mask); coaste.lat=md.mesh.lat(pos); coaste.long=md.mesh.long(pos); 26 pos=find(ocean_mask); coasto.lat=md.mesh.lat(pos); coasto.long=md.mesh.long(pos); 30 27 31 28 for j=1:md.mesh.numberofvertices 32 29 phi1=md.mesh.lat(j)/180*pi; lambda1=md.mesh.long(j)/180*pi; 33 if md.mask.ocean_levelset(j),30 if ocean_mask(j), 34 31 phi2=coaste.lat/180*pi; lambda2=coaste.long/180*pi; 35 32 deltaphi=abs(phi2-phi1); deltalambda=abs(lambda2-lambda1); … … 44 41 pos=find(distance<mindistance_coast); distance(pos)=mindistance_coast; 45 42 46 pos2=find( md.mask.ocean_levelset~=1 & distance>mindistance_land);43 pos2=find(ocean_mask~=1 & distance>mindistance_land); 47 44 distance(pos2)=mindistance_land; 48 45 … … 51 48 end 52 49 53 md.mask.ocean_levelset=gmtmask(md.mesh.lat,md.mesh.long); 50 ocean_mask=gmtmask(md.mesh.lat,md.mesh.long); 51 pos = find(ocean_mask==0); 52 md.mask.ocean_levelset=-ones(md.mesh.numberofvertices,1); 53 md.mask.ocean_levelset(pos)=1; 54 54 55 55 save ./Models/SlrGRACE_Mesh md; … … 67 67 water_load = grace(md.mesh.elements,md.mesh.lat,md.mesh.long,time_range(1),time_range(2)); 68 68 69 md.s lr.deltathickness= water_load*md.materials.rho_freshwater/md.materials.rho_ice;69 md.solidearth.surfaceload.icethicknesschange = water_load*md.materials.rho_freshwater/md.materials.rho_ice; 70 70 71 71 save ./Models/SlrGRACE_Loads md; 72 72 73 plotmodel (md,'data',md.s lr.deltathickness,'view',[90 -90],'caxis',[-.1 .1],'title','Ice height equivalent [m]');73 plotmodel (md,'data',md.solidearth.surfaceload.icethicknesschange,'view',[90 -90],'caxis',[-.1 .1],'title','Ice height equivalent [m]'); 74 74 end %}}} 75 75 … … 80 80 md.solidearth.lovenumbers = lovenumbers('maxdeg',10000); 81 81 82 md.mask.ocean_levelset = ones(md.mesh.numberofvertices,1); 83 md.mask.ice_levelset = ones(md.mesh.numberofvertices,1); 84 pos=find(md.slr.deltathickness~=0); 85 md.mask.ice_levelset(md.mesh.elements(pos,:))=-1; 86 md.mask.land_levelset = 1-md.mask.ocean_levelset; 87 88 md.slr.sealevel=zeros(md.mesh.numberofvertices,1); 89 md.slr.steric_rate=zeros(md.mesh.numberofvertices,1); 90 md.slr.ocean_area_scaling = 1; 91 92 di=md.materials.rho_ice/md.materials.rho_water; 93 md.geometry.thickness=ones(md.mesh.numberofvertices,1); 94 md.geometry.surface=(1-di)*zeros(md.mesh.numberofvertices,1); 95 md.geometry.base=md.geometry.surface-md.geometry.thickness; 96 md.geometry.bed=md.geometry.base; 82 md.mask.ice_levelset=-md.mask.ocean_levelset; 83 84 md.solidearth.initialsealevel=zeros(md.mesh.numberofvertices,1); 85 md.dsl.global_average_thermosteric_sea_level_change=[0;0]; 86 md.dsl.sea_surface_height_change_above_geoid=zeros(md.mesh.numberofvertices+1,1); 87 md.dsl.sea_water_pressure_change_at_sea_floor=zeros(md.mesh.numberofvertices+1,1); 88 89 md.solidearth.settings.ocean_area_scaling=1; 90 91 % arbitary to pass consistency check. 92 md.geometry.bed=-ones(md.mesh.numberofvertices,1); 93 md.geometry.surface=ones(md.mesh.numberofvertices,1); 94 md.geometry.base=md.geometry.bed; 95 md.geometry.thickness=md.geometry.surface-md.geometry.base; 97 96 98 97 md.initialization.temperature=273.25*ones(md.mesh.numberofvertices,1); … … 109 108 md = loadmodel('./Models/SlrGRACE_Parameterization'); 110 109 111 md.slr.rigid=1; 112 md.slr.elastic=1; 113 md.slr.rotation=1; 110 md.solidearth.settings.rigid=1; 111 md.solidearth.settings.elastic=1; 112 md.solidearth.settings.rotation=1; 113 114 md.solidearth.requested_outputs = {'Sealevel','SealevelRSL'}; 114 115 115 116 md.cluster=generic('name',oshostname(),'np',3); … … 125 126 md = loadmodel('./Models/SlrGRACE_Solution'); 126 127 127 sol1 = md.s lr.deltathickness*100; % [cm]128 sol2 = md.results.SealevelriseSolution.Sealevel *1000; % [mm]128 sol1 = md.solidearth.surfaceload.icethicknesschange*100; % [cm] 129 sol2 = md.results.SealevelriseSolution.SealevelRSL*1000; % [mm] 129 130 130 131 sol_name={'Change in water equivalent height [cm]', 'Relative sea-level [mm]'}; … … 190 191 191 192 [ne,nt]=size(water_load); 192 md.s lr.deltathickness= zeros(ne+1,nt);193 md.s lr.deltathickness(1:ne,:) = water_load*md.materials.rho_freshwater/md.materials.rho_ice;194 md.s lr.deltathickness(ne+1,:)=[1:nt]; % times193 md.solidearth.surfaceload.icethicknesschange = zeros(ne+1,nt); 194 md.solidearth.surfaceload.icethicknesschange(1:ne,:) = water_load*md.materials.rho_freshwater/md.materials.rho_ice; 195 md.solidearth.surfaceload.icethicknesschange(ne+1,:)=[1:nt]; % times 195 196 196 197 md.transient.issmb=0;
Note:
See TracChangeset
for help on using the changeset viewer.