1. 登陆天河2号
本次使用星光系统登陆,登陆入口如下:
这里采用tianhe2c分区,点击对应 WEBSSH绿色按钮即可登陆,成功登陆界面如下:
2. 加载环境
本次需要加载三个包,分别是WPS,WRF,和NCL(非必需,用于画图)
指令如下:
module load WPS/4.2-icc-18 WRF/4.2-icc-18 NCL/6.6.2
使用module list
检测是否加载成功,返回如下页面,即为成功!
3. 新建文件夹,拷贝WPS所需文件
mkdir Matthew && cd Matthew && mkdir WPS && mkdir WRF
上传9个grib2
文件到WPS
文件夹
cd WPS
进入WPS文件夹,拷贝文件到该目录下
cp -r /WORK/app/WPS/4.2-icc-18/geogrid .
cp -r /WORK/app/WPS/4.2-icc-18/ungrib .
cp -r /WORK/app/WPS/4.2-icc-18/util .
cp -r /WORK/app/WPS/4.2-icc-18/metgrid .
cp -r /WORK/app/WPS/4.2-icc-18/metgrid.exe .
ln -sf /WORK/app/WPS/4.2-icc-18/ungrib/Variable_Tables/Vtable.GFS ./Vtable
使用ls -lh
查看是否拷贝成功,返回结果如下,即为成功!
链接grib2
文件
link_grib.csh fnl_2016100*
使用ls -lh
查看是否链接成功,返回结果如下,即为成功!
4. ungrib生成FILE文件
创建namelist.wps
文件,内容如下:
&share
wrf_core = 'ARW',
max_dom = 1,
start_date = '2016-10-06_00:00:00'
end_date = '2016-10-08_00:00:00'
interval_seconds = 21600
io_form_geogrid = 2,
/
&geogrid
parent_id = 1,
parent_grid_ratio = 1,
i_parent_start = 1,
j_parent_start = 1,
e_we = 91,
e_sn = 100,
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 = 'default',
dx = 27000,
dy = 27000,
map_proj = 'mercator',
ref_lat = 28.00,
ref_lon = -75.00,
truelat1 = 30.0,
truelat2 = 60.0,
stand_lon =-75.00,
geog_data_path = '/WORK/app/WRF/geog/'
/
&ungrib
out_format = 'WPS',
prefix = 'FILE',
/
&metgrid
fg_name = 'FILE'
io_form_metgrid = 2,
/
执行如下代码:
yhrun ungrib.exe
不到10秒钟(不包含排队时间),返回如下结果:
使用ls -lh
查看是否执行成功,返回结果如下,即为成功!
5. geogrid生成nc文件
执行如下代码:
yhrun -n 64 geogrid.exe
大约10秒钟(不包含排队时间),返回如下结果:
使用ls -lh geo*.nc
查看是否执行成功,返回结果如下,即为成功!
修改util/plotgrids_new.ncl
文件
执行ncl util/plotgrids_new.ncl
,得到名为wps_show_dom.pdf
的文件,图像如下:
6. metgrid生成nc文件
执行如下代码:
yhrun -n 64 metgrid.exe
不到4分钟(不包含排队时间),返回如下结果:
使用ls -lh met*.nc
查看是否执行成功,返回结果如下,即为成功!
7. 拷贝WRF所需文件
cd ../WRF/
cp -r /WORK/app/WRF/4.2/4.2-icc-18/run .
cd run
ln -sf ../../WPS/met*.nc .
使用ls -lh
查看是否拷贝成功,返回结果如下,即为成功!
8. real生成wrfinput和wrfbdy文件
创建namelist.input
文件,内容如下:
&time_control
run_days = 0,
run_hours = 48,
run_minutes = 0,
run_seconds = 0,
start_year = 2016,
start_month = 10,
start_day = 06,
start_hour = 00,
end_year = 2016,
end_month = 10,
end_day = 08,
end_hour = 00,
interval_seconds = 21600
input_from_file = .true.,
history_interval = 180
frames_per_outfile = 1,
restart = .false.,
restart_interval = 1440,
io_form_history = 2
io_form_restart = 2
io_form_input = 2
io_form_boundary = 2
/
&domains
time_step = 150,
time_step_fract_num = 0,
time_step_fract_den = 1,
max_dom = 1,
e_we = 91,
e_sn = 100,
e_vert = 45,
p_top_requested = 5000,
num_metgrid_levels = 32,
num_metgrid_soil_levels = 4,
dx = 27000,
dy = 27000,
grid_id = 1,
parent_id = 0,
i_parent_start = 1,
j_parent_start = 1,
parent_grid_ratio = 1,
parent_time_step_ratio = 1,
feedback = 1,
smooth_option = 0
/
&physics
physics_suite = 'CONUS'
mp_physics = 4,
cu_physics = 1,
ra_lw_physics = 1,
ra_sw_physics = 1,
bl_pbl_physics = 1,
sf_sfclay_physics = 1,
sf_surface_physics = 2,
radt = 30,
bldt = 0,
cudt = 5,
icloud = 1,
num_land_cat = 21,
sf_urban_physics = 0,
/
&fdda
/
&dynamics
hybrid_opt = 2,
w_damping = 0,
diff_opt = 1,
km_opt = 4,
diff_6th_opt = 0,
diff_6th_factor = 0.12,
base_temp = 290.,
damp_opt = 3,
zdamp = 5000.,
dampcoef = 0.2,
khdif = 0,
kvdif = 0,
non_hydrostatic = .true.,
moist_adv_opt = 1,
scalar_adv_opt = 1,
gwd_opt = 1,
/
&bdy_control
spec_bdy_width = 5,
specified = .true.,
/
&grib2
/
&namelist_quilt
nio_tasks_per_group = 0,
nio_groups = 1,
/
执行如下代码:
yhrun -n 64 real.exe
不到1分钟(不包含排队时间),返回如下结果:
使用ls -lh wrf*
查看是否执行成功,返回结果如下,即为成功!
9. wrf生成wrfout文件
执行如下代码:
yhrun -n 64 wrf.exe
大约2分钟(不包含排队时间),返回如下结果:
使用ls -lh wrfout*
查看是否执行成功,返回结果如下,即为成功!
10. 绘制飓风图像
在当前目录创建eye_wall.ncl
文件,内容如下:
;----------------------------------------------------------------------
; eye_wall.ncl
;----------------------------------------------------------------------
; In NCL Versions 6.3.1 and earlier, you will get these warnings which
; you can safely ignore:
;
; warning:start_lat is not a valid resource in wrf_gsn_contour at this time
; warning:start_lon is not a valid resource in wrf_gsn_contour at this time
; warning:end_lat is not a valid resource in wrf_gsn_contour at this time
; warning:end_lon is not a valid resource in wrf_gsn_contour at this time
; warning:mpNestTime is not a valid resource in map at this time
;----------------------------------------------------------------------
; These files are loaded by default in NCL V6.2.0 and newer
; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
; load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
;---Open WRF output file
filename = "wrfout_d01_2016-10-06_06:00:00"
a = addfile(filename,"r")
;---Read several WRF variables at first time step
it = 0
slp = wrf_user_getvar(a,"slp",it) ; sea level pressure
wrf_smooth_2d( slp, 3 ) ; smooth slp
mdbz = wrf_user_getvar(a,"mdbz",it) ; max reflectivity
wks = gsn_open_wks("pdf","matthew")
;---Set common resources for all plots
res = True
res@gsnFrame = False
res@gsnDraw = False
res@gsnLeftString = ""
res@gsnRightString = ""
;---Necessary for contours to be overlaid correctly on WRF projection
res@tfDoNDCOverlay = True ; Tell NCL you are doing a native plot
; res@tfDoNDCOverlay = "NDCViewport" ; can use this in NCL V6.5.0 or later
;---Reflectivity filled contour plot
mdbz_res = res
mdbz_res@cnFillOn = True
mdbz_res@cnLevelSelectionMode = "ExplicitLevels"
mdbz_res@cnLevels = ispan(10,50,10)
mdbz_res@cnFillColors = (/-1,4,54,104,154,204/)
mdbz_res@lbLabelFontHeightF = 0.015
mdbz_res@lbOrientation = "Vertical"
mdbz_res@pmLabelBarOrthogonalPosF = -0.005
contour_mdbz = gsn_csm_contour(wks,mdbz,mdbz_res)
;---SLP line contour plot
levels = ispan(900,1100,5)
info_string = "Sea level pressure contours from 900 to 1100 by 5"
slp_res = res
slp_res@cnLineColor = "black"
slp_res@cnLevelSelectionMode = "ExplicitLevels"
slp_res@cnLevels = levels
slp_res@cnLineLabelBackgroundColor = -1 ; transparent
slp_res@cnLineThicknessF = 2.5
slp_res@cnInfoLabelString = info_string
slp_res@cnInfoLabelFontColor = "black"
slp_res@cnInfoLabelPerimOn = False
contour_psl = gsn_csm_contour(wks,slp,slp_res)
;---Map plot
map_res = True
map_res@gsnFrame = False
map_res@gsnDraw = False
map_res@tiMainString = filename
map_res@gsnLeftString = mdbz@description + " (" + mdbz@units + ")~C~" + \
slp@description + " (" + slp@units + ")"
map_res@gsnLeftStringFontHeightF = 0.01
;---Set map resources based on projection on WRF output file
map_res = wrf_map_resources(a,map_res)
map = gsn_csm_map(wks,map_res)
;---Overlay plots on map and draw.
overlay(map,contour_mdbz)
overlay(map,contour_psl)
draw(map) ; This will draw all overlaid plots and the map
frame(wks)
end
执行ncl eye_wall.ncl
,得到名为matthew.pdf
的文件,图像如下: