gsn_csm_streamline and panels

From: Medeiros, Brian <brianpm_at_nyahnyahspammersnyahnyah>
Date: Fri Apr 29 2011 - 10:54:47 MDT

Hey NCL list,

I have just been struggling with making a panel plot of two plots using gsn_csm_streamline_contour_map_ce. The problem seems to be that some resources are not defined for the plot type "streamline" in gsn_code.ncl, which makes NCL unhappy when trying to make the panel label bar. My current fix for this is to turn off the panel label bar, but I'd prefer to have it. I checked the archives, and didn't immediately find this issue mentioned; I hope I'm not repeating a known issue.

The error I actually get with from the script below is:

***
 Copyright (C) 1995-2011 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.0.0-beta
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.
(0) Set lbLabelFontHeightF resource to control labelbar font heights.
fatal:Variable (mono_fill_col) is undefined
fatal:Execute: Error occurred at or near line 5989 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl

fatal:Execute: Error occurred at or near line 6201 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl

fatal:Execute: Error occurred at or near line 71 in file /Users/brianpm/Dropbox/prevoca/scripts/streamline_contour_panel_bug.ncl
***

Here is the script, as stripped down as I could make it:

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

  ;;; load a standard CAM history file containing U(time, lev, lat, lon), V(time, lev, lat, lon),
  ;;; along with something that is X(time, lat, lon), here I use CLDLOW
  F = addfile("/Users/brianpm/Public/aqua2010/cam5_earth_mam/cam5_earth_mam.cam2.h0.0003-01.nc", "r")

  ;;; select two regions to plot:

  ;;; region 1:
  COLOR1 = F->CLDLOW(0,{-30:0},{300:330})
  U1 = F->U(0,{850},{-30:0},{300:330})
  V1 = F->V(0,{850},{-30:0},{300:330})

  ;;; region 2:
  COLOR2 = F->CLDLOW(0,{10:40},{300:330})
  U2 = F->U(0,{850},{10:40},{300:330})
  V2 = F->V(0,{850},{10:40},{300:330})

  ;;; lat/lon for each region
  lat1 = U1&lat
  lon1 = U1&lon

  lat2 = U2&lat
  lon2 = U2&lon

  ;;; make the panel plot:

  plot = new(2,graphic)

  plotname = "~/Desktop/streamline_contour_panel_plot"
  wks = gsn_open_wks("pdf", plotname)
  gsn_define_colormap(wks, "sunshine_9lev")

  res = True
  res@gsnFrame = False
  res@gsnDraw = False
  res@gsnSpreadColors = True
  res@mpMinLatF = min(lat1)
  res@mpMaxLatF = max(lat1)
  res@mpMinLonF = min(lon1)
  res@mpMaxLonF = max(lon1)

  res@gsnAddCyclic = False
  res@mpLandFillColor = "black"
  res@mpFillDrawOrder = "PostDraw"

  res@cnFillOn = True
  res@cnLinesOn = False

  res@lbLabelBarOn = False

  plot(0) = gsn_csm_streamline_contour_map_ce(wks,U1,V1,COLOR1,res)

  res@mpMinLatF = min(lat2)
  res@mpMaxLatF = max(lat2)
  res@mpMinLonF = min(lon2)
  res@mpMaxLonF = max(lon2)

  plot(1) = gsn_csm_streamline_contour_map_ce(wks,U2,V2,COLOR2,res)

  pres = True
  pres@gsnPanelLabelBar = True
  pres@lbLabelAutoStride = True
  gsn_panel(wks, plot, (/1,2/), pres)

end

thanks,

.brian
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Apr 29 10:55:03 2011

This archive was generated by hypermail 2.1.8 : Tue May 03 2011 - 14:47:34 MDT