[ncl-talk] Regridding reananlysis 2 data error (NetCDF sub sectional data)

Dennis Shea shea at ucar.edu
Wed Apr 27 14:09:48 MDT 2016


Please always carefully read the documentation for the functions you are
using. That is your responsibility.

===

Did you look at the dimensions sizes and variable rank of the variables? The
lat & lon variables on the *reanalysis* are

float lat ( lat )
float lon( lon )

Both of these are **one-dimensional***.* In function/procedure prototyping,
the syntax used to denote one-dimensional variables is [*].

---

Please look at the function prototyping for rcm2rgrid as described in the
documentation:

https://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2rgrid.shtml

Specifically ...

function rcm2rgrid (
		lat2d [*][*] : numeric,
		lon2d [*][*] : numeric,
		fi           : numeric,
		lat      [*] : numeric,
		lon      [*] : numeric,
		Option       : numeric
	)


lat2d/lon2d are prototyped as **two-dimensional**

In procedure prototyping, the syntax used to denote
two-dimensional variables is  [*][*] ==> two-dimensional

You do the following:

 lat2d=a->lat      ; one dimensional [*] which you put in a variable named
lat2d
 lon2d=a->lon    ; I am not sure why you used this confusing naming.


 rtrmm = rcm2rgrid_Wrap(lat2d,lon2d,u11,lat,lon,0)

Then you write ...
*However I get the following error :*





*fatal:Number of dimensions in parameter (0) of (rcm2rgrid_Wrap) is (1),
(2) dimensions were expectedfatal:["Execute.c":8573]:Execute: Error
occurred at or near line 24===*
It is telling you exactly what the error is.

Function parameter numbering starts at the left an begins with argument 0.

*So* parameter 0 i requires 2-dimensional arguments BUT you are passing in
lat (which has the confusing name 'lat2d') which is [*]

Now reread the error message. Does this make sense to you??

I don't even think you need ESMF regrid unless you need conservative
regridding.

===

   a    = addfile("/home/cee2/SV10.nc","r")
   u11= a->uwnd(:,0,:,:)     ; (level,lat,lon)

; Global TRMM grid .... Change for the Reanalysis region
   nlat       = 400
   mlon       = 1440
   lat        = ispan(0,nlat-1,1)*0.25 -  49.875
   lon        = ispan(0,mlon-1,1)*0.25 - 179.875


  lat!0     = "lat"
  lat at units = "degrees_north"

;  lon       = fspan(-179.875, 179.875, nlon-1)
  lon!0     = "lon"
  lon at units = "degrees_east"

; regrid (bilinear)
  wks = gsn_open_wks("png","resize")
  rtrmm = linint2_Wrap(u&lat,u&lon,u11,lat,lon,0)
  printVarSummary(rtrmm)

====
I *expect* you to read the documentation for linint2 (linint2_Wrap)





On Wed, Apr 27, 2016 at 12:30 PM, Saurabh Singh <saurabhsingh123op at gmail.com
> wrote:

> Dear sir I am trying to interpolate Reanalysis-II data to TRMM data in
> order to find correlation;
>
> NCL Version 6.3.0
> OS: UBUNTU 15.10
>
> ncl_filedum uwnd.nc
>
>
>
>
>
>
>
> *float lat ( lat )         units :        degrees_north
> actual_range : ( 14.2855, -14.2855 )         long_name :
> Latitude         standard_name :        latitude         axis : Y
> coordinate_defines :   point*
>
>
>
>
>
>
>
> *      float lon ( lon )         units :        degrees_east
> long_name :    Longitude         actual_range : ( 90, 123.75 )
> standard_name :        longitude         axis : X
> coordinate_defines :   point*
>
>
>
>
>
>
> *      double time ( time )         units :        hours since 1800-1-1
> 00:00:0.0         long_name :    Time         actual_range : ( 1753152,
> 1823256 )         delta_t :      0000-00-01 00:00:00         standard_name
> :        time*
>
>
> Thereafter I use the following code :
>
>  a=addfile("/home/cee2/SV10.nc","r")
>
> y=a->lat
>  u10=a<-uwnd
>  u11=u10(:,0,:,:)
> lat2d=a->lat
>  lon2d=a->lon
>
>  ; Global TRMM grid .... Change for the Reanalysis region
>    nlat       = 400
>    mlon       = 1440
>    lat        = ispan(0,nlat-1,1)*0.25 -  49.875
>    lon        = ispan(0,mlon-1,1)*0.25 - 179.875
>
>
> lat!0     = "lat"
>   lat at units = "degrees_north"
>
> ;  lon       = fspan(-179.875, 179.875, nlon-1)
>   lon!0     = "lon"
>   lon at units = "degrees_east"
>
> ; regrid (bilinear)
>   wks = gsn_open_wks("png","resize")
>   rtrmm = rcm2rgrid_Wrap(lat2d,lon2d,u11,lat,lon,0)
>
> *However I get the following error :*
>
>
> *fatal:Number of dimensions in parameter (0) of (rcm2rgrid_Wrap) is (1),
> (2) dimensions were expectedfatal:["Execute.c":8573]:Execute: Error
> occurred at or near line 24*
>
> --
> With regards
> Saurabh Kumar singh
>
>  *P** : * *Please consider the environment before printing this e-mail*
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160427/4c9ce00f/attachment.html 


More information about the ncl-talk mailing list