Why I only get the half data after regridding?

From: leo.aries.g <leo.aries.g_at_nyahnyahspammersnyahnyah>
Date: Thu, 17 Sep 2009 03:06:42 +0800

Hi, all

    I am using the following scripts to regrid the HadISST sst data with 1 degree into

the grids of NCEP (2.5 degree). But the plot show that half field were blank in the plot

of regridded data. Anyone can show me the where the error is. Thanks!

Lin

;************************************************
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
;************************************************
; read in netCDF file
;************************************************
  in = addfile("/dgpfs/fs1/HadISST/HadISST_sst.nc","r")
;************************************************
; read in SST

  sst = in->sst(:,{-89.5:89.5},{-179.5:179.5}) ; remove cyclic point
  lon = in->lon
;************************************************
; interpolate to new grid
;***********************************************
  newlat = fspan(-90.,90.,73)
  newlon = fspan(0.,357.5,144)
  newlat_at_units = "degrees_north"
  newlon_at_units = "degrees_east"
  print("xi: " + lon(0) + " " + lon(dimsizes(lon)-1))
  print("yi: " + sst&lat(0) + " " + sst&lat(dimsizes(sst&lat)-1))
  print("x0: " + newlon(0) + " " + newlon(dimsizes(newlon)-1))
  print("y0: " + newlat(0) + " " + newlat(dimsizes(newlat)-1))
  
  
  newsst = linint2(lon,sst&lat,sst,False,newlon,newlat,0)
  printVarSummary(newsst)
  newsst!0 = "time"
  newsst!1 = "lat"
  newsst!2 = "lon"
  newsst&time= sst&time
  newsst&lat = newlat
  newsst&lon = newlon
wks = gsn_open_wks("eps","regrid") ; open a ps file
  gsn_define_colormap(wks,"gui_default") ; choose colormap
  res = True ; plot mods desired
  res_at_cnFillOn = True ; turn on color
  res_at_gsnSpreadColors = True ; use full color map
  res_at_cnLinesOn = False ; no contour lines
  res_at_cnLineLabelsOn = False ; no line labels
  res_at_mpMaxLatF = 90 ; choose map range
  res_at_mpMinLatF = -90
  res_at_gsnDraw = False ; don't draw yet
  res_at_gsnFrame = False ; don't advance frame yet
  ;res_at_cnLevelSelectionMode = "ManualLevels" ; manual levels
  ;res_at_cnMinLevelValF = 4 ; min level
  ;res_at_cnMaxLevelValF = 32 ; max level
  ;res_at_cnLevelSpacingF = 2 ; interval
  res_at_tmXBLabelFontHeightF = 0.014 ; adjust some font heights
  res_at_tmYLLabelFontHeightF = 0.014
  res_at_tiMainFontHeightF = 0.022
  res_at_txFontHeightF = 0.017
  res_at_lbLabelBarOn = False ; turn off label bar
;************************************************
; create plots
;************************************************
  plot = new(2,graphic)
  res_at_tiMainString = "Original Grid"
  plot(0) = gsn_csm_contour_map_ce(wks,sst(1,:,:),res) ; create the plot
printVarSummary(newsst)
  res_at_tiMainString = "Grid after linint2"
  plot(1) = gsn_csm_contour_map_ce(wks,newsst(1,:,:),res) ; create the plot
;************************************************
; create panel
;************************************************
  pres = True
  pres_at_gsnPanelLabelBar = True ; common label bar
  gsn_panel(wks,plot,(/2,1/),pres)
end
2009-09-17

leo.aries.g

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Sep 16 2009 - 13:06:42 MDT

This archive was generated by hypermail 2.2.0 : Fri Sep 18 2009 - 15:36:15 MDT