contour plot MA-ECHAM

From: Stergios Misios <stergios.misios_at_nyahnyahspammersnyahnyah>
Date: Mon, 27 Jul 2009 10:35:00 +0200

Dear all,
I have monthly values of zonal mean zonal wind interpolated to some
vertical layers.
The ncdump -h gives,

netcdf 02030_blz_ATM_1980-1999_zm_ymm {
dimensions:
        lon = 1 ;
        lat = 160 ;
        lev = 45 ;
        time = UNLIMITED ; // (12 currently)
variables:
        double lon(lon) ;
                lon:long_name = "longitude" ;
                lon:units = "degrees_east" ;
                lon:standard_name = "longitude" ;
        double lat(lat) ;
                lat:long_name = "latitude" ;
                lat:units = "degrees_north" ;
                lat:standard_name = "latitude" ;
        double lev(lev) ;
                lev:long_name = "pressure" ;
                lev:units = "Pa" ;
                lev:positive = "down" ;
        double time(time) ;
                time:units = "months since 1900-01-01 12:00" ;
                time:calendar = "proleptic_gregorian" ;
        float t(time, lev, lat, lon) ;
                t:long_name = "temperature" ;
                t:units = "K" ;
                t:code = 130 ;
                t:table = 128 ;
                t:grid_type = "gaussian" ;
        float u(time, lev, lat, lon) ;
                u:long_name = "u-velocity" ;
                u:units = "m/s" ;
                u:code = 131 ;
                u:table = 128 ;
                u:grid_type = "gaussian" ;
======================================
and the vertical layers are
lev = 1000, 925, 850, 775, 700, 600, 500, 400, 300, 250, 200, 150, 100, 90,
    80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0.9, 0.8,
0.7,
    0.5, 0.4, 0.3, 0.1, 0.09, 0.08, 0.07, 0.05, 0.03, 0.02, 0.01 ;
======================================
I am trying simply to plot in a pressure/latitude sections with
gsn_csm_pres_hgt but
the spline interpolation is getting crazy and says something like,

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
warning:_NhlCreateSplineCoordApprox: Attempt to create spline
approximation for Y axis failed: consider adjusting trYTensionF value
warning:IrTransSetValues: error creating spline approximation for
trYCoordPoints; defaulting to linear
warning:_NhlCreateSplineCoordApprox: Attempt to create spline
approximation for Y axis failed: consider adjusting trYTensionF value
warning:IrTransSetValues: error creating spline approximation for
trYCoordPoints; defaulting to linear
warning:_NhlCreateSplineCoordApprox: Attempt to create spline
approximation for Y axis failed: consider adjusting trYTensionF value
===================================================================================================
Of course i am getting a plot but is incorrect. What i am missing? What
i am doing wrong?
the print(dvar&lev) gives,

Variable: lev (coordinate)
Type: double
Total Size: 360 bytes
            45 values
Number of Dimensions: 1
Dimensions and sizes: [lev | 45]
Coordinates:
Number Of Attributes: 3
  positive : down
  units : Pa
  long_name : pressure
(0) 1000
(1) 925
(2) 850
(3) 775
(4) 700
(5) 600
(6) 500
(7) 400
(8) 300
(9) 250
(10) 200
(11) 150
(12) 100
(13) 90
(14) 80
(15) 70
(16) 60
(17) 50
(18) 40
(19) 30
(20) 20
(21) 10
(22) 9
(23) 8
(24) 7
(25) 6
(26) 5
(27) 4
(28) 3
(29) 2
(30) 1
(31) 0.9
(32) 0.8
(33) 0.7
(34) 0.5
(35) 0.4
(36) 0.3
(37) 0.1
(38) 0.09
(39) 0.08
(40) 0.07000000000000001
(41) 0.05
(42) 0.03
(43) 0.02
(44) 0.01
The level 40 looks very odd. The original value is 0.07

I have attached my script. Thank you in advance.

Regards,
Stergios

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"

begin
first_year=1980
last_year=1999
fname_ymm="02030_blz_ATM_1980-1999_zm_ymm.nc"
fname_ymv="02030_blz_ATM_1980-1999_zm_ymv.nc"
var="u"
month=1
smonth="January"
plot_out="02030_blz_ATM_1980-1999_zm_ymm_month"+month

;read selected variable
;======================
f= addfile(fname_ymm, "r")
u=f->$var$

;select month
;============
dvar=u(month,:,:,0)
print(dvar&lev)

wks=gsn_open_wks("eps",plot_out) ; open workstation
gsn_define_colormap(wks,"BlWhRe") ; choose colormap

; define workstation
;===================
  res = True ; plot mods desired
;res_at_wkWidth = 400
;res_at_wkHeight = 400
res_at_gsnMaximize = True
;--------
;contours
;--------
  res_at_cnLinesOn = False ; turn on contour lines
  res_at_cnLevelSelectionMode = "ManualLevels" ; manual contour levels
  ;res_at_cnLevelSpacingF = 5 ; contour interval
  ;res_at_cnMinLevelValF = -60. ; min level
 ; res_at_cnMaxLevelValF = 60. ; max level
  res_at_cnLineLabelsOn = False ; turn on line labels
  res_at_cnFillOn = True ; turn on color fill
  res_at_gsnSpreadColors = True ; use full range of colors
  res_at_lbLabelAutoStride = True ; optimal labels
;-------
; labels
;-------
  res_at_tiMainString = smonth ; title
  res_at_gsnRightString = "U-Wind [m/s]" ; lower right string
  res_at_gsnLeftString = "MA-ECHAM T106L95"
;----
;axis
;----

;===============================================================================

  plot = gsn_csm_pres_hgt(wks,u(month,:,:,0),res)

end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 27 2009 - 02:35:00 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 29 2009 - 09:07:41 MDT