Changeset 24775
- Timestamp:
- 05/04/20 09:56:20 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/SandBox/test2004.m
r24764 r24775 7 7 %}}} 8 8 9 skipmesh=1;10 skipparameterization=0;11 12 9 %create sealevel model to hold our information: 13 if ~skipmesh,14 10 sl=sealevelmodel(); 15 %Create basins using boundaries from shapefile: %{{{ 11 12 %Create basins using boundaries from shapefile: 13 %some projections we'll rely on: %{{{ 14 proj4326=epsg2proj(4326); 15 proj3031=epsg2proj(3031); 16 %}}} 16 17 %HemisphereWest: {{{ 17 sl.addbasin(basin('continent','hemispherewest','name','hemispherewest','epsg',3587,'boundaries',{... %Peru projection 358718 boundary('shppath',shppath,'shpfilename','HemisphereSplit',' epsg',4326,'orientation','reverse'),...19 boundary('shppath',shppath,'shpfilename','NorthAntarctica',' epsg',3031),...20 boundary('shppath',shppath,'shpfilename','RonneBrunt',' epsg',3031,'orientation','reverse'),...21 boundary('shppath',shppath,'shpfilename','RonneEastSummit',' epsg',3031),...22 boundary('shppath',shppath,'shpfilename','RonneFront',' epsg',3031,'orientation','reverse'),...23 boundary('shppath',shppath,'shpfilename','RonneWestSummit',' epsg',3031),...24 boundary('shppath',shppath,'shpfilename','WestAntarctica2',' epsg',3031,'orientation','reverse'),...25 boundary('shppath',shppath,'shpfilename','SouthAntarctica',' epsg',3031)...18 sl.addbasin(basin('continent','hemispherewest','name','hemispherewest','proj',laea(0,-90),'boundaries',{... %Peru projection 3587 19 boundary('shppath',shppath,'shpfilename','HemisphereSplit','proj',proj4326,'orientation','reverse'),... 20 boundary('shppath',shppath,'shpfilename','NorthAntarctica','proj',proj3031),... 21 boundary('shppath',shppath,'shpfilename','RonneBrunt','proj',proj3031,'orientation','reverse'),... 22 boundary('shppath',shppath,'shpfilename','RonneEastSummit','proj',proj3031),... 23 boundary('shppath',shppath,'shpfilename','RonneFront','proj',proj3031,'orientation','reverse'),... 24 boundary('shppath',shppath,'shpfilename','RonneWestSummit','proj',proj3031),... 25 boundary('shppath',shppath,'shpfilename','WestAntarctica2','proj',proj3031,'orientation','reverse'),... 26 boundary('shppath',shppath,'shpfilename','SouthAntarctica','proj',proj3031)... 26 27 })); 27 28 %}}} 28 29 %HemisphereEast: {{{ 29 sl.addbasin(basin('continent','hemisphereeast','name','hemisphereeast','epsg',4462,'boundaries',{... %Australian projection lat,long 30 boundary('shppath',shppath,'shpfilename','HemisphereSplit','epsg',4326),... 31 boundary('shppath',shppath,'shpfilename','SouthAntarctica','epsg',3031),... 32 boundary('shppath',shppath,'shpfilename','EastAntarctica2','epsg',3031,'orientation','reverse'),... 33 boundary('shppath',shppath,'shpfilename','NorthAntarctica','epsg',3031)... 30 sl.addbasin(basin('continent','hemisphereeast','name','hemisphereeast','proj',laea(0,+90),'boundaries',{... %Australian projection lat,long 31 boundary('shppath',shppath,'shpfilename','HemisphereSplit','proj',proj4326),... 32 boundary('shppath',shppath,'shpfilename','SouthAntarctica','proj',proj3031),... 33 boundary('shppath',shppath,'shpfilename','EastAntarctica2','proj',proj3031,'orientation','reverse'),... 34 boundary('shppath',shppath,'shpfilename','NorthAntarctica','proj',proj3031)... 35 })); 36 %}}} 37 %Antarctica excluding Ronne: {{{ 38 sl.addbasin(basin('continent','antarctica','name','antarctica-grounded','proj',proj3031,'boundaries',{... 39 boundary('shppath',shppath,'shpfilename','NorthAntarctica','proj',proj3031),... 40 boundary('shppath',shppath,'shpfilename','EastAntarctica2','proj',proj3031),... 41 boundary('shppath',shppath,'shpfilename','SouthAntarctica','proj',proj3031),... 42 boundary('shppath',shppath,'shpfilename','WestAntarctica2','proj',proj3031)... 43 boundary('shppath',shppath,'shpfilename','RonneWestSummit','proj',proj3031)... 44 boundary('shppath',shppath,'shpfilename','RonneIceShelf','proj',proj3031)... 45 boundary('shppath',shppath,'shpfilename','RonneEastSummit','proj',proj3031)... 46 boundary('shppath',shppath,'shpfilename','RonneBrunt','proj',proj3031)... 34 47 })); 35 48 %}}} 36 %Antarctica excluding Ronne: {{{37 sl.addbasin(basin('continent','antarctica','name','antarctica-grounded','epsg',3031,'boundaries',{...38 boundary('shppath',shppath,'shpfilename','NorthAntarctica','epsg',3031),...39 boundary('shppath',shppath,'shpfilename','EastAntarctica2','epsg',3031),...40 boundary('shppath',shppath,'shpfilename','SouthAntarctica','epsg',3031),...41 boundary('shppath',shppath,'shpfilename','WestAntarctica2','epsg',3031)...42 boundary('shppath',shppath,'shpfilename','RonneWestSummit','epsg',3031)...43 boundary('shppath',shppath,'shpfilename','RonneIceShelf','epsg',3031)...44 boundary('shppath',shppath,'shpfilename','RonneEastSummit','epsg',3031)...45 boundary('shppath',shppath,'shpfilename','RonneBrunt','epsg',3031)...46 }));47 %}}}48 49 %Ronne: {{{ 49 sl.addbasin(basin('continent','antarctica','name','ronne','epsg',3031,'boundaries',{... 50 boundary('shppath',shppath,'shpfilename','RonneWestSummit','epsg',3031),... 51 boundary('shppath',shppath,'shpfilename','RonneIceShelf','epsg',3031),... 52 boundary('shppath',shppath,'shpfilename','RonneEastSummit','epsg',3031),... 53 boundary('shppath',shppath,'shpfilename','RonneFront','epsg',3031,'orientation','reverse')... 54 })); 55 %}}} 56 %}}} 50 sl.addbasin(basin('continent','antarctica','name','ronne','proj',proj3031,'boundaries',{... 51 boundary('shppath',shppath,'shpfilename','RonneWestSummit','proj',proj3031),... 52 boundary('shppath',shppath,'shpfilename','RonneIceShelf','proj',proj3031),... 53 boundary('shppath',shppath,'shpfilename','RonneEastSummit','proj',proj3031),... 54 boundary('shppath',shppath,'shpfilename','RonneFront','proj',proj3031,'orientation','reverse')... 55 })); 56 %}}} 57 58 %Meshing 57 59 %Go through basins and mesh: %{{{ 58 60 %meshing parameters: {{{ 59 hmin= 500; hmax=2000; hmin=hmin*1000; hmax=hmax*1000;61 hmin=2000; hmax=10000; hmin=hmin*1000; hmax=hmax*1000; 60 62 tolerance=100; %tolerance of 100m on Earth position when mergin 3d meshes 61 threshold= 1;63 threshold=5; 62 64 defaultoptions={'KeepVertices',0,'MaxCornerAngle',0.0000000001,'NoBoundaryRefinment',1}; 63 65 alreadyloaded=0; … … 79 81 80 82 %miscellaneous: 81 md.mesh. epsg=bas.epsg; md.miscellaneous.name=bas.name;83 md.mesh.proj=bas.proj; md.miscellaneous.name=bas.name; 82 84 83 85 %recover mask where we have land: … … 91 93 end 92 94 %}}} 93 end 94 if ~skipparameterization, 95 96 %Parameterization: 95 97 %Parameterize ice sheets : {{{ 96 98 … … 123 125 end 124 126 if bas.isnameany('ronne'), 125 127 126 128 md.mask.groundedice_levelset=-ones(md.mesh.numberofvertices,1); 127 129 … … 133 135 %}}} 134 136 %latlong: % {{{ 135 [md.mesh.long,md.mesh.lat]=gdaltransform(md.mesh.x,md.mesh.y, sprintf('EPSG:%i',md.mesh.epsg),'EPSG:4326');137 [md.mesh.long,md.mesh.lat]=gdaltransform(md.mesh.x,md.mesh.y,md.mesh.proj,'EPSG:4326'); 136 138 %}}} 137 139 %geometry: {{{ … … 190 192 191 193 %recover lat,long: 192 [md.mesh.long,md.mesh.lat]=gdaltransform(md.mesh.x,md.mesh.y, sprintf('EPSG:%i',md.mesh.epsg),'EPSG:4326');194 [md.mesh.long,md.mesh.lat]=gdaltransform(md.mesh.x,md.mesh.y,md.mesh.proj,'EPSG:4326'); 193 195 194 196 %mask: %{{{ … … 244 246 %grounded ice: 245 247 md.mask.groundedice_levelset=-ones(md.mesh.numberofvertices,1); 246 248 247 249 md.mask.glacier_levelset=zeros(md.mesh.numberofvertices,1); 248 250 … … 252 254 253 255 md.slr.sealevel=zeros(md.mesh.numberofvertices,1); 256 md.slr.deltathickness=zeros(md.mesh.numberofelements,1); 254 257 md.slr.spcthickness=NaN*ones(md.mesh.numberofvertices,1); 255 258 md.slr.Ngia=zeros(md.mesh.numberofvertices,1); … … 275 278 end 276 279 % }}} 277 end 278 % Assemble Earth in 3D {{{280 281 %%Assemble Earth in 3D {{{ 279 282 280 283 %parameters: … … 287 290 288 291 %figure out how each icecap's mesh connects to the larger earth mesh: 289 sl.intersections( );292 sl.intersections('force',1); 290 293 291 294 %figure out connectivity: … … 307 310 sl.transfer('mesh.long'); 308 311 sl.transfer('slr.deltathickness'); 312 sl.transfer('slr.spcthickness'); 309 313 sl.transfer('slr.Ngia'); 310 314 sl.transfer('slr.Ugia'); 311 error; 315 sl.transfer('slr.hydro_rate'); 316 sl.transfer('slr.sealevel'); 317 sl.transfer('dsl.sea_surface_height_change_above_geoid'); 318 sl.transfer('dsl.sea_water_pressure_change_at_sea_floor'); 312 319 313 320 %radius: … … 315 322 316 323 %check on the mesh transitions: {{{ 324 plotting=1; 317 325 if plotting, 318 flags=ones(sl.earth.mesh.numberof vertices,1);319 for i=1:length(sl. transitions),320 flags(sl. transitions{i})=i;326 flags=ones(sl.earth.mesh.numberofelements,1); 327 for i=1:length(sl.eltransitions), 328 flags(sl.eltransitions{i})=i; 321 329 end 322 330 plotmodel(sl.earth,'data',flags,'shading','faceted','coastline','on','coast_color','g') … … 325 333 326 334 % }}} 327 error; 335 328 336 %Solve Sea-level equation on Earth only: {{{ 329 337 md=sl.earth; %we don't do computations on ice sheets or land. 338 339 %Materials: 340 md.materials=materials('hydro'); 330 341 331 342 %elastic loading from love numbers: … … 340 351 341 352 %New stuff 342 md.slr.spcthickness = NaN(md.mesh.numberofvertices,1); 343 md.slr.Ngia = zeros(md.mesh.numberofvertices,1); 344 md.slr.Ugia = zeros(md.mesh.numberofvertices,1); 353 md.dsl.global_average_thermosteric_sea_level_change=[0;0]; 345 354 346 355 %Solution parameters … … 349 358 md.slr.geodetic=1; 350 359 360 %eustatic: 361 md.slr.rigid=0; md.slr.elastic=0; md.slr.rotation=0; 362 md.cluster=generic('name',oshostname(),'np',10); 363 md=solve(md,'Sealevelrise'); 364 351 365 %eustatic + rigid + elastic run: 352 366 md.slr.rigid=1; md.slr.elastic=1; md.slr.rotation=0; 353 md.cluster=generic('name',oshostname(),'np', 3);354 %md.verbose=verbose('111111111');367 md.cluster=generic('name',oshostname(),'np',16); 368 md.verbose=verbose('111111111'); 355 369 md=solve(md,'Sealevelrise'); 356 370 SnoRotation=md.results.SealevelriseSolution.Sealevel;
Note:
See TracChangeset
for help on using the changeset viewer.