<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Based on the error message, it looks like it is dying when <tt>time</tt>
goes to be overwritten on the second loop, but it looks like it
should still be the same size. Deleting the variables at the end of
the loop would probably get it to run, but this might be indicating
unexpected behavior. I would run a <tt>printVarSummary</tt> on time
each loop to confirm it is giving the expected dimensions each loop.<br>
<br>
- Walter<br>
<br>
<div class="moz-cite-prefix">On 2016-03-10 20:03, Dennis Shea wrote:<br>
</div>
<blockquote
cite="mid:CAOF1d_4MBk7DjsqBoM0DGkaiacSR3JkW+=8CpfSEdwWEZOqBWA@mail.gmail.com"
type="cite">
<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
moz-do-not-send="true"
href="mailto:theomar_trindade@hotmail.com" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:theomar_trindade@hotmail.com">theomar_trindade@hotmail.com</a></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>
</div>
</div>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a moz-do-not-send="true" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a moz-do-not-send="true"
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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
ncl-talk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>
List instructions, subscriber options, unsubscribe:
<a class="moz-txt-link-freetext" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>
</pre>
</blockquote>
<br>
<br />
<table style="border-top: 1px solid #aaabb6;">
        <tr>        
                <td style="width: 470px; padding-top: 20px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">This email has been sent from a virus-free computer protected by Avast. <br /><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient&utm_term=emailclient&utm_term=oa-2115-a" target="_blank" style="color: #4453ea;">www.avast.com</a>
                </td>
        </tr>
</table>
</body>
</html>