WRF后处理:降雨量的说明以及降雨的绘制

以下内容,可以关注微信公众号气海同途,获取相应的代码,以及更多大气海洋数值模式相关的消息。

图片

对于WRF模式中的降水,不少使用者特别是新手都有困惑。此篇对WRF降水变量做一个详细说明,并基于NCL结合气象家园中提供的中国shapefile绘制降雨量。

WRF的模拟结果中不同来源的降雨是分开的,wrfout文件中,降雨的变量如下:

图片

RAINC: 积云深对流过程产生的累积降水量,也就是模式中的积云对流参数化方案导致的降雨( cu_physics)。对于高分辨率的模拟,比如dx<5km,通常会将积云对流参数化方案关闭,此时RAINC为0。

RANNC: 此类降雨来源于云微物理参数化方案(mp_physics),如大尺度抬升过程产生的凝结等微物理过程降水,也就是非对流产生的降水。

RAINSH: 积云对流参数化方案主要是反映深对流的降水过程,但是一些积云对流参数化方案,能够支持浅对流导致的降水,此时总降水还需要加上RAINSH。WRF中支持浅对流的参数化方案(cu_physics)有以下几种:KF,SAS,G3,BMJ,Tiedtke。WRF中也有独立于深对流过程的浅对流方案,通过namelist中设置shcu_physics。一般情况下,浅对流产生的降水量较小。

此外,固态降水例如雪(SNOWC/SNOWNC)、霰(GRAUPELC/GRAUPELNC)等降水,它们是降水的不同相态,已经都包含在RAINC/RAINNC中,不需要额外添加。

总结为一句话:总降水=RAINNC + RAINC + RAINSH,其中RAINC和RAINSH根据物理参数化方案的设置可能为0。

需要注意的是,降雨是个累积量,而不是瞬时值,在wrfout中如果需要得到模拟起止日期内的降雨,需要将最后一个时刻的降雨量减去第一个时刻的降雨量。

WRF后处理:降雨量的说明以及降雨的绘制_第1张图片

以上为NCL绘制的wrfout降水分布,代码如下:

;**********************************************************  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/csm/contributed.ncl"  load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl";**********************************************************begin begTime = get_cpu_time() diri_constant= "./" a  = addfile(diri_constant + "wrfout_d01_2020-06-11_00_00_00","r") lon2d = a->XLONG(0,:,:) lat2d = a->XLAT(0,:,:) lat = lat2d(:,0)              ;; Xarray of latitudes lon = lon2d(0,:)              ;; Xarray of Longitudes times = wrf_user_list_times(a)
 minLat = min(lat) maxLat = max(lat) minLon = min(lon) maxLon = max(lon)  ;calculate the total precipitation rain1 = wrf_user_getvar(a,"RAINNC",-1) rain2 = wrf_user_getvar(a,"RAINC",-1) rain3 = wrf_user_getvar(a,"RAINSH",-1) dim_sizes=dimsizes(rain1) NT = dim_sizes(0) NY = dim_sizes(1) NX = dim_sizes(2)
 deltaRain1 = rain1(NT-1,:,:) - rain1(0,:,:) deltaRain2 = rain2(NT-1,:,:) - rain2(0,:,:) deltaRain3 = rain3(NT-1,:,:) - rain3(0,:,:) rain_tot   = deltaRain1 + deltaRain2 + deltaRain3
 delete(rain1) delete(rain2)  rain_tot!0 = "lat" rain_tot!1 = "lon" rain_tot&lat = lat rain_tot&lon = lon rain_tot@description = "Precipitation" rain_tot@units = "mm"  ; create a window fig_name = "precipitaion_"+times(0)+"-"+times(NT-1)+"UTC.png" wks = gsn_open_wks("png",fig_name)
 ;define colormap cmap =  (/ (/255, 255, 255/), \            (/0, 0,0/), \            (/242, 255, 255/), \            (/242, 242, 242/), \            (/154, 192, 205/), \            (/178, 223, 238/), \            (/191, 239, 255/), \            (/  0, 235, 235/), \            (/  0, 163, 247/), \            (/  0, 255,   0/), \            (/  0, 199,   0/), \            (/  0, 143,   0/), \            (/  0,  63,   0/), \            (/255, 255,   0/), \            (/255, 143,   0/), \            (/255,   0,   0/), \            (/215,   0,   0/), \            (/191,   0,   0/), \            (/255,   0, 255/), \            (/155,  87, 203/), \            (/ 92,  52, 176/) /) /255.0
 gsn_define_colormap(wks,cmap) ;gsn_define_colormap(wks,"Rainbow")
 res = True res@gsnDraw       = False res@gsnFrame      = False res@gsnAddCyclic  = False res@mpFillOn      = False
 res@mpMaxLatF = maxLat                      ; specify the plot domain res@mpMinLatF = minLat                      ; res@mpMaxLonF = maxLon                      ; res@mpMinLonF = minLon res@tiMainString = "Precipitation: "+times(0)+" to "+times(NT-1)+"UTC" res@tiMainFontHeightF = 0.013 res@gsnLeftStringFontHeightF  = 0.012 res@gsnRightStringFontHeightF = 0.012  res@cnLevelSelectionMode = "ManualLevels" res@cnLevelSpacingF      = 10 res@cnMinLevelValF       = 0 res@cnMaxLevelValF       = 150
 res@cnFillOn = True res@cnLinesOn = False res@lbLabelAutoStride = True res@cnFillDrawOrder = "PreDraw" res@cnInfoLabelOn = False  res@lbLabelBarOn          = True        ; 色标 res@pmLabelBarHeightF     = 0.15 res@pmLabelBarWidthF      = 0.6 res@pmLabelBarOrthogonalPosF = 0.07 res@lbLabelFontHeightF    = 0.010 res@cnInfoLabelOn         = False            ; 去掉图底端的标签信息 lon_value = fspan(minLon, maxLon, 5) lon_label = lon_value + "~S~o~N~E" res@tmXBMode = "Explicit" res@tmXBValues = lon_value res@tmXBLabels = lon_label res@tmXBLabelFontHeightF = 0.01 lat_value = fspan(minLat, maxLat , 5) lat_label = lat_value + "~S~o~N~N" res@tmYLValues = lat_value res@tmYLLabels = lat_label ;; plot plot  = gsn_csm_contour_map(wks,rain_tot,res)
 ; add China map cnres           = True cnres@china     = True       ;draw china map or not cnres@river     = False       ;draw changjiang&huanghe or not cnres@province  = True      ;draw province boundary or not cnres@nanhai    = False       ;draw nanhai or not cnres@diqu      = True       ; draw diqujie or not chinamap = add_china_map(wks,plot,cnres)
 draw(plot) frame(wks) print("Time Required " + (get_cpu_time() - begTime) + " seconds")end

NCL中默认的shapefile在中国地区有多处错误,以上代码中,涉及到使用中国shapefile,为气象家园中下载。需要将cnmap文件夹复制到$NCARG_ROOT/lib/ncarg/nclscripts/目录下,实际使用中可以通过设置属性,支持中国国界、省界、地区界、长江黄河和南海小地图的显示。

以上代码和中国的shapefile文件,可以关注微信公众号气海同途,后台留言回复“ncl降雨"获取相应的百度云链接。

图片

你可能感兴趣的:(大气海洋数值模式)