masked area shift

From: Ioana Colfescu <colfescu_at_nyahnyahspammersnyahnyah>
Date: Sat Feb 12 2011 - 20:58:26 MST

Hi,

I calculate EOFs for SST, the domain 62N - 62S and 0-360 longitude.
I used atmosphere temperature data but masked the land and used only the sst.
When I plot the EOFs the plots seem fine but the contours of the masked area doesn't overlap with the continents that I masked - the area of the EOFs where is masked ( white ) is much bigger than the actual continents. There is no shift rather a difference in scale.
I set up the plots only for 62S to 62N but still doesn't look correct.
Could anyone tell me please what should I do to fix this ?
The code is below :

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"
;****************************************************
; the script calculates sst EOFs for data from CCSM3 b30.030b control run,
; 1870-1999, for domain 62N-62S, 0-360 E/W
;************************************************
begin
;************************************************
  path = ("/data/oldfarm2/colfi/cam3.1.p2/CCSM/IE85_test1/temp/ts_anom.dat")
  nlat = 46
  nlon = 128
  nrec=1560
  ts = new((/nrec,nlat,nlon/),float)
  do ir=1,1559
  rec=ir
  ts(ir,:,:)=fbindirread(path,rec,(/nlat,nlon/),"float")
  end do

  ins=addfile("/data/oldfarm2/colfi/cam3.1.p2/CCSM/IEt42_test1/scripts/IEt85_test1.cam.1870-01.nc","r")
  oro = ins->LANDFRAC(0,10:55,:)
  ; ice = ins->ICEFRAC(0,:,:)
  lat=ins->lat(10:55)
  lon=ins->lon
;************************************************
; use mask function to mask out land
; ocean=0
;************************************************
  ocean_only = ts
  ocean_only =mask(ts,oro,0) ; Return the values of ts where oro=0.1
  ocean_only=lonFlip(ocean_only)

;***** make time the rightmost dimension to apply eof function
  ocean_only!0="time"
  ocean_only!1="latn"
  ocean_only!2="lonn"
  ocean_only2=ocean_only(latn|:,lonn|:,time|:)

;******** weight the variables
  wgt = sqrt(cos(lat*0.01745329))
 ocean_only3 = ocean_only2*conform(ocean_only2, wgt, 0)

;********* calculate eofs**************************
 eof = eofunc(ocean_only3,5,False)
 cbinwrite("eof_tsanom",eof)

;************************************************
; common resources
;************************************************
  wks = gsn_open_wks("ps","eof.ts.b30CCSM") ; open a ps file
  plot = new(3,graphic)
  gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap

  res = True ; plot mods desired
  res@gsnDraw = False ; don't draw
  res@gsnFrame = False ; don't advance frame
  res@cnInfoLabelOn = False ; turn off cn info label
  res@cnFillOn = True ; turn on color fill
  res@cnLinesOn = False ; turn of contour lines
  res@gsnSpreadColors = True ; use full colormap
  res@mpLimitMode = "LatLon" ; use lat/lon coordinates to limit area
  res@mpMinLatF = -60.
  res@mpMaxLatF = 60.
; res@gsnCenterStringFontHeightF = 0.03 ; set the center string font height

;************************************************
; individual plots
;************************************************
  res@tiMainString = "EOF 1, 1870-1999 TS anomalies, b30.030b CCSM Control "
  plot(0) = gsn_csm_contour_map_ce(wks,10*eof(0,:,:),res)
  res@tiMainString = "EOF 2, 1870-1999 TS anomalies, b30.030b CCSM Control "
  plot(1) = gsn_csm_contour_map_ce(wks,10*eof(1,:,:),res)
  res@tiMainString = "EOF 3, 1870-1999 TS anomalies, b30.030b CCSM Control "
  plot(2) = gsn_csm_contour_map_ce(wks,10*eof(2,:,:),res)

;************************************************
; create panel
;************************************************
  resP = True ; modify the panel plot
  resP@txString = "EOF 1,2,3 for CCSM b30.030b control run TS anomalies "
  gsn_panel(wks,plot,(/3,1/),False) ; now draw as one plot
end

Thanks,

Ioana
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Feb 12 20:59:22 2011

This archive was generated by hypermail 2.1.8 : Tue Feb 15 2011 - 09:43:19 MST