<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><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"></a>                                            </div></body>
</html>