<div dir="ltr"><div>Hi (offline for a moment):</div><div><br></div><div>I can not see the problem either. I note that the lines in question are in a doubly-nested loop. Does this error occur on the very first attempt at writing a netcdf? Each time through the loop(s), you are reassigning the filevariable ncdf -- I'm wondering if the "previous" file is not getting closed or perhaps the var ncdf retains some stale information? Perhaps just before the end of the "if (netCDF1) " statement, place a delete(ncdf), which somewhat counterintuitively, will close the file.</div><div><br></div><div>Rick<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 23, 2019 at 1:03 PM Toni Klemm via ncl-talk <<a href="mailto:ncl-talk@ucar.edu">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 style="overflow-wrap: break-word;">Hello NCL Community,<div><br></div><div>I am perplexed by what seems to be a very simple error in my script (attached). I am analyzing gridded data for the U.S. Great Plains region and have divided the region into 6 parts, Northern, Central, and Southern Plains as well as each of them into east and west. </div><div><br></div><div>After analyzing the data I am assembling everything to save in an output file, but for some reason this line in my code</div><div><br></div><div>ncdf->lat_2 = lat_2</div><div><br></div><div>gets this error message and the program crashes:</div><div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Dimension sizes of left hand side do not match right hand side</span></div><div><br></div><div>
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div>“lat_2” is the latitude dimension associated with the Central Plains data.</div><div><br></div><div>“lat_1” three lines above it does not get an error, but when I comment lat_2 out, then lat_3, three lines down, gets the same error.</div><div><br></div><div>I looked very carefully and changed the script in a number of ways, but I cannot find the reason for this error. lat_1 is longer than lat_2 and lat_3 (see below), but that shouldn’t be the reason.</div><div><br></div><div><div>I did a printVarSummary on all three, but it didn’t give me any clues:</div><div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Variable: lat_1</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Type: float</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Total Size: 676 bytes</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures"> 169 values</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 1</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span style="white-space:pre-wrap"> </span>[lat | 169]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Coordinates: </span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures"> lat: [42..49]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Number Of Attributes: 2</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures"> long_name :<span style="white-space:pre-wrap"> </span>latitude</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures"> units :<span style="white-space:pre-wrap"> </span>degrees_north</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Variable: lat_2</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Type: float</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Total Size: 580 bytes</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures"> 145 values</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 1</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span style="white-space:pre-wrap"> </span>[lat | 145]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Coordinates: </span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures"> lat: [36..42]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Number Of Attributes: 2</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures"> long_name :<span style="white-space:pre-wrap"> </span>latitude</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures"> units :<span style="white-space:pre-wrap"> </span>degrees_north</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Variable: lat_3</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Type: float</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Total Size: 580 bytes</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures"> 145 values</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Number of Dimensions: 1</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Dimensions and sizes:<span style="white-space:pre-wrap"> </span>[lat | 145]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Coordinates: </span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures"> lat: [30..36]</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures">Number Of Attributes: 2</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures"> long_name :<span style="white-space:pre-wrap"> </span>latitude</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(34,79,188)"><span style="font-variant-ligatures:no-common-ligatures"> units :<span style="white-space:pre-wrap"> </span>degrees_north</span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div></div></div><div>Does anyone have a suggestion? I appreciate your help!</div><div><br></div><div>Tank you very much,</div><div>Toni</div><div><br></div><div><br><b>Toni Klemm, Ph.D.<br></b>Postdoctoral Research Associate<br>Department of Ecosystem Science and Management<br>College of Agriculture and Life Sciences<br>Texas A&M University, College Station, TX<br><a href="http://www.toni-klemm.de" target="_blank">www.toni-klemm.de</a> | <a href="http://www.twitter.com/toniklemm" target="_blank">@toniklemm</a><br>Editorial Board member, <a href="http://www.eccforum.org" target="_blank">Early Career Climate Forum</a><br><br><br><br><br><br><br><br></div></div></div></div>
</div>
</div></div><div style="overflow-wrap: break-word;"><div></div></div>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>