<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi NCL-Talk,
<div class=""><br class="">
</div>
<div class="">I have something conceptually wrong in my head with NCL.</div>
<div class=""><br class="">
</div>
<div class="">I am attempting to take a .nc file with countries, and map them onto regions.</div>
<div class=""><br class="">
</div>
<div class="">Country Map</div>
<div class=""><br class="">
</div>
<div class=""><img apple-inline="yes" id="BC65C0BF-416D-453E-A515-B376427488BA" src="cid:F6B4FF24-54F1-4BBB-BEEC-CD5FBE6C06BD" class=""></div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span></div>
<div class=""><br class="">
</div>
<div class="">I use:</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">cntrycodes!0 = "lat"</div>
<div class="">cntrycodes&lat = lat</div>
<div class="">cntrycodes!1 = "lon"</div>
<div class="">cntrycodes&lon = lon</div>
<div class="">cntrycodes@long_name = "Country Codes"</div>
<div class="">cntrycodes@missing_value = cntrycodes@_FillValue</div>
</div>
<div class="">…</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">cntrycodes_region04 = where(cntrycodes.eq.7,4,cntrycodes_region04)</div>
<div class="">cntrycodes_region04 = where(cntrycodes.eq.10,4,cntrycodes_region04)</div>
<div class="">cntrycodes_region04 = where(cntrycodes.eq.13,4,cntrycodes_region04)</div>
</div>
<div class="">…</div>
<div class="">
<div class="">cntrycodes_region04 = where(cntrycodes.eq.145,4,cntrycodes_region04)</div>
<div class="">cntrycodes_region04 = where(cntrycodes.eq.152,4,cntrycodes_region04)</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">I get:</div>
<div class=""><img apple-inline="yes" id="86104144-C5F6-4BF1-9652-6FB7DE23FA2C" src="cid:8479E216-2B25-4B77-909A-66B3FAF84C4C" class=""></div>
<div class=""><br class="">
</div>
<div class="">I do this for 16 regions.</div>
<div class="">Then I try to put it together:</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">cntrycodes_regionALL = where(cntrycodes_region01.eq.1,1,cntrycodes_regionALL)</div>
<div class="">cntrycodes_regionALL = where(cntrycodes_region02.eq.2,2,cntrycodes_regionALL)</div>
<div class="">cntrycodes_regionALL = where(cntrycodes_region03.eq.3,3,cntrycodes_regionALL)</div>
</div>
<div class="">…</div>
<div class="">
<div class="">cntrycodes_regionALL = where(cntrycodes_region15.eq.15,15,cntrycodes_regionALL)</div>
<div class="">cntrycodes_regionALL = where(cntrycodes_region16.eq.16,16,cntrycodes_regionALL)</div>
</div>
<div class=""><br class="">
</div>
<div class="">And I get:</div>
<div class=""><img apple-inline="yes" id="1624F096-F82F-4B18-A891-CE20D73D7192" src="cid:B7C3B8DC-019E-448E-A4B0-1CC12746C8BB" class=""></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">I am not sure what I am doing wrong. But I have a feeling it is with how I am using the where function.</div>
<div class=""><br class="">
</div>
<div class="">Cheers,</div>
<div class="">-Jonathan</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""></div>
</body>
</html>