Module run_even_more
[hide private]
[frames] | no frames]

Source Code for Module run_even_more

 1  import numpy as N 
 2  import pylab as P 
 3   
 4  import simple_ice_model_even_more 
 5   
 6  # import os 
 7  # import sys 
 8  # sys.path.append('..') 
 9  # from py_fortran_tools import * 
10   
11 -def run():
12 # physical params 13 rho=920. 14 g_grav=9.8 15 A_rate=1.e-16 16 n_glen=3. 17 18 # numerical params 19 grid = 51 20 dt = 0.1 21 t_start = 0. 22 t_final = 1000. 23 times_out_delta_t = 10 # how often output is made 24 t_steps = N.round((t_final-t_start)/dt) 25 26 xl = 0 27 xr =50e3 28 mass_b_0=4. 29 mass_b_1=0.2e-3 30 dbed_dx=0.025 31 32 # the time steps 33 tt = N.arange(t_start, t_final+dt, dt) 34 # the indices of the output times 35 t_output_ind = N.where(N.mod(tt,times_out_delta_t)==0) 36 # the output times 37 t_out = tt[t_output_ind] 38 ## input on the grid 39 # make the spatial discretisation 40 xx = N.linspace(xl, xr, grid) 41 # make a bed 42 bed = -dbed_dx * xx 43 # mass-balance vector 44 mass_b = mass_b_0 - mass_b_1*xx 45 # initial ice sheet elevation 46 thick_IC = xx*0 47 48 # run the model with above IC and parameters 49 thick = simple_ice_model_even_more.simple_ice_model( 50 grid, dt, t_steps, t_out_ind, dx, #numerics 51 rho, g_grav, A_rate, n_glen, # physical constants 52 xx, mass_b, bed, # input on grid 53 thick, # IC 54 thickr, thickl) #BC 55 56 P.figure() 57 P.plot(xx/1e3, bed+thick[:,-1], 'b') 58 P.hold(True) 59 P.plot(xx/1e3, bed, 'r') 60 P.xlabel('x (km)') 61 P.ylabel('b+H (m)')
62 63 if __name__=='__main__': 64 run() 65 P.show() 66