Changeset 1434 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jan 20, 2017, 3:05:32 PM (8 years ago)
Author:
lfita
Message:

Fixing a 'segmentation fault' on `file_oper_alongdims'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r1433 r1434  
    94479447
    94489448            varslice, varsliceddims = SliceVarDict(ov,dimslice)
    9449             varvals0 = ov[tuple(varslice)]
     9449            # This is absolutely weirdm, but if not there is segmentation fault!
     9450            if len(varsliceddims) == len(ov.shape):
     9451                varvals0 = np.zeros(tuple(ov.shape), dtype=np.float)
     9452                for ix in range(ov.shape[0]):
     9453                    varvals0[ix,...] = ov[ix,...]
     9454            else:
     9455                varvals0 = ov[tuple(varslice)]
    94509456            varvals = np.squeeze(varvals0)
    94519457
Note: See TracChangeset for help on using the changeset viewer.