[ncl-talk] Extract point values from WRF model
zoe jacobs
zoejacobs1990 at gmail.com
Sun Jul 16 13:00:09 MDT 2023
Dear Dennis,
Thanks for your advice.
I prepare a script as follow:
----------------------------------------------------------------------------------------------------------------------------------------------------------------
lon_pts = 51
lat_pts = 31
f = addfile ("wrfout_d03_2021-01-14_00:00:00", "r")
lat2d = f->XLAT(0,:,:) ; size = (nlat,nlon)
lon2d = f->XLONG(0,:,:) ; size = (nlat,nlon)
time = wrf_user_getvar(f,"times",-1)
;=========================================
u10 = f->U10
v10 = f->V10
;u_plane := u10*3.6
;v_plane := v10*3.6
wspd = wind_speed(u10,v10)
wdir = wind_direction(u10,v10,0)
;===========================================
printVarSummary(time)
printVarSummary(rh)
x1 = f->T2
x=x1-273.15
nm = getind_latlon2d (lat2d,lon2d, lat_pts, lon_pts)
print(nm)
do k=0,dimsizes(lat_pts)-1 ; loop over locations
n = nm(k,0)
m = nm(k,1)
x_nm = x(:,n,m) ; x(n,m)
wspd_nm = wspd (:,n,m)
print("---")
print(lat2d(n,m)+" "+lon2d(n,m))
print(time)
print(x_nm)
print(wspd_nm)
asciiwrite ("temperature", x_nm)
asciiwrite ("wind", wspd_nm)
asciiwrite ("time", time)
end do
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Now my questions are that:
1. Is my script correct?
2. How can I have time and one of variable (say temperature) net together
in an ascii file please?
like:
time temp
00 2
06 2.3
12 4
Look forward to hearing from you.
Best wishes,
On Sat, Jul 15, 2023 at 6:22 AM Dennis Shea <shea at ucar.edu> wrote:
> rcm2points
> <https://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2points.shtml>
> or to include meta data
> *rcm2points_Wrap*
> <https://www.ncl.ucar.edu/Document/Functions/Contributed/rcm2points_Wrap.shtml>
>
>
> On Fri, Jul 14, 2023 at 8:31 PM zoe jacobs via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
>> Hi dear NCL users,
>> I need to extract values for some specific lat/lon from my WRF output
>> files ( for example temperature value fat lat=23 and lon= 36 at 00:00 UTC)
>> . But I am completely new in NCL, and do not know how I can d o this. May I
>> ask you please to help me to achieve this?
>> Looking forward to hearing from you.
>> Kind regards.
>> _______________________________________________
>> 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/20230716/dc6cdc98/attachment.htm>
More information about the ncl-talk
mailing list