[ncl-talk] Getting location and dates of a point(s) that satisfy certain conditions

Lyndz olagueralyndonmark429 at gmail.com
Fri Apr 16 02:37:27 MDT 2021


Dear NCL-experts,

*[1] Details*
I have three variables dpdx, dpdy, and px2py2 with the following dimensions
and sizes:
*Dimensions and sizes: [time | 124] x [lat | 73] x [lon | 144]*
These variables were derived using spherical harmonics.

*[2] Problem and what I have done so far*

(a) I want to get the dates when any gridpoint in a specified domain
satisfies the following conditions:
dpdx = 0 *.and.* dpdy = 0 *.and. *px2py2 *.lt.* 0

(b) get the coordinates of these points, if possible.

I have the following lines in my script:

  latS = 5.0

  latN = 30.0

  lonL = 120.0

  lonR = 160.0

  dpdx_region=dpdx(:,{latS:latN},{lonL:lonR})

  dpdx_region=dpdy(:,{latS:latN},{lonL:lonR})

  px2py2_region=px2py2(:,{latS:latN},{lonL:lonR})

I am stuck here. I dont know what index I should use to get the dates and
how to get their coordinates.

  dpdx_thres  = dim_num_n((dpdx_region .eq. 0),(/1,2/))

  dpdy_thres  = dim_num_n((dpdy_region .eq. 0),(/1,2/))

  px2py2_thres  = dim_num_n((px2py2_region .lt. 0),(/1,2/))

  n_thres  = ind(dpdx_thres .gt. 0 .and. dpdy_thres .gt. 0 .and.
px2py2_thres .gt. 0 ) ;time indices but i'm not sure if this is correct!


  print(n_thres)

  print("=====")


  if(ismissing(nt_thres(0))) then

     print("++++++++++++++")

     print(" NO values exceed threshold="+threshold)

     print("++++++++++++++")

  exit

  end if



I am attaching my script.


I'll appreciate any help on this!


Sincerely,

*Lyndz*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210416/8daeb45b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lyndz_dx2dy2.ncl
Type: application/octet-stream
Size: 3870 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210416/8daeb45b/attachment.obj>


More information about the ncl-talk mailing list