Re: ncl script problem

From: Chao Luo <cluo_at_nyahnyahspammersnyahnyah>
Date: Wed, 12 Jul 2006 09:37:23 -0700

Hi,

I got another problem for plot emission and fraction of emission.
I want to setup res1_at_cnLevelSelectionMode = "ManualLevels",
since I tested the automaticLevels is no good for my plot. When I setup
res1_at_cnMinLevelValF, res1_at_cnMaxLevelValF, and res1_at_cnLevelSpacingF, the
plot are different background between 0-180E, and o-180W. Please see
attached ncl script and plot.

Thanks for any help and advice!

Chao

; $Id$

; Purpose: Plot AMSR-E soil moisture data

begin

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/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

 diri = "/data3/chaoluo/camdst/cam3019aersombf/"
 fl_mdl_3 = addfile(diri+"cam3019aersombf_annual.nc","r")

if(.not.isvar("dev")) then
        dev="ps"; "x11", "ps", or "ncgm"
end if
if(dev.eq."x11") then
        wks_id=create "wks" xWorkstationClass noparent
        end create
end if ; endif "x11"
if(dev.eq."ps") then
        wks_id=create "wks" psWorkstationClass defaultapp
        "wkPSFileName": "/data3/chaoluo/camdst/cam3019aersombf/dustsfmbl_6p.ps"
        end create
end if ; endif "ps"

dstodt = fl_mdl_3->DUSTOD_v(0,:,:)
sfmbl = fl_mdl_3->DSTSFMBL(0,:,:)
sfmbl1 = fl_mdl_3->DSTX01SF(0,:,:)
sfmbl2 = fl_mdl_3->DSTX02SF(0,:,:)
sfmbl3 = fl_mdl_3->DSTX03SF(0,:,:)
sfmbl4 = fl_mdl_3->DSTX04SF(0,:,:)
emistot=sfmbl
emistot = emistot*1.e9 ;ug/m2/s

frc1 = sfmbl ; copy of sfmbl
; frc1 = frc1@_FillValue ; initialize all to _FillValue
  
  temp0 = ndtooned( frc1 ) ; a bit cumbersome but fast
  temp1 = ndtooned( sfmbl )
  temp2 = ndtooned( sfmbl1 )
  i = ind(temp1.ne.0.)
  temp0(i) = temp2(i)/temp1(i)
  
  frc1 = onedtond( temp0,dimsizes(frc1))
  frc1_at_long_name = "ratio: sfmblx01/sfmbl"
  frc1_at_units = ""

printMinMax(frc1,True)
printMinMax(emistot,True)

;gsn_define_colormap(wks_id,"BlAqGrYeOrRe") ; choose colormap
gsn_define_colormap(wks_id,"gui_default")
plot = new(6,graphic)

res1 = True
    res1_at_gsnDraw = False
    res1_at_gsnFrame = False
    
    res1_at_mpPerimOn = False
    res1_at_mpGridLatSpacingF = 30.
    res1_at_mpGridLonSpacingF = 30.
    res1_at_mpFillOn = False
    
    res1_at_gsnStringFont = "helvetica"
    res1_at_cnLevelSelectionMode = "ManualLevels"
    res1_at_cnLineLabelsOn = False
    res1_at_cnFillOn = True
    res1_at_cnLinesOn = False
    res1_at_mpPerimOn = True
    res1_at_gsnPaperMargin = 0.25
    res1_at_gsnSpreadColors = True
    res1_at_cnMinLevelValF = 0.0
    res1_at_cnMaxLevelValF = 2.0
    res1_at_cnLevelSpacingF = 0.2
    res1_at_gsnMaximize = True
    res1_at_lbLabelBarOn = True
    res1_at_gsnLeftString = ""
    res1_at_gsnRightString = ""
    res1_at_gsnCenterString = "DUSTOD_v"
    plot(0) = gsn_csm_contour_map_ce(wks_id,dstodt,res1)

; res1_at_cnLevelSelectionMode = "AutomaticLevels"
    res1_at_cnMinLevelValF = 0.0
    res1_at_cnMaxLevelValF = 20.0
    res1_at_cnLevelSpacingF = 2.
    res1_at_gsnCenterString = "DSTSFMBL (ug/m2/s)"
    plot(1) = gsn_csm_contour_map_ce(wks_id,emistot,res1)

    res1_at_cnLevelSelectionMode = "ManualLevels"
    res1_at_cnMinLevelValF = 0.0
    res1_at_cnMaxLevelValF = 0.1
    res1_at_cnLevelSpacingF = 0.01
    res1_at_gsnCenterString = "DSTX01SF/DSTSFMBL"
    plot(2) = gsn_csm_contour_map_ce(wks_id,frc1,res1)

     res1_at_cnMinLevelValF = 0.0
    res1_at_cnMaxLevelValF = 1.0
    res1_at_cnLevelSpacingF = 0.15
    res1_at_gsnCenterString = "DSTX02OD/DUSTOD"
; plot(3) = gsn_csm_contour_map_ce(wks_id,frc1,res1)
    res1_at_cnMinLevelValF = 0.0
    res1_at_cnMaxLevelValF = 1.0
    res1_at_cnLevelSpacingF = 0.1
   res1_at_gsnCenterString = "DSTX03OD/DUSTOD"
; plot(4) = gsn_csm_contour_map_ce(wks_id,frc1,res1)

     res1_at_cnMinLevelValF = 0.0
    res1_at_cnMaxLevelValF = 1.0
    res1_at_cnLevelSpacingF = 0.1
    res1_at_gsnCenterString = "DSTX04OD/DUSTOD"
; plot(5) = gsn_csm_contour_map_ce(wks_id,frc1,res1)
  
    resP = True
; resP_at_gsnPanelYWhiteSpacePercent = 5
; resP_at_gsnPanelXWhiteSpacePercent = 5
; resP_at_cnFillColors = (/ 5,20,35,50,0,0,65,75,85,96/)
    resP_at_gsnMaximize = True
; resP_at_gsnPanelLabelBar = True
    resP_at_lbLabelBarOn = True
    resP_at_gsnPaperOrientation = "landscape"
; resP_at_lbOrientation = "vertical" ; vertical label bar
    resP_at_lbOrientation = "horizontal"
    resP_at_lbLabelAutoStride = True ; nice label bar labels
    resP_at_lbTitleOn = True
    resP_at_lbLabelFont = "helvetica"
; resP_at_lbTitleString = "Sig lvl"
    resP_at_lbTitlePosition = "Bottom"
    resP_at_lbTitleFontHeightF = .012
    resP_at_lbTitleDirection = "Across"
; resP_at_txString = title
  gsn_panel(wks_id,plot,(/3,2/),resP)
; frame(wks_id)
end

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

Received on Wed Jul 12 2006 - 10:37:23 MDT

This archive was generated by hypermail 2.2.0 : Mon Jul 17 2006 - 11:02:00 MDT