source: issm/trunk-jpl/test/Par/SquareSheetConstrained.py@ 17769

Last change on this file since 17769 was 17769, checked in by cborstad, 11 years ago

CHG: reverting previous change, isdamage=0 is specified by default in the damage class, problem was a typo elsewhere...

  • Property svn:executable set to *
File size: 2.8 KB
Line 
1import os.path
2import netCDF4
3import numpy
4import inspect
5from verbose import verbose
6from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
7from paterson import paterson
8from SetIceSheetBC import SetIceSheetBC
9
10#Start defining model parameters here
11
12#Geometry
13hmin=300.
14hmax=1000.
15ymin=numpy.min(md.mesh.y)
16ymax=numpy.max(md.mesh.y)
17xmin=min(md.mesh.x)
18xmax=max(md.mesh.x)
19md.geometry.thickness=hmax+(hmin-hmax)*(md.mesh.y.reshape(-1,1)-ymin)/(ymax-ymin)+0.1*(hmin-hmax)*(md.mesh.x.reshape(-1,1)-xmin)/(xmax-xmin)
20md.geometry.base=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness+20.
21md.geometry.surface=md.geometry.base+md.geometry.thickness
22
23#Initial velocity
24f = netCDF4.Dataset('../Data/SquareSheetConstrained.nc','r')
25x = numpy.reshape(f.variables['x'][:],(-1))
26y = numpy.reshape(f.variables['y'][:],(-1))
27vx = f.variables['vx'][:]
28vy = f.variables['vy'][:]
29index = f.variables['index'][:]
30f.close()
31
32[md.initialization.vx]=InterpFromMeshToMesh2d(index,x,y,vx,md.mesh.x,md.mesh.y)
33[md.initialization.vy]=InterpFromMeshToMesh2d(index,x,y,vy,md.mesh.x,md.mesh.y)
34md.initialization.vz=numpy.zeros((md.mesh.numberofvertices,1))
35md.initialization.pressure=numpy.zeros((md.mesh.numberofvertices,1))
36
37#Materials
38md.initialization.temperature=(273.-20.)*numpy.ones((md.mesh.numberofvertices,1))
39md.materials.rheology_B=paterson(md.initialization.temperature)
40md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
41
42#Masstransport
43md.masstransport.calvingrate=0.*numpy.ones((md.mesh.numberofvertices,1))
44
45#Friction
46md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
47md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
48md.friction.p=numpy.ones((md.mesh.numberofelements,1))
49md.friction.q=numpy.ones((md.mesh.numberofelements,1))
50
51#Numerical parameters
52md.stressbalance.viscosity_overshoot=0.0
53md.masstransport.stabilization=1.
54md.thermal.stabilization=1.
55md.verbose=verbose(0)
56md.settings.waitonlock=30
57md.stressbalance.restol=0.05
58md.steadystate.reltol=0.05
59md.stressbalance.reltol=0.05
60md.stressbalance.abstol=float('NaN')
61md.timestepping.time_step=1.
62md.timestepping.final_time=3.
63
64#GIA:
65md.gia.lithosphere_thickness=100.*numpy.ones((md.mesh.numberofvertices,1)); # in km
66md.gia.mantle_viscosity=1.*10**21*numpy.ones((md.mesh.numberofvertices,1)); # in Pa.s
67md.materials.lithosphere_shear_modulus=6.7*10**10; # in Pa
68md.materials.lithosphere_density=3.32; # in g/cm^-3
69md.materials.mantle_shear_modulus=1.45*10**11; # in Pa
70md.materials.mantle_density=3.34; # in g/cm^-3
71
72#Boundary conditions:
73md=SetIceSheetBC(md)
74
75#Change name so that no test have the same name
76if len(inspect.stack()) > 2:
77 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
Note: See TracBrowser for help on using the repository browser.