| 1 | %This test is a test from the ISMP-HOM Intercomparison project
|
|---|
| 2 | %TestE
|
|---|
| 3 | %Four tests to run: - Pattyn frozen
|
|---|
| 4 | % - Stokes frozen
|
|---|
| 5 | % - Pattyn with some sliding
|
|---|
| 6 | % - Stokes with some sliding
|
|---|
| 7 | printingflag=false;
|
|---|
| 8 | results={};
|
|---|
| 9 |
|
|---|
| 10 | for i=1:4,
|
|---|
| 11 | Lx=10; %in m
|
|---|
| 12 | Ly=5000; %in m
|
|---|
| 13 | nx=3; %number of nodes in x direction
|
|---|
| 14 | ny=51;
|
|---|
| 15 | md=model;
|
|---|
| 16 | md=squaremesh(md,Lx,Ly,nx,ny);
|
|---|
| 17 | md=setmask(md,'',''); %ice sheet test
|
|---|
| 18 | md=parameterize(md,'../Par/ISMIPE.par');
|
|---|
| 19 | md=extrude(md,10,1);
|
|---|
| 20 |
|
|---|
| 21 | if i==1 | i==3,
|
|---|
| 22 | md=setflowequation(md,'pattyn','all');
|
|---|
| 23 | elseif i==2 | i==4,
|
|---|
| 24 | md=setflowequation(md,'stokes','all');
|
|---|
| 25 | end
|
|---|
| 26 |
|
|---|
| 27 | %Create MPCs to have periodic boundary conditions
|
|---|
| 28 | posx=find(md.mesh.x==0);
|
|---|
| 29 | posx2=find(md.mesh.x==max(md.mesh.x));
|
|---|
| 30 | md.diagnostic.vertex_pairing=[posx,posx2];
|
|---|
| 31 |
|
|---|
| 32 | %Create spcs on the bed
|
|---|
| 33 | pos=find(md.mesh.vertexonbed);
|
|---|
| 34 | md.diagnostic.spcvx=NaN*ones(md.mesh.numberofvertices,1);
|
|---|
| 35 | md.diagnostic.spcvy=NaN*ones(md.mesh.numberofvertices,1);
|
|---|
| 36 | md.diagnostic.spcvz=NaN*ones(md.mesh.numberofvertices,1);
|
|---|
| 37 | md.diagnostic.spcvx(pos)=0;
|
|---|
| 38 | md.diagnostic.spcvy(pos)=0;
|
|---|
| 39 | md.diagnostic.spcvz(pos)=0;
|
|---|
| 40 |
|
|---|
| 41 | %Remove the spc where there is some sliding (case 3 and 4):
|
|---|
| 42 | if i==3 | i==4,
|
|---|
| 43 | pos=find(md.mesh.y/max(md.mesh.y)>=0.44 & md.mesh.y/max(md.mesh.y)<=0.5);
|
|---|
| 44 | md.diagnostic.spcvx(pos)=NaN;
|
|---|
| 45 | md.diagnostic.spcvy(pos)=NaN;
|
|---|
| 46 | md.diagnostic.spcvz(pos)=NaN;
|
|---|
| 47 | end
|
|---|
| 48 |
|
|---|
| 49 | %Compute the diagnostic
|
|---|
| 50 | md.cluster=generic('name',oshostname(),'np',8);
|
|---|
| 51 | md=solve(md,DiagnosticSolutionEnum);
|
|---|
| 52 |
|
|---|
| 53 | vx=(md.results.DiagnosticSolution.Vx);
|
|---|
| 54 | vy=(md.results.DiagnosticSolution.Vy);
|
|---|
| 55 | vz=(md.results.DiagnosticSolution.Vz);
|
|---|
| 56 | results{i}=md.results.DiagnosticSolution;
|
|---|
| 57 |
|
|---|
| 58 | if i==1,
|
|---|
| 59 | plotmodel(md,'data',vy,'ylim',[-10 80],'layer',md.mesh.numberoflayers,'sectionvalue','../Exp/ISMIPE.exp','resolution',[10 10],'title','','xlabel','')
|
|---|
| 60 | if printingflag,
|
|---|
| 61 | set(gcf,'Color','w')
|
|---|
| 62 | printmodel('ismipepattynvxfrozen','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
|
|---|
| 63 | system(['mv ismipepattynvxfrozen.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestE ']);
|
|---|
| 64 | end
|
|---|
| 65 | elseif i==2,
|
|---|
| 66 | plotmodel(md,'data',vy,'ylim',[-10 80],'layer',md.mesh.numberoflayers,'sectionvalue','../Exp/ISMIPE.exp','resolution',[10 10],'title','','xlabel','')
|
|---|
| 67 | if printingflag,
|
|---|
| 68 | set(gcf,'Color','w')
|
|---|
| 69 | printmodel('ismipestokesvxfrozen','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
|
|---|
| 70 | system(['mv ismipestokesvxfrozen.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestE ']);
|
|---|
| 71 | end
|
|---|
| 72 | elseif i==3,
|
|---|
| 73 | plotmodel(md,'data',vy,'ylim',[-50 200],'layer',md.mesh.numberoflayers,'sectionvalue','../Exp/ISMIPE.exp','resolution',[10 10],'title','','xlabel','')
|
|---|
| 74 | if printingflag,
|
|---|
| 75 | set(gcf,'Color','w')
|
|---|
| 76 | printmodel('ismipepattynvxsliding','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
|
|---|
| 77 | system(['mv ismipepattynvxsliding.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestE ']);
|
|---|
| 78 | end
|
|---|
| 79 | elseif i==4,
|
|---|
| 80 | plotmodel(md,'data',vy,'ylim',[-50 200],'layer',md.mesh.numberoflayers,'sectionvalue','../Exp/ISMIPE.exp','resolution',[10 10],'title','','xlabel','')
|
|---|
| 81 | if printingflag,
|
|---|
| 82 | set(gcf,'Color','w')
|
|---|
| 83 | printmodel('ismipestokesvxsliding','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
|
|---|
| 84 | system(['mv ismipestokesvxsliding.png ' ISSM_DIR '/website/doc_pdf/validation/Images/ISMIP/TestE ']);
|
|---|
| 85 | end
|
|---|
| 86 | end
|
|---|
| 87 | end
|
|---|
| 88 | %Fields and tolerances to track changes
|
|---|
| 89 | field_names ={ ...
|
|---|
| 90 | 'VxPattynSliding','VyPattynSliding','VzPattynSliding',...
|
|---|
| 91 | 'VxStokesSliding','VyStokesSliding','VzStokesSliding',...
|
|---|
| 92 | 'VxPattynFrozen','VyPattynFrozen','VzPattynFrozen',...
|
|---|
| 93 | 'VxStokesFrozen','VyStokesFrozen','VzStokesFrozen'
|
|---|
| 94 | };
|
|---|
| 95 | field_tolerances={...
|
|---|
| 96 | 1e-06,1e-05,1e-05,...
|
|---|
| 97 | 1e-06,1e-06,1e-06,...
|
|---|
| 98 | 1e-06,1e-05,1e-04,...
|
|---|
| 99 | 1e-06,1e-06,1e-06,...
|
|---|
| 100 | };
|
|---|
| 101 | field_values={};
|
|---|
| 102 | for i=1:4,
|
|---|
| 103 | result=results{i};
|
|---|
| 104 | field_values={field_values{:},...
|
|---|
| 105 | (result.Vx),...
|
|---|
| 106 | (result.Vy),...
|
|---|
| 107 | (result.Vz),...
|
|---|
| 108 | };
|
|---|
| 109 | end
|
|---|