登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 hbl1021 于 2021-11-4 19:38 编辑
之前学习了一段时间WRF,但是没有实际应用和分析,结果几个月不碰全都忘了,所以这次借此机会把具体的步骤记录一下,下次可以有地方查询。WRF具体的安装就不说了,论坛里有好多帖子可以参考,着重交流以下WRF处理fnl再分析资料(逐6小时,1°×1°)的步骤:
其实主要内容大概有以下几个方面:即前处理部分(WPS)和数值求解部分,其中前处理部分(WPS)部分可概括为:定义数值模拟区域,将地形下垫面等静态数据插值到模拟区域的网格,对驱动WRF模式的格点数据进行解码,并将其插值到模拟区域的网格。数值求解部分主要介绍ARW(advanced research WRF)部分:利用WPS提供的初始场和边界场,通过求解通量形式的预报方程组实现未来时刻的模拟和预报。以上内容来自数值天气预报基础教材,我也一知半解,本人不是搞研究的不懂,看个大概吧,具体步骤如下:
Tips:以下为本人根据教材和网上的教程大概总结的步骤,难免有雷同,其中容易出错得已经标注。(注意:“#”以后内容均为解释下一行代码)
1.Running WPS(V3.8版本)
(注意:以下代码要整行复制,不要漏掉“.”“/”等符号)
#跳转至WPS目录
cd ~/Build_WRF/WPS
#修改namelist.wps(直接使用记事本打开进行修改,参考namelist参数说明)
#载入下垫面地形数据,如果载入正确则显示successful
./geogrid.exe
#检查文件信息,会显示大小和文件时间
ls -lah geo_em.d01.nc
#链接数据(尽量把DATA文件夹中不用的数据单独创建另一个文件夹保存,DATA根目录里仅保留将要使用模拟的数据)
./link_grib.csh ~/Build_WRF/DATA/fnl
#链接Vtable(具体意思不懂)
ln -sf ungrib/Variable_Tables/Vtable.GFS Vtable
#创建grib文件,得到驱动模式数据、气象场的解析和插值后的数据,如果创建成功则显示successful
./ungrib.exe
#检查文件信息,会显示大小和文件时间
ls -lah FILE*
#创建metgrid文件,得到各模拟嵌套层的网格数据文件,如果创建成功则显示successful
./metgrid.exe
#检查文件信息,会显示大小和文件时间
ls -lah met_em.*
2.Running WRF(V4.0版本)
#跳转至em_real文件夹,注意WRF目录名称,有的是WRF有的是WRFV3
cd ~/Build_WRF/WRF/test/em_real/
#链接WPS到WRF
ln -sf ~/Build_WRF/WPS/met_em* .
#修改namelist.input(直接使用记事本打开进行修改,参考namelist参数说明)
#接下来是create real case(具体意思我也不懂),成功后会显示starting wrf task 0 of 1
mpirun -np 1 ./real.exe
#运行测试,成功后会显示success complete real_em init
tail rsl.error.0000
#查看wrfbdy_d01和wrfinput_d01两个文件,会显示大小,时间信息
ls -alh wrfbdy_d01 wrfinput_d01
#运行WRF,会显示starting wrf task 0 of 2,1 of 2。(此处为关键步骤,会耗费挺长时间,耐心等待)
mpirun -np 2 ./wrf.exe
#检查是否成功,成功会显示success complete wrf
tail rsl.error.0000
#查看wrfout文件,会显示大小,时间信息
ls -alh wrfout_*
#Tips:基本上在运行WRF这一步后,数值模拟工作就完成了,但是按教程来看还是把后面三步跑一下。
#列出wrfout文件中的信息(没看出有什么用处)
ncdump -h wrfout_d01*
ncdump -v Times wrfout_d01*
ncdump -v U wrfout_d01*
#此时在/Build_WRF/WRF/test/em_real/下会出现模拟数据,比如wrfout_d01_2021-10-15_00:00:00文件,就是模拟后的数据文件
3.如果使用grads处理数据的话,还需要使用ARWpost处理数据文件
#首先跳转到arwpost文件夹(根据实际路径补全路径信息),或者直接在arwpost文件夹下运行terminal窗口
cd arwpost
#在此之前用记事本修改好namelist.arwpost文件
#接下来就是最后一步
./ARWpost.exe
#运行成功后会提示: SUCCESS COMPLETE ARWpost
#最后在设定好的文件夹里找到对应的ctl和dat文件就可以用grads处理啦。
在此把namelist.wps、namelist.input、namelist.arwpost三个文件附上,可供参考,其中需要注意的地方已标注,具体原因可以参考论坛里的“论WRF中namelist陷阱”的帖子。
namelist.wps
&share
wrf_core = 'ARW',
max_dom = 1,
start_date = '2021-10-15_00:00:00','2006-08-16_12:00:00',
end_date = '2021-10-17_18:00:00','2006-08-16_12:00:00',
interval_seconds = 21600
io_form_geogrid = 2,
/
&geogrid
parent_id = 1, 1,
parent_grid_ratio = 1, 3,
i_parent_start = 1, 31,
j_parent_start = 1, 17,
e_we = 74, 112,
e_sn = 61, 97,
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!
! The default datasets used to produce the MAXSNOALB and ALBEDO12M
! fields have changed in WPS v4.0. These fields are now interpolated
! from MODIS-based datasets.
!
! To match the output given by the default namelist.wps in WPS v3.9.1,
! the following setting for geog_data_res may be used:
!
! geog_data_res = 'maxsnowalb_ncep+albedo_ncep+default', 'maxsnowalb_ncep+albedo_ncep+default',
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
geog_data_res = '10m','2m',
dx = 30000,
dy = 30000,
map_proj = 'lambert',
ref_lat = 45.1,
ref_lon = 110.8,
truelat1 = 30.0,
truelat2 = 60.0,
stand_lon = 110.8,
geog_data_path = '/home/wrf/Build_WRF/WPS_GEOG/'
/
&ungrib
out_format = 'WPS',
prefix = 'FILE',
/
&metgrid
fg_name = 'FILE'
io_form_metgrid = 2,
/
namelist.input
&time_control
run_days = 0,
run_hours = 30,
run_minutes = 0,
run_seconds = 0,
start_year = 2021, 2000, 2000,
start_month = 10, 01, 01,
start_day = 15, 24, 24,
start_hour = 00, 12, 12,
end_year = 2021, 2000, 2000,
end_month = 10, 01, 01,
end_day = 17, 25, 25,
end_hour = 18, 12, 12,
interval_seconds = 21600
input_from_file = .true.,.true.,.true.,
history_interval = 60, 60, 60,
frames_per_outfile = 1000, 1000, 1000,
restart = .false.,
restart_interval = 7200,
io_form_history = 2
io_form_restart = 2
io_form_input = 2
io_form_boundary = 2
/
&domains
time_step = 180,
time_step_fract_num = 0,
time_step_fract_den = 1,
max_dom = 1,
e_we = 74, 112, 94,
e_sn = 61, 97, 91,
e_vert = 33, 33, 33,
p_top_requested = 5000,
num_metgrid_levels = 34, 使用fnl资料的此处要改成34
num_metgrid_soil_levels = 4,
dx = 30000, 10000, 3333.33,
dy = 30000, 10000, 3333.33,
grid_id = 1, 2, 3,
parent_id = 0, 1, 2,
i_parent_start = 1, 31, 30,
j_parent_start = 1, 17, 30,
parent_grid_ratio = 1, 3, 3,
parent_time_step_ratio = 1, 3, 3,
feedback = 1,
smooth_option = 0
/
&physics
physics_suite = 'CONUS'
mp_physics = -1, -1, -1,
cu_physics = -1, -1, 0,
ra_lw_physics = -1, -1, -1,
ra_sw_physics = -1, -1, -1,
bl_pbl_physics = -1, -1, -1,
sf_sfclay_physics = -1, -1, -1,
sf_surface_physics = -1, -1, -1,
radt = 30, 30, 30,
bldt = 0, 0, 0,
cudt = 5, 5, 5,
icloud = 1,
num_land_cat = 21,
sf_urban_physics = 0, 0, 0,
/
&fdda
/
&dynamics
hybrid_opt = 2,
w_damping = 0,
diff_opt = 1, 1, 1,
km_opt = 4, 4, 4,
diff_6th_opt = 0, 0, 0,
diff_6th_factor = 0.12, 0.12, 0.12,
base_temp = 290.
damp_opt = 3,
zdamp = 5000., 5000., 5000.,
dampcoef = 0.2, 0.2, 0.2
khdif = 0, 0, 0,
kvdif = 0, 0, 0,
non_hydrostatic = .true., .true., .true.,
moist_adv_opt = 1, 1, 1,
scalar_adv_opt = 1, 1, 1,
gwd_opt = 1,
/
&bdy_control
spec_bdy_width = 5,
specified = .true.
/
&grib2
/
&namelist_quilt
nio_tasks_per_group = 0,
nio_groups = 1,
/
namelist.arwpost
&datetime
start_date = '2021-10-15_00:00:00',
end_date = '2021-10-17_18:00:00',
interval_seconds = 3600,
tacc = 0,
debug_level = 0,
/
&io
input_root_name = '/home/wrf/Build_WRF/WRF/test/em_real/wrfout_d01_2021-10-15_00:00:00'
output_root_name = '/home/wrf/Build_WRF/test_20211015'
plot = 'all_list'
fields = 'height,geopt,theta,tc,tk,td,td2,rh,rh2,umet,vmet,pressure,u10m,v10m,wdir,wspd,wd10,ws10,slp,mcape,mcin,lcl,lfc,cape,cin,dbz,max_dbz,clfr'
output_type = 'grads'
mercator_defs = .true.
/
split_output = .true.
frames_per_outfile = 2
plot = 'all'
plot = 'list'
plot = 'all_list'
! Below is a list of all available diagnostics
fields = 'height,geopt,theta,tc,tk,td,td2,rh,rh2,umet,vmet,pressure,u10m,v10m,wdir,wspd,wd10,ws10,slp,mcape,mcin,lcl,lfc,cape,cin,dbz,max_dbz,clfr'
&interp
interp_method = 1,
interp_levels = 1000.,975.,950.,925.,900.,875.,850.,825.,800.,750.,700.,650.,600.,550.,500.,450.,400.,350.,300.,250.,200.,150.,100.,
/
extrapolate = .true.
interp_method = 0, ! 0 is model levels, -1 is nice height levels, 1 is user specified pressure/height
interp_levels = 1000.,975.,950.,925.,900.,875.,850.,825.,800.,750.,700.,650.,600.,550.,500.,450.,400.,350.,300.,250.,200.,150.,100.,
interp_levels = 0.25, 0.50, 0.75, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00, 7.00, 8.00, 9.00, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0,
|