Changeset 8810


Ignore:
Timestamp:
Apr 5, 2013, 10:25:46 AM (12 years ago)
Author:
steve
Message:

Some changes to netcdf config

Location:
trunk/anuga_core/source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/generic_domain.py

    r8782 r8810  
    16121612                self.max_speed = num.zeros(N, num.float)
    16131613
     1614
    16141615    def evolve_one_euler_step(self, yieldstep, finaltime):
    16151616        """One Euler Time Step
  • trunk/anuga_core/source/anuga/config.py

    r8808 r8810  
    220220
    221221# Determine if we can read/write large NetCDF files
    222 netcdf_mode_w = 'w'
    223 netcdf_mode_a = 'a'
     222netcdf_mode_w = 'wl'
     223netcdf_mode_a = 'r+'
    224224netcdf_mode_r = 'r'
    225225
  • trunk/anuga_core/source/anuga/file/netcdf.py

    r8785 r8810  
    4343
    4444
     45
    4546    try:
    4647        from Scientific.IO.NetCDF import NetCDFFile
     
    4849    except:
    4950        from netCDF4 import Dataset
    50         return Dataset(file_name, netcdf_mode, format='NETCDF3_64BIT')
    51 
    52    
     51        if netcdf_mode == 'wl' :
     52            return Dataset(file_name, 'w', format='NETCDF3_64BIT')
     53        else:
     54            return Dataset(file_name, netcdf_mode, format='NETCDF3_64BIT')
     55
     56#    from netCDF4 import Dataset
     57#    return Dataset(file_name, netcdf_mode, format='NETCDF3_64BIT')
    5358
    5459    #return Dataset(file_name, netcdf_mode, format='NETCDF3_CLASSIC')
  • trunk/anuga_core/source/anuga/file/sww.py

    r8782 r8810  
    205205        fid.close()
    206206
     207
    207208    def store_timestep(self):
    208209        """Store time and time dependent quantities
    209210        """
    210211
    211         import types
     212        #import types
    212213        from time import sleep
    213214        from os import stat
     215
    214216
    215217        # Get NetCDF
     
    238240        # Check to see if the file is already too big:
    239241        time = fid.variables['time']
     242
    240243        i = len(time) + 1
    241244        file_size = stat(self.filename)[6]
     
    309312                z, _ = Q.get_vertex_values(xy=False)               
    310313               
    311                 storable_indices = (w-z >= self.minimum_storable_height)
     314                storable_indices = num.array(w-z >= self.minimum_storable_height)
    312315            else:
    313316                # Very unlikely branch
     
    317320            dynamic_quantities = {}
    318321            for name in self.writer.dynamic_quantities:
    319                 netcdf_array = fid.variables[name]
     322                #netcdf_array = fid.variables[name]
    320323               
    321324                Q = domain.quantities[name]
     
    363366
    364367            # Flush and close
    365             fid.sync()
     368            #fid.sync()
    366369            fid.close()
    367370
     
    793796                   
    794797       
    795        
     798
    796799    def store_quantities(self,
    797800                         outfile,
  • trunk/anuga_core/source/anuga/shallow_water/boundaries.py

    r8578 r8810  
    2626     import Boundary, File_boundary
    2727import numpy as num
     28
     29import anuga.utilities.log as log
    2830     
    2931
  • trunk/anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r8696 r8810  
    15531553
    15541554
    1555    
     1555
    15561556    def evolve(self,
    15571557               yieldstep=None,
     
    15831583                                       finaltime=finaltime, duration=duration,
    15841584                                       skip_initial_step=skip_initial_step):
     1585
    15851586            # Store model data, e.g. for subsequent visualisation
    15861587            if self.store is True:
  • trunk/anuga_core/source/anuga/shallow_water/shallow_water_ext.c

    r8592 r8810  
    54865486}
    54875487
     5488
    54885489PyObject *compute_fluxes_ext_wb(PyObject *self, PyObject *args) {
    54895490    /*Compute all fluxes and the timestep suitable for all volumes
  • trunk/anuga_core/source/anuga_validation_tests/Case_studies/Okushiri/compare_timeseries_with_measures.py

    r8807 r8810  
    168168#eps = get_machine_precision()
    169169
    170 # Windows tolerances
    171 rtol = 1.0e-2
    172 atol = 1.0e-2
     170# Tolerances  for 20,000 triangles
     171rtol = 2.0e-2
     172atol = 2.0e-2
     173
     174# Tolerances  for 60,000 triangles
     175#rtol = 1.0e-2
     176#atol = 1.0e-2
     177
    173178print 'Precisions used: rtol=%e, atol=%e' %(rtol, atol)
    174179
  • trunk/anuga_core/source/anuga_validation_tests/Case_studies/Okushiri/create_okushiri.py

    r8780 r8810  
    3131#base_resolution = 0.04 # 989,669 triangles
    3232#base_resolution = 0.1 # 397,456 triangles
    33 base_resolution = 0.6 # 68162 triangles
    34 #base_resolution = 2.0 # 21214 triangles
     33#base_resolution = 0.6 # 68162 triangles
     34base_resolution = 2.0 # 21214 triangles
    3535#base_resolution = 4.0 # 11069 triangles
    3636
  • trunk/anuga_core/source/anuga_validation_tests/Case_studies/Okushiri/run_okushiri.py

    r8787 r8810  
    6262    domain.set_default_order(2)               # Apply second order scheme
    6363    domain.set_minimum_storable_height(0.001) # Don't store w < 0.001m
    64     domain.set_quantities_to_be_monitored('stage')
     64    #domain.set_quantities_to_be_monitored('stage')
    6565
    6666
     
    6969    # or override manually yourself
    7070    #------------------------------------------------------------------------------
    71     from anuga.utilities.argparsing import parse_standard_args
    72     alg, cfl = parse_standard_args()
     71    #from anuga.utilities.argparsing import parse_standard_args
     72    #alg, cfl = parse_standard_args()
     73    alg = '1_5'
     74    cfl = 1.0
    7375    domain.set_flow_algorithm(alg)
    7476    domain.set_CFL(cfl)
     77   
     78   
     79    domain.set_store(False)
    7580       
    7681
     
    105110    t0 = time.time()
    106111
    107     for t in domain.evolve(yieldstep = 0.05, finaltime = 22.5):
     112    for t in domain.evolve(yieldstep = 0.01, finaltime = 4.0):
     113        print 80*"="
    108114        domain.write_time()
    109         print domain.quantity_statistics(precision='%.12f')
     115        import objgraph
     116        #objgraph.show_most_common_types()
     117        #print objgraph.typestats(objgraph.get_leaking_objects())
     118        objgraph.show_growth()
     119        #print domain.quantity_statistics(precision='%.12f')
    110120
    111121    print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset for help on using the changeset viewer.