[ncl-talk] about where as mask in NCL

yogesh kumkar yogeshkumkar at gmail.com
Wed Feb 7 01:42:14 MST 2018


All the 3 files have same size and rank (COLO, NEW_MEX, ARIZ, UTAH).
What I want is to replace the values of mod_PCT_PFT to PCT_PFT where there
is 1 in mask variable.

My domain has 4 states, COLORADO, NEW_MEXICO, ARIZONA, UTAH.
mod_PCT_PFT has data of COLORADO only where mask has values 1s.
PCT_PFT has values of all 4 states, only COLORADO values should be
different.

There is no error message, but the desired output did not come.
Thank you.

On Wed, Feb 7, 2018 at 4:16 AM, Dennis Shea <shea at ucar.edu> wrote:

> You must be more specific.
>
> How does  it "not work." ? Is there an error message?
>
> ---
> The array sizes and rank must match
>
> Mfc(:,:)   ==> Mfc( n0, n1)
> PCT_PFT(:,:) ==>PCT_PFT( n0, n1)
> mod_PCT_PFT(:,:) ==>  mod_PCT_PFT(n0, n1)
>
> You write: "the variable 'PCT_PFT' which has bigger domain." What does
> this mean?
>
>
>
> On Tue, Feb 6, 2018 at 9:47 AM, yogesh kumkar <yogeshkumkar at gmail.com>
> wrote:
>
>> Hello,
>>
>> 1) I have a mask 2d var 'Mfc', includes 0 and 1.
>> 2) I have a variable 'mod_PCT_PFT' which I want to replace values from.
>> 3) to the netcdf file opened for writing the variable 'PCT_PFT' which has
>> bigger domain.
>>
>> I want to replace the values of 'mod_PCT_PFT' (where Mfc == 1) in to the
>> 'PCT_PFT' only.
>> Everything is 2d.
>>
>> I am using
>>
>> masked_PCT_PFT = where(Mfc .eq. 1, PCT_PFT  , mod_PCT_PFT)
>> FM->PCT_PFT  =  masked_PCT_PFT
>>
>> but it does not work.
>>
>> Any suggestions?
>>
>> Thank you,
>> Yogesh
>>
>> _______________________________________________
>> 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/20180207/a9859215/attachment.html>


More information about the ncl-talk mailing list