Re: loop error

From: Adam Phillips (asphilli AT cgd.ucar.edu)
Date: Mon Aug 29 2005 - 13:29:41 MDT

  • Next message: David Ian Brown: "Re: vector plot question"

    Hi Mike,

    Try adding:
    delete(tas)

    right after contour = gsn_csm....

    If each input file has the same lats/lons this wouldn't be an issue, but
    I am guessing based on your directory name that you are reading in IPCC
    data, and that data (assuming you didn't previously regrid it) comes on
    a variety of different grids depending on the modeling center.

    Thus, if tas the first time thru is set to say (64,128) and the next
    time thru a different grid is read in and the dimensions are (128,256),
    the script will fail.

    Adam

    brownmc@uci.edu wrote:
    > Hi all,
    > I have been trying to make a script that loops through all my files and
    > creates a plot for each one, but I keep getting an error message about my
    > dimensions sizes on the left and right not matching. My script and the
    > error is included below. Thanks for the help.
    >
    > Mike Brown
    >
    > ncl 0> ;;Mollweide Map Operation
    > ncl 1> begin
    > ncl 2> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
    > ncl 3> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
    > ncl 4>
    > ncl 5> diri = "/data/brownmc/IPCC_Loop/"
    > ncl 6> fList = systemfunc("cd "+diri+" ; /bin/ls *.nc")
    > ncl 7> nFiles = dimsizes(fList)
    > ncl 8> do iFile = 0, nFiles-1
    > ncl 9> a = addfile(diri+fList(iFile),"r")
    > ncl 10>
    > ncl 11> tas = a->tas(0,:,:)
    > ncl 12> g = fList(iFile)
    > ncl 13> wks = gsn_open_wks("ps",g)
    > ncl 14>
    > ncl 15> gsn_define_colormap(wks,"gui_default")
    > ncl 16>
    > ncl 17> res = True
    > ncl 18> res@mpProjection = "Mollweide"
    > ncl 19> res@mpGridAndLimbOn = True
    > ncl 20> res@mpPerimOn = False
    > ncl 21> res@mpGridLatSpacingF = 30.
    > ncl 22> res@mpGridLonSpacingF = 30.
    > ncl 23> res@mpFillOn = False
    > ncl 24> res@cnFillOn = True
    > ncl 25> res@cnLineLabelsOn = False
    > ncl 26> res@txFontHeightF = 0.015
    > ncl 27> res@vpXF = 0.1
    > ncl 28> res@vpYF = 0.9
    > ncl 29> res@vpWidthF = 0.8
    > ncl 30> res@vpHeightF = 0.8
    > ncl 31> res@gsnSpreadColors = True
    > ncl 32> res@gsnSpreadColorStart = 2
    > ncl 33> res@gsnSpreadColorEnd = -3
    > ncl 34> res@lbLabelFontHeightF = 0.015
    > ncl 35>
    > ncl 36>
    > ncl 37> res@tiMainString = "Test Plot"
    > ncl 38> res@tiMainFontHeightF = .018
    > ncl 39> contour = gsn_csm_contour_map(wks,tas,res)
    > ncl 40>
    > ncl 41> end do
    > ncl 42> end
    > fatal:Dimension sizes of left hand side and right hand side of assignment
    > do not match
    > fatal:Execute: Error occurred at or near line 11
    >
    >
    >
    > _______________________________________________
    > ncl-talk mailing list
    > ncl-talk@ucar.edu
    > http://mailman.ucar.edu/mailman/listinfo/ncl-talk

    -- 
    --------------------------------------------------------------
    Adam Phillips			             asphilli@ucar.edu
    National Center for Atmospheric Research   tel: (303) 497-1726
    ESSL/CGD                                   fax: (303) 497-1333
    P.O. Box 3000				
    Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    



    This archive was generated by hypermail 2b29 : Mon Aug 29 2005 - 14:26:56 MDT