#!/opt/anaconda3/envs/py37/bin/python
importnumpyasnpimportnetCDF4importos,sysimportdatetimefname=sys.argv[1]nc=netCDF4.Dataset(fname,'r')V=[list(filter(lambdax:nc.variables[x].ndim==j,[iforiinnc.variables]))forjin[1,2,3,4]]v='Times'ifvnotinV[1]:sys.exit('not a wrf system file')nt=len(nc[v][:,0])strT=[''.join([i.decode('utf-8')foriinnc[v][t,:]])fortinrange(nt)]forainstrT:print(datetime.datetime.strptime(a,'%Y-%m-%d_%H:00:00'))