[ncl-talk] 回复: Re: use rgrid2rcm to deal with TRMM 3B42

易路 dg1225033 at smail.nju.edu.cn
Thu Nov 20 09:14:04 MST 2014


Thanks very much for your respond!!

I also get a well displayed trmm2rcm1 picture followed with your script,but there are still two problems needing your guide:

[1] the rain data in the trmm2rcm1 picture are quite differnt from the rain data in the trmmGrid picture, the data seems be mirroed~~~(two picture attached).What maybe the reason? How to adjust it?

[2] the gridline of the trmm2rcm1 picture are not curvelinear, not the same with wrfOutput picture. And my understanding is the rain data have been transformed to the same grid with wrfoutput which is in the lambert projecttion, so in order to adjust the gridline to be curvlinear, my solution is to change the map projection to lambert projection, thus I got the trmm2rcm2 pictur, the added script are as follows, does my solution resonable ?

;set grid line
  res at mpGridAndLimbOn          =True     ; defalt is True
  res at mpGridAndLimbDrawOrder   ="PostDraw" ; Draw, PostDraw
  res at pmTickMarkDisplayMode    ="Always"

  res at mpGridLineDashPattern       =0   ; 17 kinds in all 
  res at mpGridSpacingF              =5.
  res at mpGridLineThicknessF        =2
  res at mpGridLineColor             ="Grey"

   ;res at mpMinLatF            = minLatWrf
   ;res at mpMaxLatF            = maxLatWrf
   ;res at mpMinLonF            = minLonWrf
   ;res at mpMaxLonF            = maxLonWrf
   ;res at mpCenterLonF         = 0.5*(res at mpMinLonF+res@mpMaxLonF)
   res at mpFillOn             = False

; set projection
   res at mpProjection            ="LambertConformal"
   res at mpLimitMode             ="Corners"
   res at mpLeftCornerLatF        =minLatWrf               ; lat2d(nlat-1,0)
   res at mpLeftCornerLonF        =minLonWrf               ; lon2d(nlat-1,0)
   res at mpRightCornerLatF        =maxLatWrf              ; lat2d(0,nlon-1)
   res at mpRightCornerLonF        =maxLonWrf              ; lon2d(0,nlon-1)

   res at mpProjection            ="LambertConformal"
   res at mpLambertParallel1F     =30.
   res at mpLambertParallel2F     =60.
   res at mpLambertMeridianF      =113.5
   res at mpCenterLonF            =113.5
   res at mpFillOn                =False
 
----- 原始邮件 -----
发件人: Dennis Shea <shea at ucar.edu>
收件人: 易路 <dg1225033 at smail.nju.edu.cn>
抄送: ncl-talk <ncl-talk at ucar.edu>
已发送邮件: Thu, 20 Nov 2014 00:14:56 +0800 (CST)
主题: Re: [ncl-talk] use rgrid2rcm to deal with TRMM 3B42

I modified an existing script (attached).

The TRMM 3B42RT file I have had the 'rain' (PRC) as type short.
Also, I used a WRF file I had locally ... not China.

Good Luck


On Wed, Nov 19, 2014 at 5:23 AM, 易路 <dg1225033 at smail.nju.edu.cn> wrote:

> Dear all,
>
>    I downloaded the TRMM 3B42 with a format of NetCDF, and want to change
> to rcm for keeping consistance with WRF output data.
>
> 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)
>                (2) the TRMM data is grided, the wrf data is rcm (lambert)
> when I want to display the regioanl (China) area of the TRMM and in a
> format of RCM, how to realize?
>
> I tried writing the scriput, but it is wrong , would you please check it
> for me? Thanks a lot!
>
> SCRIPT AS FOLLOWS:
> ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
>
> 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/wrf/WRFUserARW.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
>
> begin
>
> ; read data
> *****************************************************************
>
>   aDataDir       ="/home/yl/wrfcase/ncl-picture/"
>   aFileName      ="wrfout_d01_2003-07-02_00:00:00.nc"
>   aFile          =aDataDir+aFileName
>   a = addfile(aFile,"r")                                             ; a
> is the wrf output with the format of rcm
>
>   bDataDir       ="/home/yl/wrfcase/TRMM/rgrid2rcm/"
>   bFileName      ="trmmdata"
>   bFile          =bDataDir+bFileName
>   b = addfile(bFile,"r")                                             ; b
> is the trmm data with the format of grid
>
>   lat2d=wrf_user_getvar(a,"XLAT",0)
>   lon2d=wrf_user_getvar(a,"XLONG",0)
>
>   xlat=b->latitude
>   xlon=b->longitude
>   rain=b->pcp
>   times=b->time
>   xtimes=dimsizes(times)
>   year="2003"
>   ;printVarSummary(xlat)
>   ;printVarSummary(xlon)
>   ;printVarSummary(times)
>   ;printVarSummary(rain)
> ; set basic resources*****************************************************
>
>    type    = "x11"
>    wksname ="GrADS_rain_2rcm"
>    wks     = gsn_open_wks(type,wksname)
>
>   res                   = True
>   res at gsnAddCyclic     = False
>
> ; set map
>    res at mpGeophysicalLineColor = "Navy"
>    res at mpNationalLineColor    = "Black"
>   ;res at mpUSStateLineColor     = "Black"
>   ;res at mpLimbLineColor        = "Black"
>   ;res at mpPerimLineColor       = "Black"
>   res at mpDataBaseVersion="MediumRes"    ;加入中国省界边界线
>   res at mpDataSetName="Earth..4"         ;加入中国省界边界线
>   res at mpOutlineSpecifiers = "China:states"   ;加入中国省界边界线
>
>   res at pmTickMarkDisplayMode   ="Always"
>
>   res at mpLimitMode             ="Corners"
>   res at mpLeftCornerLatF        =lat2d(0,0)             ; lat2d(nlat-1,0)
>   res at mpLeftCornerLonF        =lon2d(0,0)             ; lon2d(nlat-1,0)
>   res at mpRightCornerLatF        =lat2d(nlat-1,mlon-1)  ; lat2d(0,nlon-1)
>   res at mpRightCornerLonF        =lon2d(nlat-1,mlon-1)  ; lon2d(0,nlon-1)
>
>   res at mpProjection            ="LambertConformal"
>   res at mpLambertParallel1F     =30.
>   res at mpLambertParallel2F     =60.
>   res at mpLambertMeridianF      =113.5
>   res at mpCenterLonF            =113.5
>   res at mpFillOn                =False
>
> ;set grid line
>   res at mpGridAndLimbOn          =True     ; defalt is True
>   res at mpGridAndLimbDrawOrder   ="PostDraw" ; Draw, PostDraw
>   res at pmTickMarkDisplayMode    ="Always"
>
>   res at mpGridLineDashPattern       =0   ; 17 kinds in all
>   res at mpGridSpacingF              =5.
>   res at mpGridLineThicknessF        =2
>   res at mpGridLineColor             ="Grey"
>
> ;
> plot*************************************************************************
> ; do it =0,xtimes-1,1          ; TIME LOOP  0,xtimes-1,1
>
>       ;print("Working on time: " + times(it) )
>
>       rain_it  =rain(:,:,:)
>       rain_it_xgrd = rgrid2rcm(xlat,xlon,rain_it,lat2d,lon2d,0)
>       rain_it_xgrd!0  ="south_north"
>       rain_it_xgrd!1  ="west_east"
>       rain_it_xgrd at lat2d  =lat2d
>       rain_it_xgrd at lon2d  =lon2d
>
>       printVarSummary(rain_it_xgrd)
>
>       plot = gsn_csm_contour_map(wks,rain_it_xgrd,res)
>
>
>  ;end do
>
> ;*****************************************************************************
>
> end
>
>
> ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: trmmGrid.pdf
Type: application/pdf
Size: 90601 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141121/25b78409/attachment-0001.pdf 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trm2rcm1.png
Type: image/png
Size: 49752 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141121/25b78409/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trmm2rcm2.png
Type: image/png
Size: 75442 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141121/25b78409/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrfOutput.bmp
Type: image/bmp
Size: 1371094 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141121/25b78409/attachment-0001.bmp 


More information about the ncl-talk mailing list