Changeset 331 in lmdz_wrf
- Timestamp:
- Feb 27, 2015, 2:33:46 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r329 r331 12179 12179 12180 12180 if wrfnc.variables.has_key(varn): 12181 print errormsg12181 print warnmsg 12182 12182 print ' ' + fname + ": WRF file '" + ncfile + "' already has variable '" + \ 12183 12183 varn + "' !!!" 12184 quit(-1)12184 print ' overwritting values' 12185 12185 12186 12186 timeobj = wrfnc.variables['Times'] … … 12194 12194 secref=refdate[12:14] 12195 12195 12196 refdateS = yrref + ' /' + monref + '/' + dayref + '_' + horref + ':' + minref + \12196 refdateS = yrref + '-' + monref + '-' + dayref + ' ' + horref + ':' + minref + \ 12197 12197 ':' + secref 12198 12198 … … 12206 12206 tunits = tunitsval + ' since ' + refdateS 12207 12207 12208 newvar = wrfnc.createVariable('time','f4',('Time')) 12208 if wrfnc.variables.has_key(varn): 12209 newvar = wrfnc.variables[varn] 12210 else: 12211 newvar = wrfnc.createVariable('time','f4',('Time')) 12212 12209 12213 newattr = basicvardef(newvar, 'time','time',tunits) 12210 12214 newvar[:] = cftimes
Note: See TracChangeset
for help on using the changeset viewer.