1 | import os.path
|
---|
2 | import inspect
|
---|
3 | from arch import *
|
---|
4 | import numpy
|
---|
5 | from verbose import verbose
|
---|
6 | from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
|
---|
7 | from paterson import paterson
|
---|
8 | from SetMarineIceSheetBC import SetMarineIceSheetBC
|
---|
9 |
|
---|
10 | #Start defining model parameters here
|
---|
11 |
|
---|
12 | #Geometry and observation
|
---|
13 | x = numpy.array(archread('../Data/Pig.arch','x'))
|
---|
14 | y = numpy.array(archread('../Data/Pig.arch','y'))
|
---|
15 | vx_obs = numpy.array(archread('../Data/Pig.arch','vx_obs'))
|
---|
16 | vy_obs = numpy.array(archread('../Data/Pig.arch','vy_obs'))
|
---|
17 | index = numpy.array(archread('../Data/Pig.arch','index')).astype(int)
|
---|
18 | surface = numpy.array(archread('../Data/Pig.arch','surface'))
|
---|
19 | thickness = numpy.array(archread('../Data/Pig.arch','thickness'))
|
---|
20 |
|
---|
21 | [md.inversion.vx_obs] =InterpFromMeshToMesh2d(index,x,y,vx_obs,md.mesh.x,md.mesh.y)
|
---|
22 | [md.inversion.vy_obs] =InterpFromMeshToMesh2d(index,x,y,vy_obs,md.mesh.x,md.mesh.y)
|
---|
23 | [md.geometry.surface] =InterpFromMeshToMesh2d(index,x,y,surface,md.mesh.x,md.mesh.y)
|
---|
24 | [md.geometry.thickness]=InterpFromMeshToMesh2d(index,x,y,thickness,md.mesh.x,md.mesh.y)
|
---|
25 | md.geometry.base=md.geometry.surface-md.geometry.thickness
|
---|
26 | md.initialization.vx=md.inversion.vx_obs
|
---|
27 | md.initialization.vy=md.inversion.vy_obs
|
---|
28 | md.initialization.vz=numpy.zeros((md.mesh.numberofvertices))
|
---|
29 | md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices))
|
---|
30 |
|
---|
31 | #Materials
|
---|
32 | md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
|
---|
33 | md.materials.rheology_B=paterson(md.initialization.temperature)
|
---|
34 | md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
|
---|
35 | md.initialization.temperature=md.initialization.temperature
|
---|
36 |
|
---|
37 | #Friction
|
---|
38 | md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices))
|
---|
39 | md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
|
---|
40 | md.friction.p=numpy.ones((md.mesh.numberofelements))
|
---|
41 | md.friction.q=numpy.ones((md.mesh.numberofelements))
|
---|
42 |
|
---|
43 | #Numerical parameters
|
---|
44 | md.masstransport.stabilization=1.
|
---|
45 | md.verbose=verbose(0)
|
---|
46 | md.settings.waitonlock=30
|
---|
47 | md.timestepping.time_step=1.
|
---|
48 | md.timestepping.final_time=2.
|
---|
49 | md.stressbalance.restol=0.05
|
---|
50 | md.stressbalance.reltol=1.
|
---|
51 | md.steadystate.reltol=1.
|
---|
52 | md.stressbalance.abstol=float('nan')
|
---|
53 |
|
---|
54 | #Boundary conditions:
|
---|
55 | md=SetMarineIceSheetBC(md)
|
---|
56 |
|
---|
57 | #Change name so that no test have the same name
|
---|
58 | if len(inspect.stack()) > 2:
|
---|
59 | md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
|
---|