Re: Edge issue in Regridding Daymet Joined Tiles with ESMF_Regridding on NCL 6.1.0

From: Ping Yang <pyang_at_nyahnyahspammersnyahnyah>
Date: Sat Apr 13 2013 - 11:07:54 MDT

Hi Mary,

I uploaded two files in the ftp (just for one time slice)
Original 1KM file: prcp.NE.19800112.llc
Regridded 3 armin file: prcp.3MIN.lonlat.19800112.nc

Would you please have a look at it and help to figure it out?

Regards,

Ping

On Fri, Apr 12, 2013 at 6:12 PM, Mary Haley <haley@ucar.edu> wrote:

> Hi Ping,
>
> If you have the three *.nc files that are created by ESMF_regrid, then
> the ESMF folks might be able to look at them to see if there's an issue
> with the conserve method.
> They would also need to see exactly how ESMF_RegridWeightGen is being
> called, which you can see if you set:
>
> Opt@Debug = True
>
> Or, if you can provide me with your two input data files, then I can
> narrow down the script so that it only does one timestamp, and I will send
> the info off to the ESMF folks.
>
> http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP
>
> --Mary
>
>
> On Apr 12, 2013, at 3:19 PM, Ping Yang wrote:
>
> > Dear NCL,
> >
> > I was using the following script to regridding the joined Daymet grid (1
> KM) to 3 acrmin, in which the projection was translated from LLC to lonlat
> and the resolution from 1 KM to 3 arcmin. However, after I tried to
> comparing different interpolation method based on the 3 arcmin data (I used
> a conserve method for the ESMF regridding), I found the this 3 arcmin data
> has problem in the edge/boundary.
> >
> > I am including a graphs here to show the problem:
> > <image.png>
> > The edge(coast and land) place especially in Maine (also massachusetts)
> looks weird after the regridding, a mixture of no data value and real
> values, and when I do a statistical of year sum, I got very small
> values(below 10 mm) for one year.
> >
> > The script I was using is:
> >
> > 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/wrf/WRFUserARW.ncl"
> > load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"
> > vname ="pr"
> > srcFileName = vname + ".NE." + year +".nc"
> > ;srcFileName = "NE_all_1980_correct_prcp.nc"
> > srcPathName = srcDirName+srcFileName
> > sfile = addfile(srcPathName,"r")
> >
> > ;---Set the destination file name
> > dstDirName = "/data/ecr/yangping/DAYMET/Grid/Intermediate/"
> > system("/bin/mkdir -p "+ dstDirName)
> > dstFileName = str_upper(vname)+"."+year+"_1KM.esmf.nc"
> > dstPathName = dstDirName+dstFileName
> >
> > setfileoption("nc","Format","LargeFile")
> >
> > ;out=addfile("/data/ecr/yangping/DAYMET/Grid/3MIN/" + vname +
> "_3MIN_lonlat_" + year+".nc","c")
> > outDirName = "/data/ecr/yangping/DAYMET/Grid/3MIN/"
> > outFileName = vname + ".3MIN.lonlat." + year+".nc"
> > outPathName = outDirName + outFileName
> > system("/bin/rm -f "+outPathName) ; delete any pre-existing file
> > out=addfile(outPathName,"c")
> >
> > ;--- ESMF regrid method: "conserve", "bilinear", "patch"
> > method = "conserve"
> > ; method = "patch"
> >
> > ;===================================================
> >
> > ;---Options
> > Opt = True
> > Opt@SrcTitle = "Daymet Joined Grid "+year+" to rectlinear"
> ; optional
> > Opt@WgtFileName = dstDirName + "Daymet_to_Rect.Wgt.nc"
> >
> > Opt@ForceOverwrite = True
> > ;;Opt@PrintTimings = True
> >
> > ;---Get the source file Daymet lat/lon grid
> > lat2d = sfile->lat
> > lon2d = sfile->lon
> >
> > dim2d = dimsizes(lat2d)
> > nlat = dim2d(0)
> > nlon = dim2d(1)
> >
> > print(nlat)
> > print(nlon)
> >
> > ;---Get the Daymet source variable
> > var = sfile->$vname$ ; (time, y, x)=>(365,232,221)
> >
> > ;Opt@SrcGridType = "curvilinear"
> > Opt@SrcGridLat = lat2d
> > Opt@SrcGridLon = lon2d
> >
> > ;---Create the destination lat/lon grid
> > dll=0.05 ;3MIN
> > latrange=abs(max(lat2d)-min(lat2d))
> > lonrange=abs(max(lon2d)-min(lon2d))
> > kpts_lat= toint(latrange/dll)+1
> > kpts_lon= toint(lonrange/dll)+1
> > lat = fspan( min(lat2d),max(lat2d), kpts_lat )
> > lon = fspan( min(lon2d),max(lon2d), kpts_lon )
> >
> > newlon = fspan(-84.025,-64.875,384)
> > newlat = fspan(34.875,50.125,306)
> >
> > Opt@DstGridType = "rectilinear"
> > ;Opt@DstGridLat = lat
> > Opt@DstGridLat = newlat
> > ;Opt@DstGridLon = lon
> > Opt@DstGridLon = newlon
> >
> > Opt@CopyVarCoords= True ; default for 6.1.0
> >
> > Opt@InterpMethod = method
> > Opt@SrcRegional = True
> > Opt@DstRegional = True
> >
> > var_regrid = ESMF_regrid(var,Opt) ; Do the regridding for 'var'
> > printVarSummary(var_regrid)
> > var_regrid@grid_mapping = "lonlat" ;
> > out->$vname$=var_regrid ;output the regridding
> result
> >
> > Can some here where is the problem and how to fix it?
> >
> > Look forward to hearing from you.
> >
> > Regards,
> >
> > Ping
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

-- 
Ping Yang, Ph.D.
CUNY Environmental Crossroads Initiative
Marshak Science Building - Suite 925
The City College of New York - CUNY
160 Convent Avenue, New York NY 10031
Phone: 212-650-5769
Fax: 212-650-7064

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Apr 13 11:08:29 2013

This archive was generated by hypermail 2.1.8 : Fri Apr 26 2013 - 17:10:26 MDT