<div dir="ltr"><div>I don't know!<br><br>==<br></div>Try<br><br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>begin<br><br>tStrt = 11 <br>tLast = 2492<br>pltType = "pdf"<br><br>do a=1,6<br><br> fname = "/home/theomar/Documents/Theomar/GobleATTO15/2015110"+a+"1100.txt"<br> data := asciiread(fname,-1,"string")<br> <br> nfields = str_fields_count(data(11)," ")<br> print("number of fields = " + nfields)<br><br> time := tofloat(str_get_field(data(tStrt:tLast:), 1," ")) ;Time[min:sec]<br> Geo := tofloat(str_get_field(data(tStrt:tLast:), 2," ")) ;P[hPa] <br> T := tofloat(str_get_field(data(tStrt:tLast:), 3," ")) ;T[C] <br> U := tofloat(str_get_field(data(tStrt:tLast:), 4," ")) ;U[%] <br> <br> ; wks = gsn_open_wks(pltType,"perfil_110215") ; Open an ps workstation.<br> wks = gsn_open_wks(pltType,"perfil_110"+a+"15") ; Open an ps workstation.<br> a1 = gsn_xy(wks,T(:1100),Geo(:1100),False) ; Draw an XY plot with 1 curve.<br> a2 = gsn_xy(wks,U(:1100),Geo(:1100),False) ; Draw an XY plot with 1 curve.<br> <br> plot=(/a1,a2/)<br> dims=(/1,2/)<br> <br> gsn_panel(wks,plot,dims,False)<br>end do<br><br> delete([/data, fname /]) <br> <br> end <br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 10, 2016 at 11:46 AM, Theomar Trindade <span dir="ltr"><<a href="mailto:theomar_trindade@hotmail.com" target="_blank">theomar_trindade@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">Dear NCL users fellows,<br><br>I'm trying to play a loop in my scipt:<br><br>----------------------------------------------------------------------------------------------------------------------------<br><i>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br><br>begin<br><br>do a=1,6<br><br> fname = "/home/theomar/Documents/Theomar/GobleATTO15/2015110"+a+"1100.txt"<br> data = asciiread(fname,-1,"string")<br> <br> nfields = str_fields_count(data(11)," ")<br> print("number of fields = " + nfields)<br><br> time = stringtofloat(str_get_field(data(11:2492:), 1," ")) ;Time[min:sec] <br> Geo = stringtofloat(str_get_field(data(11:2492:), 2," ")) ;P[hPa] <br> T = stringtofloat(str_get_field(data(11:2492:), 3," ")) ;T[C] <br> U = stringtofloat(str_get_field(data(11:2492:), 4," ")) ;U[%] <br> <br> ; wks = gsn_open_wks("pdf","perfil_110215") ; Open an ps workstation.<br> wks = gsn_open_wks("pdf","perfil_110"+a+"15") ; Open an ps workstation.<br> a1 = gsn_xy(wks,T(:1100),Geo(:1100),False) ; Draw an XY plot with 1 curve.<br> a2 = gsn_xy(wks,U(:1100),Geo(:1100),False) ; Draw an XY plot with 1 curve. <br> <br> plot=(/a1,a2/)<br> dims=(/1,2/)<br> <br> gsn_panel(wks,plot,dims,False)<br> <br> end do<br><br> delete(data)<br> delete(fname)<br> <br> end </i><br>----------------------------------------------------------------------------------------------------------------------------<br><br>As answer it gives to me the file <i>perfil_110"+a+"15 </i>with a=1 and the follow error:<br><br>fatal:Dimension sizes of left hand side and right hand side of assignment do not match<br>fatal:["Execute.c":8567]:Execute: Error occurred at or near line 12 in file perfil_v2.ncl<br><br>What am I doing wrong? If I write 2 instead <i>a</i> it runs normally.<br><br>Thanks,<br><a href="mailto:theomar.neves@cptec.inpe.br" target="_blank"></a>                                            </div></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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><br>
<br></blockquote></div><br></div>