source: issm/trunk-jpl/test/Par/ISMIPE.py@ 23707

Last change on this file since 23707 was 23707, checked in by bdef, 6 years ago

CHG: translate from python 2 to3

  • Property svn:executable set to *
File size: 1.3 KB
RevLine 
[14134]1import numpy
[21170]2from arch import *
[16170]3from SetIceSheetBC import SetIceSheetBC
[14134]4
5#Ok, start defining model parameters here
6
[23707]7print(" creating thickness")
[21170]8data = numpy.array(archread('../Data/ISMIPE.arch','data'));
[21409]9md.geometry.surface=numpy.zeros((md.mesh.numberofvertices))
10md.geometry.base=numpy.zeros((md.mesh.numberofvertices))
[23707]11for i in range(0,md.mesh.numberofvertices):
[14134]12 y=md.mesh.y[i]
13 point1=numpy.floor(y/100.)
14 point2=numpy.minimum(point1+1,50)
[22267]15 coeff=(y-(point1)*100.)/100.
[17590]16 md.geometry.base[i]=(1.-coeff)*data[point1,1]+coeff*data[point2,1]
[14134]17 md.geometry.surface[i]=(1.-coeff)*data[point1,2]+coeff*data[point2,2]
[22267]18
[17590]19md.geometry.thickness=md.geometry.surface-md.geometry.base
[14134]20md.geometry.thickness[numpy.nonzero(numpy.logical_not(md.geometry.thickness))]=0.01
[17590]21md.geometry.base=md.geometry.surface-md.geometry.thickness
[14134]22
[23707]23print(" creating drag")
[21409]24md.friction.coefficient=numpy.zeros((md.mesh.numberofvertices))
25md.friction.p=numpy.ones((md.mesh.numberofelements))
26md.friction.q=numpy.ones((md.mesh.numberofelements))
[14134]27
[23707]28print(" creating flow law parameter")
[21409]29md.materials.rheology_B=6.8067*10**7*numpy.ones((md.mesh.numberofvertices))
30md.materials.rheology_n=3.*numpy.ones((md.mesh.numberofelements))
[14134]31
[23707]32print(" boundary conditions for stressbalance model:")
[14134]33#Create node on boundary first (because we can not use mesh)
34md=SetIceSheetBC(md)
Note: See TracBrowser for help on using the repository browser.