resource file with gsn_csm

From: Wenshan Wang <wenshanw_at_nyahnyahspammersnyahnyah>
Date: Tue Jul 01 2014 - 18:02:03 MDT

Dear NCL group,

I am learning how to use resource files now.
And I got a problem with gsn_csm interface.

I know that if I use gsn_csm and set cnFillOn to be True, a labelbar will
be created automatically.
And it is TRUE if I put cnFillOn in .ncl script.
However, when I move this resource to a resource file, I have a filled
contour but no labelbar, even though I explicitly set lbLabelBarOn to be
True.

I have other resources in that resource file.
Some of them work; some don't. cnFillOn is just one example.

Just wondering where I went wrong.
Thank you very much!

Here I list:
1, NCL script (resfile.ncl)
2, resource file in the same directory (resfile.res)
3, I put the test data (cf_grl_airs.nc) and the above two files to the ftp.
4, I am using NCL 6.2.0
5, Linux grele 3.5.0-52-generic #78~precise1-Ubuntu SMP Wed Jun 11 17:14:53
UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

*NCL script: resfile.ncl*

; Written by Wang Wenshan 2014-07-01 Tuesday 16:32:47
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
;*************************************************************
; Use Resource File
;************************************************************
begin
fname = "resfile"
fn = "cf_grl_airs.nc"
fin = addfile(fn,"r")
cf = fin->CldFrcTot
lat = fin->Latitude
lon = fin->Longitude

;- res
wks = gsn_open_wks("x11",fname)

res = True ; Plot mods desired.

res@gsnMaximize = True ; make plot large

res@gsnDraw = False
res@gsnFrame = False

;res@cnFillOn = True
res@cnLinesOn = False ; turn off contour lines
res@cnFillMode = "RasterFill"
res@cnLineLabelsOn = False; turn off contour line labels
res@cnMissingValFillPattern = 0 ; missing value pattern is set to
"SolidFill"
;res@cnMissingValFillColor = "grey"; color for missing values

res@mpProjection = "LambertEqualArea" ; choose map projection
;res@mpProjection = "Satellite" ; choose map projection
res@mpGridAndLimbOn = False ; turn on lat/lon lines
res@mpPerimOn = False ; turn off perimeter
res@mpFillDrawOrder = "PostDraw"
res@mpDataBaseVersion = "MediumRes"
res@mpDataSetName = "Earth..4"
res@mpFillOn = False
res@mpOutlineOn = True
res@mpOutlineBoundarySets = "AllBoundaries"

res@mpLimitMode = "LatLon" ; required
res@mpMinLatF = 60. ; min lat
res@mpMaxLatF = 85. ; max lat
res@mpMinLonF = 290. ; min lon
res@mpMaxLonF = 350. ; max lon
res@mpCenterLonF = 320.
res@mpCenterLatF = 72.5

res@trGridType = "TriangularMesh" ; faster graphic rendering

res@pmTickMarkDisplayMode = "Always"
res@tmXBOn = False
res@tmXTOn = False
res@tmYLOn = False
res@tmYROn = False

res@gsnAddCyclic = False ; don't add cyclic longitude point

res@sfYArray = lat
res@sfXArray = lon
plot = gsn_csm_contour_map(wks,cf,res)

draw(plot)
frame(wks)

print("done!")
end


=====================================================================
*Resource file: resfile.res*
! test cnFillOn
*cnFillOn : True
*cnMissingValFillColor : grey


Best,
Wenshan
------------------------------------------------------------------------------
Graduate Student Researcher
Earth System Science
University of California, Irvine

Received on Wed Jul 02 12:02:29 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:46 MDT