<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'><div class="post-text" itemprop="description">

        I have 50 files that I want to run a script on one after the 
other, and to save the generated graph with a unique name each time. My 
script to create the graph is fine, but looping through the 50 files is 
not. I have left out many of the resources I'm using.<BR><br><BR>Thanks in advance,<BR>Ciara<BR><br><BR> My script is: <BR>

<pre><code>    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

    do n=1961,2010
        begin
        fnam="/home/cohara/TempData/yearly_data/average/average_" + sprinti("0.4n",n) + ".nc"
        x=addfile(fnam,"r")
        data=x-&gt;var61(0,0,:,:)
        xwks=gsn_open_wks("ps","Average_" + sprinti("0.4n",n)
        resources=True
        resources@tiMainString="Average Annual Temperature" + sprinti("0.4n",n)
            plot=gsn_csm_contour_map(xwks,data,resources)
        end
    end do
<br><br></code></pre>

    </div>                                               </div></body>
</html>