<div dir="ltr"><div><div><div><div>Based on the code segment you sent, I could see nothing wrong. <br><br>rPCT_NET = mPCT_NET<br><div>rPCT_NET = where(Mfc .eq. 1, PCT_NET, mPCT_NET)<br>-----<br><pre>function where (
condtnl_expr ,
true_value ,
false_value
)
</pre></div>-----<br><br></div>I am sure that NCL's 'where' is working correctly. It is one of the most commonly used functions within NCL.<br><br></div>printMinMax(Mfc,0)<br><br></div>Or, you can ftp the necessary files and we can look .<br><br></div>D<br><div><div><div><div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 7, 2018 at 3:38 PM, yogesh kumkar <span dir="ltr"><<a href="mailto:yogeshkumkar@gmail.com" target="_blank">yogeshkumkar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello Dennis,</div><div><br></div><div>Sorry for the misunderstanding.</div><div><br></div><div>Here I explained in more details.</div><div>In previous email, I gave an example of states which was misleading.</div><div><br></div><div><br></div><div>ncl 113> printVarSummary(PCT_NET)<br></div><div><br></div><div><b>Variable: PCT_NET</b></div><div>Type: double</div><div>Total Size: 2700000 bytes</div><div> 337500 values</div><div>Number of Dimensions: 2</div><div>Dimensions and sizes: [lsmlat | 450] x [lsmlon | 750]</div><div>Coordinates:</div><div>Number Of Attributes: 2</div><div> long_name : percent plant functional type of gridcell</div><div> units : unitless</div><div><br></div><div>ncl 114> printVarSummary(mPCT_NET)</div><div><br></div><div><b>Variable: mPCT_NET</b></div><div>Type: double</div><div>Total Size: 2700000 bytes</div><div> 337500 values</div><div>Number of Dimensions: 2</div><div>Dimensions and sizes: [lsmlat | 450] x [lsmlon | 750]</div><div>Coordinates:</div><div>ncl 115></div><div>ncl 116> printVarSummary(Mfc)</div><div><br></div><div><b>Variable: Mfc</b></div><div>Type: double</div><div>Total Size: 2700000 bytes</div><div> 337500 values</div><div>Number of Dimensions: 2</div><div>Dimensions and sizes: [lat | 450] x [lon | 750]</div><div>Coordinates:</div><div>Number Of Attributes: 0</div><div><br></div><div><br></div><div>I want to replace values from
<b style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">mPCT_NET </b><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">to</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><b> </b>
<b style="font-weight:bold;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">PCT_NET </b><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">only where there is '1' in</span><b style="font-weight:bold;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> Mfc.</b></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Mfc has values 0 and 1 only.</span></span></div><div><div><br></div><div>I am doing the following, but its not working as expected.</div><div><br></div><div>FM = addfile(dir+"surfdata_<wbr>c0Control.nc","w")</div></div><div>rPCT_NET = mPCT_NET<br></div><div>rPCT_NET = where(Mfc .eq. 1, PCT_NET, mPCT_NET)</div><div><div>FM->PCT_PFT(2,:,:) = rPCT_NET</div></div><div><br></div><div>In this figure, I want to replace/superimpose mPCT_NET to PCT_NET where there is 1 in Mfc only. In simple words, I want to crop fig1 (where Mfc==1) and paste/stick on fig 3.<br></div><div><br></div><div><div>ncl 139> print(num(mPCT_NET.gt.0))</div><div>(0) 113191</div><div>ncl 140> print(num(Mfc.gt.0))</div><div>(0) 136086</div><div>ncl 141> print(num(PCT_NET.gt.0))</div><div>(0) 172161</div></div><div><br></div><div>I want to replace only 136086 values from mPCT_NET to PCT_NET, keeping the others unchanged. </div><div><br></div><div><img src="cid:ii_161724b3992654cc" alt="Inline image 1" style="margin-right: 0px;"><br></div><div>Thank you,</div><div>Yogesh</div></div>
</blockquote></div><br></div></div></div></div></div></div></div>