How to use NCL to plot EASE grid vector

From: Xiucheng Wang <xcwang_at_nyahnyahspammersnyahnyah>
Date: Tue, 11 Dec 2007 23:56:10 +0800

Hi,everyone,
   I generate a February mean(1979-1999) north polar EASE grid ice motion(data from NSIDC) nc file, then I make use of the following NCL program similar to http://www.ncl.ucar.edu/Applications/Scripts/ease_1.ncl to plot u component.

;*********************************
; iceu.ncl
;*********************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
 
begin
 
;*******************************************
;read netCDF file
;*******************************************
    a = addfile("icemotion79-99.02.n.NoscalFil.nc","r")
 
     u = a->u
; v = a->v
;*******************************************
; Create plots
;*******************************************
 
    wks = gsn_open_wks("ps","iceu")
    gsn_define_colormap(wks,"amwg") ; Change color map
; gsn_define_colormap(wks,"BlAqGrYeOrReVi200") ; choose colormap
; i = NhlNewColor(wks,0.7,0.7,0.7) ; add gray to colormap
 
    res = True ; Plot modes desired.
    res_at_gsnMaximize = True ; Maximize plot
    res_at_mpFillOn = False
    res_at_gsnSpreadColors = True ; use full range of colormap
    res_at_cnFillOn = True ; color plot desired
    res_at_cnLinesOn = False ; turn off contour lines
    res_at_cnFillMode = "RasterFill" ; turn raster on
    res_at_pmLabelBarWidthF = 0.9 ; make wider
    res_at_pmLabelBarHeightF = 0.1 ; default is taller
    res_at_lbLabelFontHeightF = .018 ; default is HUGE
 
    res_at_cnLevelSelectionMode= "ExplicitLevels" ; set explicit contour levels
    res_at_cnLevels =(/-40,-30,-25,-20,-15,-10,-5,-1 \
                               ,0,1,5,10,25,30,40/)
 
;************************************************
;No georeferencing: simple contour. Draws faster
;************************************************
; res_at_tiMainString = "gsn_csm_contour"
; plot = gsn_csm_contour(wks,snow,res) ; contour, no map
 
;*******************************************
; georeferencing: plot on polar projection
;*******************************************
                                             ; georeference
; v_at_lat2d = a->lat
; v_at_lon2d = a->lon
 
     u_at_lat2d = a->lat
     u_at_lon2d = a->lon
 
    res_at_trGridType = "TriangularMesh" ; allow missing coordinates
 
    res_at_gsnPolar = "NH" ; specify the hemisphere
    res_at_mpMinLatF = 45
    res_at_tiMainString = "gsn_csm_contour_map_polar"
 
    plot = gsn_csm_contour_map_polar(wks,u,res)
; plot = gsn_csm_contour_map_polar(wks,v,res)
end

    Despite the fact it can generate a plot,the following warning information appears:
warning:cnFillMode is not a valid resource in iceu_contour at this time
warning:trGridType is not a valid resource in iceu_contour at this time
   
    why cnFillMode and trGridType not valid at that time? If trGridType is not valid at this time, the plot generated is correct or wrong?
   
    I also try to plot EASE grid ice motion vector with the following NCL program:
;*********************************
; motion.ncl
;*********************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
 
begin
 
;*******************************************
;read netCDF file
;*******************************************
    a = addfile("icemotion79-99.02.n.NoscalFil.nc","r")
    u = a->u
    v = a->v
    lat2d = a->lat
    lon2d = a->lon
 
    u_at_lat2d = lat2d
    u_at_lon2d = lon2d
    v_at_lat2d = lat2d
    v_at_lon2d = lon2d
 
;*******************************************
; Create plots
;*******************************************
 
    wks = gsn_open_wks("ps","motion7902n.noscale")
    gsn_define_colormap(wks,"amwg") ; Change color map
 
    res = True ; plot mods desired
    res_at_gsnPolarNH = True ; specify the hemisphere
    res_at_mpMinLatF = 45
 
    res_at_vcRefMagnitudeF = 10 ; vec magnitude
    res_at_vcRefLengthF = 0.04 ; size of ref vector
    res_at_vcMinDistanceF = 0.01 ; thins arrows near pole
    res_at_vcGlyphStyle = "LineArrow" ; curley vectors on
 
    res_at_tiMainString = "NSIDC 79-99 Ice Velocity Field"
    res_at_tiMainFont = 21
    res_at_gsnStringFont = 21
    res_at_gsnLeftString = "February mean"
    res_at_trGridType = "TriangularMesh" ; allow missing coordinates
  
    plot = gsn_csm_vector_map_polar(wks,u,v,res)
 
  
end
    
   The following warning information appears again.
warning:trGridType is not a valid resource in motion7902n.noscale_vector at this time

   Besides the warning information above, I am either not sure whether the method I plot the EASE grid vector is right or not. I hope some who have processed the EASE grid data give me some advices! Thanks a lot!

   my NCL version is NCAR Command Language Version 4.2.0.a030,my OS is IBM AIX 5.11. the necesary files above are attached.
 
    

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Tue Dec 11 2007 - 08:56:10 MST

This archive was generated by hypermail 2.2.0 : Tue Dec 11 2007 - 14:19:21 MST