<div dir="ltr"><div>The code snipprt you posted:</div><div><br></div><div><font size="1">4   do i=0,dimsizes(years)-1<br>5            dir_s ="/work/as10017/CESM/archive/Data_ICEFREE/Grid_all/"<br>6           dir_c ="/work/as10017/SPS_hindcast/Control_of_ICEFREE/Grid_all/"<br>7            fil_s1 = systemfunc("ls "+dir_s+"/sps_"+years(i)+"11_0??_icef.cam.h0.6mth_grid.all.nc_"+Field+"_BK_avg")   ; "+years(i)+"<br>8            fil_c1 = systemfunc("ls "+dir_c+"/sps_"+years(i)+"11_0??.cam.h0.6mth_grid.all.nc_"+Field+"_BK_avg")     ; "+years(i)+"<br>9            f_s1 = addfiles(fil_s1,"r")<br>10            f_c1 = addfiles(fil_c1, "r")<br>11<br>12        if (VAR.eq.1)<br>13          varS = f_s1[:]->ICEFRAC(:,0,0)<br>14          varC = f_c1[:]->ICEFRAC(:,0,0)<br>15<br>16  end if</font></div><div><font size="1"><br></font></div><div><font size="1"><font face="arial,sans-serif">and code you attached are different. Maybe:<br></font></font></div><div><font size="1"><font face="arial,sans-serif"><br></font></font></div><div><font size="1"><font face="arial,sans-serif"><font size="1">4   do i=0,dimsizes(years)-1<br>5            dir_s ="/work/as10017/CESM/archive/Data_ICEFREE/Grid_all/"<br>6           dir_c ="/work/as10017/SPS_hindcast/Control_of_ICEFREE/Grid_all/"<br>7            fil_s1 = systemfunc("ls "+dir_s+"/sps_"+years(i)+"11_0??_icef.cam.h0.6mth_grid.all.nc_"+Field+"_BK_avg")   ; "+years(i)+"<br>8            fil_c1 = systemfunc("ls "+dir_c+"/sps_"+years(i)+"11_0??.cam.h0.6mth_grid.all.nc_"+Field+"_BK_avg")     ; "+years(i)+"<br>9            f_s1 = addfiles(fil_s1,"r")<br>10            f_c1 = addfiles(fil_c1, "r")<br>11<br>12        if (VAR.eq.1)<br>13          varS = f_s1[:]->ICEFRAC(:,0,0)<br>14          varC = f_c1[:]->ICEFRAC(:,0,0)</font></font></font></div><div><font size="1"><font face="arial,sans-serif"><font size="1">15       <b>end if</b><br></font></font></font></div><div><font size="1"><font face="arial,sans-serif"><font size="1">16  <b>end do</b><br></font></font></font></div><div><font size="1"><font face="arial,sans-serif"><br></font></font></div><div><font size="1"><font face="arial,sans-serif"></font><br></font></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 2, 2019 at 4:11 AM Anne 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 dir="ltr">Hi,<br><div><br></div><div>I want to read in and append multiple files using NCL's 'systemfunc' function, like so:</div><div><br></div><font size="1">1   VAR = 1         ; 1-ICE  2-T2M  3-SHF  4-Z500  5-U250<br></font><div><font size="1">2    Field = "ICE" </font></div><div><font size="1">3</font></div><div><font size="1">4   do i=0,dimsizes(years)-1<br>5            dir_s ="/work/as10017/CESM/archive/Data_ICEFREE/Grid_all/"<br>6           dir_c ="/work/as10017/SPS_hindcast/Control_of_ICEFREE/Grid_all/"<br>7            fil_s1 = systemfunc("ls "+dir_s+"/sps_"+years(i)+"11_0??_icef.cam.h0.6mth_grid.all.nc_"+Field+"_BK_avg")   ; "+years(i)+"<br>8            fil_c1 = systemfunc("ls "+dir_c+"/sps_"+years(i)+"11_0??.cam.h0.6mth_grid.all.nc_"+Field+"_BK_avg")     ; "+years(i)+"<br>9            f_s1 = addfiles(fil_s1,"r")<br>10            f_c1 = addfiles(fil_c1, "r")<br>11<br>12        if (VAR.eq.1)<br>13          varS = f_s1[:]->ICEFRAC(:,0,0)<br>14          varC = f_c1[:]->ICEFRAC(:,0,0)<br>15<br>16  end if</font><br></div><div><font size="1"><br></font></div><div>I have run this script one million times before, all of a sudden NCL complains 'Dimension sizes of left hand side and right hand side of assignment do not match' in line 7 above  (where fil_s1 is defined for the first time) but I have not defined this variable anywhere before as it's really the beginning of the script..   Interestingly, this error message disappears when I comment 'end' at the end of the script and also apparently it depends where I insert 'exit' for testing the script.. Could there be a bug in NCL 6.5 ? I attach the full script. I'm running NCL 6.5.</div><div><br></div><div>Thanks</div><div>Anne</div></div>

<br>
<div><font style="font-family:Arial,Helvetica,sans-serif" size="2">Nota automatica aggiunta dal sistema di posta.</font></div><div><img src="https://www.unive.it/media/banner_5x1000_2019_v3.png"></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>