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


Ignore:
Timestamp:
Jun 17, 2015, 5:43:57 PM (9 years ago)
Author:
lfita
Message:

Fixing minor typos/issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/validation_sim.py

    r506 r511  
    16561656
    16571657print main + ': found',Nexactt,'Temporal same values in simulation and observations'
     1658
    16581659# Sim Coincident times
    16591660##
     1661sumsimval = 0.
     1662sum2simval = 0.
     1663Nsimt = 0
    16601664coindtvalues0 = []
     1665coindtvalues0st = []
     1666tsiminit = 0
     1667tsimend = 0
     1668
    16611669for it in range(dimtsim):   
    16621670    ot = 0
     
    16661674            ot = ito
    16671675            tdist = simobstimes[it] - valdimobs['T'][ito]
    1668             coindtvalues0.append([it, ito, simobstimes[it], valdimobs['T'][ito],      \
     1676            coindtvalues0.append([it, ito, simobstimes[it], valdimobs['T'][ito],     \
    16691677              tdist])
     1678            Nsimt = Nsimt + 1
     1679            if tsiminit == 0: tsiminit=simobstimes[it]
     1680            tsimend = simobstimes[it]
     1681        elif simobstimes[it] > valdimobs['T'][ito+1]:
     1682            coindtvalues0st.append([Nsimt, ito, valdimobs['T'][ito],tsimend-tsiminit])
    16701683
    16711684coindtvalues = np.array(coindtvalues0, dtype=np.float)
     1685coindtvaluesst = np.array(coindtvalues0st, dtype=np.float)
    16721686
    16731687Ncoindt = len(coindtvalues[:,0])
     
    16881702# Dimensions
    16891703newdim = onewnc.createDimension('time',None)
     1704newdim = onewnc.createDimension('betweentime',None)
    16901705newdim = onewnc.createDimension('bnds',2)
    16911706newdim = onewnc.createDimension('obstime',None)
     
    17011716# Variable dimensions
    17021717##
    1703 newvar = onewnc.createVariable('obstime','f8',('time'))
    1704 basicvardef(newvar, 'obstime', 'time observations', obstunits )
     1718newvar = onewnc.createVariable('exacttime','f8',('time'))
     1719basicvardef(newvar, 'obstime', 'exact coincident time observations and simulation', obstunits)
     1720set_attribute(newvar, 'calendar', 'standard')
     1721newvar[:] = exacttvalues[:,3]
     1722
     1723newvar = onewnc.createVariable('obstime','f8',('obstime'))
     1724basicvardef(newvar, 'obstime', 'time observations for between values', obstunits)
    17051725set_attribute(newvar, 'calendar', 'standard')
    17061726set_attribute(newvar, 'bounds', 'time_bnds')
    17071727newvar[:] = coindtvalues[:,3]
     1728
     1729newvar = onewnc.createVariable('betweentime','f8',('betweentime'))
     1730basicvardef(newvar, 'obstime', 'time simulations for between values', simtunits )
     1731set_attribute(newvar, 'calendar', 'standard')
     1732set_attribute(newvar, 'bounds', 'time_bnds')
     1733newvar[:] = coindtvalues[:,2]
    17081734
    17091735newvar = onewnc.createVariable('couple', 'c', ('couple','StrLength'))
     
    19661992          aroundostats[3,it])
    19671993
    1968 # sim Values to netCDF
    1969     newvar = onewnc.createVariable(valvars[ivar][0] + '_sim', 'f', ('time'),         \
     1994# exact sim Values to netCDF
     1995    newvar = onewnc.createVariable(valvars[ivar][0] + '_Esim', 'f', ('time'),        \
    19701996      fill_value=fillValueF)
    1971     descvar = 'simulated: ' + valvars[ivar][0]
     1997    descvar = 'exact time simulated: ' + valvars[ivar][0]
     1998    basicvardef(newvar, valvars[ivar][0], descvar, ovobs.getncattr('units'))
     1999    newvar[:] = Earrayvals[:,0]
     2000
     2001# exact obs Values to netCDF
     2002    newvar = onewnc.createVariable(valvars[ivar][1] + '_Eobs', 'f', ('time'),        \
     2003      fill_value=fillValueF)
     2004    descvar = 'exact time observed: ' + valvars[ivar][1]
     2005    basicvardef(newvar, valvars[ivar][1], descvar, ovobs.getncattr('units'))
     2006    newvar[:] = Earrayvals[:,1]
     2007
     2008# between sim Values to netCDF
     2009    newvar = onewnc.createVariable(valvars[ivar][0] + '_sim', 'f', ('betweentime'),  \
     2010      fill_value=fillValueF)
     2011    descvar = 'between observed time simulated: ' + valvars[ivar][0]
    19722012    basicvardef(newvar, valvars[ivar][0], descvar, ovobs.getncattr('units'))
    19732013    newvar[:] = arrayvals[:,0]
    19742014
    1975 # obs Values to netCDF
    1976     newvar = onewnc.createVariable(valvars[ivar][1] + '_obs', 'f', ('time'),         \
     2015# between obs Values to netCDF
     2016    newvar = onewnc.createVariable(valvars[ivar][1] + '_obs', 'f', ('obstime'),      \
    19772017      fill_value=fillValueF)
    19782018    descvar = 'observed: ' + valvars[ivar][1]
Note: See TracChangeset for help on using the changeset viewer.