Re: Hovmuller plot

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri Jan 24 2014 - 07:46:15 MST

I'm not sure if "rubbish" is the correct word :-) :-)
but your 'time' or 'longitude' coordinates are
not being understood correctly.

Whenever, you have something like the following

> plot = gsn_csm_hov(wks, udiff(:,19,95,:), res ) ; (time,lon)

you should *always* include a printVarSummary(..)

   printVarSummary(udiff)

or, more to the point

   printVarSummary(udiff(:,19,95,:))

---
The following offers some insight into the 
'warning:_NhlCreateSplineCoordApprox:...' message
but does not answer your question.
http://www.ncl.ucar.edu/FAQ/
See #28
---
What version of NCL are you using?
%> ncl -V
Although available for backward compatibility, addfiles_GetVar
is a deprecated. See:
 
http://www.ncl.ucar.edu/Document/Functions/Contributed/addfiles_GetVar.shtml
Newer codes would replace
 > f2     = addfiles (fili2,"r")
 > U2= addfiles_GetVar(f2,fili2,"U")  ;<==== deprecated
with
   f2     = addfiles (fili2,"r")
   U2     = f[:]->U
You should upgrade your version of NCL.
This helps you *and ncl-talk. Supporting very old code is a nuisance.
On 1/24/14, 5:07 AM, Kristina Fröhlich wrote:
> Hi Helen,
>
> the warning tells you that it cannot interpolate in the y-axis. Means the numbers must be rubbish.
>
> have you checked, if you produce meaningfull numbers?
> I think your averaging is somehow wrong. Better than reordering would be to use dim_avg_n_Wrap where you can chose the dimension(s) to be averaged.
>
> And than check them with printVarSummary before summing up everything.
>
> Only, if you are sure you have something reasonable in the longitude and time, try to plot.
>
> Good luck, Kristina
>
>
>
> "Parish, Helen" <hparish@epss.ucla.edu> schrieb am 12:37 Freitag, 24.Januar 2014:
>
> I am getting the following message when creating a Hovmuller plot, but I don't know what this means :
>
>
> " warning:_NhlCreateSplineCoordApprox: Attempt to create spline approximation for Y axis failed: consider adjusting trYTensionF value
> warning:IrTransInitialize: error creating spline approximation for trYCoordPoints; defaulting to linear "
>
>
> Can anyone tell me what this warning means, whether I need to be concerned, and whether I need to adjust something to produce a meaningful plot?.
>
> I enclose a copy of my script below:
>
> Thanks,
> Helen.
>
>
> 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
>
> ; ********************
>
> wks   = gsn_open_wks ("pdf", "hovdailyzon350days4" )           ; open workstation
>
> gsn_define_colormap(wks,"rainbow")               ; choose colormap
>
> ; ************************
>
>
> diri = "./"
> fili  = systemfunc("cd  "+diri+"  ; ls cesm*cam2.h0*nc")
> print(fili)
> nfili = dimsizes(fili)
>
> ; define pi, universal gas constant (rgas), Venus planetary rotation rate (omegarot) etc.
>
> pi = 3.1415926
> twopi = 2.0 * 3.1415926536
> rgas = 8.314468              ; gas constant (J/K/mole)
> radi = 6.05180e6             ; radius of Venus in meters
> omegarot = 2.992677e-7       ; rotation rate of Venus
> mwt = 43.45                  ; mean molecular weight (kg/mole)
> grav = 8.87                  ; gravitataional acceleration (m/s^2)
> cp = 8.5e2                   ; specific heat at constant pressure (J/Kg/K  or m^2/s^2/K)
>
>
> do nf = 0, nfili-1
>
>     nf100 = nf + 100
>
> fi   = addfile (diri+fili(nf), "r")
>
> diro = "./"
> filo  = "uhelen"+nf100+".nc"
> print(filo)
> system ("/bin/rm -f "+diro+filo)     ; remove any pre-exist file
> fo    = addfile (diro+filo, "c")
>
>      hyam = fi->hyam                      ; read hybrid info
>      hybm = fi->hybm
>      hyai = fi->hyai                      ; read hybrid info
>      hybi = fi->hybi
>      U     = fi->U
>      lat   = fi->lat
>      lev   = fi->lev
>      lon   = fi->lon
>
>      fo->U = U                 ; write to netCDF file
>    fo->lat = lat                 ; write to netCDF file
>    fo->lon = lon                 ; write to netCDF file
>    fo->lev = lev                 ; write to netCDF file
>
> end do
>
> ; ******************************************
> ;
> ; *******************************************
>
> diri = "./"
> fili2  = systemfunc("cd  "+diri+"  ; ls uhelen*nc")
> print(fili2)
> nfili = dimsizes(fili2)
>
> f2     = addfiles (fili2,"r")
> U2= addfiles_GetVar(f2,fili2,"U")
>
> printVarSummary( U2 )
>
> dimt4  = dimsizes( U2 )
> ntim4  = dimt4(0)
> klvl4  = dimt4(1)
> nlat4  = dimt4(2)
> mlon4  = dimt4(3)
>
>
> ureorder = U2(lev | :, lat | :, lon |:, time | :)   ; (lev,lat,lon,time)
> printVarSummary( ureorder )
>
> uzonav = dim_avg_Wrap(U2)        ; (time,lev,lat)
> printVarSummary( uzonav )
> utimeav = dim_avg_Wrap(ureorder)        ; (lev,lat,lon)
> printVarSummary( utimeav )
>
>
> UTIMEAV = U2   ; copy U2 coordinate variables to UZONAV
>
> printVarSummary( UTIMEAV )
>
> UTIMEAV = conform(U2,utimeav,(/1,2,3/))    ;  (time,lev,lat,lon)
>
>
> udiff = U2    ; copy U2 coordinate variables to udiff
>
> udiff = U2 - UTIMEAV                      ; (time,lev,lat,lon)
>
> printVarSummary( udiff )
>
> ;***********************
> ; Create  Plot
> ;***********************
>
> res   = True
>
>      res@gsnLeftString   = ""
>      res@gsnCenterString = "Hovmuller Plot U-Utime-mean - Equator"
>      res@gsnRightString  = ""
>
>
> res@cnFillOn          = True
> res@lbLabelAutoStride = True
> res@gsnMaximize       = True      ; if [ps, eps, pdf] make large
> res@gsnSpreadColors   = True      ; span color map
> res@cnLineLabelsOn = False   ; Turn off contour line labels
> res@cnInfoLabelOn  = False   ; Turn off informational label
>
>
> res@tiXAxisString = "Longitude (degrees)"
>      res@tiYAxisString = "Time (Earth days)"
>
>    res@pmTitleZone               = 3
>    res@pmLabelBarOrthogonalPosF  = 0.05
>
>        res@lbTitleOn = True
>        res@lbTitleDirection = "Across"             ; title direction
>        res@lbTitlePosition = "Right"
>        res@lbTitleString = "(m s~S~-1~N~)"
>        res@lbTitleFontHeightF = 0.02
>        res@lbTitleOffsetF = 0.0
>
>     plot  = gsn_csm_hov(wks, udiff(:,19,95,:), res )    ; (time,lon)
>
>
> end
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jan 24 07:46:22 2014

This archive was generated by hypermail 2.1.8 : Fri Feb 07 2014 - 16:39:11 MST