[ncl-talk] Fw: lintint2_points

Mary Haley haley at ucar.edu
Mon Feb 5 08:57:26 MST 2018


You are treating "lat2d" and "lon2d" like coordinate arrays with the
following call:

    curvilinear_to_SCRIP(srcGridName,var&lat2d,var&lon2d,Opt)

​These two variables are NOT attached to var, and they couldn't be anyway,
because they violate the rule that coordinate arrays be one-dimensional.

lat2d and lon2d are standalone variables that you read off a file earlier
in your script, so you simply want:

​    curvilinear_to_SCRIP(srcGridName,lat2d,lon2d,Opt)

--Mary






On Mon, Feb 5, 2018 at 5:05 AM, Ehsan Taghizadeh <ehsantaghizadeh at yahoo.com>
wrote:

> Dear NCL users,
> I've modified the script and I have some problems with it, yet.
> New outputs and errors are:
>
> Variable: lat2d
> Type: float
> Total Size: 1565536 bytes
>             391384 values
> Number of Dimensions: 2
> Dimensions and sizes:   [DIM_000 | 406] x [DIM_001 | 964]
> Coordinates:
> Number Of Attributes: 2
>   long_name :   Latitude of the center of the Earth based grid cell.
>   units :       degrees_north
>
> Variable: lon2d
> Type: float
> Total Size: 1565536 bytes
>             391384 values
> Number of Dimensions: 2
> Dimensions and sizes:   [DIM_000 | 406] x [DIM_001 | 964]
> Coordinates:
> Number Of Attributes: 2
>   long_name :   Longitude of the center of the Earth based grid cell.
>   units :       degrees_east
>
> Variable: var
> Type: float
> Total Size: 1565536 bytes
>             391384 values
> Number of Dimensions: 2
> Dimensions and sizes:   [DIM_000 | 406] x [DIM_001 | 964]
> Coordinates:
> Number Of Attributes: 6
>   _FillValue :  -9999
>   coordinates : /Soil_Moisture_Retrieval_Data_AM/latitude
> /Soil_Moisture_Retrieval_Data_AM/longitude
>   long_name :   Representative soil moisture measurement for the Earth
> based grid cell.
>   units :       cm**3/cm**3
>   valid_max :   0.5
>   valid_min :   0.02
> fatal:(lat2d) is not a named dimension in variable (var).
> fatal:["Execute.c":8640]:Execute: Error occurred at or near line 101 in
> file 2_SPL3SMP_E_Interpolating1.ncl
>
> I'll be thankful if I could have your help.
>
> *Sincerely*
> *Ehsan Taghizadeh*
> On Sunday, February 4, 2018, 3:32:14 PM GMT+3:30, Ehsan Taghizadeh <
> ehsantaghizadeh at yahoo.com> wrote:
>
>
> Dear Dennis
> Thank you so much for you help.
> I've changed my script to attached one by adding lines 79-91, however it
> seems to have some basic problems! Could I ask help me about them, please?
> I faced following errors:
>
> fatal:syntax error: line 87 in file 2_SPL3SMP_E_Interpolating1.ncl before
> or near \n
>     curvilinear_to_SCRIP(src_file,var&LAT,var&LON,Opt)
> -------------------------------------------------------^
>
> fatal:syntax error: possibly an undefined procedure
> fatal:syntax error: line 88 in file 2_SPL3SMP_E_Interpolating1.ncl before
> or near \n
>         latlon_to_SCRIP(dstGridName,"5x5",Opt)
> ----------------------------------------^
>
> fatal:syntax error: possibly an undefined procedure
> fatal:syntax error: line 89 in file 2_SPL3SMP_E_Interpolating1.ncl before
> or near \n
>         ESMF_regrid_gen_weights(src_file,dstGridName,wgtFileName,Opt)
> ---------------------------------------------------------------^
>
> fatal:syntax error: possibly an undefined procedure
> fatal:Syntax Error in block, block not executed
> fatal:error at line 126 in file 2_SPL3SMP_E_Interpolating1.ncl
>
>
> Sincerely
> Ehsan
>
> On Tuesday, January 30, 2018, 7:34:40 AM GMT+3:30, Dennis Shea <
> shea at ucar.edu> wrote:
>
>
> [1] As noted in the documentation, linint2_points Interpolates from a
> *rectilinear grid* to a user specified set of points using bilinear
> interpolation.
>
>      http://www.ncl.ucar.edu/Document/Functions/Built-in/
> linint2_points.shtml
>
> [2] The SMAP data are on a *curvilinear* grid: [DIM_000 | 406] x [DIM_001
> | 964] . Hence, 'linint2_points'  will not work.
>
> [3] I suggest that you
>      (a) use ESMF regridding to interpolate from the curvilinear grid to a
> rectilinear grid of approximately the same resolution.
>      (b) then use linint2_points on (3a)
>
> ===
> See the NARR Example 5. NARR uses a curvilinear grid. Create an SMAP ESMF
> weight file [eg: ESMF eamaple 30) ; Use the weight file to generate a
> rectilinear grid; use linint2_points.
>
>  http://www.ncl.ucar.edu/Applications/narr.shtml
>
> Good luck
>
>
>
> On Mon, Jan 29, 2018 at 9:23 AM, Ehsan Taghizadeh via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
> Hi,
> I want to interpolate soil moisture data from SMAP (Soil Moisture
> Ative/Passive) to some specified locations (in stations_NW.csv attached
> file). Some information of data are as belows.
>
> printVarSummary(lat2d)
> Variable: lat2d
> Type: float
> Total Size: 1565536 bytes
>             391384 values
> Number of Dimensions: 2
> Dimensions and sizes:   [DIM_000 | 406] x [DIM_001 | 964]
> Coordinates:
> Number Of Attributes: 2
>   long_name :   Latitude of the center of the Earth based grid cell.
>   units :       degrees_north
>
> printVarSummary(lon2d)
> Variable: lon2d
> Type: float
> Total Size: 1565536 bytes
>             391384 values
> Number of Dimensions: 2
> Dimensions and sizes:   [DIM_000 | 406] x [DIM_001 | 964]
> Coordinates:
> Number Of Attributes: 2
>   long_name :   Longitude of the center of the Earth based grid cell.
>   units :       degrees_east
>
> printVarSummary(var):
> Variable: var
> Type: float
> Total Size: 1565536 bytes
>             391384 values
> Number of Dimensions: 2
> Dimensions and sizes:   [DIM_000 | 406] x [DIM_001 | 964]
> Coordinates:
> Number Of Attributes: 6
>   _FillValue :  -9999
>   coordinates : /Soil_Moisture_Retrieval_Data_ AM/latitude
> /Soil_Moisture_Retrieval_Data_ AM/longitude
>   long_name :   Representative soil moisture measurement for the Earth
> based grid cell.
>   units :       cm**3/cm**3
>   valid_max :   0.5
>   valid_min :   0.02
>
> However I've faced below error:
> fatal:(lon) is not a dimension name in variable (var), could not determine
> dimension number
>
> I searched in google and I found may be "There is no 'lon' dimension
> name. In fact, there are no latitude/longitude coordinates on the file at
> all."
> So I used following line:
>     SMAP_fo = linint2_points(lon2d,lat2d, var(DIM_000 | :, DIM_001 | :),
> False , lon_NW, lat_NW, 0)
>
> instead of:
>     SMAP_fo = linint2_points(lon2d,lat2d, var(lat | :, lon | :), False ,
> lon_NW, lat_NW, 0)
>
> and after that I faced following error:
> fatal:linint2_points: If xi is not one-dimensional, then it must have one
> less dimension than fi
>
> After that I added following lines to the script:
>     lat1d = ndtooned(lat2d)
>     lon1d = ndtooned(lon2d)
>
> Again I had following error:
> fatal:linint2_points: The rightmost dimensions of fi must be nyi x nxi,
> where nyi and nxi are the lengths of yi and xi respectively
>
> And here I'm not sure about what I've done.
> I've attached the script, stations_NW.csv (input for unstructured points)
> and links.txt (which contains links for downloading SMAP data. Sorry about
> that but I couldn't attach SMAP files, because of their sizes. However to
> download them it is necessary to have earthdata user name!).
> I'll be thankful if I could have your help, again.
>
> Sincerely
> Ehsan
>
> ______________________________ _________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/ mailman/listinfo/ncl-talk
> <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>
>
>
> _______________________________________________
> 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/20180205/19e25b35/attachment.html>


More information about the ncl-talk mailing list