- 积分
- 408
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-11-15
- 最后登录
- 1970-1-1
|
发表于 2017-4-18 21:48:34
|
显示全部楼层
# Set working directory
metDir = 'I:\Tianhe\wrf_exp18'
outDir = 'I:\Tianhe\wrf_exp18'
workingDir = 'I:\Tianhe\wrf_exp18'
os.chdir(workingDir)
print 'Current directory: ' + os.getcwd()
# Set parameters
lon = '140.0'
lat = '30.0'
shour = '06'
heights = ['100.0','500.0','1000.0']
hnum = len(heights)
hours = '-12'
vertical = '0'
top = '10000.0'
# Set meteorological data files
fns = []
fn = 'test_wrfout1.arl'
fns.append(fn)
# Set start/end time
stime = datetime.datetime(2001,6,29)
# Write CONTROL file
ctFile = './CONTROL'
print stime.strftime('%Y-%m-%d ') + shour + ':00'
ctf = open(ctFile, 'w')
ctf.write(stime.strftime('%y %m %d ') + shour + "\n")
ctf.write(str(hnum) + '\n')
for j in range(0,hnum):
ctf.write(lat + ' ' + lon + ' ' + heights[j] + '\n')
ctf.write(hours + '\n')
ctf.write(vertical + '\n')
ctf.write(top + '\n')
fnnum = len(fns)
ctf.write(str(fnnum) + '\n')
for j in range(0,fnnum):
ctf.write(metDir + '/' + '\n')
ctf.write(fns[j] + '\n')
ctf.write(outDir + '/' + '\n')
outfn = stime.strftime('traj_%Y%m%d')
ctf.write(outfn)
ctf.close()
# Calculate trajectories
os.system('c:/hysplit4/exec/hyts_std.exe')
print 'Finish...'
王老师,根据您提供的脚本,我把wrfout数据转化成arl,但对比了原来的wrfout和新的数据发现出现了数据的移位(附图),上面是我的脚本,请问这可能是什么原因呢?
|
-
-
|