I'm having trouble with the coastline example,
http://www.ncl.ucar.edu/Applications/coast.shtml
I get the low and medium resolution to plot but after downloading all ten
RANGS/GSHHS files and moving per the instructions, I get the error message,
fatal:MapRGDHDrawMapList: MDRGSF/MDRGOF - ERROR OPENING RANGS/GSHHS CAT
FILE
fatal:PlotManagerDraw: error in plot draw
fatal:_NhlPlotManagerDraw: Draw error
Please answer these questions for me:
(1) Do the contents of each rangs(#).zip file need to be moved into the
/rangs folder I create in /database (and/or moved out of
"rangs(#) Folder"s)?
(2) I really simplified the data because the temperature
data wasn't included in the example so maybe I messed up the code. If the
first question doesn't resolve my problem please take a look at my
altered code below.
(3) How do you set the environmental variable NCARG_RANGS?
(4) "RANGS_GSHHS" or "highres" or "HighRes" are all acceptable for res@mpDataBaseVersion?
Thanks!
Matt
;************************************
; coast_1.ncl
;************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
;************************************
begin
;************************************
;print(get_ncl_version) ; Not yet available.
; in = addfile("/cgd/cas/murphys/Data/HIGH_RES/tpom000.nc","r")
; t=in->Temperature
lat = fspan(24,31,700)
lat!0 = "lat"
lat&lat = lat
printVarSummary(lat)
lon = fspan(-86,-81,500)
lon!0 = "lon"
lon&lon = lon
printVarSummary(lon)
time = 0
time!0 = "time"
time&time = time
stn = new((/1,700,500/),"integer")
stn(:,:,:) = 0
stn!0 = "time"
stn!1 = "lat"
stn!2 = "lon"
stn@long_name = "Station Grid"
stn@units = "On/Off"
stn&lat = lat
stn&lon = lon
stn&time = time
printVarSummary(stn)
stn(0,{27.0:27.1},{-82.4:-82.5}) = 1
;***********************************************************
; create plot
;***********************************************************
wks = gsn_open_wks("x11","coast") ; choose output type
gsn_define_colormap(wks,"BlAqGrYeOrReVi200") ; choose colormap
i = NhlNewColor(wks,.96,.87,.7) ; land color
res = True
res@cnFillOn = True ; turn on color
res@cnLinesOn = False ; turn off contour
lines
res@cnLevelSpacingF = 0.10 ; contour interval
res@cnFillDrawOrder = "PreDraw" ; draw contours first
res@lbLabelStride = 3 ; stride on label bar
res@gsnSpreadColors = True ; use full colormap
res@gsnSpreadColorEnd = -3 ; don't use land color
res@gsnAddCyclic = False ; regional data
res@mpMaxLatF = max(stn&lat) ; zoom in on region
res@mpMinLatF = min(stn&lat)
res@mpMinLonF = min(stn&lon)
res@mpMaxLonF = max(stn&lon)
res@gsnMajorLatSpacing = 1 ; finer labels on axis
res@gsnMajorLonSpacing = 1
res@tiMainString = "Straights of Gibraltar"
res@gsnCenterString = "Default Coastline"
; note, that this geographical region is small enough, that we run into
the
; problems with the labels being too small. You can other exampls of this
; issue and associated solutions at: "tropical strip plots"
; http://www.cgd.ucar.edu/csm/support/CSM_Graphics/sol.shtml
font_height = 0.015 ; make fonts larger
res@tmYLLabelFontHeightF = font_height
res@tmXBLabelFontHeightF = font_height
res@tiMainFontHeightF = 1.25 * font_height
res@pmLabelBarOrthogonalPosF = .1 ; move label bar down
;**************************************************
; assign required attributes
;**************************************************
stn&lon@units = "degrees_east"
stn&lat@units = "degrees_north"
;**************************************************
; fix bug in data
;**************************************************
;stn@_FillValue = 0.0
;stn@_FillValue = -999
;**************************************************
; create plots
;**************************************************
plot = gsn_csm_contour_map_ce(wks,stn(0,:,:),res)
res@gsnCenterString = "Medium Coastline"
res@mpDataBaseVersion = "Ncarg4_1" ; use GMT coastline
plot = gsn_csm_contour_map_ce(wks,stn(0,:,:),res)
res@gsnCenterString = "High Res Coastline"
res@mpDataBaseVersion = "HighRes" ; use GMT coastline
plot = gsn_csm_contour_map_ce(wks,stn(0,:,:),res)
end
_______________________________________________
ncl-talk mailing list
ncl-talk AT ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2b29 : Fri Sep 03 2004 - 12:17:58 MDT