1 | import numpy
|
---|
2 | from model import *
|
---|
3 | from triangle import *
|
---|
4 | from setmask import *
|
---|
5 | from parameterize import *
|
---|
6 | from setflowequation import *
|
---|
7 | from EnumDefinitions import *
|
---|
8 | from solve import *
|
---|
9 | from MatlabFuncs import *
|
---|
10 |
|
---|
11 | """
|
---|
12 | Test on the diagnostic model and the prognostic in 2d
|
---|
13 | """
|
---|
14 |
|
---|
15 | printingflag=False
|
---|
16 |
|
---|
17 | #tests 3 and 4: using Glen's flow law
|
---|
18 | md=model()
|
---|
19 | md=triangle(md,'../Exp/SquareEISMINT.exp',3550.)
|
---|
20 | md=setmask(md,'all','')
|
---|
21 | md=parameterize(md,'../Par/SquareEISMINT.py')
|
---|
22 | md=setflowequation(md,'macayeal','all') #MacAyeal's model and 2d
|
---|
23 |
|
---|
24 | #Compute solution for MacAyeal's model
|
---|
25 | md.cluster=generic('name',oshostname(),'np',8)
|
---|
26 | md=solve(md,DiagnosticSolutionEnum())
|
---|
27 |
|
---|
28 | #plot results
|
---|
29 | vx=md.results.DiagnosticSolution.Vx
|
---|
30 | vy=md.results.DiagnosticSolution.Vy
|
---|
31 |
|
---|
32 | #plotmodel(md,'data',vx,'contourlevels',{0,20,40,60,60,100,120,140,160,180,-20,-40,-60,-80,-100,-120,-140,-160,-180}, ...
|
---|
33 | # 'contourcolor','k')
|
---|
34 | if printingflag:
|
---|
35 | pass
|
---|
36 | # set(gcf,'Color','w')
|
---|
37 | # printmodel('eismintdiag1vx','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off');
|
---|
38 | # system(['mv eismintdiag1vx.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf ']);
|
---|
39 |
|
---|
40 | #plotmodel(md,'data',vy,'contourlevels',{-100,-200,-300,-400,-500,-600,-700,-800,-900,-1000},...
|
---|
41 | # 'contourcolor','k')
|
---|
42 | if printingflag:
|
---|
43 | pass
|
---|
44 | # set(gcf,'Color','w')
|
---|
45 | # printmodel('eismintdiag1vy','png','margin','on','marginsize',25,'frame','off','resolution',2,'hardcopy','off');
|
---|
46 | # system(['mv eismintdiag1vy.png ' ISSM_DIR '/website/doc_pdf/validation/Images/EISMINT/IceShelf ']);
|
---|
47 |
|
---|
48 | #Fields and tolerances to track changes
|
---|
49 | field_names =['Vx','Vy']
|
---|
50 | field_tolerances=[1e-13,1e-13]
|
---|
51 | field_values=[\
|
---|
52 | vx, \
|
---|
53 | vy, \
|
---|
54 | ]
|
---|