# [ncl-talk] Extracting data for a given point from a model output

Dennis Shea shea at ucar.edu
Mon Dec 28 11:47:03 MST 2020

```*getind_latlon2d *
<https://www.ncl.ucar.edu/Document/Functions/Contributed/getind_latlon2d.shtml>

A modification of Example 1

, "r")
lat2d = f->xlat
lon2d = f->xlon

*printVarSummary*
<https://www.ncl.ucar.edu/Document/Functions/Built-in/printVarSummary.shtml>(lat2d)
*printMinMax*
<https://www.ncl.ucar.edu/Document/Functions/Contributed/printMinMax.shtml>(lat2d,
0)
*printMinMax*
<https://www.ncl.ucar.edu/Document/Functions/Contributed/printMinMax.shtml>(lon2d,
0)

lat   = (/  31.0 ,  17.31, 24.05   /)   ; user specified coordinate pairs
lon   = (/ -86.45,-101.00,-92.46   /)
; return 2d subscripts
nm = *getind_latlon2d* (lat2d,lon2d, lat, lon)

*print* <https://www.ncl.ucar.edu/Document/Functions/Built-in/print.shtml>(nm)

X = f->mixrat              ; (time, kz, iy, jx)
Y = d->ddflx               ; (time, iy, jx)

nt =     .... the index some specified time

kl =     ... index

do k=0,*dimsizes*
<https://www.ncl.ucar.edu/Document/Functions/Built-in/dimsizes.shtml>(lat)-1
n = nm(k,0)
m = nm(k,1)

x = X(nt,kl,n,m)
y = Y(nt,n,m)

*print* <https://www.ncl.ucar.edu/Document/Functions/Built-in/print.shtml>(lat2d(n,m)+"
"+lon2d(n,m)+"  "+x+"   "+y)
end do

On Mon, Dec 28, 2020 at 10:16 AM Setareh Rahimi via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Dear all,
>
> I need to extract data (it could be any variable like temperature, wind
> ...) for a specific point (say synoptic stations) at a specific day and
> time
>  Yazd-2019_DUST01.2019010100.nc
> ( Jan-03- 00:00 UTC), from a model output (file attached).  I wonder how
> it could be achieved using NCL (any example...) .
>
> I appreciate any suggestion,
> Best wishes,
> --
> S.Rahimi
>
> _______________________________________________
> 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/20201228/ca042c60/attachment.html>
```