How to use 2D lon/lat (curvilinear) with gsn_contour_csm_map_ce and gsnZonalMean

From: Mario Krapp <mario.krapp_at_nyahnyahspammersnyahnyah>
Date: Tue, 14 Jul 2009 11:21:32 +0200

Hi,

I want to contour the data of a curvilinear grid using gsn_contour_csm_map_ce and add a zonal mean as in
http://www.ncl.ucar.edu/Applications/Scripts/dev_1.ncl
I use version 5.0.0.

The lon, lat values are 2D arrays so I use
res_at_sfXArray = lon
res_at_sfYArray = lat

Here is the part I changed according to the script mentioned above:
---cut---
   fn = "tho_6m_mean.nc" ; define filename
   in = addfile(fn,"r") ; open netcdf file
   ts = in->var2(0,0,:,:) ; select variable to ave
   lat = in->lat
   lon = in->lon

;************************************************
; plot parameters
;************************************************
   wks = gsn_open_wks("ps","stddev") ; Opens a ps file
   gsn_define_colormap(wks,"BlWhRe") ; choose colormap

   plot = new(2,graphic) ; create graphical array
   res = True ; plot mods desired
;************************************************
; original data
;************************************************

   res_at_gsnZonalMean = True ; add zonal plot
   res_at_mpOutlineOn = False
   res_at_sfXArray = lon
   res_at_sfYArray = lat

   res_at_vpWidthF = 0.7

   plot(0) = gsn_csm_contour_map_ce(wks,ts(:,:),res)
---cut---

The message I receive is:
(0) gsn_csm_contour_map_ce: Warning: The resource gsnZonalMean can only be set to True
fatal:Plus: Dimension size, for dimension number 0, of operands does not match, can't continue

So I uncomment
;res_at_gsnZonalMean = True ; add zonal plot

now I receive:
warning:ScalarFieldSetValues: 2d coordinate array sfXArray has an incorrect dimension size: defaulting sfXArray
warning:ScalarFieldSetValues: 2d coordinate array sfYArray has an incorrect dimension size: defaulting sfYArray

I don't know what this means and made a 'ncl_filedump':
---cut---
Variable: f (file variable)

filename: tho_6m_mean
path: tho_6m_mean.nc
   file global attributes:
      CDI : Climate Data Interface version 1.3.2
      Conventions : CF-1.0
   dimensions:
      x = 362
      y = 192
      nv = 4
      lev = 1
      time = 1 // unlimited
   variables:
      float lon ( y, x )
         long_name : longitude
         units : degrees
         standard_name : longitude
         bounds : lon_bounds

      float lon_bounds ( y, x, nv )

      float lat ( y, x )
         long_name : latitude
         units : degrees
         standard_name : latitude
         bounds : lat_bounds

      float lat_bounds ( y, x, nv )

      double lev ( lev )
         long_name : generic
         units : level

      double time ( time )
         units : day as %Y%m%d.%f
         calendar : proleptic_gregorian

      float var2 ( time, lev, y, x )
         coordinates : lon lat
         _FillValue : -9e+33
---cut---

If I plot the data just using gsn_contour_map everything works fine, but gsnZonalMean is not supported.

Thanks and Regards

Mario Krapp

-- 
Mario Krapp
Max Planck Institute for Meteorology
Bundesstraße 53
20146 Hamburg
Germany
tel. +49 40 41173 168
email mario.krapp_at_zmaw.de
www http://www.mpimet.mpg.de
_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Tue Jul 14 2009 - 03:21:32 MDT

This archive was generated by hypermail 2.2.0 : Sat Aug 01 2009 - 06:38:59 MDT