<div dir="ltr">Hi Toni,<div>I think it is due to the lat coordinate variable being different sizes between lat_1, and lat_2/lat_3. This would result in the error you are seeing, as NCL is trying to write lat of size 169 for lat_1, but lat of size 145 for the other two arrays. The solution would be to rename the lat coordinate variable for lat_2 and lat_3 to something other than lat. </div><div>Best,</div><div>Adam</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 23, 2019 at 1:50 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;">Hi Rick,<div><br></div><div>Sadly, that’s not the problem. It occurs in the very first loop already.</div><div><br></div><div>However, I just commented out </div><div><br></div><div>;<span style="white-space:pre-wrap"> </span>ncdf->lat_1 = lat_1</div><div><br></div><div>which is three lines above the line that doesn’t work, and now the script runs without problems. I still don’t understand why this is happening. Could it be a bug in NCL, some sort of problem with too many variables in an output file?<br><div><br></div><div>Toni</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><br><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><br><blockquote type="cite"><div>On Oct 23, 2019, at 2:43 PM, Rick Brownrigg <<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>> wrote:</div><br><div><div dir="ltr" style="font-family:Calibri;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><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 style="font-family:Calibri;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div class="gmail_quote" style="font-family:Calibri;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><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" target="_blank">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>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="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="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="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="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.toni-2Dklemm.de&d=DwMFaQ&c=u6LDEWzohnDQ01ySGnxMzg&r=zmhRVp0i4wZ5_1Ujh0fnRXAExHgKLTQu0rZLW7PxKA4&m=sDafbGmyKPR5OQ8WtRt5k5Mo7DoX0xF9js_2lyVQZdE&s=OS40pGsx6HC0-JwGgMzYsIvQgnHirMy8x7lQ1OPcwfQ&e=" target="_blank">www.toni-klemm.de</a> | <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.twitter.com_toniklemm&d=DwMFaQ&c=u6LDEWzohnDQ01ySGnxMzg&r=zmhRVp0i4wZ5_1Ujh0fnRXAExHgKLTQu0rZLW7PxKA4&m=sDafbGmyKPR5OQ8WtRt5k5Mo7DoX0xF9js_2lyVQZdE&s=8187HO3W45kOnzV2tJWGiB-WuN9l4rtyMeaHDTvEHqY&e=" target="_blank">@toniklemm</a><br>Editorial Board member, <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.eccforum.org&d=DwMFaQ&c=u6LDEWzohnDQ01ySGnxMzg&r=zmhRVp0i4wZ5_1Ujh0fnRXAExHgKLTQu0rZLW7PxKA4&m=sDafbGmyKPR5OQ8WtRt5k5Mo7DoX0xF9js_2lyVQZdE&s=-lfhexfh0FBaS_GYU8rbB3vthAgLH5fzVyWB07-f3Qw&e=" target="_blank">Early Career Climate Forum</a><br><br><br><br><br><br><br><br></div></div></div></div></div></div></div><div><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="https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.ucar.edu_mailman_listinfo_ncl-2Dtalk&d=DwMFaQ&c=u6LDEWzohnDQ01ySGnxMzg&r=zmhRVp0i4wZ5_1Ujh0fnRXAExHgKLTQu0rZLW7PxKA4&m=sDafbGmyKPR5OQ8WtRt5k5Mo7DoX0xF9js_2lyVQZdE&s=CPhrZgPJaFLOgKilmyK2qkZkapwM62TOpy6F73wuchc&e=" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div></div></blockquote></div><br></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><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>