<div dir="ltr"><div><div><div>I modified an existing script (attached).<br><br></div>The TRMM 3B42RT file I have had the 'rain' (PRC) as type short. <br></div>Also, I used a WRF file I had locally ... not China.<br><br></div>Good Luck<br><div><div><br><pre></pre></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 19, 2014 at 5:23 AM, 易路 <span dir="ltr"><<a href="mailto:dg1225033@smail.nju.edu.cn" target="_blank">dg1225033@smail.nju.edu.cn</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all,<br>
<br>
I downloaded the TRMM 3B42 with a format of NetCDF, and want to change to rcm for keeping consistance with WRF output data.<br>
<br>
The problem is (1) the spatial area of wrf output is regioanl, for example in China, but the spatial area of TRMM is nearly global(-50,50;-180,180)<br>
(2) the TRMM data is grided, the wrf data is rcm (lambert)<br>
when I want to display the regioanl (China) area of the TRMM and in a format of RCM, how to realize?<br>
<br>
I tried writing the scriput, but it is wrong , would you please check it for me? Thanks a lot!<br>
<br>
SCRIPT AS FOLLOWS:<br>
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br>
<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"<br>
<br>
begin<br>
<br>
; read data *****************************************************************<br>
<br>
aDataDir ="/home/yl/wrfcase/ncl-picture/"<br>
aFileName ="wrfout_d01_2003-07-02_00:00:<a href="http://00.nc" target="_blank">00.nc</a>"<br>
aFile =aDataDir+aFileName<br>
a = addfile(aFile,"r") ; a is the wrf output with the format of rcm<br>
<br>
bDataDir ="/home/yl/wrfcase/TRMM/rgrid2rcm/"<br>
bFileName ="trmmdata"<br>
bFile =bDataDir+bFileName<br>
b = addfile(bFile,"r") ; b is the trmm data with the format of grid<br>
<br>
lat2d=wrf_user_getvar(a,"XLAT",0)<br>
lon2d=wrf_user_getvar(a,"XLONG",0)<br>
<br>
xlat=b->latitude<br>
xlon=b->longitude<br>
rain=b->pcp<br>
times=b->time<br>
xtimes=dimsizes(times)<br>
year="2003"<br>
;printVarSummary(xlat)<br>
;printVarSummary(xlon)<br>
;printVarSummary(times)<br>
;printVarSummary(rain)<br>
; set basic resources*****************************************************<br>
<br>
type = "x11"<br>
wksname ="GrADS_rain_2rcm"<br>
wks = gsn_open_wks(type,wksname)<br>
<br>
res = True<br>
res@gsnAddCyclic = False<br>
<br>
; set map<br>
res@mpGeophysicalLineColor = "Navy"<br>
res@mpNationalLineColor = "Black"<br>
;res@mpUSStateLineColor = "Black"<br>
;res@mpLimbLineColor = "Black"<br>
;res@mpPerimLineColor = "Black"<br>
res@mpDataBaseVersion="MediumRes" ;加入中国省界边界线<br>
res@mpDataSetName="Earth..4" ;加入中国省界边界线<br>
res@mpOutlineSpecifiers = "China:states" ;加入中国省界边界线<br>
<br>
res@pmTickMarkDisplayMode ="Always"<br>
<br>
res@mpLimitMode ="Corners"<br>
res@mpLeftCornerLatF =lat2d(0,0) ; lat2d(nlat-1,0)<br>
res@mpLeftCornerLonF =lon2d(0,0) ; lon2d(nlat-1,0)<br>
res@mpRightCornerLatF =lat2d(nlat-1,mlon-1) ; lat2d(0,nlon-1)<br>
res@mpRightCornerLonF =lon2d(nlat-1,mlon-1) ; lon2d(0,nlon-1)<br>
<br>
res@mpProjection ="LambertConformal"<br>
res@mpLambertParallel1F =30.<br>
res@mpLambertParallel2F =60.<br>
res@mpLambertMeridianF =113.5<br>
res@mpCenterLonF =113.5<br>
res@mpFillOn =False<br>
<br>
;set grid line<br>
res@mpGridAndLimbOn =True ; defalt is True<br>
res@mpGridAndLimbDrawOrder ="PostDraw" ; Draw, PostDraw<br>
res@pmTickMarkDisplayMode ="Always"<br>
<br>
res@mpGridLineDashPattern =0 ; 17 kinds in all<br>
res@mpGridSpacingF =5.<br>
res@mpGridLineThicknessF =2<br>
res@mpGridLineColor ="Grey"<br>
<br>
; plot*************************************************************************<br>
; do it =0,xtimes-1,1 ; TIME LOOP 0,xtimes-1,1<br>
<br>
;print("Working on time: " + times(it) )<br>
<br>
rain_it =rain(:,:,:)<br>
rain_it_xgrd = rgrid2rcm(xlat,xlon,rain_it,lat2d,lon2d,0)<br>
rain_it_xgrd!0 ="south_north"<br>
rain_it_xgrd!1 ="west_east"<br>
rain_it_xgrd@lat2d =lat2d<br>
rain_it_xgrd@lon2d =lon2d<br>
<br>
printVarSummary(rain_it_xgrd)<br>
<br>
plot = gsn_csm_contour_map(wks,rain_it_xgrd,res)<br>
<br>
<br>
;end do<br>
;*****************************************************************************<br>
<br>
end<br>
<br>
;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>