clmMonTLL: Error in Time dimension

From: Simone Marras <simone.marras_at_nyahnyahspammersnyahnyah>
Date: Mon, 21 May 2007 13:30:23 +0200

Good morning, I am having a problem with running a climatological script (the
one in the example from "http://www.ncl.ucar.edu/Applications/climo.shtml"
after making some modification so that it can work with my *.nc file.
Though, I obatin an error that I cannot solve even if conceptually very
simple.

ERROR:
Coordinates:
(0) contributed.ncl: clmMonTLL: dimension must be a multiple of 12

I understand that I need to invert the order of the array components in the
clmMonTLL input file (in my case I called it tmp), but even when I do that,
I keeo obtaining the same error.

Here is my script, and I can provife u with information on my *.nc file if
needed

Thanks a lot

Regards,
Simone

;*****************************************************
; climo_2.ncl
;*****************************************************
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"
;******************************************************
begin
;**************************
; open file and read in monthly data
;**************************
  f = addfile
("../ERA40/2_monthlyMeans/ERA40_2mT_SLP_monthlyMeans_1970to1994.nc", "r")
  P = f->msl
  ntim = dimsizes(P&time) ; # time steps [months]
  printVarSummary(ntim)
  nmos = 12

; printVarSummary(P)
 tmp = (/ short2flt(P) /)
; printVarSummary(tmp)
; printVarSummary(P)
; P = (/ short2flt(P) /)
; printVarSummary(P)
;**************************
; use functions in contributed.ncl
;**************************

        tmp!0 = "lat"
    tmp!1 = "lon"
        tmp!2 = "time"
        
        Pclm = clmMonTLL (tmp) ; monthly climatology (12,nlat,mlon)
          Pstd = stdMonTLL (tmp) ; stDev monthly means (12,nlat,mlon)
;**************************
; compute Seasonal means
;*********s*****************
  Psea = P(lat|:,lon|:,time|:) ; reorder variable-to-variable transfer
  Psea = runave (Psea, 3, 1) ; seasonal (3-month) averages

 printVarSummary(Psea)

;**************************
; calculate eof's
;**************************
 ; eofData = Psea(::4, ::4, 10:ntim-1:12) ; temporary
  eofData = Psea(::4, ::4, 1:2) ;
  eof = eofcov_Wrap (eofData,3) ; eof of seasonal means
  eofTs = eofcov_ts_Wrap(eofData,eof) ; time series coef
;******************************************
; create plot
;******************************************
  wks = gsn_open_wks("ps" ,"climo") ; open ps file
  gsn_define_colormap(wks,"gui_default") ; choose colormap
  plot = new ( 3, "graphic") ; create graphic array
  
  res = True ; plot mods desired
  res_at_gsnDraw = False ; don't draw
  res_at_gsnFrame = False ; don't advance frame
  
  res_at_cnLevelSelectionMode = "ManualLevels" ; manual contour levels
  res_at_cnMinLevelValF = -0.40 ; min level
  res_at_cnMaxLevelValF = 0.40 ; max level
  res_at_cnLevelSpacingF = 0.04 ; interval
  
  res_at_cnFillOn = True ; turn on color
  res_at_gsnSpreadColors = True ; use full color table
  res_at_lbLabelBarOn = False ; turn off individual color bars
  
  res_at_tmXBOn = False ; eliminate bottom labels
  res_at_cnLinesOn = False ; no contour lines
  
  if (isatt(eof,"long_name")) then
    eof_LongName = eof_at_long_name ; save for later use as title
    delete (eof_at_long_name)
  end if
  
  do ne=0,2
    res_at_gsnLeftString = "Covariance"
    res_at_gsnCenterString = "EOF "+(ne+1)
    res_at_gsnRightString = "%Var=" + sprintf("%4.1f", eof_at_pcvar(ne))
    plot(ne) = gsn_csm_contour_map_ce(wks,eof(ne,:,:), res)
  end do
  
  resP = True ; panel mods desired
  resP_at_gsnPanelLabelBar = True ; common color bar
  resP_at_lbLabelStride = 3 ; every other label
  gsn_panel(wks,plot,(/3,1/),resP)
;******************************************
; create plot of time series
;******************************************
  resxy = True ; xy plot mods desired
  resxy_at_gsnDraw = False ; don't draw yet
  resxy_at_gsnFrame = False ; don't advance frame yet
  resxy_at_vpWidthF = 0.80 ; plot width
  resxy_at_vpHeightF= 0.50 ; plot height
  
  time = eofTs&time
  
  do ne=0,2
    resxy_at_gsnLeftString = "Covariance" ; titles
    resxy_at_gsnCenterString = "EOF "+(ne+1)
    resxy_at_gsnRightString = "%Var=" + sprintf("%4.1f", eof_at_pcvar(ne))
    plot(ne) = gsn_csm_xy(wks,time,eofTs(ne,:), resxy)
  end do
  gsn_panel(wks,plot,(/3,1/),False) ; draw: 1-across, 3-down
end

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon May 21 2007 - 05:30:23 MDT

This archive was generated by hypermail 2.2.0 : Mon May 21 2007 - 09:22:55 MDT