Link Search Menu Expand Document

亞洲土地使用檔案

Table of contents

背景

  • CCTM執行過程會需要E2C_LU(Fractional crop distributions)檔案,以供雙向氨氣通量之計算。在美國本土USEPA提供了軟體界面,其他地區則需自行產生。
    • 依據範例,E2C_LU的內容可以參考tarball之${LUpath}/beld4_12kmCONUS_2006nlcd.ncf、${INPDIR}/surface/beld4_camq12km_2011_4CMAQioapi.ncf等檔案
    • 範例檔案共有21種穀物栽植(加上灌溉_irr共42種)、以及194林相分布的資料庫,除此之外,還有40種NLCD/MODIS土地覆蓋類別。
    • 21 種穀物與FEST-C系統編號對照表
BELD4BELD3Crop NameBELD4BELD3Crop NameBELD4BELD3Crop Name
122Hay1536Cotton2950SorghumSilage
324Alfalfa1738Oats3152Soybeans
526Other_Grass1940Peanuts3354Wheat_Spring
728Barley2142Potatoes3556Wheat_Winter
930BeansEdible2344Rice3758Other_Crop
1132CornGrain2546Rye3960Canola
1334CornSilage2748SorghumGrain4162Beans
  • 此處土地使用設定主要來依據WRF系統的LUFRAC檔案。

模版處理過程

NCO及ipython交互處理

  • 原始模版:beld4.EAsia_81K.ncf
  • 目標:南北擴增到389、東西伸長到665,以與mcip網格定義一致
kuang@DEVP /nas1/cmaqruns/2018base/data/land
$ cat ../mcip/1804_run5/CWBWRF_15k/GRIDDESC
' '
'TWN_PULI'
  2        10.000        40.000       121.736       121.736        23.610
' '
'CWBWRF_15k'
'TWN_PULI'  -4980000.000  -2966000.000     15000.000     15000.000 665 389   1
' '

擴增南北向

  • ncpdq改順序、ncks開放UNLIMITED
nc=beld4.CWBWRF_15k.ncf
cp beld4.EAsia_81K.ncf $nc
ncpdq -O -a ROW,TSTEP,LAY,COL $nc a;ncks -O --mk_rec_dmn ROW a $nc
  • 進入ipython
fname='beld4.CWBWRF_15k.ncf'
nc = netCDF4.Dataset(fname, 'r+')
V=[list(filter(lambda x:nc.variables[x].ndim==j, [i for i in nc.variables])) for j in [1,2,3,4]]
nrow,nt,nlay,ncol=(nc.variables[V[3][0]].shape[i] for i in range(4)
for j in range(nrow,389):
  for v in V[3]:
    nc[v][j,0,0,:]=0.
nc.NROWS=389
nc.close()

擴增東西向

  • 回到OS、用ncpdq改順序、ncks開放UNLIMITED
ncpdq -O -a COL,TSTEP,LAY,ROW $nc a;ncks -O --mk_rec_dmn COL a $nc
  • 進入ipython
nc = netCDF4.Dataset(fname, 'r+')
for j in range(ncol,665):
  for v in V[3]:
    nc[v][j,0,0,:]=0.
nc.NCOLS=665
# 其他全域屬性,抄自mcip結果
# 注意:VG*、NLAYS等垂直設定不能抄襲、NVARS也不能覆蓋、刪除舊的HISTORY會使檔案看起來較為清爽
fname='../mcip/1804_run5/CWBWRF_15k/LUFRAC_CRO_1804_run5.nc'
nc0 = netCDF4.Dataset(fname, 'r')
atts=['CDATE',  'CTIME', 'EXEC_ID', 'FILEDESC', 'FTYPE', 'GDNAM', 'GDTYP', 'HISTORY', 'IOAPI_VERSION', 'NCO', 'NCOLS',  'NROWS',
     'NTHIK', 'P_ALP', 'P_BET', 'P_GAM', 'UPNAM', 'WDATE',
     'WTIME', 'XCELL', 'XCENT', 'XORIG', 'YCELL', 'YCENT', 'YORIG']
for i in atts:
  if i not in dir(nc0):continue
  exec('nc.'+i+'=nc0.'+i)
nc.close()

恢復順序

ncpdq -O -a TSTEP,LAY,ROW,COL $nc a;ncks -O --mk_rec_dmn TSTEP a $nc

填入MODIS值

由LUFRAC填入MODIS

fname='beld4.CWBWRF_15k.ncf'
nc = netCDF4.Dataset(fname, 'r+')
V=[list(filter(lambda x:nc.variables[x].ndim==j, [i for i in nc.variables])) for j in [1,2,3,4]]
modis=["MODIS_"+str((i+1)%17) for i in range(17)]
for v in V[3]:
  nc[v][:]=0.
  if v[:6]=="MODIS_":
    try:
      ii=int(v[6:8])-1
    except:
      ii=17+int(v[9:10])
    else:
      if ii<0:ii=ii+17
    nc[v][0,0,:,:]=nc0["LUFRAC"][0,ii,:,:]

確認

  • 所有網格MODIS加總必須<=1
modis=[i for i in V[3] if 'MODIS' in i and 'Res' not in i]
var=np.zeros(shape=(len(modis),nrow,ncol))
for v in modis:
  iv=modis.index(v)
  var[iv,:,:]=nc[v][0,0,:,:]
sumv=np.sum(var[:,:,:],axis=0)
np.max(sumv) 
#1.0000000596046448  
MODIS_16.PNG
圖 CWBWRF_15k範圍土地使用(MODIS_16)之分布

Reference

  • USEAP, Fertilizer Emission Scenario Tool for CMAQ (FEST-C v1.4), cmascenter,09/20/2018
  • 必全,**中國農業地圖全國植物區域分布圖**, kknews.cc, 2019-10-31.
  • Mishra, B., Busetto, L., Boschetti, M., Laborte, A., Nelson, A. (2021). RICA: A rice crop calendar for Asia based on MODIS multi year data. International Journal of Applied Earth Observation and Geoinformation 103, 102471.doi