[Thread Prev][Thread Next][Index]
[ferret_users] variance up to a time-varying level
Title: variance up to a time-varying level
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement
Hello Ferreters,
I am running into a wall and would like to know if anybody has some suggestions on how to get around it. I have a 4-D (XYZT) dataset of clouds and wind (WRF output). For each time, I want to get the variance of w within the XYZ box defined by the full XY domain and up to the highest level in the domain containing a cloud. I have come up with an algorithm that works at one time, but it fails when applied to a multi-time dataset because I have to evaluate an expression to a scalar to get it into the k=1:`lev`@var command. If anybody can get around this problem, I would be grateful for your assistance.
Here is what I am doing right now...
let cloudthresh = 0.00001
let cloudmixr = qcloud+qice
let event_mask = cloudmixr[k=@evnt:`cloudthresh`] !Counts number of cloudy cells from the bottom of the domain
let event_max = event_mask[k=@max] !At each column, find out how many cloudy cells exist
let event_max_mask = if event_mask eq event_max then 1 !Make a mask that goes to 1 at the top of the clouds for each col.
let cloud_top_lev3d = event_max_mask[k=@loc:1] !The level of the highest cloud top within each column
let cloud_top_lev = cloud_top_lev3d[i=@max,j=@max] !The single highest cloud top level in the domain
let w_var = w[i=1:`w,return=iend`@var,j=1:`w,return=jend`@var,k=1:`cloud_top_lev`@var] !Variance of w up to cloud_top_lev
The last line is what fails when I do not set the time region to a single time.
Thanks,
Bill
--------------------------------------------------------------------
William I. Gustafson Jr.
Atmospheric Science and Global Change Division
Pacific Northwest National Laboratory
3200 Q Ave., MSIN K9-30
Richland, WA 99352
(509)372-6110
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement