<div dir="ltr"><div><div>Hi,<br><br></div>I don&#39;t know for certain what is going on there, but I suspect those labels are not inherently wrong given the apparent projection, but perhaps just not what you wanted. It would be interesting to know the values of<br><br>  opts@mpLeftCornerLatF      = lat2d(0,0)<br>
  opts@mpLeftCornerLonF      = lon2d(0,0)<br>
  opts@mpRightCornerLatF     = lat2d(nlat-1,mlon-1)<br>
  opts@mpRightCornerLonF     = lon2d(nlat-1,mlon-1)<br>
<br>
  opts@mpCenterLonF          = f1@CEN_LON<br>
;  opts@mpCenterLatF          = f1@CEN_LAT<br>
  opts@mpCenterLatF          = 90.         ; This is necessary to fix<br>
the wrong value on the WRF file.<br><br><br>It may be that for the mpCenterLatF to the pole is the issue.  Also, temporarily setting this resource to True may help explain what projection is like:<br></div><div>
<br>  opts@mpGridAndLimbOn       = False         ; turn on lat/lon lines<br><br></div><div>Hope that helps some...<br></div><div>Rick<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 12, 2016 at 1:20 AM,  <span dir="ltr">&lt;<a href="mailto:am@bio.mie-u.ac.jp" target="_blank">am@bio.mie-u.ac.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello NCL users,<br>
<br>
I am having a problem with plotting figures on polar stereographic<br>
projection.<br>
<br>
The labels on left, right and top sides of the figures seem somewhat<br>
strange. They all show longitude. I expect the labels on left and right<br>
show latitude as <a href="http://www.ncl.ucar.edu/Applications/wrfpo.shtml" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/wrfpo.shtml</a>. Would<br>
you please give me suggestions on my script attached below? If you need<br>
more information, please let me know. Thank you very much.<br>
<br>
$ uname -a<br>
Linux <a href="http://aofd165.bio.mie-u.ac.jp" rel="noreferrer" target="_blank">aofd165.bio.mie-u.ac.jp</a> 2.6.18-398.el5 #1 SMP Tue Sep 16 20:50:52<br>
EDT 2014 x86_64 x86_64 x86_64 GNU/Linux<br>
<br>
$ cat /etc/redhat-release<br>
CentOS release 5.11 (Final)<br>
<br>
$ ncl -V<br>
6.3.0<br>
<br>
<br>
$ <a href="http://ncl.run.sh" rel="noreferrer" target="_blank">ncl.run.sh</a><br>
1st Argument (script name) =h_sst.ncl<br>
2nd Argument (runname) =PL1101_00.02<br>
3rd Argument (domain) =d02<br>
4th Argument (nc_file) =wrfout_d02_2011-01-18_00:00:<a href="http://00.nc" rel="noreferrer" target="_blank">0<wbr>0.nc</a><br>
5th Argument (indir) =../../../../WRF.Result/<br>
6th Argument (nn) =0<br>
<br>
Input file: ../../../../WRF.Result/PL1101_<wbr>00.02/WRF_PL1101_00.02/<br>
wrfout_d02_2011-01-18_00:00:<a href="http://00.nc" rel="noreferrer" target="_blank">00<wbr>.nc</a><br>
<br>
fig file = ../../../../WRF.Plots/PL1101_<wbr>00.02/PL1101_00.02_h_sst.ncl/<br>
PL1101_00.02.d02.h_sst.000<br>
warning:PlotManagerSetValues: TickMark annotation cannot be added after<br>
NhlCreate<br>
<br>
<br>
======================<br>
<a href="http://ncl.run.sh" rel="noreferrer" target="_blank">ncl.run.sh</a><br>
======================<br>
#!/bin/sh<br>
<br>
exe=./runncl.sh<br>
<br>
domain=d02<br>
<br>
#ncl=&quot;h_t2.ncl&quot;<br>
#ncl=&quot;h_t2.polarstereo.ncl&quot;<br>
#ncl=&quot;h_ice.ncl&quot;<br>
ncl=&quot;h_sst.ncl&quot;<br>
<br>
indir=&quot;../../../../WRF.Result/<wbr>&quot;<br>
<br>
list_runname=&quot; \<br>
PL1101_00.02 \<br>
&quot;<br>
<br>
datetimelist=&quot;\<br>
2011-01-18_00:00:00 \<br>
&quot;<br>
<br>
nn=0<br>
for runname in $list_runname; do<br>
<br>
  for datetime in $datetimelist; do<br>
<br>
    nc_file=wrfout_${domain}_${<wbr>datetime}.nc<br>
<br>
    $exe $ncl &quot;$runname&quot; &quot;$domain&quot; &quot;$nc_file&quot; &quot;$indir&quot; &quot;$nn&quot;<br>
<br>
    nn=$(expr $nn + 1)<br>
<br>
  done<br>
<br>
done<br>
<br>
<br>
exit 0<br>
<br>
----------------------<br>
 End of <a href="http://ncl.run.sh" rel="noreferrer" target="_blank">ncl.run.sh</a><br>
----------------------<br>
<br>
<br>
<br>
======================<br>
runncl.sh<br>
======================<br>
#!/bin/bash<br>
#<br>
# Universal wrapper script for ncl.<br>
# Pass arguments from the command line to environment variables<br>
#<br>
# version 0.1, Thierry Corti, C2SM ETH Zurich<br>
#<br>
<br>
E_BADARGS=65<br>
<br>
if [ ! -n &quot;$1&quot; ]<br>
then<br>
  echo &quot;Usage: `basename $0` script.ncl argument1 argument2 etc.&quot;<br>
  exit $E_BADARGS<br>
fi<br>
<br>
# save number of arguments to environment variable NCL_N_ARG<br>
export NCL_N_ARGS=$#<br>
<br>
# save command line arguments to environment variable NCL_ARG_#<br>
for ((index=1; index&lt;=$#; index++))<br>
do<br>
  eval export NCL_ARG_$index=\$$index<br>
done<br>
<br>
# run ncl<br>
ncl -nQ $1<br>
<br>
----------------------<br>
 End of runncl.sh<br>
----------------------<br>
<br>
<br>
<br>
======================<br>
h_sst.ncl<br>
======================<br>
load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/wrf/WRFUserARW.ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/shea_util.ncl&quot;<br>
load &quot;./add_lc_labels.ncl&quot;<br>
<br>
<br>
begin<br>
  wallClock1 = systemfunc(&quot;date&quot;) ; retrieve wall clock time<br>
<br>
  a1 = getenv(&quot;NCL_ARG_1&quot;)<br>
  print(&quot;1st Argument (script name) =&quot;+a1)<br>
  runname1 = getenv(&quot;NCL_ARG_2&quot;)<br>
  print(&quot;2nd Argument (runname) =&quot;+runname1)<br>
  domain = getenv(&quot;NCL_ARG_3&quot;)<br>
  print(&quot;3rd Argument (domain) =&quot;+domain)<br>
  nc_file = getenv(&quot;NCL_ARG_4&quot;)<br>
  print(&quot;4th Argument (nc_file) =&quot;+nc_file)<br>
  indir = getenv(&quot;NCL_ARG_5&quot;)<br>
  print(&quot;5th Argument (indir) =&quot;+indir)<br>
  nn = getenv(&quot;NCL_ARG_6&quot;)<br>
  print(&quot;6th Argument (nn) =&quot;+nn)<br>
<br>
  scriptname=systemfunc(&quot;<wbr>basename &quot; + a1 + &quot; .ncl&quot;)<br>
  scriptname2=a1<br>
<br>
  outdir= &quot;../../../../WRF.Plots/&quot; + runname1 + &quot;/&quot; \<br>
  + runname1 + &quot;_&quot; + scriptname2 + &quot;/&quot;<br>
<br>
  command=&quot;mkdir -p &quot; + outdir<br>
  system(command)<br>
  print(&quot;&quot;)<br>
<br>
  infile1= indir + runname1 + &quot;/&quot; + &quot;WRF_&quot; + runname1 + &quot;/&quot; + nc_file<br>
  print(&quot;Input file: &quot;+ infile1)<br>
  print(&quot;&quot;)<br>
<br>
;<br>
; The WRF ARW input file.<br>
; This needs to have a &quot;.nc&quot; appended, so just do it.<br>
  f1 = addfile(infile1,&quot;r&quot;)<br>
<br>
; Get land mask data<br>
  it=0<br>
  oro = wrf_user_getvar(f1,&quot;XLAND&quot;,it)<br>
<br>
  lat2d = wrf_user_getvar(f1,&quot;XLAT&quot;,it)   ; latitude<br>
  lon2d = wrf_user_getvar(f1,&quot;XLONG&quot;,it)  ; longitude<br>
  nlat = dimsizes(lat2d(:,0))<br>
  nlon = dimsizes(lat2d(0,:))<br>
<br>
<br>
; What times and how many time steps are in the data set?<br>
  times = wrf_user_getvar(f1,&quot;times&quot;,-1)  ; get all times in the file<br>
  ntimes = dimsizes(times)         ; number of times in the file<br>
<br>
; Check dimension<br>
  it=0<br>
  lh  = wrf_user_getvar(f1, &quot;LH&quot;,it)<br>
  dsizes  = new( (/2/),integer)<br>
  dsizes  = dimsizes(lh)<br>
;  print(dsizes)<br>
  im=dsizes(0)<br>
  jm=dsizes(1)<br>
<br>
  dx = f1@DX<br>
  dy = f1@DY<br>
<br>
  lat1=50.<br>
  lat2=83.<br>
  lon1=-30.<br>
  lon2=32.<br>
<br>
; We generate plots, but what kind do we prefer?<br>
  type = &quot;png&quot; ; ps x11  pdf  ngcm<br>
<br>
  res                       =  True<br>
  res@gsnDraw      =  False                   ; do not draw the plot<br>
  res@gsnFrame              =  False                   ;-- don&#39;t advance<br>
frame<br>
  res@gsnAddCyclic          =  False                   ;-- data are not<br>
global, don&#39;t add lon cyclic point<br>
<br>
;  Figure size<br>
  res@gsnMaximize      =  False ;True           ; maximize plot in frame<br>
  res@vpXF = 0.1<br>
  res@vpYF = 1<br>
  res@vpHeightF = 0.8<br>
  res@vpWidthF  = 0.6<br>
<br>
  res@gsnDraw          = False                    ; turn off draw and<br>
frame<br>
  res@gsnFrame         = False                    ; b/c this is an<br>
overlay plot<br>
  res@pmTickMarkDisplayMode = &quot;Always&quot;                 ;-- draw nicer<br>
tickmarks<br>
  res@tiMainString    = runname1   ; add titles<br>
  res@pmTickMarkDisplayMode = &quot;Always&quot;     ; turn on automatic tickmarks<br>
<br>
  res@tiMainString          = runname1<br>
  res@gsnAddCyclic          = False<br>
<br>
;   Plotting options<br>
    opts = res<br>
    opts@mpFillOn  = False<br>
    opts@mpDataBaseVersion     = &quot;MediumRes&quot;              ;-- choose map<br>
database<br>
    opts@mpGeophysicalLineColor = &quot;Gray&quot; ;changes the outline line color.<br>
    opts@<wbr>mpGeophysicalLineThicknessF = 1 ;changes the thickness of<br>
continental outlines.<br>
    opts@gsnLeftString   = &quot;&quot;; sst1@long_name<br>
    opts@gsnRightString = times(it)<br>
    opts@gsnAddCyclic = False<br>
    opts@sfXArray = lon2d<br>
    opts@sfYArray = lat2d<br>
    opts@mpDataBaseVersion = &quot;HighRes&quot;<br>
<br>
  dimll  = dimsizes(lat2d)                ; get size of dimensions<br>
  nlat   = dimll(0)<br>
  mlon   = dimll(1)<br>
<br>
  opts@mpProjection          = &quot;Stereographic&quot;<br>
  opts@mpLimitMode           = &quot;Corners&quot;<br>
  opts@mpLeftCornerLatF      = lat2d(0,0)<br>
  opts@mpLeftCornerLonF      = lon2d(0,0)<br>
  opts@mpRightCornerLatF     = lat2d(nlat-1,mlon-1)<br>
  opts@mpRightCornerLonF     = lon2d(nlat-1,mlon-1)<br>
<br>
  opts@mpCenterLonF          = f1@CEN_LON<br>
;  opts@mpCenterLatF          = f1@CEN_LAT<br>
  opts@mpCenterLatF          = 90.         ; This is necessary to fix<br>
the wrong value on the WRF file.<br>
<br>
  opts@cnFillOn = True<br>
  opts@mpGridAndLimbOn       = False         ; turn on lat/lon lines<br>
  opts@cnLevelSelectionMode = &quot;ManualLevels&quot;     ; set manual contour<br>
levels<br>
  opts@cnMinLevelValF       =  0.                ; set min contour level<br>
  opts@cnMaxLevelValF       =  14.                ; set max contour<br>
level<br>
  opts@cnLevelSpacingF      =  1.               ; set contour spacing<br>
<br>
  opts2=res<br>
  opts2@cnFillOn = False<br>
  opts2@sfXArray = lon2d<br>
  opts2@sfYArray = lat2d<br>
<br>
<br>
  nt=0<br>
  nstart=0 ; Time loop starts a day after the model initial time<br>
  nstep=1<br>
  nend=1; ntimes-1<br>
;  do it = nstart, nend, nstep              ; TIME LOOP<br>
<br>
  it=0<br>
<br>
    lh = wrf_user_getvar(f1,&quot;LH&quot;,it) ;<br>
    t2 = wrf_user_getvar(f1,&quot;SST&quot;,it) ;<br>
    t2=t2-273.15<br>
<br>
    slp=wrf_user_getvar(f1,&quot;slp&quot;,<wbr>it)<br>
<br>
    figfile= outdir + runname1 + &quot;.&quot; + domain + &quot;.&quot; + scriptname + \<br>
    &quot;.&quot; + sprinti(&quot;%0.3i&quot;,<wbr>stringtointeger(nn))<br>
<br>
    print(&quot;fig file = &quot; + figfile )<br>
    wks = gsn_open_wks(type, figfile)<br>
    gsn_define_colormap(wks,&quot;<wbr>WhBlGrYeRe&quot;)<br>
<br>
    plot = gsn_csm_contour_map(wks,t2,<wbr>opts)<br>
<br>
    plot2 = gsn_csm_contour(wks,slp,opts2)<br>
<br>
    overlay(plot,plot2)<br>
<br>
<br>
   ;MAKE PLOTS<br>
    draw(plot)<br>
    frame(wks)<br>
<br>
;    nt=nt+1<br>
;  end do<br>
<br>
  wallClock2 = systemfunc(&quot;date&quot;) ; retrieve wall clock time<br>
  print(&quot;Started  at &quot; + wallClock1)<br>
  print(&quot;Finished at &quot; + wallClock2)<br>
<br>
end<br>
<br>
----------------------<br>
 End of h_sst.ncl<br>
----------------------<br>
<br>
Atsuyoshi<br>
<br>
---<br>
Atsuyoshi Manda, PhD<br>
Mie University, Japan<br>
am at <a href="http://bio.mie-u.ac.jp" rel="noreferrer" target="_blank">bio.mie-u.ac.jp</a><br>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>