Changeset 2137 in lmdz_wrf
- Timestamp:
- Sep 13, 2018, 12:00:30 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/nc_var_tools.py
r2109 r2137 11538 11538 print infmsg 11539 11539 print ' ' + fname + ": creation of variable 'time' from WRF 'Times' !!" 11540 odimvar = ncobjs[0].variables['Times'] 11541 timewrfv = odimvar[:] 11542 tvals, urefvals = compute_WRFtime(timewrfv, refdate='19491201000000', tunitsval='minutes') 11540 tvals = [] 11541 for ifile in range(Nfiles): 11542 odimvar = ncobjs[ifile].variables['Times'] 11543 timewrfv = odimvar[:] 11544 tvals0, urefvals = compute_WRFtime(timewrfv, refdate='19491201000000', \ 11545 tunitsval='minutes') 11546 tvals = tvals + list(tvals0) 11547 tvals = np.array(tvals) 11543 11548 dimtwrf = len(tvals) 11544 11549 if not gen.searchInlist(newnc.dimensions,'time'): 11545 11550 newnc.createDimension('time',None) 11546 11551 newvar = newnc.createVariable('time', 'f8', 'time') 11552 newvar[:] = np.zeros((totcondim), dtype=np.float64) 11547 11553 basicvardef(newvar, 'time', 'Time', urefvals) 11548 11554 newvar.setncattr('axis', 'T') … … 11601 11607 timewrfvf = odimvarf[:] 11602 11608 tvalsf, utimef = compute_WRFtime(timewrfvf, refdate='19491201000000', tunitsval='minutes') 11603 ldimfile = tvals .shape[0]11609 ldimfile = tvalsf.shape[0] 11604 11610 dimn = 'time' 11605 11611 condimn = 'time' 11606 if dimn == condim :11612 if dimn == condim or (condim == 'Time' and vardimname == 'WRFtime'): 11607 11613 slicevartot.append(slice(begslicetot,begslicetot+ldimfile)) 11608 11614 begslicetot = begslicetot + ldimfile
Note: See TracChangeset
for help on using the changeset viewer.