Changeset 511 in lmdz_wrf for trunk/tools/validation_sim.py
- Timestamp:
- Jun 17, 2015, 5:43:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/validation_sim.py
r506 r511 1656 1656 1657 1657 print main + ': found',Nexactt,'Temporal same values in simulation and observations' 1658 1658 1659 # Sim Coincident times 1659 1660 ## 1661 sumsimval = 0. 1662 sum2simval = 0. 1663 Nsimt = 0 1660 1664 coindtvalues0 = [] 1665 coindtvalues0st = [] 1666 tsiminit = 0 1667 tsimend = 0 1668 1661 1669 for it in range(dimtsim): 1662 1670 ot = 0 … … 1666 1674 ot = ito 1667 1675 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], \ 1669 1677 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]) 1670 1683 1671 1684 coindtvalues = np.array(coindtvalues0, dtype=np.float) 1685 coindtvaluesst = np.array(coindtvalues0st, dtype=np.float) 1672 1686 1673 1687 Ncoindt = len(coindtvalues[:,0]) … … 1688 1702 # Dimensions 1689 1703 newdim = onewnc.createDimension('time',None) 1704 newdim = onewnc.createDimension('betweentime',None) 1690 1705 newdim = onewnc.createDimension('bnds',2) 1691 1706 newdim = onewnc.createDimension('obstime',None) … … 1701 1716 # Variable dimensions 1702 1717 ## 1703 newvar = onewnc.createVariable('obstime','f8',('time')) 1704 basicvardef(newvar, 'obstime', 'time observations', obstunits ) 1718 newvar = onewnc.createVariable('exacttime','f8',('time')) 1719 basicvardef(newvar, 'obstime', 'exact coincident time observations and simulation', obstunits) 1720 set_attribute(newvar, 'calendar', 'standard') 1721 newvar[:] = exacttvalues[:,3] 1722 1723 newvar = onewnc.createVariable('obstime','f8',('obstime')) 1724 basicvardef(newvar, 'obstime', 'time observations for between values', obstunits) 1705 1725 set_attribute(newvar, 'calendar', 'standard') 1706 1726 set_attribute(newvar, 'bounds', 'time_bnds') 1707 1727 newvar[:] = coindtvalues[:,3] 1728 1729 newvar = onewnc.createVariable('betweentime','f8',('betweentime')) 1730 basicvardef(newvar, 'obstime', 'time simulations for between values', simtunits ) 1731 set_attribute(newvar, 'calendar', 'standard') 1732 set_attribute(newvar, 'bounds', 'time_bnds') 1733 newvar[:] = coindtvalues[:,2] 1708 1734 1709 1735 newvar = onewnc.createVariable('couple', 'c', ('couple','StrLength')) … … 1966 1992 aroundostats[3,it]) 1967 1993 1968 # sim Values to netCDF1969 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'), \ 1970 1996 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] 1972 2012 basicvardef(newvar, valvars[ivar][0], descvar, ovobs.getncattr('units')) 1973 2013 newvar[:] = arrayvals[:,0] 1974 2014 1975 # obs Values to netCDF1976 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'), \ 1977 2017 fill_value=fillValueF) 1978 2018 descvar = 'observed: ' + valvars[ivar][1]
Note: See TracChangeset
for help on using the changeset viewer.