<div dir="auto">Thanks so much Rick Brownrigg, I was able to solve the problem with the help of printVarSummary() as you suggested. It made it easy for me to trace and locate the source of the said errors in my scripts.<div dir="auto"><br></div><div dir="auto">I was very lazy writing the script from scratch that's why I edited my old script leading to the error. </div><div dir="auto"><br></div><div dir="auto">Thanks so much once again. </div><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sun, Apr 26, 2020, 4:30 PM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu">brownrig@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br>Hi,<br><br>You have a rather complex script that computes many derived variables. While it looks like the incoming data has proper coordinate variables, and it looks like you've taken care to call copy_VarCoords() in places, the root cause of the error message is that something doesn't have the coordinate variables expected by shapefile_mask_data(). Do you know which of the 48 calls to shapefile_mask_data() is throwing the error? Perhaps place a printVarSummary() on that variable before the call to make sure the variable is what you think it is.<br><br>I would note that shapefile_mask_data() has very specific requirements for coordinate variables. This is from the comments embedded in the source code:<br><br>  - If a rectilinear grid, then "data" must have coordinate arrays<br>;    attached. <br>;  - If a curvilinear grid, then "data" must have the special lat2d <br>;    and lon2d attributes attached.<br>;  - If a unstructured grid, then "data"must have the special lat1d <br>;    and lon1d attributes attached.<br><br><br>And to be more specific, the section of code that throws the error message is below.<br><br>Finally, the script looks like much of it is copy-paste construction -- repetitive code for each derived variable. Perhaps one thing to try is to lift just the code associated with the problem variable out into a separate test script and see what it takes to get that working.<br><br>Good luck,<br>Rick<br><br> - - - - - - - - <br><br>"data" is the first parameter to shapefile_mask_data():<br><span style="font-family:monospace"><br>  grid_type = ""<br>  if(rank.eq.2.and.\<br>     isdimnamed(data,0).and.iscoord(data,data!0).and.\<br>     isdimnamed(data,1).and.iscoord(data,data!1)) then<br>    lat1d = ndtooned(conform_dims(dims,data&$data!0$,0))<br>    lon1d = ndtooned(conform_dims(dims,data&$data!1$,1))<br>    grid_type = "rectilinear"<br>  else if(rank.eq.2.and.all(isatt(data,(/"lat2d","lon2d"/)))) then<br>;---Curvilinear<br>    lat1d = ndtooned(data@lat2d)<br>    lon1d = ndtooned(data@lon2d)<br>    if(product(dims).eq.dimsizes(lat1d).and.\<br>       product(dims).eq.dimsizes(lon1d)) then<br>      grid_type = "curvilinear"<br>    end if<br>  else if(rank.eq.1.and.all(isatt(data,(/"lat1d","lon1d"/)))) then<br>;---Unstructured<br>    lat1d = data@lat1d<br>    lon1d = data@lon1d<br>    if(dims.eq.dimsizes(lat1d).and.\<br>       product(dims).eq.dimsizes(lon1d)) then<br>      grid_type = "unstructured"<br>    end if<br>  end if<br>  end if<br>  end if<br><br>  if(grid_type.eq."") then<br>    print("shapefile_mask_data: Error: not a valid rectilinear, curvilinear, or unstructured grid")<br>    exit<br>  end if</span><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 25, 2020 at 10:39 AM Oluwaseun Ilori via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank" rel="noreferrer">ncl-talk@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>I've been trying do some Mann-Kendall analysis and to calculate 
coefficient of regression using shapefile of Nigeria using the attached 
script until I got error message saying "<b>shapefile_mask_data: Error: not a valid rectilinear, curvilinear, or unstructured grid</b>"
 I have searched for help but could not find any. Since all my inputs 
data are similar, I also attached output of ncl_filedump of one input since ncdump keeps giving me unknown file form.</div><div><br></div><div>thanks for your reply<font color="#888888"><br></font></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 25, 2020 at 4:47 PM Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank" rel="noreferrer">brownrig@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">Hi -- did you perhaps forget the ncdump output?  IOf so, please reply to the group.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Apr 25, 2020 at 9:33 AM Oluwaseun Ilori via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank" rel="noreferrer">ncl-talk@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>Good day  NCL users</div><div><br></div><div>I've been trying do some Mann-Kendall analysis and to calculate coefficient of regression using shapefile of Nigeria using the attached script until I got error message saying "<b>shapefile_mask_data: Error: not a valid rectilinear, curvilinear, or unstructured grid</b>" I have searched for help but could not find any. Since all my inputs data are similar, I also attached output of ncdump of one input.</div><div><br></div><div>thanks for your reply<br></div><div><div><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><span style="font-family:monospace,monospace"><span style="background-color:rgb(243,243,243)"><span style="color:rgb(0,0,255)"><i>OLUWASEUN ILORI</i></span></span></span></div><div><span style="font-family:monospace,monospace"><i>M.Tech in Meteorology and climate science</i></span></div><div><span style="font-family:monospace,monospace"><i>Phone: +2347031000687 +2348069154213<br></i></span></div><div><span style="font-family:monospace,monospace"><i>Federal University of Technology Akure. Nigeria.</i></span></div><div><span style="font-family:monospace,monospace"><i>Facebook: </i></span><span><a href="https://www.facebook.com/hilorywilson" target="_blank" rel="noreferrer"><span><span>http://facebook.com/</span><span></span>hilorywilson</span></a><br></span></div><div>linkedln: <a href="https://www.linkedin.com/in/wilson-ilori-447952108" target="_blank" rel="noreferrer">https://www.linkedin.com/in/wilson-ilori-447952108</a></div><div>Twitter: HiloryW<br></div><div><span></span></div></div></div></div></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank" rel="noreferrer">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="font-family:monospace,monospace"><span style="background-color:rgb(243,243,243)"><span style="color:rgb(0,0,255)"><i>OLUWASEUN ILORI</i></span></span></span></div><div><i style="font-family:monospace,monospace">M.Tech in Meteorology and climate science</i></div><div><span style="font-family:monospace,monospace"><i>Phone: +2347031000687 +2348069154213<br></i></span></div><div><span style="font-family:monospace,monospace"><i>Federal University of Technology Akure. Nigeria.</i></span></div><div><span style="font-family:monospace,monospace"><i>Facebook: </i></span><span><a href="https://www.facebook.com/hilorywilson" target="_blank" rel="noreferrer"><span><span>http://facebook.com/</span><span></span>hilorywilson</span></a><br></span></div><div>linkedln: <a href="https://www.linkedin.com/in/wilson-ilori-447952108" target="_blank" rel="noreferrer">https://www.linkedin.com/in/wilson-ilori-447952108</a></div><div>Twitter: HiloryW<br></div><div><span></span></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank" rel="noreferrer">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br></a></blockquote></div>
</blockquote></div></div>