WPS - UNGRIB

Ungrib

UNGRIB - 氣象資料分割

ungrib 程式讀取 GRIB 檔案,提取(氣象)資料,並將數據寫入簡單的中介格式。GRIB 檔案包含了隨時間變化的氣象場,通常來自另一個區域或全球模式,例如 NCEP 的 GFS (Global Forecast System) 或是 ECMWF的 IFS (Integrated Forecasting System) 或是它們的再分析資料。GRIB格式的檔案使用數字代碼(code)來識別檔案中的變數和層場。因此需要給定 Vtable 又稱作「變數表」,它定義了要從 GRIB 檔案中數字代碼(code)跟變數的對應,提取指定的資料片段並寫入中介格式中。

Linking the data

將先前準備好的氣象場資料 (FNL/ECMWF) 連結至此,並執行 link_grib.csh 來連結資料:[./link_grib.csh ${PATH2ANALYSES}/*],成功後會出現  GRIBFILE.AAA GRIBFILE.AAB 、  GRIBFILE.AAC GRIBFILE.AAD ….會以這樣的排序排下去,若失敗會出現紅底,此時請確認你的資料路徑是否正確。以 ECMWF/ERA5 的資料示範比較嚴謹的作法(做兩次ungrib,因為 ERA5 資料有分Pressure level 跟 single(surface) level 兩種),如果只做一次就可以取得使用者想取得的必要資料 (可以從 metgrid 生成的met_em*.nc 檔來確認變數) 也是可以的,沒有規定一定要怎麼做才是正確的。

Linking the Vtable

GRIB 檔案還需要給變數表,讓 ungrib 程式可以認到正確的變數。內建的變數表位置放在 ${WPS_DIR}/ungrib/Variable_Tables 目錄下,可以打開確認是不是符合所需的 GRIB 檔案,確定的話,請用軟連結將變數表連結至 WPS 的最上層目錄,並命名成 Vtable。

Vtables List

WPS 中已存在的 Vtable ,及適用的分析場資料。

Editing namelist.wps

namelist.wps 的設定重點就是時間了,Domain 01 就必須至少要包含需要模擬的整段時間才行,因為邊界條件完全依賴分析場資料來提供。這一步 (ungrib) 只是把資料去蕪存菁,取必要的值,還跟內層 domain 較無關。

Extracting the data at surface level

[USER@VAPOR]$ cd ${WPS_DIR}[USER@VAPOR]$ ./link_grib.csh ${data_era5}/*SFC*grib[USER@VAPOR]$ ln -sf ungrib/Variable_Tables/Vtable.ECMWF Vtable[USER@VAPOR]$ vi namelist.wps&share wrf_core = 'ARW', max_dom = 3, start_date = '2015-08-06_12:00:00','2015-08-06_12:00:00','2015-08-06_12:00:00', end_date   = '2015-08-09_12:00:00','2015-08-06_12:00:00','2015-08-06_12:00:00', interval_seconds = 21600 io_form_geogrid = 2,/...(略)...&ungrib out_format = 'WPS', prefix = 'SFC', # prefix of ungrib output file/

執行ungrib.exe,執行完要確認一下 SFC 開頭的檔案數量。

Executing ungrib

[USER@VAPOR]$ cd ${WPS_DIR}[USER@VAPOR]$ ./ungrib.exe ...( 略 )...2024-03-08 15:25:12.918 ---  Deleting file: ./PFILE:2015-08-08_122024-03-08 15:25:13.042 ---  Deleting file: ./PFILE:2015-08-08_182024-03-08 15:25:13.203 ---  Deleting file: ./PFILE:2015-08-09_002024-03-08 15:25:13.336 ---  Deleting file: ./PFILE:2015-08-09_062024-03-08 15:25:13.512 ---  Deleting file: ./PFILE:2015-08-09_122024-03-08 15:25:13.768 --- ****  Done deleting temporary files.2024-03-08 15:25:13.769 ---  *** Successful completion of program ungrib.exe *** 

Extracting the data in pressure levels

[USER@VAPOR]$ cd ${WPS_DIR}[USER@VAPOR]$ ./link_grib.csh ${data_era5}/*PRES*grib[USER@VAPOR]$ vi namelist.wps&share wrf_core = 'ARW', max_dom = 3, start_date = '2015-08-06_12:00:00','2015-08-06_12:00:00','2015-08-06_12:00:00', end_date   = '2015-08-09_12:00:00','2015-08-06_12:00:00','2015-08-06_12:00:00', interval_seconds = 21600 io_form_geogrid = 2,/...(略)...&ungrib out_format = 'WPS', prefix = 'PRES', # prefix of ungrib output file/

兩次執行 ungrib.exe 所產出的不同 prefix 開頭的檔案都有出現的話,就可以往 metgrid 前進。