Changeset 763 in lmdz_wrf for trunk/tools/nc_var_tools.py


Ignore:
Timestamp:
May 9, 2016, 10:23:46 AM (9 years ago)
Author:
lfita
Message:

Working version even with spaces of `writing_str_nc'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r762 r763  
    44614461        else:
    44624462            stringv = values[iv] 
    4463         charvals = np.chararray(Lchar)
     4463        charvals = np.zeros((Lchar), dtype='string_')
    44644464        Lstr = len(stringv)
    44654465        charvals[Lstr:Lchar] = ''
    44664466
    44674467        for ich in range(Lstr):
     4468            chrv = stringv[ich:ich+1]
     4469            if ord(chrv) == 32: chrv = unichr(32)
    44684470            charvals[ich] = stringv[ich:ich+1]
    4469 
    4470         print 'Lluis: ' + fname + 'stringv:', stringv, 'charvals:', charvals
    4471         quit()
    44724471        varo[iv,:] = charvals
    44734472
Note: See TracChangeset for help on using the changeset viewer.