<div dir="ltr"><div>I don't know for certain. If the regions are not overlapping, what about initializing "data" and "data_mask" to zero and then simply adding the loop results back into those variable each time? Something like <br></div><div><br></div><div>data = data +  (/shapefile_mask_data(dgrid_fs,shp_path,opt)/)<br>...</div><div>data_mask(j,i) = data_mask(j,i) + vtrend(0,ir)/100.</div><div><br></div><div>Rick</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 19, 2020 at 1:24 PM Thierno Doumbia <<a href="mailto:elthiedo@gmail.com">elthiedo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div>Hi,<div dir="auto">If that is exactly what I done, it was not what I wanted. In this case how do I get a single variable containing data for all regions ? </div><div dir="auto"><br></div><div dir="auto">Thank you </div>Thierry<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 19 juin 2020 à 20:53, Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>> a écrit :<br></div><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>Hi,</div><div><br></div><div>If I read the script correctly, it looks like you are looping over region names and over writing the variables "data" and "data_mask" each time through. Then  the plot is generated after the loop has terminated -- the values of data and data_mask would contain the last region.</div><div><br></div><div>??</div><div>Rick</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 19, 2020 at 12:23 PM Thierno Doumbia via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" rel="noreferrer" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><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 dir="ltr">Dear NCL community,</div><div dir="ltr"><br><div><div>As indicated in the subject line of this mail, I have a problem to create a gridded netcdf file containing constant values for different regions of the globe, using world administrative boundaries shapefile as a mask.</div><div>My code seems to be working for one region. But when I try to loop through multiple regions, the result is not what I expected. Please find attached my code, the obtained plot and a sample of my data.</div><div><br></div><div>I would appreciate it if you would check to see what I have done wrong. </div></div><div><br></div><div>Sincerely,</div>-- <br><div dir="ltr">Thierry</div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" rel="noreferrer" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>
</blockquote></div></div></div>
</blockquote></div>