<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif;font-size:small;color:rgb(0,0,0)"><div class="gmail_default">Dear NCL, </div><div class="gmail_default">How can I plot a model variable on a grid without knowing the native grid&#39;s particular map projection? I would like to see an image similar to what &quot;ncview&quot; does when I look at the file (image attached). NCVIEW seems to just know what to plot.</div>
<div class="gmail_default">Although I am able to extract the variable, I can&#39;t seem to plot it correctly at all. How do I show a decent map?</div><div class="gmail_default">Thank you, </div></div><div>- Erik - <br><br>
</div><div><br></div><div><div><img src="cid:ii_147cb75873b89784" alt="Inline image 2" width="454" height="301"><img src="cid:ii_147cb7585697f7bd" alt="Inline image 1" width="454" height="310"><br></div><div><br></div><div>
<br></div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;   </div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;  </div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;</div>
<div><span class="" style="white-space:pre">                                                                        </span>; Get file</div><div>a=addfile(&quot;<a href="http://ICE.2012.01-12.f06.nc">ICE.2012.01-12.f06.nc</a>&quot;,&quot;r&quot;)</div><div><span class="" style="white-space:pre">                                                                        </span>; Get variable </div>
<div><span class="" style="white-space:pre">                                                                        </span>; and lat-lons (2D)</div><div>s1=a-&gt;SHF</div><div>printVarSummary(s1)<span class="" style="white-space:pre">                                        </span>; display variable</div><div>lat2d    = a-&gt;LAT</div>
<div>lon2d    = a-&gt;LON</div><div>s1@lat2d=lat2d</div><div>s1@lon2d=lon2d</div><div>printVarSummary(s1)<span class="" style="white-space:pre">                                        </span>; display variable again</div><div><br></div><div><span class="" style="white-space:pre">                                                                        </span>; plot paramaters</div>
<div>res = True</div><div>wks = gsn_open_wks(&quot;x11&quot;  ,&quot;x_static&quot;)</div><div>res@pmTickMarkDisplayMode = &quot;Always&quot;         ; turn on lat / lon labeling</div><div>;************************************************</div>
<div>; set map limits</div><div>;************************************************</div><div>dimll = dimsizes(lat2d)</div><div>nlat  = dimll(0)</div><div>mlon  = dimll(1)</div><div>; res@mpProjection          = ??? I HAVE NO IDEA???</div>
<div>res@mpLimitMode           = &quot;Corners&quot;</div><div>res@mpLeftCornerLatF      = lat2d(0,0)</div><div>res@mpLeftCornerLonF      = lon2d(0,0)</div><div>res@mpRightCornerLatF     = lat2d(nlat-1,mlon-1)</div><div>res@mpRightCornerLonF     = lon2d(nlat-1,mlon-1)</div>
<div>res@tfDoNDCOverlay        = True             ; True only for &#39;native&#39; grid</div><div>res@gsnAddCyclic          = False  ; data are not cyclic</div><div>; res@lbLabelAutoStride     = True ; let NCL determine label bar spacing</div>
<div>plot = gsn_csm_contour_map (wks,s1(0,:,:),res)</div><div><br></div><div>; TERMINAL OUTPUT</div><div><br></div><div>erikmbp:MAR_3.2 enoble$ ncl test_plot_080714.ncl </div><div> Copyright (C) 1995-2014 - All Rights Reserved</div>
<div> University Corporation for Atmospheric Research</div><div> NCAR Command Language Version 6.2.0</div><div> The use of this software is governed by a License Agreement.</div><div> See <a href="http://www.ncl.ucar.edu/">http://www.ncl.ucar.edu/</a> for more details.</div>
<div><br></div><div>Variable: s1</div><div>Type: float</div><div>Total Size: 9662400 bytes</div><div>            2415600 values</div><div>Number of Dimensions: 3</div><div>Dimensions and sizes:<span class="" style="white-space:pre">        </span>[TIME | 366] x [Y18_127 | 110] x [X10_69 | 60]</div>
<div>Coordinates: </div><div>            TIME: [972672.0625..981432]</div><div>            Y18_127: [-1200.000091097248..1525.000107494753]</div><div>            X10_69: [-775.0000471284118..700.0000440380242]</div><div>Number Of Attributes: 3</div>
<div>  units :<span class="" style="white-space:pre">        </span>W/m2</div><div>  long_name :<span class="" style="white-space:pre">        </span>Sensible Heat Flux</div><div>  history :<span class="" style="white-space:pre">        </span>From ICE.j06.2012.01.01-15</div>
<div><br></div><div>Variable: s1</div><div>Type: float</div><div>Total Size: 9662400 bytes</div><div>            2415600 values</div><div>Number of Dimensions: 3</div><div>Dimensions and sizes:<span class="" style="white-space:pre">        </span>[TIME | 366] x [Y18_127 | 110] x [X10_69 | 60]</div>
<div>Coordinates: </div><div>            TIME: [972672.0625..981432]</div><div>            Y18_127: [-1200.000091097248..1525.000107494753]</div><div>            X10_69: [-775.0000471284118..700.0000440380242]</div><div>Number Of Attributes: 5</div>
<div>  lon2d :<span class="" style="white-space:pre">        </span>&lt;ARRAY of 6600 elements&gt;</div><div>  lat2d :<span class="" style="white-space:pre">        </span>&lt;ARRAY of 6600 elements&gt;</div><div>  units :<span class="" style="white-space:pre">        </span>W/m2</div>
<div>  long_name :<span class="" style="white-space:pre">        </span>Sensible Heat Flux</div><div>  history :<span class="" style="white-space:pre">        </span>From ICE.j06.2012.01.01-15</div></div>
</div>