Changeset 7276 for anuga_validation/circular_island/run_circular.py
- Timestamp:
- Jun 30, 2009, 2:07:41 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/circular_island/run_circular.py
r5442 r7276 15 15 from anuga.abstract_2d_finite_volumes.util import file_function, sww2csv_gauges,csv2timeseries_graphs 16 16 from anuga.pmesh.mesh_interface import create_mesh_from_regions 17 from anuga.utilities.polygon import read_polygon #, plot_polygons18 from math import cos,pi,sin,tan #,sqrt19 from Numeric import array, zeros, Float, allclose,resize,sqrt 17 from anuga.utilities.polygon import read_polygon 18 from math import cos,pi,sin,tan 19 import numpy as num 20 20 from anuga.shallow_water.data_manager import csv2dict 21 21 from time import localtime, strftime, gmtime 22 22 from anuga.utilities.system_tools import get_user_name, get_host_name 23 23 from os import sep, environ, getenv 24 from anuga.config import netcdf_float 25 from Scientific.IO.NetCDF import NetCDFFile 26 24 27 #------------------------- 25 28 # Create Domain from mesh … … 57 60 58 61 print 'Preparing time boundary from %s' %textversion 59 from Numeric import array60 62 61 63 fid = open(textversion) … … 70 72 71 73 N = len(lines) 72 T = zeros(N, Float) #Time73 Q = zeros(N, Float) #Values74 T = num.zeros(N, num.float) #Time 75 Q = num.zeros(N, num.float) #Values 74 76 75 77 for i, line in enumerate(lines): … … 82 84 83 85 #Create tms file 84 from Scientific.IO.NetCDF import NetCDFFile85 86 86 print 'Writing to', filename 87 87 fid = NetCDFFile(filename[:-4] + '.tms', 'w') … … 91 91 fid.starttime = 0.0 92 92 fid.createDimension('number_of_timesteps', len(T)) 93 fid.createVariable('time', Float, ('number_of_timesteps',))93 fid.createVariable('time', netcdf_float, ('number_of_timesteps',)) 94 94 fid.variables['time'][:] = T 95 95 96 fid.createVariable('stage', Float, ('number_of_timesteps',))96 fid.createVariable('stage', netcdf_float, ('number_of_timesteps',)) 97 97 fid.variables['stage'][:] = Q[:] 98 98 99 fid.createVariable('xmomentum', Float, ('number_of_timesteps',))99 fid.createVariable('xmomentum', netcdf_float, ('number_of_timesteps',)) 100 100 fid.variables['xmomentum'][:] = 0.0 101 101 102 fid.createVariable('ymomentum', Float, ('number_of_timesteps',))102 fid.createVariable('ymomentum', netcdf_float, ('number_of_timesteps',)) 103 103 fid.variables['ymomentum'][:] = 0.0 104 104 … … 181 181 def circular_island_elevation(x,y): 182 182 water_depth = 0.32 183 list_xy = sqrt((center_x-x)**2+(center_y-L-y)**2)183 list_xy = num.sqrt((center_x-x)**2+(center_y-L-y)**2) 184 184 print 'x',min(x),max(x) 185 185 print 'y',min(y),max(y)
Note: See TracChangeset
for help on using the changeset viewer.