Re: ESMF regrid fuction

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Dec 10 2012 - 09:28:41 MST

[1] Yes, linint2_Wrap can be used. It does require the input latitudes
     to be ordered South->North. Read the documentation. The returned
     grid is ordered S->N. That is opposite the input order. You
     can easily reorder via NCL syntax. Again, please read
     NCL documentation.

[2] The following is vague:
"The regrided file for soil temperature and soil moisture show no good
  comparison with the orignal NCEP data". WHat is meant by "no good
  comparison"?

[3] Attached is a slightly different script.

On 12/9/12 8:32 AM, Muhammad Amjad wrote:

>
> Could you kindly reply my question? The older fuction in NCL
> 'linint2_Wrap' do well for 2m temperature data but it does perform
> well with soil temperature and soil moisture data of NCEP reanalysis.
> The regrided file for soil temperature and soil moisture show no good
> comparison with the orignal NCEP data.

>>
>> 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 Tue Dec 11 02:12:10 2012

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