[ncl-talk] rcm2rgrid issue

Dennis Shea shea at ucar.edu
Wed Jun 24 16:43:35 MDT 2020


Thank you Rashad
===============
Attached is a script that explores the original data and the specified
sub-region.
It is the user's responsibility to explore the data that is being used.
Read:

*region_ind*
<http://www.ncl.ucar.edu/Document/Functions/Contributed/region_ind.shtml>
*stat_dispersion*
<https://www.ncl.ucar.edu/Document/Functions/Contributed/stat_dispersion.shtml>

output from attached script.
================
Variable: *t_region*
Type: float
Total Size: 64976 bytes
            16244 values
Number of Dimensions: 2
Dimensions and sizes: [y | 131] x [x | 124]
Coordinates:
Number Of Attributes: 6
  cell_method : time: mean
  units : K
  long_name : soil temperature (vegetated landunits only)
  levgrnd : 0.007100635417193535
  time : 287808
  _FillValue : 1e+36
(0) soil temperature (vegetated landunits only) (K) : min=269.201
max=311.192
(0) ==============
(0)
(0)   ===> Robust Dispersion Statistics: soil temperature (vegetated
landunits only) <===
(0) [0]            Mean=291.962
(0) [1]          StdDev=10.9702
(0) [2]             Min=269.201
(0) [3]          LowDec=275.401
(0) [4]          LowOct=275.94
(0) [5]          LowSex=276.929
(0) [6]     LowQuartile=279.668
(0) [7]          LowTri=287.303
(0) [8]          Median=296.164
(0) [9]         HighTri=299.089
(0) [10]   HighQuartile=300.707
(0) [11]        HighSex=302.299
(0) [12]        HighOct=303.273
(0) [13]        HighDec=303.886
(0) [14]            Max=311.192
(0) [15]          Range=41.9907
(0) [16]     Dispersion=3.82772
(0) [17]    RMS Anomaly=10.9697
(0) [18]      #   Total=16244
(0) [19]      #    Used=10799
(0) [20]      # Missing=5445
(0) [21]      % Missing=33.5201
(0) [22]     Lower 0.1%=270.537
(0) [23]     Lower 1.0%=272.28
(0) [24]     Lower 5.0%=274.152
(0) [25]     Upper 5.0%=305.754
(0) [26]     Upper 1.0%=308.581
(0) [27]     Upper 0.1%=310.4
(0) [28]       Skewness=-0.460913
(0) [29]       Kurtosis=-1.23899
============================
%> ncl soil.Suman_Mailty.ncl

On Wed, Jun 24, 2020 at 3:34 PM Dr. Suman Maity <suman.buie at gmail.com>
wrote:

> Dear Rashed
> I have another query. Will ESMF regrid functionworks only in 2D? I mean if
> for 3D data like t(time,lat,lon) will it be applicable? If yes, what to do
> especially?
> Because it is mentioned in the website that the data to be of any
> dimensionality with the rightmost dimension lat x lon, but I am getting
> error like:
>
> fatal:Eq: Dimension size, for dimension number 0, of operands does not
> match, can't continue
> Will you please comment?
> Thanking you,
>
> Best
> Suman
> ++++++++++++++++++++++++++++++++++++++++++
> Dr. Suman Maity
> Research Associate
> School of Atmospheric Science
> Sun Yat-sen University, Zhuhai campus,Tangjiawan Town
> Zhuhai, Guangdong, Postcode-519082,China.
> Phone:+86-13543861045 (China), +91-9732636778 (India)
> skype: reach2suman
> https://www.researchgate.net/profile/Suman_Maity
> ++++++++++++++++++++++++++++++++++++++++++
>
>
> On Thu, Jun 25, 2020 at 2:30 AM Dr. Suman Maity <suman.buie at gmail.com>
> wrote:
>
>> Dear Rashed
>> Yes, you are absolutely right.It works fine for me.
>> Thanking you once again.
>>
>> Best
>> Suman
>> ++++++++++++++++++++++++++++++++++++++++++
>> Dr. Suman Maity
>> Research Associate
>> School of Atmospheric Science
>> Sun Yat-sen University, Zhuhai campus,Tangjiawan Town
>> Zhuhai, Guangdong, Postcode-519082,China.
>> Phone:+86-13543861045 (China), +91-9732636778 (India)
>> skype: reach2suman
>> https://www.researchgate.net/profile/Suman_Maity
>> ++++++++++++++++++++++++++++++++++++++++++
>>
>>
>> On Thu, Jun 25, 2020 at 2:02 AM Rashed Mahmood <rashidcomsis at gmail.com>
>> wrote:
>>
>>> ESMF regrid function is my personal choice when it comes to regriding:
>>> See the attached script and the resulting plot. I turned off zoom
>>> resources to see the full picture. Your "t" data seems to have missing
>>> values which are masked before regriding. Please make sure that this looks
>>> right to you.
>>>
>>> Cheers,
>>> Rashed
>>>
>>> On Wed, Jun 24, 2020 at 6:28 PM Dr. Suman Maity <suman.buie at gmail.com>
>>> wrote:
>>>
>>>> Hi Dennis
>>>> As you directed I uploaded both the files "temp_seltime.nc" and "
>>>> EIN5.soilT.0-7cm.JJASmean.1982-2016.remap.nc" at ftp.cgd.ucar.edu
>>>> I would like to request you to have a look and comment where I am doing
>>>> mistake.
>>>> @Rashed
>>>> As directed by Dennis, the data are now available at ftp.cgd.ucar.edu.
>>>> Please have a look with the data and comment.
>>>> Thanking you all.
>>>>
>>>> Best
>>>> Suman
>>>> ++++++++++++++++++++++++++++++++++++++++++
>>>> Dr. Suman Maity
>>>> Research Associate
>>>> School of Atmospheric Science
>>>> Sun Yat-sen University, Zhuhai campus,Tangjiawan Town
>>>> Zhuhai, Guangdong, Postcode-519082,China.
>>>> Phone:+86-13543861045 (China), +91-9732636778 (India)
>>>> skype: reach2suman
>>>> https://www.researchgate.net/profile/Suman_Maity
>>>> ++++++++++++++++++++++++++++++++++++++++++
>>>>
>>>>
>>>> On Wed, Jun 24, 2020 at 8:27 PM Dennis Shea <shea at ucar.edu> wrote:
>>>>
>>>>> Perhaps, you could ftp the two netcdf file "temp_seltime.nc" and "
>>>>> EIN5.soilT.0-7cm.JJASmean.1982-2016.remap.nc"
>>>>>
>>>>> ftp ftp.cgd.ucar.edu
>>>>> anonymous
>>>>> cd incoming
>>>>> put temp_seltime.nc
>>>>> put  EIN5.soilT.0-7cm.JJASmean.1982-2016.remap.nc
>>>>> quit
>>>>>
>>>>> If the EINS file is large, sInce NCL needs only rom the latitude and
>>>>> longitude variables from the EINS file, you could use (say) the netCDF
>>>>> 'ncks' operator
>>>>>
>>>>> %> ncks -v latitude,longitude
>>>>> EIN5.soilT.0-7cm.JJASmean.1982-2016.remap.nc EINS_latlon.nc
>>>>>
>>>>> and ftp that file
>>>>>
>>>>>
>>>>> On Tue, Jun 23, 2020 at 3:30 PM Rashed Mahmood <rashidcomsis at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> did you check what the min/max of your data values are?
>>>>>>
>>>>>> printMinMax(xgrid,0)
>>>>>>
>>>>>> What does printVarSummary(xgrid) tell?
>>>>>>
>>>>>> Without data file(s) there is not much people can do to help. You
>>>>>> could also try using ESMF regridding:
>>>>>> http://www.ncl.ucar.edu/Applications/ESMF.shtml
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, Jun 23, 2020 at 9:18 PM Dr. Suman Maity via ncl-talk <
>>>>>> ncl-talk at mailman.ucar.edu> wrote:
>>>>>>
>>>>>>> Hi Dennis
>>>>>>> Thank you for your suggestions. As you mentioned, I modified my
>>>>>>> script as beow:
>>>>>>> begin
>>>>>>>   a = addfile("EIN5.soilT.0-7cm.JJASmean.1982-2016.remap.nc","r")
>>>>>>>   soil = a->stl1
>>>>>>>   soil = soil(:,::-1,:)
>>>>>>>   b = addfile("temp_seltime.nc","r")
>>>>>>>   t = rm_single_dims(b->TSOI(:,0,:,:))
>>>>>>>   lat2d = b->lat
>>>>>>>   lon2d = b->lon
>>>>>>>   xgrd  =
>>>>>>> rcm2rgrid_Wrap(lat2d,lon2d,t,soil&latitude,soil&longitude,0)
>>>>>>>
>>>>>>>   wks  = gsn_open_wks ("x11", "plot")
>>>>>>>   sres                      = True
>>>>>>>   sres at gsnAddCyclic         = False
>>>>>>>   sres at mpMinLatF            = 5
>>>>>>>   sres at mpMaxLatF            = 40
>>>>>>>   sres at mpMinLonF            = 65
>>>>>>>   sres at mpMaxLonF            = 100
>>>>>>>   sres at cnFillOn = True
>>>>>>>   sres at mpFillOn = False
>>>>>>>   sres at cnLevelSelectionMode = "ManualLevels"
>>>>>>>   sres at cnMinLevelValF = 280.
>>>>>>>   sres at cnMaxLevelValF = 320.
>>>>>>>   sres at cnLevelSpacingF = 10
>>>>>>>   plot = gsn_csm_contour_map(wks,xgrd,sres)
>>>>>>> end
>>>>>>> But unfortunately, all the efforts goes to vain and the plot remains
>>>>>>> same as observed earlier. Is there any other issue? Please comment.
>>>>>>> Thanking you,
>>>>>>>
>>>>>>> Best
>>>>>>> Suman
>>>>>>> ++++++++++++++++++++++++++++++++++++++++++
>>>>>>> Dr. Suman Maity
>>>>>>> Research Associate
>>>>>>> School of Atmospheric Science
>>>>>>> Sun Yat-sen University, Zhuhai campus,Tangjiawan Town
>>>>>>> Zhuhai, Guangdong, Postcode-519082,China.
>>>>>>> Phone:+86-13543861045 (China), +91-9732636778 (India)
>>>>>>> skype: reach2suman
>>>>>>> https://www.researchgate.net/profile/Suman_Maity
>>>>>>> ++++++++++++++++++++++++++++++++++++++++++
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Jun 23, 2020 at 11:02 PM Dennis Shea <shea at ucar.edu> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> *http://www.ncl.ucar.edu/Document/Functions/Contributed/rcm2rgrid_Wrap.shtml*
>>>>>>>> <http://www.ncl.ucar.edu/Document/Functions/Contributed/rcm2rgrid_Wrap.shtml>
>>>>>>>>
>>>>>>>> and *rcm2rgrid*
>>>>>>>> <http://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2rgrid.shtml>
>>>>>>>> require that the destination (rectilinear) grid have the coordinates
>>>>>>>> (lat[*] and lon[*])  in *ascending order*.
>>>>>>>>
>>>>>>>> You rectilinear grid looks like it is in descending order:  *latitude:
>>>>>>>> [49.5..-19.5]*
>>>>>>>>
>>>>>>>> *f = addfile("EIN5.soilT.0-7cm.JJASmean.1982-2016.remap.nc
>>>>>>>> <http://EIN5.soilT.0-7cm.JJASmean.1982-2016.remap.nc>","r")*
>>>>>>>> *x = f->SOIL*
>>>>>>>> *printVarSummary(x)*
>>>>>>>>
>>>>>>>> *print("========")*
>>>>>>>>
>>>>>>>>
>>>>>>>> *x = x(::-1,:)    *
>>>>>>>> *printVarSummary(x)*
>>>>>>>> *print("========")*
>>>>>>>>
>>>>>>>>   xgrd  = *rcm2rgrid*(lat2d,lon2d,*x,x&lat,x&lon*,0)
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Jun 23, 2020 at 9:32 AM Dr. Suman Maity via ncl-talk <
>>>>>>>> ncl-talk at mailman.ucar.edu> wrote:
>>>>>>>>
>>>>>>>>> Hi Barry
>>>>>>>>> Thanks for your prompt reply. As you mentioned, here are the
>>>>>>>>> details:
>>>>>>>>>  See http://www.ncl.ucar.edu/ for more details.
>>>>>>>>> (0) ============Before Interpolation===========
>>>>>>>>> Variable: t
>>>>>>>>> Type: float
>>>>>>>>> Total Size: 265960 bytes
>>>>>>>>>             66490 values
>>>>>>>>> Number of Dimensions: 2
>>>>>>>>> Dimensions and sizes: [218] x [305]
>>>>>>>>> Coordinates:
>>>>>>>>> Number Of Attributes: 6
>>>>>>>>>   _FillValue : 1e+36
>>>>>>>>>   time : 287808
>>>>>>>>>   levgrnd : 0.007100635417193535
>>>>>>>>>   long_name : soil temperature (vegetated landunits only)
>>>>>>>>>   units : K
>>>>>>>>>   cell_method : time: mean
>>>>>>>>> (0) ============After Interpolation===========
>>>>>>>>> Variable: xgrd
>>>>>>>>> Type: float
>>>>>>>>> Total Size: 52080 bytes
>>>>>>>>>             13020 values
>>>>>>>>> Number of Dimensions: 2
>>>>>>>>> Dimensions and sizes: [latitude | 93] x [longitude | 140]
>>>>>>>>> Coordinates:
>>>>>>>>>             latitude: [49.5..-19.5]
>>>>>>>>>             longitude: [20.25..124.5]
>>>>>>>>> Number Of Attributes: 7
>>>>>>>>>   _FillValue : 1e+36
>>>>>>>>>   time : 287808
>>>>>>>>>   levgrnd : 0.007100635417193535
>>>>>>>>>   long_name : soil temperature (vegetated landunits only)
>>>>>>>>>   units : K
>>>>>>>>>   cell_method : time: mean
>>>>>>>>>   ncl : rcm2rgrid used for interpolation
>>>>>>>>> [suman at localhost ght]$
>>>>>>>>> Please reply if you need further information. I am unable to share
>>>>>>>>> the data as ncl community allow only 2 MB.
>>>>>>>>> Thanking you once again.
>>>>>>>>>
>>>>>>>>> Best
>>>>>>>>> Suman
>>>>>>>>> ++++++++++++++++++++++++++++++++++++++++++
>>>>>>>>> Dr. Suman Maity
>>>>>>>>> Research Associate
>>>>>>>>> School of Atmospheric Science
>>>>>>>>> Sun Yat-sen University, Zhuhai campus,Tangjiawan Town
>>>>>>>>> Zhuhai, Guangdong, Postcode-519082,China.
>>>>>>>>> Phone:+86-13543861045 (China), +91-9732636778 (India)
>>>>>>>>> skype: reach2suman
>>>>>>>>> https://www.researchgate.net/profile/Suman_Maity
>>>>>>>>> ++++++++++++++++++++++++++++++++++++++++++
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, Jun 23, 2020 at 8:48 PM Barry Lynn <barry.h.lynn at gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Hello Dr. Suman Maity:
>>>>>>>>>>
>>>>>>>>>> It would be helpful if you could attach printouts from your
>>>>>>>>>> interpolation, as well as printVarSummary output of variables you are using
>>>>>>>>>> and/or calculating during the interpolation.
>>>>>>>>>>
>>>>>>>>>> Barry
>>>>>>>>>>
>>>>>>>>>> On Tue, Jun 23, 2020 at 5:58 PM Dr. Suman Maity via ncl-talk <
>>>>>>>>>> ncl-talk at mailman.ucar.edu> wrote:
>>>>>>>>>>
>>>>>>>>>>> Dear All
>>>>>>>>>>> I am facing an issue from "rcm2rgrid" which is mentioned below:
>>>>>>>>>>> I have two netcdf file "temp_seltime.nc" and "
>>>>>>>>>>> EIN5.soilT.0-7cm.JJASmean.1982-2016.remap.nc" and I want to
>>>>>>>>>>> interpolate "temp_seltime.nc" to the lon/lat of "
>>>>>>>>>>> EIN5.soilT.0-7cm.JJASmean.1982-2016.remap.nc" for evaluation.
>>>>>>>>>>> Now " temp_seltime.nc" is an curviliear data with lat and lon
>>>>>>>>>>> information in 2D and the lat2D and lon2D contains some missing points. On
>>>>>>>>>>> the otherhand, "EIN5.soilT.0-7cm.JJASmean.1982-2016.remap.nc"
>>>>>>>>>>> is a normal netdf file (rectilinear grid).  Although interpolation doesn't
>>>>>>>>>>> through any error but the resultant plot is blank. I couldn't understand
>>>>>>>>>>> where I did the mistake? Please scripts and plots as attached.
>>>>>>>>>>> Any sort of suggestion/comments are highly appreciable.
>>>>>>>>>>> Best
>>>>>>>>>>> Suman
>>>>>>>>>>> ++++++++++++++++++++++++++++++++++++++++++
>>>>>>>>>>> Dr. Suman Maity
>>>>>>>>>>> Research Associate
>>>>>>>>>>> School of Atmospheric Science
>>>>>>>>>>> Sun Yat-sen University, Zhuhai campus,Tangjiawan Town
>>>>>>>>>>> Zhuhai, Guangdong, Postcode-519082,China.
>>>>>>>>>>> Phone:+86-13543861045 (China), +91-9732636778 (India)
>>>>>>>>>>> skype: reach2suman
>>>>>>>>>>> https://www.researchgate.net/profile/Suman_Maity
>>>>>>>>>>> ++++++++++++++++++++++++++++++++++++++++++
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> ncl-talk mailing list
>>>>>>>>>>> ncl-talk at mailman.ucar.edu
>>>>>>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>>>>>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Barry H. Lynn, Ph.D
>>>>>>>>>> Senior Associate Scientist, Lecturer,
>>>>>>>>>> The Institute of the Earth Science,
>>>>>>>>>> The Hebrew University of Jerusalem,
>>>>>>>>>> Givat Ram, Jerusalem 91904, Israel
>>>>>>>>>> Tel: 972 547 231 170
>>>>>>>>>> Fax: (972)-25662581
>>>>>>>>>>
>>>>>>>>>> C.E.O, Weather It Is, LTD
>>>>>>>>>> Weather and Climate Focus
>>>>>>>>>> http://weather-it-is.com
>>>>>>>>>> Jerusalem, Israel
>>>>>>>>>> Local: 02 930 9525
>>>>>>>>>> Cell: 054 7 231 170
>>>>>>>>>> Int-IS: x972 2 930 9525
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>> ncl-talk mailing list
>>>>>>>>> ncl-talk at mailman.ucar.edu
>>>>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>>>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>> ncl-talk mailing list
>>>>>>> ncl-talk at mailman.ucar.edu
>>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>>
>>>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200624/8f5f15e7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: soil.Suman_Mailty.ncl
Type: application/octet-stream
Size: 1466 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200624/8f5f15e7/attachment.obj>


More information about the ncl-talk mailing list