Re: Regridding IMD data 1*1 degree to 2.5*2.5 degree

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue Apr 06 2010 - 09:07:20 MDT

Hi A.R.,
The area_hi2lores_Wrap documentation details an option, foOption, that
controls how much missing data is allowed to be present before the
interpolation is performed. As the documentation states, the default is
critpc = 100, which means if any missing data is encountered the output
grid point will be set to _FillValue. As you have no data over the
ocean, this will result in all regridded coastal points to be set to 0.
Try setting:
foOption = True
foOption@critpc = 30
pptn=area_hi2lores_Wrap(newlon,newlat,rainfall,False,1,lon,lat,foOption)

I believe you will get different results.
Adam

On 04/05/2010 10:11 PM, A.R Ragi wrote:
>
>
> Dennis..,
> I'm attaching those plots i'm getting before regridding and after
> regridding using area_hi2lores_Wrap. After regridding it looks odd. The
> code am using also attaching.
>
>
> ;**************************************************************************
> ; NCL script to calculate total precip from CMAP and IMD
> ;**************************************************************************
>
> 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"
>
> begin
>
> ;Open ECHAM output file
>
> ncep_out =
> addfile("/newhdd/guest/NCL_codes/CMAP/PRECIP/precip.mon.mean.nc
> <http://precip.mon.mean.nc>","r")
> imd_out = addfile("/newhdd/guest/IMD/rf_2002.nc
> <http://rf_2002.nc>","r")
>
>
> ;Extracting the variables
> ; NCEP Variables
>
> lat = ncep_out->lat(33:21)
> lon = ncep_out->lon(26:39)
>
> nlat = dimsizes(lat)
> nlon = dimsizes(lon)
>
> precip = ncep_out->precip(281,33:21,26:39)
> precip!0 = "lat"
> precip!1 = "lon"
> precip&lat = lat
> precip&lon = lon
> printVarSummary(precip)
>
> ; IMD variables
>
> newlat = imd_out->latitude
> newlon = imd_out->longitude
> printVarSummary(newlat)
> printVarSummary(newlon)
>
> mlon = dimsizes(newlon)
> mlat = dimsizes(newlat)
>
> gridded_rainfall = imd_out->rf(152:181,0,:,:)
> printVarSummary(gridded_rainfall)
>
> rainfall = dim_avg_n(gridded_rainfall,0)
> rainfall!0 = "lat"
> rainfall!1 = "lon"
> rainfall&lat = newlat
> rainfall&lon = newlon
> printVarSummary(rainfall)
>
>
> ; Open Workstation
>
> wks =
> gsn_open_wks("ps","Observational_precipitation_2002_06_india")
> plot = new(3, graphic)
>
> ; Setting resources
>
> res = True
> res@gsnMaximize = True
>
> res@lbOrientation = "Vertical"
> res@lbLabelFontHeightF = 0.015
> res@lbLabelAutoStride = True
>
> res@mpDataBaseVersion = "Ncarg4_1"
> res@mpDataSetName = "Earth..2"
> res@mpOutlineBoundarySets = "NoBoundaries"
> res@mpNationalLineColor = "black"
> res@mpNationalLineThicknessF = 1.8
> res@mpGeophysicalLineThicknessF = 1.8
> res@mpFillAreaSpecifiers = (/"Land","India","Water"/)
> res@mpSpecifiedFillColors = (/"white","transparent","white"/)
> res@mpInlandWaterFillColor = 238
> res@mpLandFillColor = -1
> res@mpOutlineOn = True
> res@mpOutlineSpecifiers = (/"Land","India"/)
> res@mpMaskOutlineSpecifiers = (/"water"/)
>
>
> res@cnFillOn = True
>
> res@cnLineLabelsOn = False
> res@cnLevelSelectionMode = "ExplicitLevels"
> res@cnLinesOn = False
> res@cnFillDrawOrder = "PreDraw"
>
> res@gsnAddCyclic = False
> res@gsnRightString = "(mm/day)"
>
> res@tmXTOn = False
> res@tmYROn = False
>
> minlat = lat(0)
> maxlat = lat(nlat-1)
> minlon = lon(0)
> maxlon = lon(nlon-1)
>
> res@mpMinLatF = minlat
> res@mpMaxLatF = maxlat
> res@mpMinLonF = minlon
> res@mpMaxLonF = maxlon
>
>
> ;Total Precipitation calculation for CMAP
>
> res1 = res
> res1@tiMainString = "CMAP"
> res1@cnLevels = (/2, 4, 6, 8, 10, 15, 14, 16, 18/)
> res1@cnFillColors =
> (/"green","greenyellow","yellow","goldenrod","tomato","orangered","red","cyan","RoyalBlue","NavyBlue","darkviolet","Purple"
> /)
>
> plot(0) = gsn_csm_contour_map_ce(wks,precip,res1)
>
> ;Total Precipitation calculation for IMD
> pptn =
> area_hi2lores_Wrap(newlon,newlat,rainfall,False,1,lon,lat,False)
> pptn!0 = "lat"
> pptn!1 = "lon"
> pptn&lat = lat
> pptn&lon = lon
> printVarSummary(pptn)
>
> res2 = res
> res2@tiMainString = "IMD"
> res2@cnLevels = (/2, 4, 6, 8, 10, 12, 14, 16, 18/)
> res2@cnFillColors =
> (/"green","greenyellow","yellow","goldenrod","tomato","orangered","red","cyan","RoyalBlue","NavyBlue","darkviolet","Purple"
> /)
>
>
> plot(1) = gsn_csm_contour_map_ce(wks,pptn,res2)
>
>
> ; Difference in IMD and CMAP values
>
> diff_cmap_imd = precip - pptn
> diff_cmap_imd!0 = "lat"
> diff_cmap_imd!1 = "lon"
> diff_cmap_imd&lat = lat
> diff_cmap_imd&lon = lon
> printVarSummary(diff_cmap_imd)
>
> res3 = res
> res3@tiMainString = "Difference IMD and CMAP"
> res3@cnLevels = (/0,1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12/)
> res3@cnFillColors =
> (/"white","green","greenyellow","yellow","goldenrod","tomato","orangered","red","cyan","RoyalBlue","NavyBlue","darkviolet","Purple"
> /)
>
>
> plot(2) = gsn_csm_contour_map_ce(wks,diff_cmap_imd,res3)
>
> pres = True
> pres@gsnPanelLabelBar = False
> pres@gsnMaximize = True
> pres@txString = "Observational Precipitation June 2002"
> pres@gsnAddCyclic = False
> gsn_panel(wks, plot,(/3,1/),pres)
>
> end
>
>
>
> *********************************************************************
> Thanks,
> A.R.Ragi
> M.Tech Atmospheric science
> Department of Atmospheric science
> Cochin University of Science and Technology
> Email : ar.ragi@gmail.com <mailto:ar.ragi@gmail.com>
>
> ***********************************************************************
> "I want to know how God created this world.I am not interested in this
> or that phenomenon. I want to know, his thought, the rest are details"
> . ---Albert Einstein
>
> ***********************************************************************
>
>
>
> On Mon, Apr 5, 2010 at 19:40, Dennis Shea <shea@ucar.edu
> <mailto:shea@ucar.edu>> wrote:
>
> Your question/clarification needs clarification.
> Whta is "the output is not getting proper"
>
>
> On 4/5/10 2:36 AM, A.R Ragi wrote:
>
>
> Dear NCL users..,
> I would like to compare NCEP rainfall data(2.5*2.5 degree) and
> IMD data
> ( 1*1 degree) (/India Meteorological Department).
> For comparing I would like to regrid the IMD data to 2.5*2.5 degrees
> which NCL function will help in this case?
> I tried /area_hi2lores_Wrap but the output is not getting proper.
> Can anyone help me for this?
> Thanks in advance
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
__________________________________________________
Adam Phillips 
asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
Climate and Global Dynamics Division         fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Apr 6 09:07:32 2010

This archive was generated by hypermail 2.1.8 : Wed Apr 07 2010 - 07:12:50 MDT