Ignore:
Timestamp:
Jun 30, 2009, 2:07:41 PM (15 years ago)
Author:
ole
Message:

Merged numpy branch back into the trunk.

In ~/sandpit/anuga/anuga_core/source
svn merge -r 6246:HEAD ../../branches/numpy .

In ~/sandpit/anuga/anuga_validation
svn merge -r 6417:HEAD ../branches/numpy_anuga_validation .

In ~/sandpit/anuga/misc
svn merge -r 6809:HEAD ../branches/numpy_misc .

For all merges, I used numpy version where conflicts existed

The suites test_all.py (in source/anuga) and validate_all.py passed using Python2.5 with numpy on my Ubuntu Linux box.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/circular_island/run_circular.py

    r5442 r7276  
    1515from anuga.abstract_2d_finite_volumes.util import file_function, sww2csv_gauges,csv2timeseries_graphs
    1616from anuga.pmesh.mesh_interface import create_mesh_from_regions
    17 from anuga.utilities.polygon import read_polygon#, plot_polygons
    18 from math import cos,pi,sin,tan#,sqrt
    19 from Numeric import array, zeros, Float, allclose,resize,sqrt
     17from anuga.utilities.polygon import read_polygon
     18from math import cos,pi,sin,tan
     19import numpy as num
    2020from anuga.shallow_water.data_manager import csv2dict
    2121from time import localtime, strftime, gmtime
    2222from anuga.utilities.system_tools import get_user_name, get_host_name
    2323from os import sep, environ, getenv
     24from anuga.config import netcdf_float
     25from Scientific.IO.NetCDF import NetCDFFile
     26
    2427#-------------------------
    2528# Create Domain from mesh
     
    5760
    5861    print 'Preparing time boundary from %s' %textversion
    59     from Numeric import array
    6062
    6163    fid = open(textversion)
     
    7072
    7173    N = len(lines)
    72     T = zeros(N, Float)  #Time
    73     Q = zeros(N, Float)  #Values
     74    T = num.zeros(N, num.float)  #Time
     75    Q = num.zeros(N, num.float)  #Values
    7476
    7577    for i, line in enumerate(lines):
     
    8284
    8385    #Create tms file
    84     from Scientific.IO.NetCDF import NetCDFFile
    85 
    8686    print 'Writing to', filename
    8787    fid = NetCDFFile(filename[:-4] + '.tms', 'w')
     
    9191    fid.starttime = 0.0
    9292    fid.createDimension('number_of_timesteps', len(T))
    93     fid.createVariable('time', Float, ('number_of_timesteps',))
     93    fid.createVariable('time', netcdf_float, ('number_of_timesteps',))
    9494    fid.variables['time'][:] = T
    9595
    96     fid.createVariable('stage', Float, ('number_of_timesteps',))
     96    fid.createVariable('stage', netcdf_float, ('number_of_timesteps',))
    9797    fid.variables['stage'][:] = Q[:]
    9898
    99     fid.createVariable('xmomentum', Float, ('number_of_timesteps',))
     99    fid.createVariable('xmomentum', netcdf_float, ('number_of_timesteps',))
    100100    fid.variables['xmomentum'][:] = 0.0
    101101
    102     fid.createVariable('ymomentum', Float, ('number_of_timesteps',))
     102    fid.createVariable('ymomentum', netcdf_float, ('number_of_timesteps',))
    103103    fid.variables['ymomentum'][:] = 0.0
    104104
     
    181181def circular_island_elevation(x,y):
    182182    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)
    184184    print 'x',min(x),max(x)
    185185    print 'y',min(y),max(y)
Note: See TracChangeset for help on using the changeset viewer.