[ncl-talk] how plot temperature profile for four time step in wrf out file
E Mobarak
mobarak_e at yahoo.com
Sat Dec 15 04:25:11 MST 2018
Dear Stavros NTAFISthanks for your help
but problem is how plot for four time step and in vertical profile(different height or pressure value)same as attach file
On Saturday, December 15, 2018, 2:47:26 PM GMT+3:30, sdafis <sdafis at noa.gr> wrote:
Dear Elham, I am giving you a simple code to read and plot a time series for T2m and 10-m wind speed for two locations defined by "locs", "lats", "lons". You can add more locations if you like or choose a sub-period by defining "it".
a = addfile("wrf_file.nc","r")
; Get variables for 10-m wind
uvmet = wrf_user_getvar(a, "uvmet10", -1)
u = uvmet(0,:,:,:)
v = uvmet(1,:,:,:)
; Get Temp at 2m in Kelvin
tc2 = wrf_user_getvar(a,"T2",-1)
it = 0 ; first time step, ignore it if you want a time-series
locs = (/ "1st Location", "2nd Location" /) ; define the locations
lats = (/ 37.5938, 40.6401 /)
lons = (/ 23.4375, 22.9444/)
nlocs = dimsizes(locs)
loc = wrf_user_ll_to_ij(a, lons, lats, True) ; find the indices of the closest WRF grid points to locations
do iloc = 0, nlocs-1
print("Working for " + locs(iloc))
locX = loc(0, iloc) - 1
locY = loc(1, iloc) - 1
wind= sqrt(u(:, locY, locX)*u(:, locY, locX) + v(:, locY, locX)*v(:, locY, locX)) ; replace ":" with "it" if you want one time-step only
temp = tc2(:, locY, locX) ; if you want only one time step: temp = tc2(it, locY, locX)
print( ""+wind+" "+temp+"")
end do
regards,
--
Stavros NTAFIS (DAFIS)
-----------------------------------------------
Physicist - Meteorologist, M.Sc.
Ph.D. Candidate, Polytechnic School of Paris, France
Laboratory of Dynamic Meteorology (LMD)
Research Associate, National Observatory of Athens (NOA/IERSD)
ORCID: https://orcid.org/0000-0002-1513-1930
Tel. : (+33)1 69 33 51 64
(+33)9 81 94 22 12
Mobile: (+33) 066 030 0147
(+30) 697 04 20 242
---------------
Weather charts:
http://www.meteo.gr
http://www.meteo.gr/meteomaps/
Στις 2018-12-15 11:54, E Mobarak έγραψε:
Hi dear ncl usrI want plot some data for example temperature or wind speed in some time step from wrf out data file in one locationhow i should it?Best RegaradsElham
_______________________________________________
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/20181215/94a37a00/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sh20JANHotel.png
Type: image/png
Size: 62946 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181215/94a37a00/attachment.png>
More information about the ncl-talk
mailing list