[13675] | 1 | import os.path
|
---|
| 2 | import inspect
|
---|
[21170] | 3 | from arch import *
|
---|
[16170] | 4 | import numpy
|
---|
| 5 | from verbose import verbose
|
---|
[13675] | 6 | from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
|
---|
[16170] | 7 | from paterson import paterson
|
---|
| 8 | from SetMarineIceSheetBC import SetMarineIceSheetBC
|
---|
[13675] | 9 |
|
---|
| 10 | #Start defining model parameters here
|
---|
| 11 |
|
---|
| 12 | #Geometry and observation
|
---|
[21170] | 13 | x = numpy.array(archread('../Data/79North.arch','x'))
|
---|
| 14 | y = numpy.array(archread('../Data/79North.arch','y'))
|
---|
| 15 | vx = numpy.array(archread('../Data/79North.arch','vx'));
|
---|
| 16 | vy = numpy.array(archread('../Data/79North.arch','vy'));
|
---|
[21176] | 17 | index = numpy.array(archread('../Data/79North.arch','index')).astype(int);
|
---|
[21170] | 18 | surface = numpy.array(archread('../Data/79North.arch','surface'));
|
---|
| 19 | thickness = numpy.array(archread('../Data/79North.arch','thickness'));
|
---|
[13675] | 20 |
|
---|
| 21 | [md.initialization.vx] = InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
|
---|
| 22 | [md.initialization.vy] = InterpFromMeshToMesh2d(index,x,y,vy,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)
|
---|
[17590] | 25 | md.geometry.base = md.geometry.surface-md.geometry.thickness
|
---|
[13675] | 26 |
|
---|
| 27 | #Materials
|
---|
[21759] | 28 | md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
|
---|
[13675] | 29 | md.materials.rheology_B=paterson(md.initialization.temperature)
|
---|
[21759] | 30 | md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
|
---|
[13675] | 31 | md.initialization.temperature=md.initialization.temperature
|
---|
| 32 |
|
---|
| 33 | #Friction
|
---|
[21759] | 34 | md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices))
|
---|
[15988] | 35 | md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
|
---|
[21759] | 36 | md.friction.p=numpy.ones((md.mesh.numberofelements))
|
---|
| 37 | md.friction.q=numpy.ones((md.mesh.numberofelements))
|
---|
[13675] | 38 |
|
---|
| 39 | #Ice shelf melting and surface mass balance
|
---|
[21759] | 40 | md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
|
---|
[18068] | 41 | md.basalforcings.floatingice_melting_rate[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
|
---|
[21759] | 42 | md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
|
---|
| 43 | md.smb.mass_balance=15*numpy.ones((md.mesh.numberofvertices))
|
---|
[13675] | 44 |
|
---|
| 45 | #Numerical parameters
|
---|
[15771] | 46 | md.stressbalance.viscosity_overshoot=0.3
|
---|
[15767] | 47 | md.masstransport.stabilization=1
|
---|
[13675] | 48 | md.thermal.stabilization=1
|
---|
| 49 | md.verbose=verbose(0)
|
---|
| 50 | md.settings.waitonlock=30
|
---|
| 51 | md.timestepping.time_step=1.
|
---|
| 52 | md.timestepping.final_time=3.
|
---|
[15771] | 53 | md.stressbalance.restol=0.05
|
---|
| 54 | md.stressbalance.reltol=0.005
|
---|
[13675] | 55 | md.steadystate.reltol=0.005
|
---|
[15771] | 56 | md.stressbalance.abstol=float('NaN')
|
---|
[13675] | 57 |
|
---|
| 58 | #Boundary conditions:
|
---|
| 59 | md=SetMarineIceSheetBC(md)
|
---|
| 60 | pos=numpy.nonzero(md.mesh.vertexonboundary)
|
---|
| 61 | md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
|
---|
[15767] | 62 | md.masstransport.spcthickness[pos]=md.geometry.thickness[pos]
|
---|
[13675] | 63 |
|
---|
| 64 | #Change name so that no test have the same name
|
---|
| 65 | if len(inspect.stack()) > 2:
|
---|
| 66 | md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
|
---|