How to get the exact data type from a known file? "new "function problem

From: Yan Bao <ybao2009_at_nyahnyahspammersnyahnyah>
Date: Wed, 8 Jul 2009 07:50:33 -0700

Hi,Every one
    I'd like to creat a file namelist in my directory, but I don't know what
the type of the file name namelist, I have tried 'character','string',
' byte',
all of them don't work. I got the error message like:
fatal:Assignment type mismatch, right hand side can't be coerced to type of
left hand side
fatal:Execute: Error occurred at or near line 26 in file ght.time.ncl

I want to use the type attribute from file_list1, I think they are the same,
how can I do that?


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"
   file_home ="./"
   file_list1 = systemfunc("cd " + file_home+ " ; ls ta_A6.*nc ;")
   file_list2 = systemfunc("cd " + file_home+ " ; ls hus_A6.*nc ;")
   nfiles = dimsizes(file_list1)
   year = new(nfiles,integer)

   file_list3 =new(nfiles,byte)
   nf = nfiles-1
   do fil = 0, nf ; files numbers !from 1985
   a =addfile(file_home+file_list1(fil),"r")
   b =addfile(file_home+file_list2(fil),"r")
   file_list3(fil) ="ght_A6."+year+"010100-"+year+""
   end do

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Wed Jul 08 2009 - 08:50:33 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 08 2009 - 14:48:16 MDT