<div dir="ltr"><div><div><div>I modified an existing script (attached).<br><br></div>The TRMM 3B42RT file I have had the &#39;rain&#39; (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">&lt;<a href="mailto:dg1225033@smail.nju.edu.cn" target="_blank">dg1225033@smail.nju.edu.cn</a>&gt;</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 &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl&quot;<br>
<br>
begin<br>
<br>
; read data *****************************************************************<br>
<br>
  aDataDir       =&quot;/home/yl/wrfcase/ncl-picture/&quot;<br>
  aFileName      =&quot;wrfout_d01_2003-07-02_00:00:<a href="http://00.nc" target="_blank">00.nc</a>&quot;<br>
  aFile          =aDataDir+aFileName<br>
  a = addfile(aFile,&quot;r&quot;)                                             ; a is the wrf output with the format of rcm<br>
<br>
  bDataDir       =&quot;/home/yl/wrfcase/TRMM/rgrid2rcm/&quot;<br>
  bFileName      =&quot;trmmdata&quot;<br>
  bFile          =bDataDir+bFileName<br>
  b = addfile(bFile,&quot;r&quot;)                                             ; b is the trmm data with the format of grid<br>
<br>
  lat2d=wrf_user_getvar(a,&quot;XLAT&quot;,0)<br>
  lon2d=wrf_user_getvar(a,&quot;XLONG&quot;,0)<br>
<br>
  xlat=b-&gt;latitude<br>
  xlon=b-&gt;longitude<br>
  rain=b-&gt;pcp<br>
  times=b-&gt;time<br>
  xtimes=dimsizes(times)<br>
  year=&quot;2003&quot;<br>
  ;printVarSummary(xlat)<br>
  ;printVarSummary(xlon)<br>
  ;printVarSummary(times)<br>
  ;printVarSummary(rain)<br>
; set basic resources*****************************************************<br>
<br>
   type    = &quot;x11&quot;<br>
   wksname =&quot;GrADS_rain_2rcm&quot;<br>
   wks     = gsn_open_wks(type,wksname)<br>
<br>
  res                   = True<br>
  res@gsnAddCyclic     = False<br>
<br>
; set map<br>
   res@mpGeophysicalLineColor = &quot;Navy&quot;<br>
   res@mpNationalLineColor    = &quot;Black&quot;<br>
  ;res@mpUSStateLineColor     = &quot;Black&quot;<br>
  ;res@mpLimbLineColor        = &quot;Black&quot;<br>
  ;res@mpPerimLineColor       = &quot;Black&quot;<br>
  res@mpDataBaseVersion=&quot;MediumRes&quot;    ;加入中国省界边界线<br>
  res@mpDataSetName=&quot;Earth..4&quot;         ;加入中国省界边界线<br>
  res@mpOutlineSpecifiers = &quot;China:states&quot;   ;加入中国省界边界线<br>
<br>
  res@pmTickMarkDisplayMode   =&quot;Always&quot;<br>
<br>
  res@mpLimitMode             =&quot;Corners&quot;<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            =&quot;LambertConformal&quot;<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   =&quot;PostDraw&quot; ; Draw, PostDraw<br>
  res@pmTickMarkDisplayMode    =&quot;Always&quot;<br>
<br>
  res@mpGridLineDashPattern       =0   ; 17 kinds in all<br>
  res@mpGridSpacingF              =5.<br>
  res@mpGridLineThicknessF        =2<br>
  res@mpGridLineColor             =&quot;Grey&quot;<br>
<br>
; plot*************************************************************************<br>
; do it =0,xtimes-1,1          ; TIME LOOP  0,xtimes-1,1<br>
<br>
      ;print(&quot;Working on time: &quot; + times(it) )<br>
<br>
      rain_it  =rain(:,:,:)<br>
      rain_it_xgrd = rgrid2rcm(xlat,xlon,rain_it,lat2d,lon2d,0)<br>
      rain_it_xgrd!0  =&quot;south_north&quot;<br>
      rain_it_xgrd!1  =&quot;west_east&quot;<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>