WPS - GEOGRID

Geogrid

生成地表靜態資訊

Geogrid 的目的是定義模式地理/水平方向的 domain 網格,並將各種地表數據資料插值到模式網格上。模擬的 domain 網格是使用 namelist.wps 文件中的 &geogrid 區段指定的參數來定義的。除了計算每個網格點的緯度、經度和地圖比例因子(投影方法)之外,geogrid 還預設進行土壤類別、土地利用類別、地形高度、年均深層土壤溫度、月份植被比例、月份反照率、最大雪反照率和坡度類別等等資訊插值到模式網格上,這些地表靜態資料可以視為是不隨時間改變的(以區域模式能預報的角度而言)。部分靜態資料只有提供一種解析度可用,某些的資料有提供30"、2'、5'和10'的分辨率提供;這裡,“表示弧秒,“表示弧分,使用接近模式網格間距的資料,進行插值通常會更具代表性。

Editing namelist.wps

接著我們要來設計區域模式的巢狀網格位置,namelist.wps 是用來更改 WPS 的設定用,分為三支程式共用的 &share 區段、以及各程式專用的區段(如 geogrid 專用的 &geogrid 區段)。

[USER@VAPOR ***]$ cd ${WPS_DIR}/WPS[USER@VAPOR ***]$ vi namelist.wps&share  wrf_core = 'ARW',  max_dom = 3,  start_date = '2019-09-04_12:00:00','2019-09-04_12:00:00',  end_date   = '2019-09-06_18:00:00','2019-09-04_12:00:00',  interval_seconds = 10800,  io_form_geogrid = 2/
&geogrid  parent_id         =   1,   1,  parent_grid_ratio =   1,   3,  i_parent_start    =   1,  53,  j_parent_start    =   1,  25,  e_we              =  150, 220,  e_sn              =  130, 214,  geog_data_res     = 'default','default',  dx = 15000,  dy = 15000,  map_proj = 'lambert',  ref_lat   =  33.00,  ref_lon   = -79.00,  truelat1  =  30.0,  truelat2  =  60.0,  stand_lon = -79.0.,  geog_data_path = '/glade/work/wrfhelp/WPS_GEOG/'/

在 namelist 的 &share 區段,有三個參數跟 geogrid 有關:

wrf_core = 'ARW' # The WRF dynamical core for an ARW simulation = 'NMM' # The WRF dynamical core for an NMM simulation
max_dom = 1 # The total number of domains/nesting levels
io_form_geogrid = 2 # 1 for binary output (*.int) # 2 for NetCDF output (*.nc) # 3 for GRIB1 output (*.gr1)

Design Flow

設定 Geogrid 的建議流程

1. 決定巢狀網格數量 

2. 決定投影法及相關投影參數 

3. 由外而內依序設定 Domain 參數 (一次一個Domain) 

4. NCL 畫圖 (確定目前 Domain 位置之後,回 3. 往內層設定,直到所有的 Domain 設定都完成)

5. 填寫靜態地理資料的路徑及每個 Domain 要設定的靜態資料參數

由於 geogrid 是生成靜態資料,所以 &share 區段中跟時間有關的起始時間 (start_date) 、結束時間 (end_date)、分析場資料時間間距 (interval_seconds) 參數,geogrid 執行時是直接忽略的。

Controlling projections by parameters

map_proj = 'lambert' # the Lambert conformal projection, which is well-suited for mid-latitude domains. = 'polar' # the polar stereographic projection, which is best suited for high-latitude WRF domains. = 'mercator' # the Mercator projection, which is good for low-latitude domains or domains with predominantly west-east extent. = 'lat-lon' # The cylindrical equidistant projection is required for global simulations, although in its rotated aspect (i.e., when pole_lat, pole_lon, and stand_lon are changed from their default values) it can also be well-suited for regional domains anywhere on the earth’s surface.
ref_lat =  33.00, ref_lon = -79.00, # Specify the latitude and longitude, respectively, of the center of the coarse domain.truelat1 =  30.0, # A real value specifying, for ARW, the first true latitude for the Lambert conformal projection, or the only true latitude for the Mercator and polar stereographic projections.truelat2 =  60.0, # A real value specifying, for ARW, the second true latitude for the Lambert conformal conic projection. For all other projections, truelat2 is ignored.stand_lon = -79.0., # gives the rotation about the earth’s axis.

Recalling the geography class  at 10th grade (high school)

Setting the domains and grids sizes

控制domain大小、內層domain的平移、網格間距

max_dom = 1 # 巢狀網格總數量,預設是1。

parent_id = NUM # 父母網格編號(它的外層domain是誰,已是最外層則寫1或0)。

parent_grid_ratio = NUM # 子網格和父母網格的網格間距比例(要奇數,建議3,頂多5,請依作業規則設置)。

i_parent_start a = NUM # 子網格的西側邊界和父母網格的西側邊界相距幾個父母網格長(左右平移,單位是父母網格個數)。

j_parent_start = NUM # 子網格的南側邊界和父母網格的南側邊界相距幾個父母網格長(上下平移,單位是父母網格個數)。

e_we = NUM # 子網格的東西格數(注意數量要為kn+1,k是parent_grid_ratio的值,n會是一個小於"[(父母網格的e_we)-(i_parent_start)]"的數字,單位是子網格個數)。

e_sn = NUM # 子網格的南北格數(注意數量要為kn+1,k是parent_grid_ratio的值,n會是一個小於"[(父母網格的e_sn)-(j_parent_start)]"的數字,單位是子網格個數)。

dx/dy = NUM # 最外層網格的網格間距(單位是公尺),分別只能填一個值,內層網格大小要透過 parent_grid_ratio 設定。

重點翻譯(以蘭伯特投影為例):

最外層的 domain 1 ,會以 ref_lat, ref_lon 為中心向四周展開。往南北向展開 e_sn 個點,往東西向展開 e_we 個點,南北向及東西向的網格間距為 dx, dy 公尺。

內層 domain 的範圍不能超出父母 domain

第 N 層的 domain N,他的父母網格為 parent_id ,domain N 西南角的起始點位置距離父母網格的西南角的起始點位置為 i_parent_start 個父母網格格點,及 j_parent_start 個父母網格格點。由起始點往北展開 e_sn 個 domain N 格點,往東展開 e_we 個 domain N 格點,南北向及東西向的 domain N 網格間距為 parent_id 的 1/parent_grid_ratio 倍。

Relation between domains

Ratios between inner and outer domain

Drawing domain configuration

使用 NCL (NCAR Command Language) 繪製 domain 設置圖

請在 ${WPS_DIR}/util 目錄下尋找自己滿意的 NCL 腳本來修改後繪圖。執行繪圖指令前,記得先將環境模組解除後再載入 NCL 環境模組。當然畫圖的流程結束之後要切回來 Intel compiler 。可以參考2023年教學如何修改 NCL 繪圖腳本檔案。NCL 語法非常簡單,去 NCL Official Site  查表或找現成腳本修改一下就可以畫圖了。其實打開檔案,註解都寫得非常詳細,把握最重要的關鍵,你要在哪個目錄下(路徑)下指令,要讀的檔案(路徑)在哪裡,畫出來的圖要存(路徑)在哪裡,存什麼格式(副檔名)。

 << NCL 教學工作坊 on Youtube (文化大學王嘉琪教授)

[USER@VAPOR ***]$ module purge; module load Apps/ncl/6.6.2-gcc[USER@VAPOR ***]$ vi ${WPS_DIR}/util/plotgrids_new.ncl[USER@VAPOR ***]$ ncl ${WPS_DIR}/util/plotgrids_new.ncl

使用者可以選擇輸出的 pdf 檔甚至是 png 檔,可以使用 WinSCP 程式(在臺灣杉上透過傳輸節點)直接下載,MobaXterm 也可以直接開啟查看,注意 MobaXterm 在下載或開啟圖檔時常常當掉或是卡死,請更新 MobaXterm 至最新版本。畫圖看看 domain 的設定是否符合需求,修課同學請自行依照自己分配到的個案設計 domain 。另外同學要記住計算資源是有限的,巢狀網格的目的就是要節省計算資源,如果每一層網格都隨便開到 800 平方格或 1000 平方格以上那就沒有意義了,未來做研究時同學還要額外思考這類成本問題,大家都想準時畢業吧。

 << WinSCP Official Site Download

Executing geogrid

執行geogrid

[USER@VAPOR ***]$ ./geogrid.exe

成功執行完後,再檢查一下數量對不對,幾個 domain 要有幾個 geo_em 開頭的 nc 檔。

[USER@VAPOR ***]$ ls geo_em*.nc

Processing data (advanced)

Interpolation

關於靜態資料的插植方法,一般而言我們使用 geogrid 時都使用默認設定,即可以將大多數連續和分類式(category)資料插值到網格中。 GEOGRID.TBL 定義了 default 設定下 geogrid 如何利用不同數值方法處理每個地表靜態資料,以及該靜態資料的位置。所以透過修改 GEOGRID.TBL ,可以將新的/附加的/自製/自定義的資料插值到模式網格中。