Changeset 1436 in lmdz_wrf


Ignore:
Timestamp:
Jan 20, 2017, 5:31:59 PM (8 years ago)
Author:
lfita
Message:

Improving the avoidance of `seg fault' on 1-rank variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r1435 r1436  
    1809718097                newvar = newonc.createVariable(oldv, nctype(vinf.dtype), vinf.dimns)
    1809818098            # Avoiding segmentation fault in Curie...
    18099             for ix in range(newvar.shape[0]):
    18100                 newvar[ix,...] = oldov[ix,...]
     18099            if len(newvar.shape) > 1:
     18100                for ix in range(newvar.shape[0]):
     18101                    newvar[ix,...] = oldov[ix,...]
     18102            else:
     18103                newvar[:] = oldov[:]
    1810118104            for attrn in vinf.attributes:
    1810218105                if attrn != '_FillValue':
Note: See TracChangeset for help on using the changeset viewer.