source: issm/trunk-jpl/test/NightlyRun/test1106.py@ 21408

Last change on this file since 21408 was 21408, checked in by bdef, 8 years ago

CHG: uniformization fix

File size: 2.0 KB
RevLine 
[19049]1#Test Name: ISMIPCFS
[21408]2import numpy as np
[14134]3from model import *
[21408]4from socket import gethostname
[14134]5from triangle import *
6from setmask import *
7from parameterize import *
8from setflowequation import *
9from solve import *
10
11"""
12This test is a test from the ISMP-HOM Intercomparison project.
13Pattyn and Payne 2006
14"""
15
[21408]16L_list=[80000.]
[14134]17results=[]
18
19for L in L_list:
20 md=triangle(model(),"../Exp/Square_%d.exp" % L,L/10.) #size 3*L
21 md=setmask(md,'','') #ice sheet test
22 md=parameterize(md,'../Par/ISMIPC.py')
[21408]23 md.friction.coefficient=np.sqrt(md.constants.yts*(1000.+1000.*np.sin(md.mesh.x*2.*np.pi/L)*np.sin(md.mesh.y*2.*np.pi/L)))
[14134]24 md.extrude(10,1.)
25
26 #Add spc on the borders
[21408]27 pos=np.where(np.logical_or.reduce((md.mesh.x==0.,md.mesh.x==np.max(md.mesh.x),md.mesh.y==0.,md.mesh.y==np.max(md.mesh.y))))
[15771]28 md.stressbalance.spcvx[pos]=0.
29 md.stressbalance.spcvy[pos]=0.
[14134]30 if (L==5000.):
[15771]31 md.stressbalance.spcvx[pos]=15.66
32 md.stressbalance.spcvy[pos]=-0.1967
[14134]33 elif (L==10000.):
[15771]34 md.stressbalance.spcvx[pos]=16.04
35 md.stressbalance.spcvy[pos]=-0.1977
[14134]36 elif (L==20000.):
[15771]37 md.stressbalance.spcvx[pos]=16.53
38 md.stressbalance.spcvy[pos]=-1.27
[14134]39 elif (L==40000.):
[15771]40 md.stressbalance.spcvx[pos]=17.23
41 md.stressbalance.spcvy[pos]=-3.17
[14134]42 elif (L==80000.):
[15771]43 md.stressbalance.spcvx[pos]=16.68
44 md.stressbalance.spcvy[pos]=-2.69
[14134]45 elif (L==160000.):
[15771]46 md.stressbalance.spcvx[pos]=16.03
47 md.stressbalance.spcvy[pos]=-1.27
[14134]48
[15565]49 md=setflowequation(md,'FS','all')
[14134]50
[15771]51 #Compute the stressbalance
[21408]52 md.cluster=generic('name',gethostname(),'np',8)
[21056]53 md=solve(md,'Stressbalance')
[14134]54
55 #Plot the results and save them
[15771]56 vx=md.results.StressbalanceSolution.Vx
57 vy=md.results.StressbalanceSolution.Vy
58 vz=md.results.StressbalanceSolution.Vz
59 results.append(md.results.StressbalanceSolution)
[14134]60
61# plotmodel(md,'data',vx,'data',vy,'data',vz,'layer#all',md.mesh.numberoflayers)
62
63#Fields and tolerances to track changes
[21408]64field_names =['Vx80km','Vy80km','Vz80km']
65field_tolerances=[1e-12,1e-12,1e-12]
[14134]66field_values=[]
67for result in results:
[21408]68 field_values=field_values+[result.Vx,result.Vy,result.Vz]
Note: See TracBrowser for help on using the repository browser.