Changeset 6105
- Timestamp:
- Dec 24, 2008, 1:50:50 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/config.py
r6087 r6105 1 1 """Module where global ANUGA model parameters and default values are set 2 2 """ 3 4 import os 5 import sys 3 6 4 7 ################################################################################ … … 187 190 netcdf_mode_r = 'r' 188 191 189 #try: 190 # import tempfile 191 # from Scientific.IO.NetCDF import NetCDFFile 192 # 193 # fname = tempfile.mktemp() 194 # fid = NetCDFFile(fname, 'wl') 195 # fid.close() 196 # netcdf_mode_w = 'wl' 197 ## log('Using NetCDF large file mode') 198 #except IOError: 199 # pass 200 192 # Code to set the write mode depending on 193 # whether Scientific.IO supports large NetCDF files 194 s = """ 195 import tempfile 196 from Scientific.IO.NetCDF import NetCDFFile 197 198 fname = tempfile.mktemp() 199 fid = NetCDFFile(fname, 'wl') 200 fid.close() 201 netcdf_mode_w = 'wl' 202 log('Using NetCDF large file mode') 203 """ 204 205 # Need to run in a separate process due an 206 # error with older versions of Scientific.IO 207 if sys.platform == 'win32': 208 null = 'NUL' 209 else: 210 null = '/dev/null' 211 err = os.system('python -c "%s" 2> %s' % (s, null)) 212 213 if err > 0: 214 # The Python script s failed e.g. with a segfault 215 # which means that large file support is 216 # definitely not supported 217 pass 218 else: 219 # Try the import within this process 220 try: 221 exec(s) 222 except IOError: 223 # Large file support is not supported 224 pass 225
Note: See TracChangeset
for help on using the changeset viewer.