source: issm/trunk/test/Par/ISMIPE.py@ 16560

Last change on this file since 16560 was 16560, checked in by Mathieu Morlighem, 11 years ago

merged trunk-jpl and trunk for revision 16554

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1import numpy
2import netCDF4
3from SetIceSheetBC import SetIceSheetBC
4
5#Ok, start defining model parameters here
6
7print " creating thickness"
8f = netCDF4.Dataset('../Data/ISMIPE.nc','r')
9data = f.variables['data'][:]
10f.close()
11md.geometry.surface=numpy.zeros((md.mesh.numberofvertices,1))
12md.geometry.bed=numpy.zeros((md.mesh.numberofvertices,1))
13for i in xrange(0,md.mesh.numberofvertices):
14 y=md.mesh.y[i]
15 point1=numpy.floor(y/100.)
16 point2=numpy.minimum(point1+1,50)
17 coeff=(y-(point1-1.)*100.)/100.
18 md.geometry.bed[i]=(1.-coeff)*data[point1,1]+coeff*data[point2,1]
19 md.geometry.surface[i]=(1.-coeff)*data[point1,2]+coeff*data[point2,2]
20md.geometry.thickness=md.geometry.surface-md.geometry.bed
21md.geometry.thickness[numpy.nonzero(numpy.logical_not(md.geometry.thickness))]=0.01
22md.geometry.bed=md.geometry.surface-md.geometry.thickness
23
24print " creating drag"
25md.friction.coefficient=numpy.zeros((md.mesh.numberofvertices,1))
26md.friction.p=numpy.ones((md.mesh.numberofelements,1))
27md.friction.q=numpy.ones((md.mesh.numberofelements,1))
28
29print " creating flow law parameter"
30md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices,1))
31md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements,1))
32
33#Damage
34md.damage.D=numpy.zeros((md.mesh.numberofvertices,1))
35
36print " boundary conditions for stressbalance model:"
37#Create node on boundary first (because we can not use mesh)
38md=SetIceSheetBC(md)
Note: See TracBrowser for help on using the repository browser.