source: issm/trunk-jpl/test/NightlyRun/test2424.py@ 24256

Last change on this file since 24256 was 24256, checked in by bdef, 5 years ago

BUG: fixing some negative number syntax

File size: 2.0 KB
Line 
1#Test Name: SquareSheetShelfGroundingLine2dAggressive. From test424, with sea level increasing.
2import numpy as np
3from model import *
4from socket import gethostname
5from triangle import *
6from setmask import *
7from parameterize import *
8from setflowequation import *
9from solve import *
10from newforcing import *
11
12md = triangle(model(), '../Exp/Square.exp', 150000.)
13md = setmask(md, '../Exp/SquareShelf.exp', '')
14md = parameterize(md, '../Par/SquareSheetShelf.py')
15md = setflowequation(md, 'SSA', 'all')
16md.initialization.vx[:] = 0.
17md.initialization.vy[:] = 0.
18md.smb.mass_balance[:] = 0.
19
20md.geometry.base = - 700. - np.abs(md.mesh.y - 500000.) / 1000.
21md.geometry.bed = - 700. - np.abs(md.mesh.y - 500000.) / 1000.
22md.geometry.thickness[:] = 1000.
23md.geometry.surface = md.geometry.base + md.geometry.thickness
24
25md.transient.isstressbalance = 0
26md.transient.isgroundingline = 1
27md.transient.isthermal = 0
28md.groundingline.migration = 'AggressiveMigration'
29md.transient.requested_outputs = ['IceVolume', 'IceVolumeAboveFloatation', 'Sealevel']
30
31md.timestepping.time_step = .1
32md.slr.sealevel = newforcing(md.timestepping.start_time, md.timestepping.final_time,
33 md.timestepping.time_step, -200., 200., md.mesh.numberofvertices)
34
35md.cluster = generic('name', gethostname(), 'np', 3)
36md = solve(md, 'Transient')
37
38#we are checking that the grounding line position is near the theorical one, which is the 0 contour level
39#of surface-sealevel - (1 - di) * thickness
40
41nsteps = len(md.results.TransientSolution)
42field_names = []
43field_tolerances = []
44field_values = []
45#time is off by the year constant
46for i in range(nsteps):
47 field_names.append('Time-' + str(md.results.TransientSolution[i].time) + ' - yr - ice_levelset - S - sl - (1 - di) * H')
48 field_tolerances.append(1e-12)
49 field_values.append(md.results.TransientSolution[i].MaskGroundediceLevelset.reshape(-1, ) - (md.geometry.surface - md.results.TransientSolution[i].Sealevel.reshape(-1, ) - (1 - md.materials.rho_ice / md.materials.rho_water) * md.geometry.thickness))
Note: See TracBrowser for help on using the repository browser.