PREjelly

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/csm/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"


****读取wrf数据
f=addfile(".....文件路径/wrfout_2012_3_7.nc","r")
;-----------------------转换为等经纬度
lat2d = f->XLAT(0,:😅
lon2d = f->XLONG(0,:😅
lat1d = lat2d(:,0)
lon1d = lon2d(0,:)
;-------------------------------读取时间
times = wrf_user_getvar(f,"times",-1) ; get all times in the file
ntimes = dimsizes(times) ; number of times in the file
;-------------------------------读取降水
rainnc = wrf_user_getvar(f,"RAINNC",-1)
rainc = wrf_user_getvar(f,"RAINC",-1)
;----------------------将变量数据投影转换为等间距投影
rainnc_grd = rcm2rgrid(lat2d, lon2d, rainnc, lat1d,lon1d,0)
rainc_grd = rcm2rgrid(lat2d, lon2d, rainc, lat1d,lon1d,0)
rain_tot_grd = rainnc_grd+rainc_grd ;累计降水

posted on 2023-06-14 17:44  天天编程je  阅读(694)  评论(0)    收藏  举报