problem opening indexed files within loop?

From: Leslie Hartten <Leslie.M.Hartten_at_nyahnyahspammersnyahnyah>
Date: Wed, 24 Sep 2008 12:45:20 -0600

Hi All,

   I am modifying some working code. The original code read in
time/lat/lon from a file & plotted the ship track on a map. This
version loops through cruises and each time reads in data from that
cruise's file. If I've only got a 1-element array of cruises (1 cruise)
it works fine; when I go to 3 cruises, I get

"fatal:Dimension sizes of left hand side and right hand side of
assignment do not match" at or near the indicated line below

The relevant bits seems to be:
=====
   nyearmax = 3
   year = (/2006,2007,2008/) ; create year variable & fill
   year!0 = "year" ; name its dimension
   year&year = year ; assign coordinate variable

   diri = "/Users/lhartten/Documents/AMMA/data/"
   cruise = year
   fili =
(/"flux_30hf_AMMA06.nc","flux_30hf_AMMA07.nc","flux_30hf_AMMA08.nc"/)
   fili!0 = "year"
   fili&year = year

; ncruise = 1 ; ** must be edited by hand
; cruise = (/2006/) ; ** must be edited by hand, # years = ncruise
   ncruise = 3 ; ** must be edited by hand
   cruise = (/2006,2007,2008/); **must be edited by hand, #years=ncruise

[other stuff cut out]

   do icruise = 0, ncruise-1

     fi = addfile( diri+fili({cruise(icruise)}), "r")

     time = fi->time ; **** Fatal Error at or near here ****
     lat = fi->lat
     lon = fi->lon
=====
   Do "time", "lat", "lon" need to be somehow undefined if I'm going to
use them in this way? how would I do that?

Cheers,
   Leslie

--
Dr. Leslie M. Hartten
CIRES, Univ. of Colorado       email: Leslie.M.Hartten_at_noaa.gov
216 UCB                        web:   http://cires.colorado.edu/~hartten
Boulder  CO  80309-0216        phone: (303)497-7052   fax: 497-6181
--
Disclaimer:  The contents of this message are mine personally and do not 
necessarily reflect any position of the Government of the United States 
of America, the National Oceanic and Atmospheric Administration, or the 
University of Colorado.
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Sep 24 2008 - 12:45:20 MDT

This archive was generated by hypermail 2.2.0 : Mon Sep 29 2008 - 13:35:43 MDT