Changeset 23793 for issm/trunk-jpl/test/NightlyRun/test239.py
- Timestamp:
- 03/13/19 03:17:46 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/test/NightlyRun/test239.py
r23707 r23793 1 #Test Name: SquareShelfTranIspddIsdeltaO18pdInterpSSA2d 1 #Test Name: SquareShelfTranIspddIsdeltaO18pdInterpSSA2d 2 2 import numpy as np 3 3 from model import * … … 10 10 11 11 12 md =triangle(model(),'../Exp/Square.exp',150000.)13 md =setmask(md,'all','')14 md =parameterize(md,'../Par/SquareShelf.py')12 md = triangle(model(), '../Exp/Square.exp', 150000.) 13 md = setmask(md, 'all', '') 14 md = parameterize(md, '../Par/SquareShelf.py') 15 15 16 16 # Use of ispdd and isdelta18o methods 17 17 md.smb = SMBd18opdd() 18 md.smb.isd18opd =118 md.smb.isd18opd = 1 19 19 20 20 # Add temperature, precipitation and delta18o needed to measure the surface mass balance 21 21 # creating delta18o 22 delta18o =np.loadtxt('../Data/delta18o.data')23 md.smb.delta18o =delta18o22 delta18o = np.loadtxt('../Data/delta18o.data') 23 md.smb.delta18o = delta18o 24 24 25 25 # creating Present day temperatures 26 26 # Same temperature over the all region: 27 tmonth =np.ones(12)*(238.15+20.)28 md.smb.temperatures_presentday =np.zeros((md.mesh.numberofvertices+1,12))29 for imonth in range(0, 12):30 md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth]=tmonth[imonth]27 tmonth = np.ones(12) * (238.15 + 20.) 28 md.smb.temperatures_presentday = np.zeros((md.mesh.numberofvertices + 1, 12)) 29 for imonth in range(0, 12): 30 md.smb.temperatures_presentday[0:md.mesh.numberofvertices, imonth] = tmonth[imonth] 31 31 # Time for the last line: 32 md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth]=(float(imonth)/12.)32 md.smb.temperatures_presentday[md.mesh.numberofvertices, imonth] = (float(imonth) / 12.) 33 33 34 34 # creating initialization and spc temperatures initialization and spc 35 md.thermal.spctemperature =np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices,:],axis=1).reshape(-1,1)36 md.thermal.spctemperature =md.thermal.spctemperature-1037 md.initialization.temperature =md.thermal.spctemperature35 md.thermal.spctemperature = np.mean(md.smb.temperatures_presentday[0:md.mesh.numberofvertices, :], axis=1).reshape(-1, 1) 36 md.thermal.spctemperature = md.thermal.spctemperature - 10 37 md.initialization.temperature = md.thermal.spctemperature 38 38 md.smb.initialize(md) 39 39 40 40 # creating precipitation 41 md.smb.precipitations_presentday =np.zeros((md.mesh.numberofvertices+1,12))42 for imonth in range(0, 12):43 md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth]=-0.4*10**(-6)*md.mesh.y+0.544 md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth]=((float(imonth)+1.)/12.)41 md.smb.precipitations_presentday = np.zeros((md.mesh.numberofvertices + 1, 12)) 42 for imonth in range(0, 12): 43 md.smb.precipitations_presentday[0:md.mesh.numberofvertices, imonth] = -0.4 * 10**(-6) * md.mesh.y + 0.5 44 md.smb.precipitations_presentday[md.mesh.numberofvertices, imonth] = ((float(imonth) + 1.) / 12.) 45 45 46 46 # time steps and resolution 47 md.timestepping.time_step =0.548 md.settings.output_frequency =149 md.timestepping.final_time =247 md.timestepping.time_step = 0.5 48 md.settings.output_frequency = 1 49 md.timestepping.final_time = 2 50 50 51 # 52 md.transient.requested_outputs =['default','SmbMonthlytemperatures']53 md =setflowequation(md,'SSA','all')54 md.cluster =generic('name',gethostname(),'np',3)55 md =solve(md,'Transient')51 # 52 md.transient.requested_outputs = ['default', 'SmbMonthlytemperatures'] 53 md = setflowequation(md, 'SSA', 'all') 54 md.cluster = generic('name', gethostname(), 'np', 3) 55 md = solve(md, 'Transient') 56 56 57 57 #Fields and tolerances to track changes 58 field_names =['Vx1','Vy1','Vel1','Pressure1','Bed1','Surface1','Thickness1','SmbMonthlytemperatures1','SmbMassBalance1',\ 59 'Vx2','Vy2','Vel2','Pressure2','Bed2','Surface2','Thickness2','SmbMonthlytemperatures2','SmbMassBalance2',\ 60 'Vx3','Vy3','Vel3','Pressure3','Bed3','Surface3','Thickness3','SmbMonthlytemperatures3','SmbMassBalance3'] 61 field_tolerances=[1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\ 62 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,\ 63 1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13] 64 field_values=[\ 65 md.results.TransientSolution[0].Vx,\ 66 md.results.TransientSolution[0].Vy,\ 67 md.results.TransientSolution[0].Vel,\ 68 md.results.TransientSolution[0].Pressure,\ 69 md.results.TransientSolution[0].Base,\ 70 md.results.TransientSolution[0].Surface,\ 71 md.results.TransientSolution[0].Thickness,\ 72 md.results.TransientSolution[0].SmbMonthlytemperatures,\ 73 md.results.TransientSolution[0].SmbMassBalance,\ 74 md.results.TransientSolution[1].Vx,\ 75 md.results.TransientSolution[1].Vy,\ 76 md.results.TransientSolution[1].Vel,\ 77 md.results.TransientSolution[1].Pressure,\ 78 md.results.TransientSolution[1].Base,\ 79 md.results.TransientSolution[1].Surface,\ 80 md.results.TransientSolution[1].Thickness,\ 81 md.results.TransientSolution[1].SmbMonthlytemperatures,\ 82 md.results.TransientSolution[1].SmbMassBalance,\ 83 md.results.TransientSolution[2].Vx,\ 84 md.results.TransientSolution[2].Vy,\ 85 md.results.TransientSolution[2].Vel,\ 86 md.results.TransientSolution[2].Pressure,\ 87 md.results.TransientSolution[2].Base,\ 88 md.results.TransientSolution[2].Surface,\ 89 md.results.TransientSolution[2].Thickness,\ 90 md.results.TransientSolution[2].SmbMonthlytemperatures,\ 91 md.results.TransientSolution[2].SmbMassBalance,\ 92 ] 58 field_names = ['Vx1', 'Vy1', 'Vel1', 'Pressure1', 'Bed1', 'Surface1', 'Thickness1', 'SmbMonthlytemperatures1', 'SmbMassBalance1', 59 'Vx2', 'Vy2', 'Vel2', 'Pressure2', 'Bed2', 'Surface2', 'Thickness2', 'SmbMonthlytemperatures2', 'SmbMassBalance2', 60 'Vx3', 'Vy3', 'Vel3', 'Pressure3', 'Bed3', 'Surface3', 'Thickness3', 'SmbMonthlytemperatures3', 'SmbMassBalance3'] 61 field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 62 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 63 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13, 1e-13] 64 field_values = [md.results.TransientSolution[0].Vx, 65 md.results.TransientSolution[0].Vy, 66 md.results.TransientSolution[0].Vel, 67 md.results.TransientSolution[0].Pressure, 68 md.results.TransientSolution[0].Base, 69 md.results.TransientSolution[0].Surface, 70 md.results.TransientSolution[0].Thickness, 71 md.results.TransientSolution[0].SmbMonthlytemperatures, 72 md.results.TransientSolution[0].SmbMassBalance, 73 md.results.TransientSolution[1].Vx, 74 md.results.TransientSolution[1].Vy, 75 md.results.TransientSolution[1].Vel, 76 md.results.TransientSolution[1].Pressure, 77 md.results.TransientSolution[1].Base, 78 md.results.TransientSolution[1].Surface, 79 md.results.TransientSolution[1].Thickness, 80 md.results.TransientSolution[1].SmbMonthlytemperatures, 81 md.results.TransientSolution[1].SmbMassBalance, 82 md.results.TransientSolution[2].Vx, 83 md.results.TransientSolution[2].Vy, 84 md.results.TransientSolution[2].Vel, 85 md.results.TransientSolution[2].Pressure, 86 md.results.TransientSolution[2].Base, 87 md.results.TransientSolution[2].Surface, 88 md.results.TransientSolution[2].Thickness, 89 md.results.TransientSolution[2].SmbMonthlytemperatures, 90 md.results.TransientSolution[2].SmbMassBalance]
Note:
See TracChangeset
for help on using the changeset viewer.