[ncl-talk] how plot temperature profile for four time step in wrf out file

sdafis sdafis at noa.gr
Sat Dec 15 04:34:55 MST 2018


Then, you have to modify a little bit the code I gave you and obviously
use the 3-D variables. You can extract the variables by using
wrf_user_getvar: 

https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml
 

Then you can plot the data with the function "gsn_csm_xy" as in the
following examples: 

https://www.ncl.ucar.edu/Applications/wrfxy.shtml 

You have to modify the resources of the plot to make it similar to the
one attached.  

https://www.ncl.ucar.edu/Document/Graphics/Resources/xy.shtml 

https://www.ncl.ucar.edu/Document/Graphics/Resources/gsn.shtml 

https://www.ncl.ucar.edu/Document/Graphics/Resources/ti.shtml 

Good luck! 

Stavros 

Στις 2018-12-15 12:25, E Mobarak έγραψε:

> Dear Stavros NTAFIS 
> thanks 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 usr 
>> I want plot some data for example temperature or wind speed in some time step from wrf out data file in one location 
>> how i should it? 
>> Best Regarads 
>> Elham 
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> 
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181215/101399d7/attachment.html>


More information about the ncl-talk mailing list