[ncl-talk] Extracting temperature from specific grids where LU_INDEX = 2

Guido Cioni guidocioni at gmail.com
Tue Mar 14 01:55:04 MDT 2017


Hi Imran,
unfortunately I’m not really an expert of WRF, so I’m going to give you a general hint which may work. You should be more precise next time as generally people do not know what is LU_INDEX and what is its structure ;) 

I assume that you want to extract temperature, which is 3-D (time, lat, lon) using a mask array LU_INDEX which is 2-D (lat, lon). Again, if this assumption is wrong please be more specific. You have many choices, but I believe that for the sake of clarity you may want to go for an array which has the same dimensions but missing values where LU_INDEX is not 2. So you may want to do something like this:

T2_masked=mask(T2, LU_INDEX.ne.2, False).

You need to have a Missing Value attribute set for the T2 variable of course. As a result you will get an array with the same dimensions, so that it’s easier to compare with the original one, but with Missing Values where your condition is False, so that for every computation these points will not be considered. You can achieve something similar with the where function. Please have a look here (http://www.ncl.ucar.edu/Document/Functions/Built-in/mask.shtml <http://www.ncl.ucar.edu/Document/Functions/Built-in/mask.shtml>).

Cheers


> Il giorno 14 mar 2017, alle ore 04:38, Imran Hosen <hosen.imran09 at gmail.com> ha scritto:
> 
> Dear NCL users,
> 
> Good day!
> 
> I'm a new user of NCL. I want to extract temperature (T2) from wrfout file for the specific grid points where the LU_INDEX = 2.
> 
> For example,
> f = addfile("./wrfout.nc <http://wrfout.nc/>)
> T2 = f->T2(:,:,:)
> 
> It will extract temperature for whole domain for all time steps. In my case, I only want to extract temperature for all time steps but for the specific grids which grids represent LU_INDEX = 2.
> 
> Could you please suggest how to do it. I would grateful to you if anyone please share a script.
> 
> Thanks in advance.
> 
> Kind regards,
> Imran
> 
> _______________________________________________
> 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/20170314/accc78f3/attachment.html 


More information about the ncl-talk mailing list