Re: ESMF regrid fuction

From: Muhammad Amjad <callamjad_at_nyahnyahspammersnyahnyah>
Date: Sat Dec 08 2012 - 00:56:18 MST

Hi Dennis,

Thanks for you kind answer. By using your suggested script I am
getting lon values in created file from -180 to 180 and 145 grids for
lon. As I mentioned in my script I need it like 0 - 357.5 or 144
grids. Latitudes were regenerated as per desired.

Best regards,

Amjad.

On 12/7/12, Dennis Shea <shea@ucar.edu> wrote:
> It seems youtook Example 4 from
>
> http://www.ncl.ucar.edu/Applications/ESMF.shtml
>
> and plugged in some numbers. Also, statements like
> "The output variable has values but can't be displayed
> and size on disk."
>
> This is not clear.
>
> If your are new to NCL please read the Mini-Language Manual at:
>
> http://www.ncl.ucar.edu/Document/Manuals/
>
> There is also a graphics manual.
>
> Below is a (hopefully) working version of your script.
>
> Note: the built-in NCL function "linint2_Wrap" does
> the exact same thing.
>
> ;===============================================================
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"
>
> diri = "./"
> fili = "air.2m.gauss.2010.nc"
> sfile = addfile(diri+fili,"r")
> data = short2flt(sfile->air(:,0,:,:))
> printVarSummary(data)
>
> method = "bilinear"
>
> Opt = True
> Opt@SrcTitle = "fili"
> Opt@DstGridType = "2.5deg" ; Destination grid description
> Opt@DstTitle = "Global 2.5 degree resolution"
> Opt@ForceOverwrite = True
> Opt@RemoveSrcFile = True ; rm source grid description file
> Opt@RemoveDstFile = True ; rm destination grid description file
> Opt@RemoveWgtFile = False ; Keep for future use
> Opt@InterpMethod = method
> Opt@WgtFileName = "wgt.gauss."+method+".nc"
>
> data_regrid = ESMF_regrid(data,Opt) ; Do the regridding
> printVarSummary(data_regrid)
> print("data_regrid: min="+min(data_regrid)+" max="+max(data_regrid))
>
> sfx = get_file_suffix(fili, 0)
> regridFile = "esmf_regrid."+sfx@fBase+".nc"
> system("/bin/rm -f "+regridFile)
> b = addfile(regridFile,"c")
> b->DATA_REGRID = data_regrid
>
> ;++++++++++++++++++++++++++++++++++++++++++++++++
> ; Comparison with linint2: the same
> ;++++++++++++++++++++++++++++++++++++++++++++++++
> latG = latGlobeF( 73, "lat", "latitude", "degrees_north")
> lonG = lonGlobeF(144, "lon", "longitude", "degrees_east")
> data = data(:,::-1,:) ; linint2 requires S->N
> data_bil2 = linint2_Wrap(data&lon,data&lat,data,True,lonG,latG,0)
> printVarSummary(data_bil2)
> print("data_bil2: min="+min(data_bil2)+" max="+max(data_bil2))
>
>
>
> On 12/07/2012 02:59 AM, Muhammad Amjad wrote:
>> Dear All,
>>
>> I am using latest ncl. I am using this script but the regrided file
>> generated through this can't be displayed. The output variable has
>> values but can't be displayed and size on disk.
>> ---------------------------------
> [SNIP]
>
>

-- 
Muhammad Amjad
Scientific Officer (Climate Section)
Global Change Impact Studies Centre
National Centre for Physics Complex
Near Quaid-i-Azam University Campus
Shahdra Road P.O. Box 3022 , Islamabad
Phone: 051 - 2077300/ Ext. 514
Fax:  051 - 2077385
Mobile: +92 321 5309339
E-mail: m.amjad@gcisc.org.pk, callamjad@gmail.com
-----
Young Scientists Summer Program - 2010, Participant
International Institute for Applied Systems Analysis, Austria.
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Dec 8 16:56:33 2012

This archive was generated by hypermail 2.1.8 : Wed Dec 12 2012 - 19:07:01 MST