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


Ignore:
Timestamp:
Feb 26, 2015, 11:15:07 AM (10 years ago)
Author:
lfita
Message:

Working on 'ncstediffp' time-step (deaccumulate) differences

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r308 r309  
    1347913479            slicebck, dbck = slice_variable(ovar, tdimn + ':0@'+str(dimt-1))
    1348013480
    13481             print slicefwd[:,15,15] - slicebck[:,15,15]
    13482 
    1348313481            deaccum = np.zeros((varinf.dims), dtype=varinf.dtype)
    1348413482            ddeaccum = []
     
    1349813496                    newvar = onc.createVariable(vn + 'de', varinf.dtype,             \
    1349913497                      tuple(varinf.dimns))
    13500                 newvar[:] = deaccum
    1350113498            else:
    13502                 devar = onc.variables[vn + 'de']
    13503                 devar = deaccum
     13499                print warnmsg
     13500                print '  ' + fname ": variable '"vn + "de' already exist!!"
     13501                print '    replacing values'
     13502                newvar = onc.variables[vn + 'de']
     13503
     13504            newvar[:] = deaccum
    1350413505
    1350513506            newattr = set_attribute(newvar, 'deaccumulated', 'True')
Note: See TracChangeset for help on using the changeset viewer.