CWBWRF預報風場之正軌跡分析
Table of contents
背景
- 正軌跡分析的用途焦點除了在污染源行為的預測之外,也可以引用預報風場,檢討煙流在未來風場中可能的走向。
- 原本設計bt2.py時就已經將正/反軌跡的選擇設計成輸入引數之一,因此程式並沒有太大的差異,只是讀取風場數據的差異。
- 目前政府公開資訊中已經提供了中央氣象局15公里及3公里的WRF結果,垂直解析度雖然不是很充分,卻也足夠跨縣市、跨境的軌跡分析。
程式設計
程式碼差異
$ diff ft2.py bt2_DVP.py
25,26c25,26
< iii=int(x//dx[2]+ncol[2]//2)
< jjj=int(y//dx[2]+nrow[2]//2)
---
> iii=int(x//dx[4]+ncol[4]//2)
> jjj=int(y//dx[4]+nrow[4]//2)
42c42
< jj=int((j-nrow[n]//2)*fac[n] +nrow[2]//2)
---
> jj=int((j-nrow[n]//2)*fac[n] +nrow[4]//2)
44c44
< ii=int((i-ncol[n]//2)*fac[n] +ncol[2]//2)
---
> ii=int((i-ncol[n]//2)*fac[n] +ncol[4]//2)
74c74
< for n in range(1,-1,-1):
---
> for n in range(3,-1,-1):
119c119
< fnames=['CWB_forecast/wrfout_d0'+str(i)+'_'+ymd+'_00:00:00' for i in [1,3]]
---
> fnames=['links/wrfout_d0'+str(i)+'_'+ymd+'_00:00:00' for i in range(1,5)]
191,193c191,193
< nrow.append(nrow[0]*5)
< ncol.append(ncol[0]*5)
< dx=[15000,3000,3000]
---
> nrow.append(nrow[0]*27)
> ncol.append(ncol[0]*27)
> dx=[81000,27000,9000,3000,3000]
195c195
< fac=[dx[n]//dx[2] for n in range(3)]
---
> fac=[dx[n]//dx[4] for n in range(5)]
197,199c197,199
< x_mesh = [(i-ncol[2]//2)*dx[2] for i in range(ncol[2])]
< y_mesh = [(j-nrow[2]//2)*dx[2] for j in range(nrow[2])]
< z_mesh = [k*dz for k in range(nlay[2])]
---
> x_mesh = [(i-ncol[4]//2)*dx[4] for i in range(ncol[4])]
> y_mesh = [(j-nrow[4]//2)*dx[4] for j in range(nrow[4])]
> z_mesh = [k*dz for k in range(nlay[4])]
201,204c201,204
< xmin=[-dx[i]*(int(ncol[i]/2)) for i in range(2)]
< xmax=[ dx[i]*(int(ncol[i]/2)) for i in range(2)]
< ymin=[-dx[i]*(int(nrow[i]/2)) for i in range(2)]
< ymax=[ dx[i]*(int(nrow[i]/2)) for i in range(2)]
---
> xmin=[-dx[i]*(int(ncol[i]/2)) for i in range(4)]
> xmax=[ dx[i]*(int(ncol[i]/2)) for i in range(4)]
> ymin=[-dx[i]*(int(nrow[i]/2)) for i in range(4)]
> ymax=[ dx[i]*(int(nrow[i]/2)) for i in range(4)]
206c206
< for n in range(2):
---
> for n in range(4):
236c236
< if t1==nt[0] or t1<0:
---
> if t1==24 or t1<0:
242c242
< uvwg=np.zeros(shape=(3,2,nlay[2],nrow[2],ncol[2],))
---
> uvwg=np.zeros(shape=(3,2,nlay[4],nrow[4],ncol[4],))
程式下載
Download: CWBWRF預報風場之正軌跡分析程式