Changeset 23898
- Timestamp:
- 04/26/19 21:15:26 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/NightlyRun/test4003.m
r23890 r23898 4 4 %Script control parameters 5 5 steps=[1 2 3 4 5 6 7 8 9 10 11 12]; 6 steps=[ 7 8 9 10]; 6 7 final_time=1/365; 7 8 … … 161 162 if perform(org,'CreateMesh'), 162 163 163 loaddata(org,'Parameters');164 loaddata(org,'Bathymetry');165 loaddata(org,'IceSheetGeometry');166 167 164 %create model: 168 165 md=model(); 169 166 170 167 %Grab lat,long from MITgcm: 171 lat=lat(:); 172 long=long(:); 168 long=readbin('run/XG.data',[3 200]); 169 long=[long long(:,end)]; long=[long; -105.0*ones(1,size(long,2))]; 170 lat=readbin('run/YG.data',[3 200]); 171 lat=[lat -73.8832*ones(size(lat,1),1)]; lat=[lat; lat(end,:)]; 173 172 174 173 %project lat,long: 175 %[x,y]=ll2xy(lat,long,-1); 176 x=long; 177 y=lat; 178 174 [x,y]=ll2xy(lat(:),long(:),-1); 175 176 Nx=size(lat,1); Ny=size(lat,2) 179 177 index=[]; 180 178 % C D … … 193 191 %fill mesh and model: 194 192 md=meshconvert(md,index,x,y); 195 md.mesh.lat=lat ;196 md.mesh.long=long ;193 md.mesh.lat=lat(:); 194 md.mesh.long=long(:); 197 195 198 196 savemodel(org,md); … … 203 201 if perform(org,'MeshGeometry'), 204 202 205 loaddata(org,'Parameters');206 203 loaddata(org,'CreateMesh'); 207 loaddata(org,'Bathymetry');208 loaddata(org,'IceSheetGeometry');209 204 210 205 %transfer to vertices: 211 bathymetry=bathymetry(:); 212 iceshelf_mask=iceshelf_mask(:); 213 ice_mask=ice_mask(:); 214 thickness=thickness(:); 215 draft=draft(:); 206 bathymetry=readbin('run/bathy.box',[3 200],1,'real*8'); 207 bathymetry=[bathymetry bathymetry(:,end)]; bathymetry=[bathymetry(1,:); bathymetry]; 208 iceshelf_mask=-1*ones(size(bathymetry)); 209 ice_mask=readbin('run/hmask3.box',[3 200],1,'real*8'); 210 ice_mask=[ice_mask ice_mask(:,end)]; ice_mask=[ice_mask(1,:); ice_mask]; 211 thickness=readbin('run/h0.bin',[3 200],1,'real*8'); 212 thickness=[thickness thickness(:,end)]; thickness=[thickness; thickness(end,:)]; 216 213 217 214 %start filling some of the fields 218 md.geometry.bed=bathymetry; 219 md.geometry.thickness=thickness; 220 md.geometry.base=md.geometry.bed; 221 pos=find(iceshelf_mask); md.geometry.base(pos)=draft(pos); 215 md.geometry.bed=bathymetry(:); 216 md.geometry.thickness=thickness(:); 217 md.geometry.base=-917/1028*md.geometry.thickness; 222 218 md.geometry.surface=md.geometry.base+md.geometry.thickness; 223 219 224 220 %nothing passes icefront: 225 pos=find( ~ice_mask);221 pos=find((~ice_mask(:) & ice_mask(:)~=0) | thickness(:)==0); 226 222 md.geometry.thickness(pos)=1; 227 223 md.geometry.surface(pos)=(1-di)*md.geometry.thickness(pos); … … 229 225 230 226 %level sets: 231 md.mask.groundedice_levelset=-ones(md.mesh.numberofvertices,1); 232 md.mask.ice_levelset=ones(md.mesh.numberofvertices,1); 233 234 pos=find(ice_mask); md.mask.ice_levelset(pos)=-1; 235 pos=find(~iceshelf_mask & ice_mask); md.mask.groundedice_levelset(pos)=1; 236 237 %identify edges of grounded ice: 238 groundedice_levelset=md.mask.groundedice_levelset; 239 for i=1:md.mesh.numberofelements, 240 m=groundedice_levelset(md.mesh.elements(i,:)); 241 if abs(sum(m))~=3, 242 pos=find(m==1); md.mask.groundedice_levelset(md.mesh.elements(i,pos))=0; 243 end 244 end 245 246 %identify edges of ice: 247 ice_levelset=md.mask.ice_levelset; 248 for i=1:md.mesh.numberofelements, 249 m=ice_levelset(md.mesh.elements(i,:)); 250 if abs(sum(m))~=3, 251 pos=find(m==-1); md.mask.ice_levelset(md.mesh.elements(i,pos))=0; 252 end 253 end 227 md.mask.groundedice_levelset=iceshelf_mask(:); 228 md.mask.ice_levelset=-ones(md.mesh.numberofvertices,1); 229 230 pos=find(~ice_mask(:) & thickness(:)==0); md.mask.ice_levelset(pos)=1; 254 231 255 232 savemodel(org,md); … … 259 236 if perform(org,'ParameterizeIce'), 260 237 261 loaddata(org,'Parameters');262 loaddata(org,'CreateMesh');263 238 loaddata(org,'MeshGeometry'); 264 239 265 240 %miscellaneous 266 md.miscellaneous.name='test400 2';241 md.miscellaneous.name='test4003'; 267 242 268 243 %initial velocity: … … 281 256 md.initialization.temperature=(273.15-22)*ones(md.mesh.numberofvertices,1); 282 257 md.initialization.pressure=md.materials.rho_ice*md.constants.g*(md.geometry.surface-md.geometry.base); 283 md.smb.mass_balance = [ 1*ones(md.mesh.numberofvertices,1); 1];258 md.smb.mass_balance = [0*ones(md.mesh.numberofvertices,1); 1]; 284 259 285 260 %Flow law … … 297 272 md.masstransport.spcthickness=NaN*ones(md.mesh.numberofvertices,1); 298 273 299 %deal with water: 300 pos=find(md.mask.ice_levelset>0); 301 md.stressbalance.spcvx(pos)=0; 274 %get some flux at the ice divide: 275 pos=find(md.mesh.lat==min(md.mesh.lat)); 276 md.masstransport.spcthickness(pos)=md.geometry.thickness(pos); 277 md.stressbalance.spcvx(pos)=-800; 302 278 md.stressbalance.spcvy(pos)=0; 303 md.stressbalance.spcvz(pos)=0;304 md.masstransport.spcthickness(pos)=0;305 306 %get some flux at the ice divide:307 pos=find(md.mesh.y==min(md.mesh.y));308 md.masstransport.spcthickness(pos)=md.geometry.thickness(pos);309 md.stressbalance.spcvx(pos)=0;310 md.stressbalance.spcvy(pos)=1500;311 279 312 280 %deal with boundaries, excluding icefront: 313 vertex_on_boundary=zeros(md.mesh.numberofvertices,1); 314 vertex_on_boundary(md.mesh.segments(:,1:2))=1; 315 pos=find(vertex_on_boundary & md.mask.groundedice_levelset<=0); 316 md.stressbalance.spcvx(pos)=0; 281 pos=find(md.mesh.long==min(md.mesh.long) | md.mesh.long==max(md.mesh.long)); 282 md.stressbalance.spcvy(pos)=0; 283 284 point1=find(md.mesh.y==min(md.mesh.y)); point2=find(md.mesh.x==max(md.mesh.x)); 285 costheta=(md.mesh.x(point2)-md.mesh.x(point1))/sqrt((md.mesh.x(point2)-md.mesh.x(point1)).^2+(md.mesh.y(point2)-md.mesh.y(point1)).^2); 286 sintheta=(md.mesh.y(point2)-md.mesh.y(point1))/sqrt((md.mesh.x(point2)-md.mesh.x(point1)).^2+(md.mesh.y(point2)-md.mesh.y(point1)).^2); 287 md.stressbalance.referential(:,1:3)=repmat([costheta,sintheta,0],md.mesh.numberofvertices,1); 288 md.stressbalance.referential(:,4:6)=repmat([-sintheta,costheta,0],md.mesh.numberofvertices,1); 317 289 318 290 md.basalforcings.groundedice_melting_rate=zeros(md.mesh.numberofvertices,1); … … 335 307 %timestepping: 336 308 md.timestepping.final_time=100; 337 md.timestepping.time_step= 1;309 md.timestepping.time_step=0.25; 338 310 md.transient.isgroundingline=0; 339 311 md.transient.isthermal=0; … … 346 318 347 319 savemodel(org,md); 320 321 plotmodel(md,'data',md.results.TransientSolution(end).Vel,'data',md.results.TransientSolution(end).Thickness) 348 322 end 349 323 % }}}
Note:
See TracChangeset
for help on using the changeset viewer.