Re: where

From: gibies george <gibiesgeorge_at_nyahnyahspammersnyahnyah>
Date: Fri Apr 29 2011 - 23:36:35 MDT

On 29 April 2011 20:33, Rick Brownrigg <brownrig@ucar.edu> wrote:

> Hi,
>
> You probably want to do a printVarSummary on all three of those parameters
> to make sure they are what you think they are. In particular, aren't the
> 1st and 3rd parameters of different dimensions? (The second param is a
> scalar?). They are required to be the same.
>

But in one of the example given in
http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml

  y = *where*(*ismissing*
<http://www.ncl.ucar.edu/Document/Functions/Built-in/ismissing.shtml>(y),0,y)

Here also the second parameter is a scalar.
_______________________________

I need a similar usage

 datamasked(lat|:,lon|:,season|i,component|j,ens|k,mdl|l) = \
    where(mask .eq. mask@_FillValue, data@_FillValue, \
        data(lat|:,lon|:,season|i,component|j,ens|k,mdl|l))

 *I want to put _FillValue in data, whereever there is _FillValue in mask. *

Same thing I will be repeating using the do loop for each season, each
component, each ensemble member and each model.

> Its a misleading message if that's the case.
>
> I'm not sure that helps...please reply back to the group if not.
> Rick
>
> On Apr 29, 2011, at 7:15 AM, gibies george wrote:
>
> Dear NCL Users,
>
> Here is some part of my script in which, I used * "where() function"* for
> masking a global data to some region using another data variable which is
> already masked (regional).
>
> But I got some error as given below.
> _______________________
> ------------------
> -------------
> --------------
> regrid = True
> regrid@lat = data&lat
> regrid@lon = data&lon
> prepdata = read_data(source,predef,regrid)
> mask =prepdata(time|0,lat|:,lon|:)
> mask@_FillValue = data@_FillValue
> do l = 0, dimsize(5)-1
> do k = 0, dimsize(4)-1
> do j = 0, dimsize(3)-1
> do i = 0, dimsize(2)-1
> datamasked(lat|:,lon|:,season|i,component|j,ens|k,mdl|l) = \
> where(mask .eq. mask@_FillValue,data@
> _FillValue,data(lat|:,lon|:,season|i,component|j,ens|k,mdl|l))
> end do
> end do
> end do
> end do
> ave = dim_avg_n_Wrap(datamasked(lat|:,lon|:,season|:,component|:),(/0,1/))
> ------------------
> ---------------------
> --------------------
> ________________________
>
> *fatal:wherefunc: dimension sizes of parameter 0 and parameter 1 do not
> match
> fatal:Execute: Error occurred at or near line 1893 in file
> /home/gibies/ncl/mylib/lib_gibies.ncl
>
> **I could not find the mistake.
>
> **parameter 0*
> mask .eq. mask@_FillValue
> *parameter 1*
> data@_FillValue
>
> Can anybody suggest a solution for this problem ?
>
>
> --
> *Gibies George, CSIR-RF,*
> *Monsoon Seasonal Prediction Group,
> Climate and Global Modelling Division,
> Indian Institute of Tropical Meteorology,
> Dr. Homi Bhabha Road,
> NCL (P. O.), Pashan,
> Pune 411008, India.*
>
> *http://sites.google.com/site/gibiesge/*
>
> Please Think about the environment. Save paper; Save Trees; and don't print
> this e-mail unless it is necessary.
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>

-- **
*Gibies George, CSIR-RF,
****Climate and Global Modelling Division,
Indian Institute of Tropical Meteorology,
Dr. Homi Bhabha Road,
NCL (P. O.), Pashan,
Pune 411008, India.
Office mail : gibies@tropmet.res.in
Mobile: 9881707796 (at Pune)*

*http://sites.google.com/site/gibiesge/*

Please Think about the environment. Save paper; Save Trees; and don't print
this e-mail unless it is necessary.

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Apr 29 23:36:50 2011

This archive was generated by hypermail 2.1.8 : Tue May 03 2011 - 14:47:34 MDT