Changeset 1458 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Feb 24, 2017, 7:37:50 PM (8 years ago)
Author:
lfita
Message:

Avoiding segmentation fault in Curie in `compute_opersvarsfiles'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r1457 r1458  
    70717071            # Getting values of the variable
    70727072            varslice, dimvarvals = SliceVarDict(varobj, dictslice)
     7073
     7074            # Avoiding segmentation fault in Curie...
     7075            varvals = slice_createArray(varslice, varobj.dtype)
     7076            if len(varvals.shape) > 1:
     7077                if varvals.shape[0] != 0:
     7078                    for ix in range(varvals.shape[0]):
     7079                        varvals[ix,...] = varobj[ix,...]
     7080                else:
     7081                    for ix in range(varvals.shape[len(varvals.shape)-1]):
     7082                        varvals[...,ix] = varobj[...,ix]
     7083            else:
     7084                varvals[:] = varobj[:]
     7085
    70737086            varvals = varobj[tuple(varslice)]
    70747087
Note: See TracChangeset for help on using the changeset viewer.