Changeset 5567


Ignore:
Timestamp:
08/25/10 09:19:31 (15 years ago)
Author:
seroussi
Message:

fixed teste ismip pattyun and stokes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/test/NightlyRun/test1109.m

    r5178 r5567  
    11%This test is a test from the ISMP-HOM Intercomparison project
    22%TestE
    3 Lx=10; %in m
    4 Ly=5000; %in m
    5 nx=3; %number of nodes in x direction
    6 ny=51;
    7 md=model;
    8 md=squaremesh(md,Lx,Ly,nx,ny);
    9 md=geography(md,'',''); %ice sheet test
    10 md=parameterize(md,'../Par/ISMIPE.par');
    11 md=extrude(md,10,1);
     3%Four tests to run: - Pattyn frozen
     4%                   - Stokes frozen
     5%                   - Pattyn with some sliding
     6%                   - Stokes with some sliding
     7printingflag=true;
     8results={};
    129
    13 md=setelementstype(md,'pattyn','all');
    14 %md=setelementstype(md,'pattyn','all','stokes','all');
     10for 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=geography(md,'',''); %ice sheet test
     18        md=parameterize(md,'../Par/ISMIPE.par');
     19        md=extrude(md,10,1);
    1520
    16 %md.gridonstokes(find(md.x==0 | md.x==Lx))=0;
    17 %%Create MPCs to have periodic boundary conditions
    18 %posx=find(md.x==0);
    19 %posx2=find(md.x==max(md.x));
    20 %
    21 %md.penalties=[posx,posx2];
     21        if i==1 | i==3,
     22                md=setelementstype(md,'pattyn','all');
     23        elseif i==2 | i==4,
     24                md=setelementstype(md,'stokes','all');
     25        end
    2226
    23 %Compute the diagnostic
    24 md=solve(md,'analysis_type',DiagnosticSolutionEnum);
     27        %Create MPCs to have periodic boundary conditions
     28        posx=find(md.x==0);
     29        posx2=find(md.x==max(md.x));
     30        md.penalties=[posx,posx2];
    2531
    26 vx=PatchToVec(md.results.DiagnosticSolution.Vx);
    27 vy=PatchToVec(md.results.DiagnosticSolution.Vy);
    28 vz=PatchToVec(md.results.DiagnosticSolution.Vz);
     32        %Create spcs on the bed
     33        pos=find(md.gridonbed);
     34        md.spcvelocity=zeros(md.numberofgrids,6);
     35        md.spcvelocity(pos,1:3)=1;
    2936
    30 plotmodel(md,'data',vx,'data',vy,'data',vz,'layer#all',md.numlayers)
     37        %Remove the spc where there is some sliding (case 3 and 4):
     38        if i==3 | i==4,
     39                pos=find(md.y/max(md.y)>=0.44 & md.y/max(md.y)<=0.5);
     40                md.spcvelocity(pos,1:3)=0;
     41        end
     42
     43        %Compute the diagnostic
     44        md=solve(md,'analysis_type',DiagnosticSolutionEnum);
     45
     46        vx=PatchToVec(md.results.DiagnosticSolution.Vx);
     47        vy=PatchToVec(md.results.DiagnosticSolution.Vy);
     48        vz=PatchToVec(md.results.DiagnosticSolution.Vz);
     49        results{i}=md.results.DiagnosticSolution;
     50
     51        if i==1,
     52                plotmodel(md,'data',vy,'ylim',[-10 80],'layer',md.numlayers,'sectionvalue','../Exp/ISMIPE.exp','resolution',[10 10],'title','','xlabel','')
     53                set(gcf,'Color','w')
     54                printmodel('ismipepattynvxfrozen','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     55                system(['mv ismipepattynvxfrozen.png ' ISSM_DIR '/../website/doc_pdf/validation/Images/ISMIP/TestE ']);
     56        elseif i==2,
     57                plotmodel(md,'data',vy,'ylim',[-10 80],'layer',md.numlayers,'sectionvalue','../Exp/ISMIPE.exp','resolution',[10 10],'title','','xlabel','')
     58                set(gcf,'Color','w')
     59                printmodel('ismipestokesvxfrozen','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     60                system(['mv ismipestokesvxfrozen.png ' ISSM_DIR '/../website/doc_pdf/validation/Images/ISMIP/TestE ']);
     61        elseif i==3,
     62                plotmodel(md,'data',vy,'ylim',[-50 200],'layer',md.numlayers,'sectionvalue','../Exp/ISMIPE.exp','resolution',[10 10],'title','','xlabel','')
     63                set(gcf,'Color','w')
     64                printmodel('ismipepattynvxsliding','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     65                system(['mv ismipepattynvxsliding.png ' ISSM_DIR '/../website/doc_pdf/validation/Images/ISMIP/TestE ']);
     66        elseif i==4,
     67                plotmodel(md,'data',vy,'ylim',[-50 200],'layer',md.numlayers,'sectionvalue','../Exp/ISMIPE.exp','resolution',[10 10],'title','','xlabel','')
     68                set(gcf,'Color','w')
     69                printmodel('ismipestokesvxsliding','png','margin','on','marginsize',25,'frame','off','resolution',1.5,'hardcopy','off');
     70                system(['mv ismipestokesvxsliding.png ' ISSM_DIR '/../website/doc_pdf/validation/Images/ISMIP/TestE ']);
     71        end
     72end
     73%Fields and tolerances to track changes
     74field_names     ={ ...
     75        'VxPattynSliding','VyPattynSliding','VzPattynSliding',...
     76        'VxStokesSliding','VyStokesSliding','VzStokesSliding',...
     77        'VxPattynFrozen','VyPattynFrozen','VzPattynFrozen',...
     78        'VxStokesFrozen','VyStokesFrozen','VzStokesFrozen'
     79};
     80field_tolerances={...
     81        1e-13,1e-13,1e-13,...
     82        1e-13,1e-13,1e-13,...
     83        1e-13,1e-13,1e-13,...
     84        1e-13,1e-13,1e-13,...
     85};
     86field_values={};
     87for i=1:4,
     88        result=results{i};
     89        field_values={field_values{:},...
     90                PatchToVec(result.Vx),...
     91                PatchToVec(result.Vy),...
     92                PatchToVec(result.Vz),...
     93                };
     94end
Note: See TracChangeset for help on using the changeset viewer.