| 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/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'));
|
|---|
| 17 | index = numpy.array(archread('../Data/79North.arch','index')).astype(int);
|
|---|
| 18 | surface = numpy.array(archread('../Data/79North.arch','surface'));
|
|---|
| 19 | thickness = numpy.array(archread('../Data/79North.arch','thickness'));
|
|---|
| 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)
|
|---|
| 25 | md.geometry.base = md.geometry.surface-md.geometry.thickness
|
|---|
| 26 |
|
|---|
| 27 | #Materials
|
|---|
| 28 | md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices))
|
|---|
| 29 | md.materials.rheology_B=paterson(md.initialization.temperature)
|
|---|
| 30 | md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
|
|---|
| 31 | md.initialization.temperature=md.initialization.temperature
|
|---|
| 32 |
|
|---|
| 33 | #Friction
|
|---|
| 34 | md.friction.coefficient=50.*numpy.ones((md.mesh.numberofvertices))
|
|---|
| 35 | md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
|
|---|
| 36 | md.friction.p=numpy.ones((md.mesh.numberofelements))
|
|---|
| 37 | md.friction.q=numpy.ones((md.mesh.numberofelements))
|
|---|
| 38 |
|
|---|
| 39 | #Ice shelf melting and surface mass balance
|
|---|
| 40 | md.basalforcings.floatingice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
|
|---|
| 41 | md.basalforcings.floatingice_melting_rate[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
|
|---|
| 42 | md.basalforcings.groundedice_melting_rate=numpy.zeros((md.mesh.numberofvertices))
|
|---|
| 43 | md.smb.mass_balance=15*numpy.ones((md.mesh.numberofvertices))
|
|---|
| 44 |
|
|---|
| 45 | #Numerical parameters
|
|---|
| 46 | md.stressbalance.viscosity_overshoot=0.3
|
|---|
| 47 | md.masstransport.stabilization=1
|
|---|
| 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.
|
|---|
| 53 | md.stressbalance.restol=0.05
|
|---|
| 54 | md.stressbalance.reltol=0.005
|
|---|
| 55 | md.steadystate.reltol=0.005
|
|---|
| 56 | md.stressbalance.abstol=float('NaN')
|
|---|
| 57 |
|
|---|
| 58 | #Boundary conditions:
|
|---|
| 59 | md=SetMarineIceSheetBC(md)
|
|---|
| 60 | pos=numpy.nonzero(md.mesh.vertexonboundary)
|
|---|
| 61 | md.balancethickness.spcthickness[pos]=md.geometry.thickness[pos]
|
|---|
| 62 | md.masstransport.spcthickness[pos]=md.geometry.thickness[pos]
|
|---|
| 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]
|
|---|