[ncl-talk] variable value for specific location

Dennis Shea shea at ucar.edu
Wed Jun 17 21:24:25 MDT 2015


Please look at the function documantation.


http://www.ncl.ucar.edu/Document/Functions/Contributed/linint2_points_Wrap.shtml

See attached script

Output:

Variable: to
Type: float
Total Size: 384 bytes
            96 values
Number of Dimensions: 2
Dimensions and sizes:    [month | 12] x [pts | 8]
Coordinates:
            month: [0..11]
            pts: [0..7]
[SNIP]
  xcoord :    ( 237.7, 238.9, 241.6, 243.7, 247.3, 249, 253.7, 254.7 )
  ycoord :    ( 27.9, 29.7, 33.9, 37.8, 39, 43.2, 44.3, 45.6 )

On Sun, Jun 14, 2015 at 9:25 AM, amit timilsina <
timilsinaamit87 at huskers.unl.edu> wrote:

> Hello all,
> Here I am looking for getting variable (tasmin_diff) values for eight
> different locations. I was expecting 12 different month tasmin_diff values
> for each of these eight location. But with the syntax used, it resulted
> other latitude and longitude combination values as well. Since I have many
> locations, it would be difficult to look each index combination one by one.
> Is there any way to get only the value for specified location only or not
> in combination of provided latitude and longitude using NCL?
>
> ncl 0> a=addfile("original_file.nc","r")
> ncl 1> lat=a&lat
> ncl 2> lon=a&lon
> ncl 3> b=a->tasmin_diff
> ncl 4> rlat=(/27.9, 29.7, 33.9, 37.8, 39.0,43.2,44.3,45.6/)
> ncl 5> rlon=(/ 237.7, 238.9, 241.6, 243.7, 247.3, 249.0,253.7, 254.7/)
> ncl 6> i_rlat = ind_nearest_coord (rlat, lat, 0)
> ncl 7> i_rlon= ind_nearest_coord (rlon, lon, 0)
> ncl 8> m=i_rlat
> ncl 9> n=i_rlon
> ncl 10> c=a->tasmin_diff(:,m,n)
> ncl 11> print(c)
>
>
> Variable: c
> Type: float
> Total Size: 3072 bytes
>             768 values
> Number of Dimensions: 3
> Dimensions and sizes:   [month | 12] x [lat | 8] x [lon | 8]
> Coordinates:
>             month: [0..11]
>             lat: [27.04623985290527..45.69869232177734]
>             lon: [238.125.. 255]
> Number Of Attributes: 13
>   missing_value :       1e+20
>   info :        function clmMonLLT: contributed.ncl
>   time_op_ncl : Climatology: 30 years
>   associated_files :    baseURL:
> http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation gridspecFile:
> gridspec_atmos_fx_MPI-ESM-LR_decadal1980_r0i0p0.nc areacella:
> areacella_fx_MPI-ESM-LR_decadal1980_r0i0p0.nc
>   coordinates : height
>   history :     2011-11-09T08:48:40Z altered by CMOR: Treated scalar
> dimension: 'height'.
>   cell_measures :       area: areacella
>   cell_methods :        time: minimum within days time: mean over days
>   units :       K
>   comment :     monthly mean of the daily-minimum near-surface air
> temperature.
>   long_name :   Daily Minimum Near-Surface
>
>
>
> Regards,
> Amit Timilsina
> University of Nebraska Lincoln
> _______________________________________________
> 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/20150617/508d1d6d/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interp.ncl
Type: application/octet-stream
Size: 1139 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150617/508d1d6d/attachment.obj 


More information about the ncl-talk mailing list