Changeset 353 in lmdz_wrf
- Timestamp:
- Mar 10, 2015, 1:08:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/TS_ASCII_netCDF.py
r352 r353 118 118 tsvaluesv = np.zeros( (dimt,Ntsvariables), dtype= np.float) 119 119 120 pracc = np.zeros((dimt), dtype=np.float) 121 120 122 itz = 0 121 123 for it in range(dimt): … … 125 127 tsvaluesv[it,iv] = np.float(tsvals[itz][iv+5]) 126 128 129 pracc[it] = np.float(tsvals[it][16]) + np.float(tsvals[it][17]) 127 130 itz = itz + 1 128 # Surface variables 131 132 # time 129 133 newvar = objofile.createVariable('time','f8',('time')) 130 134 newvar[:] = time_stepv … … 139 143 newattr = ncvar.basicvardef(newvar, tsvn[iv], tsvln[iv], tsvu[iv] ) 140 144 145 # Extra vars 146 147 # pr 148 varvals = np.zeros((dimt), dtype=np.float) 149 varvals[1:dimt] = pracc[1:dimt] - pracc[0:dimt-1] 150 151 newvar = objofile.createVariable('pr', 'f4', ('time')) 152 newvar[:] = varvals 153 newattr = ncvar.basicvardef(newvar, 'pr', 'precipitation', 'mm' ) 154 141 155 objofile.sync() 142 156 objofile.close()
Note: See TracChangeset
for help on using the changeset viewer.