[ncl-talk] Extracting "dates" if a threshold is exceeded in any gridpoint of a domain

Lyndon Mark Olaguera olagueralyndonmark429 at gmail.com
Tue Apr 25 23:09:55 MDT 2017


Dear fellow NCL users,


I would like to extract the "date" when any grid point in a domain exceeds
a threshold value using NCL (daily time steps). I tried to create a netcdf
file of daily vorticity using the script below.

I would like to add a line in this script that will extract the date (day
month year) whenever a grid point from this domain is exceeded:
              LAT : 7.5N to 27.5N
              LON : 110E to 135E

the threshold value that I am using is 3e-5 per second.


I am attaching the netcdf file and the image in this email.​
 test_2003_30.png
<https://drive.google.com/file/d/0B9faET7Bc2o8RWRXcTdKZEx0YlE/view?usp=drive_web>
​​​

Is this possible in NCL?
Is there any function in NCL that can extract values from every gridpoint
in a specified domain?


I'll appreciate if anyone can point me to the right direction/functions to
implement this in NCL.

Many thanks in advance!


begin
;************************************************
; variable and file handling
;************************************************
  ufile  = addfile("uwind_may_2003_700hPa.nc","r")       ; open netcdf file
  u   = ufile->uwnd(:,0,:,:)                             ; pull u off file
  lat = ufile->lat
  lon = ufile->lon
  vfile  = addfile("vwind_may_2003_700hPa.nc","r")
  v   = vfile->vwnd(:,0,:,:)                             ; pull v off file
;************************************************
; calculate vorticity on a Gaussian Grid
;************************************************
  ;vrt   = u                                      ; retain coordinates
  ;vrt   = uv2vrG_Wrap(u,v)
  vr = uv2vr_cfd (u,v,lat,lon, 3)
  copy_VarMeta(u,vr)
  vr at long_name = "vorticity"
  vr at units     = "per second"
;***********************************************
; save to a netcdf file
;***********************************************
  ncdf = addfile("vort_700hPa.nc","c")
  fAtt = True
  fAtt at title         = "Vorticity at 700hPa"
  fAtt at source_file   = "daily winds from NCEP-NCAR Reanaysis"
  fAtt at Conventions   = "None"
  fAtt at creation_date = systemfunc("date")
  fileattdef(ncdf,fAtt)            ; copy file attributes
  filedimdef(ncdf,"time",-1,True)
  ncdf->vr = vr
end

*Lyndz*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170426/8144c8d6/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vort_700hPa.nc
Type: application/x-netcdf
Size: 1305916 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170426/8144c8d6/attachment-0001.nc 


More information about the ncl-talk mailing list