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

Last change on this file since 16063 was 16063, checked in by seroussi, 11 years ago

CHG: added a small slope in x direction for all nighlty runs to avoid 0 values problem

  • Property svn:executable set to *
File size: 2.7 KB
Line 
1import os.path
2import netCDF4
3import numpy
4import inspect
5from verbose import *
6from InterpFromMeshToMesh2d import InterpFromMeshToMesh2d
7from paterson import *
8from SetIceSheetBC import *
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.bed=-md.materials.rho_ice/md.materials.rho_water*md.geometry.thickness+20.
21md.geometry.surface=md.geometry.bed+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#Friction
43md.friction.coefficient=20.*numpy.ones((md.mesh.numberofvertices,1))
44md.friction.coefficient[numpy.nonzero(md.mask.groundedice_levelset<0.)[0]]=0.
45md.friction.p=numpy.ones((md.mesh.numberofelements,1))
46md.friction.q=numpy.ones((md.mesh.numberofelements,1))
47
48#Numerical parameters
49md.stressbalance.viscosity_overshoot=0.0
50md.masstransport.stabilization=1.
51md.thermal.stabilization=1.
52md.verbose=verbose(0)
53md.settings.waitonlock=30
54md.stressbalance.restol=0.05
55md.steadystate.reltol=0.05
56md.stressbalance.reltol=0.05
57md.stressbalance.abstol=float('NaN')
58md.timestepping.time_step=1.
59md.timestepping.final_time=3.
60
61#GIA:
62md.gia.lithosphere_thickness=100.*numpy.ones((md.mesh.numberofvertices,1)); # in km
63md.gia.mantle_viscosity=1.*10**21*numpy.ones((md.mesh.numberofvertices,1)); # in Pa.s
64md.materials.lithosphere_shear_modulus=6.7*10**10; # in Pa
65md.materials.lithosphere_density=3.32; # in g/cm^-3
66md.materials.mantle_shear_modulus=1.45*10**11; # in Pa
67md.materials.mantle_density=3.34; # in g/cm^-3
68
69#Boundary conditions:
70md=SetIceSheetBC(md)
71
72#Change name so that no test have the same name
73if len(inspect.stack()) > 2:
74 md.miscellaneous.name = os.path.basename(inspect.stack()[2][1]).split('.')[0]
75
Note: See TracBrowser for help on using the repository browser.