- Timestamp:
- Jun 30, 2009, 2:07:41 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/circular_island/sqrt_table_run_circular.py
r5442 r7276 17 17 from anuga.utilities.polygon import read_polygon#, plot_polygons 18 18 from math import cos,pi,sin,tan,sqrt 19 from Numeric import array, zeros, Float, allclose,resize 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 27 24 28 #------------------------- 25 29 # Create Domain from mesh … … 56 60 57 61 print 'Preparing time boundary from %s' %textversion 58 from Numeric import array59 62 60 63 fid = open(textversion) … … 69 72 70 73 N = len(lines) 71 T = zeros(N, Float) #Time72 Q = zeros(N, Float) #Values74 T = num.zeros(N, num.float) #Time 75 Q = num.zeros(N, num.float) #Values 73 76 74 77 for i, line in enumerate(lines): … … 81 84 82 85 #Create tms file 83 from Scientific.IO.NetCDF import NetCDFFile84 85 86 print 'Writing to', filename 86 87 fid = NetCDFFile(filename[:-4] + '.tms', 'w') … … 90 91 fid.starttime = 0.0 91 92 fid.createDimension('number_of_timesteps', len(T)) 92 fid.createVariable('time', Float, ('number_of_timesteps',))93 fid.createVariable('time', netcdf_float, ('number_of_timesteps',)) 93 94 fid.variables['time'][:] = T 94 95 95 fid.createVariable('stage', Float, ('number_of_timesteps',))96 fid.createVariable('stage', netcdf_float, ('number_of_timesteps',)) 96 97 fid.variables['stage'][:] = Q[:] 97 98 98 fid.createVariable('xmomentum', Float, ('number_of_timesteps',))99 fid.createVariable('xmomentum', netcdf_float, ('number_of_timesteps',)) 99 100 fid.variables['xmomentum'][:] = 0.0 100 101 101 fid.createVariable('ymomentum', Float, ('number_of_timesteps',))102 fid.createVariable('ymomentum', netcdf_float, ('number_of_timesteps',)) 102 103 fid.variables['ymomentum'][:] = 0.0 103 104
Note: See TracChangeset
for help on using the changeset viewer.