Hi Guilherme,<div><br></div><div>I should to allocate memory before the loop. In other words, you should create the array tempn before your loops. You&#39;re assign values to an array that doesn&#39;t exist. Before the loops, insert the following line:</div>
<div><br></div><div>tempn = new( (/ dim_t, dim_lev, dim_lat, dim_lon /), float )</div><div><br></div><div>in which</div><div><br></div><div>dim_t, dim_lev, dim_lat and dim_lon are the size of dimensions of your new array.</div>
<div><br></div><div>Best regards,</div><div><br></div><div>Mateus</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br><div class="gmail_quote">2011/11/29 Guilherme Martins <span dir="ltr">&lt;<a href="mailto:jgmsantos@gmail.com">jgmsantos@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><font size="2">Hi users,<br><br>I need a help. I did this script below:<br><br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>

load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl&quot;<br><br>begin<br><br>f = addfile(&quot;/home/gui/gui/NCEP-R2-MENSAL/<a href="http://air.mon.mean.nc" target="_blank">air.mon.mean.nc</a>&quot;,&quot;r&quot;)<br>
<br>temp = short2flt(f-&gt;air)<br>

temp = temp - 273.15<br><br>do y = -40,-40<br>   do x = 270,270<br>      do t = 0,10-1<br>         tempn(t,0,{y},{x}) = temp(t,0,{y},{x})<br>      end do<br>   end do<br>end do<br><br>valorp    = .25<br>n         = dimsizes(tempn)<br>


percentil = round(valorp*n,3)-1<br><br>print(tempn(percentil))<br><br>end<br clear="all"></font><br>But I got the error:<br><br>fatal:Undefined identifier: (tempn) is undefined, can&#39;t continue<br>fatal:Execute: Error occurred at or near line 16 in file teste04.ncl<br>


<br>I can&#39;t understand when the NCL told  me &quot;Undefined identifier&quot;.<br><br>May anyone help me?<br><br>Thanks,<br><br>Guilherme.<span class="HOEnZb"><font color="#888888"><br><br><br>-- <br>Guilherme Martins<div>
Homepage: <a href="http://guilhermemartins.hd1.com.br/" target="_blank">http://guilhermemartins.hd1.com.br/</a><br>

<br><br><div></div></div><br>
</font></span><br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Mateus da Silva Teixeira<div><a href="https://linuxcounter.net/cert/466740.png" target="_blank">https://linuxcounter.net/cert/466740.png</a><br></div><br>
</div>