Changeset 341 in lmdz_wrf for trunk/tools/validation_sim.py


Ignore:
Timestamp:
Mar 6, 2015, 12:54:12 PM (10 years ago)
Author:
lfita
Message:

Too many after 5MetMed fast changes to kept track..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/validation_sim.py

    r340 r341  
    707707                varNOcheckv = 360.*(1. + theta/(2.*np.pi))
    708708
    709                 dimensions = ncobj.variables['U'].dimensions
    710                 shape = ncobj.variables['U'].shape
    711 
    712709            elif varn == 'WRFz':
    713710                grav = 9.81
     
    12721269
    12731270# Around values
    1274     if dims.has_key('Z'):
    1275         if not onewnc.dimensions.has_key('zaround'):
    1276             newdim = onewnc.createDimension('zaround',Ngrid*2+1)
    1277 
    1278         newvar = onewnc.createVariable(valvars[ivar][0] + 'around', 'f',            \
    1279           ('time','zaround','yaround','xaround'), fill_value=fillValueF)
    1280     else:
    1281         newvar = onewnc.createVariable(valvars[ivar][0] + 'around', 'f',            \
    1282           ('time','yaround','xaround'), fill_value=fillValueF)
    1283 
    1284     descvar = 'around simulated values +/- grid values: ' + valvars[ivar][0]
    1285     basicvardef(newvar, varsimobs + 'around', descvar, ovobs.getncattr('units'))
    1286     newvar[:] = simobsSvalues
     1271    if not onewnc.variables.has_key(valvars[ivar][0] + 'around'):
     1272        if dims.has_key('Z'):
     1273            if not onewnc.dimensions.has_key('zaround'):
     1274                newdim = onewnc.createDimension('zaround',Ngrid*2+1)
     1275                newvar = onewnc.createVariable(valvars[ivar][0] + 'around', 'f',     \
     1276                  ('time','zaround','yaround','xaround'), fill_value=fillValueF)
     1277        else:
     1278            newvar = onewnc.createVariable(valvars[ivar][0] + 'around', 'f',         \
     1279              ('time','yaround','xaround'), fill_value=fillValueF)
     1280
     1281        descvar = 'around simulated values +/- grid values: ' + valvars[ivar][0]
     1282        basicvardef(newvar, varsimobs + 'around', descvar, ovobs.getncattr('units'))
     1283        newvar[:] = simobsSvalues
    12871284
    12881285# Statistics
    1289     newvar = onewnc.createVariable(valvars[ivar][0] + 'staround', 'f',               \
    1290       ('time','stats'), fill_value=fillValueF)
    1291     descvar = 'around simulated statisitcs: ' + valvars[ivar][0]
    1292     basicvardef(newvar, varsimobs + 'staround', descvar, ovobs.getncattr('units'))
    1293     newvar[:] = aroundstats.transpose()
    1294 
    1295     onewnc.sync()
     1286    if not searchInlist(onewnc.variables,valvars[ivar][0]):
     1287        newvar = onewnc.createVariable(valvars[ivar][0] + 'staround', 'f',           \
     1288          ('time','stats'), fill_value=fillValueF)
     1289        descvar = 'around simulated statisitcs: ' + valvars[ivar][0]
     1290        basicvardef(newvar, varsimobs + 'staround', descvar, ovobs.getncattr('units'))
     1291        newvar[:] = aroundstats.transpose()
     1292
     1293        onewnc.sync()
    12961294
    12971295newvar = onewnc.createVariable('simtrj','i',('time','simtrj'))
Note: See TracChangeset for help on using the changeset viewer.